* input_event for 64-bit kernel and 32-bit userland.
@ 2004-06-02 10:06 Pavel Kiryukhin
2004-06-02 10:55 ` Jan-Benedict Glaw
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Kiryukhin @ 2004-06-02 10:06 UTC (permalink / raw)
To: linux-mips; +Cc: Pavel Kiryukhin
Hi all,
I stuck in simple situation:
USB mouse (or keyboard). n64 kernel (2.4.20), n32 userland.
Userspace application tries to read "input_event" (16 bytes) from
"/dev/input/event0" [ read(fd,&key_ev, sizeof(key_ev)) ],
input core driver treats "input_event" as 24 bytes structure. It is due
to different size of "timeval" (and finally "long") in n64 kernel and
n32 userland.
Application gets some garbage as mouse events . No solutions like "ioctl
wrappers" applicable in this case.
I don't want to change any arch independent files, but can not find any
acceptable solution. It looks like headers "/usr/include/linux/input.h"
in root file system and "/include/linux/input.h" in kernel should be the
same,
(All works fine as soon as I declare a new "input_event" structure in
user application that corresponds in size to kernel
structure - but this is not acceptable).
Can anybody advice me what to do with the difference in "input_event"
structure sizes in o32/n32 userland and n64 kernel? Just a general
approach that can be used when driver's read/write operation treat some
values as 64 bit while user application tries to read/write 32-bit
values (based on the same headers).
Please, don't kick me if solution is simple and obvious.
---
Thanks,
Pavel Kiryukhin.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: input_event for 64-bit kernel and 32-bit userland.
2004-06-02 10:06 input_event for 64-bit kernel and 32-bit userland Pavel Kiryukhin
@ 2004-06-02 10:55 ` Jan-Benedict Glaw
0 siblings, 0 replies; 2+ messages in thread
From: Jan-Benedict Glaw @ 2004-06-02 10:55 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1: Type: text/plain, Size: 907 bytes --]
On Wed, 2004-06-02 14:06:10 +0400, Pavel Kiryukhin <savl@dev.rtsoft.ru>
wrote in message <40BDA692.50606@dev.rtsoft.ru>:
> Userspace application tries to read "input_event" (16 bytes) from
> "/dev/input/event0" [ read(fd,&key_ev, sizeof(key_ev)) ],
> input core driver treats "input_event" as 24 bytes structure. It is due
> to different size of "timeval" (and finally "long") in n64 kernel and
> n32 userland.
You'd probably Cc: that to LKML, too. That's an issue for all systems
running 64bit kernel with 32bit userland (eg. Ultra-Sparc, PPC64, IA64,
x86_64, ...).
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-02 10:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-02 10:06 input_event for 64-bit kernel and 32-bit userland Pavel Kiryukhin
2004-06-02 10:55 ` Jan-Benedict Glaw
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.