From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IoUOl-0006Sx-CT for qemu-devel@nongnu.org; Sat, 03 Nov 2007 21:35:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IoUOk-0006SI-OF for qemu-devel@nongnu.org; Sat, 03 Nov 2007 21:35:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoUOk-0006SF-I0 for qemu-devel@nongnu.org; Sat, 03 Nov 2007 21:35:34 -0400 Received: from bangui.magic.fr ([195.154.194.245]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IoUOk-0005kZ-5E for qemu-devel@nongnu.org; Sat, 03 Nov 2007 21:35:34 -0400 Subject: Re: [Qemu-devel] [RFC] linux-user (mostly syscall.c) From: "J. Mayer" In-Reply-To: <1194138960.2168.73.camel@phantasm.home.enterpriseandprosperity.com> References: <1194048343.2168.48.camel@phantasm.home.enterpriseandprosperity.com> <20071103012123.GB10975@networkno.de> <1194094355.16781.564.camel@rapid> <1194099328.2168.61.camel@phantasm.home.enterpriseandprosperity.com> <472CC872.2090405@bellard.org> <1194138960.2168.73.camel@phantasm.home.enterpriseandprosperity.com> Content-Type: text/plain Date: Sun, 04 Nov 2007 02:35:25 +0100 Message-Id: <1194140125.16781.580.camel@rapid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: thayne@c2.net, qemu-devel@nongnu.org On Sat, 2007-11-03 at 19:16 -0600, Thayne Harbaugh wrote: > On Sat, 2007-11-03 at 20:13 +0100, Fabrice Bellard wrote: > > Thayne Harbaugh wrote: > > > On Sat, 2007-11-03 at 13:52 +0100, J. Mayer wrote: > > >> On Sat, 2007-11-03 at 01:21 +0000, Thiemo Seufer wrote: > > >> [...] > > >> But it could be great to group the syscalls by > > >> categories, or so. For example, putting all POSIX compliant syscalls in > > >> a single file and using a syscall table could make quite easy to develop > > >> a BSD-user target (I did this in the past, not in Qemu though...). POSIX > > >> compliant interfaces can mostly be shared with Linux ones and a lot of > > >> other syscalls are common to the 3 BSD flavors (Net, Open and Free..). > > >> Being able to add a BSD target sharing the same code would be a proof > > >> the code is flexible and well organized; I guess large parts of the > > >> Darwin user target could also be merged with a FreeBSD user target... > > > > > > That's a reasonable strategy as well. I've looked through some of the > > > darwin code and have considered how common code could be merged. > > > > I am strongly against such merges. > > > > Different OS emulation must be handled in different directories (and > > maybe even in different projects) as they are likely to have subtle > > differences which makes impossible to test a modification made for one > > OS without testing all the other OSes. > > Agreed. If you take a close look, you'll find more variations between Linux ABIs for different CPUs than between all BSD implementations: common syscalls of all BSD flavors do the same thing (and have the same ABI whatever the CPU...). You'll also find very few variations between the syscalls common to BSD & Linux because most of those directly map POSIX defined functions. Then, following the given argument, we never should try to share any code between linux-user for different targets, as the Linux ABI and behavior is different for different CPUs... -- J. Mayer Never organized