Date: Sat, 16 Oct 2010 13:00:51 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Hans Petter Selasky <hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Andrew Thompson <thompsa@freebsd.org> Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb Message-ID: <20101016100051.GS2392@deviant.kiev.zoral.com.ua> In-Reply-To: <201010161141.32116.hselasky@freebsd.org> References: <201010142038.o9EKcImV036360@svn.freebsd.org> <20101016081237.GR2392@deviant.kiev.zoral.com.ua> <201010161141.32116.hselasky@freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Sat, Oct 16, 2010 at 11:41:31AM +0200, Hans Petter Selasky wrote: > On Saturday 16 October 2010 10:12:37 Kostik Belousov wrote: > > On Thu, Oct 14, 2010 at 08:38:18PM +0000, Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Thu Oct 14 20:38:18 2010 > > > New Revision: 213852 > > > URL: http://svn.freebsd.org/changeset/base/213852 > > > > > > Log: > > > - Add support for LibUSB in 32-bit compatibility mode. > > > > > > Approved by: thompsa (mentor) > > > > > > Modified: > > > head/lib/libusb/Makefile > > > head/lib/libusb/libusb20.c > > > head/lib/libusb/libusb20_int.h > > > head/lib/libusb/libusb20_ugen20.c > > > head/sys/dev/usb/usb_ioctl.h > > > > > > Modified: head/lib/libusb/Makefile > > > ========================================================================= > > > ===== --- head/lib/libusb/Makefile Thu Oct 14 20:31:07 2010 (r213851) > > > +++ head/lib/libusb/Makefile Thu Oct 14 20:38:18 2010 (r213852) > > > @@ -30,5 +30,9 @@ SRCS+= libusb10.c > > > > > > SRCS+= libusb10_desc.c > > > SRCS+= libusb10_io.c > > > > > > +.if defined(COMPAT_32BIT) > > > +CFLAGS+= -DCOMPAT_32BIT > > > +.endif > > > + > > > > > > .include <bsd.lib.mk> > > > > The support is provided in a way that contradicts the established practice > > of doing 32-bit compat. Very nice that the support is provided, thank you > > for care about it. But, can it be changed so that the kernel emulates > > 32-bit ABI instead of library conforming to the kernel ABI ? > > The short answer is yes, but it adds much more code than in the existing > approach, with regard to USB. It is not all about IOCTL's it is also about > shared memory layout. The existing approach means: > > You need to compile /usr/lib32/ and use that with the 32-bit binaries. I.E. I > want to have the 32->64 bit conversion in user-space, hence as per Right, I undestand this, and I pointed that there are some scenarious that do not work with this approach. All other FreeBSD subsystems try to implement native 32bit ABI instead of providing usermode compatibility shims. > implementation in the kernel, there are no pointer mappings involved. It is > simply a matter of zero-extending the pointer variable from 32-bit to 64-bit. > > > > > For COMPAT32, we aim in making the system where 32bit binaries and > > libraries just work on the 64bit host. Your change does not allow to take > > 32bit host into jail and run it on 64bit kernel, as example. > > USB has some shared memory structures which are used in both user-land and > kernel, which are not part of IOCTLs. Your approach means that there are two > sets of IOCTL's of all kinds, one for 32-bit and one for 64-bit? For all kinds of structures that are not ABI-invariant, yes. > > > > > Please see numerous examples of ioctl translations under > > #ifdef COMPAT_FREEBSD32 on how it is done. > > Please find attached a patch to fix libusbhid world breakage. Sorry about > that. I will do some more checing and see if more is broken. I will commit > this as soon as I get a go. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAky5d9EACgkQC3+MBN1Mb4gK2ACgoGF8W8m8db5tOngENVHWgWu4 DJUAoIirZDtXjqs6weOWkydNEtdlGACv =VTQj -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101016100051.GS2392>
