NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/47129: mouse won't move diagonally in i386 X11 on amd64 kernel



The following reply was made to PR bin/47129; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/47129: mouse won't move diagonally in i386 X11 on amd64
 kernel
Date: Sat, 27 Oct 2012 19:44:30 +0200

 >      When running an i386 userland, including X11, on an amd64 kernel,
 >      the mouse pointer moves only horizontally and vertically,
 >      it won't move in any other direction.
 
 This problem is traceable to the change in struct timespec between i386
 and amd64.  struct timespec is embedded in struct wscons_event, which
 is used for data read from the mouse.  struct timespec contains "long
 tv_nsec", which is 32 bits on i386, and 64 bits on amd64.  (Defining
 tv_nsec as long doesn't really make sense, because there is no need to
 represent values larger than 1000000000, so 32 bits would have been
 plenty, but POSIX specifies long and NetBSD apparently chose not to
 deviate from POSIX here.)
 
 To fix this 32-bit userland/64-bit kernel compatibility issue,
 wsevent_setversion() (which is called for ioctl WSMOUSEIO_SETVERSION)
 could be changed to record whether or not the calling process is
 running under netbsd32 emulation, and wsevent_copyout_events() could be
 changed to perform the appropriate data format conversions for netbsd32
 emulation.
 
 I have working code for this, but it is not yet integrated into the
 compat infrastructure.  With my patches, the mouse works correctly in an
 i386 version of X11 running on an amd64 kernel.
 
 I also suggest changing the WSMOUSEIO_SETVERSION, WSKBDIO_SETVERSION,
 and WSDISPLAYIO_SETVERSION ioctl requests to take an unsigned int
 instead of a signed int, to make it easier for the kernel implementation
 to steal some of the bits to represent flags (such as whether or not
 netbsd32 emulation is needed).  This can be done without affecting
 binary compatibility.
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index