Subject: Re: several messages
To: Chris G. Demetriou <cgd@pa.dec.com>
From: Todd Vierling <tv@pobox.com>
List: current-users
Date: 10/31/1997 18:52:42
On Fri, 31 Oct 1997, Chris G. Demetriou wrote:

: > I'd like to add support for both SPARC and m68k Linux compatibility, but to
: > do so, the syscall tables have to be divided up into architectures (the
: > syscalls themselves match, but the syscall numbers vary from one arch to the
: > next).
: 
: Don't you also need to do something similar for errnos?

Yes, but since errno constants don't change when syscalls.master changes,
they can simply be put in the architecture dependent header file:
src/sys/arch/${MACHINE_ARCH}/include/linux_machdep.h.

On Fri, 31 Oct 1997, Bill Studenmund wrote:

: > - change instances of "#include <compat/linux/linux_syscall.h>" and
: >   friends to "#include <compat/linux/arch/_MACHINE_ARCH/linux_syscall.h>"
: >   et. al.
: 
: I'd say leave it at compat/linux/linux_syscall.h, and have it in turn call
: the right architecture-dependant file. That way there's a file for the
: M.I. syscall stuff, and it's easier to type. :-)

That's actually what I've done.  I made #if MACHINE_ARCH based header stubs
that call the appropriate include file.

I have put up a draft version of this split-up at
ftp://ftp.duh.org/pub/NetBSD-hacks/linux_compat/linux_compat.tar.gz.  The
archive contains the modified and unmodified files in src/sys/compat/linux,
four architecture dependent directories with full (as of Linux 2.1.61
kernels) syscall.master files--including i386, alpha (this will likely need
tweaking as it leeches from COMPAT_OSF1), m68k, and sparc.  I haven't yet
made syscall tables for powerpc (ppc) and pmax (mips).  The i386 directory
at least may be worthy of committal as it adds spoll(), a new one in Linux
2.1 that has the same semantics as NetBSD's poll(). 

About all that remains from this package is comparing structures (stat,
termios, etc.) and errnos, moving differences to linux_machdep.h, and
writing the signal and locore code for each architecture.

=====
== Todd Vierling (Personal tv@pobox.com; Business tv@lucent.com)
== I know you like the Internet, Bobby.  Now go eat your Frosted Flakes.