Subject: Re: system call numbers problem
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 08/30/2001 23:16:08
In article <1eytiy3.v2sbmj1fw1p7fM@[10.0.12.137]>,
Emmanuel Dreyfus <manu@netbsd.org> wrote:
>> Emmanuel Dreyfus wrote:
>> > I started working on Linux/Mips emulation, and I face an unexpected
>> > problem: The system call numbers start at 4000 for Linux/MIPS. This
>> > confuses the makesyscalls.sh script, which expects the first syscall to
>> > be at zero.
>> The most suitable thing to do would prolly be to number the syscalls
>> from zero in syscalls.master, and substract the 4000 in syscall
>> dispatch code. (And add a comment in appropriate syscalls.master
>> that the syscalls dispatch code remaps the syscall numbers).
>
>The cleanest way I hink about is to add a first_syscall field in struct
>emul, which would be zero for all emuls, and 4000 for Linux/Mips, and
>use this in syscall dispatch.

Since your gonna have to supply your own linux_syscall.c, it is just
a simple one liner to subtract 4000 there. I don't think that we
need to generalize struct emul for just a single case here.

christos