Subject: Re: Linux/Mips syscall shift
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 09/15/2001 09:55:06
On Sat, Sep 15, 2001 at 05:35:05PM +0200, Emmanuel Dreyfus wrote:

 > Linux/Mips emulation is progressing quickly. To fix the system call
 > shift, I added a -4000 offset in sys/arch/mips/mips/linux_syscall.c, but
 > it would be nice to have a nicer implementation: I have to completely
 > duplicate sys/arch/mips/mips/syscall.c just to have a -4000 on two
 > lines. 

That's not quite all that will be different.  You'll use different
syscall tables, different errno tables, etc.

I.e. the point of splitting them up like that is to avoid if() statements
in the native syscall path.

 > Adding a new field to struct emul would a cleaner way of dealing with
 > this. Something like e_sysshift which would be zero for everyone, and
 > 4000 for Linux/Mips. 
 > 
 > Any other idea?
 > 
 > -- 
 > Emmanuel Dreyfus.  
 > Hiroshima 45. Tchernobyl 86. Windows 95. 
 > manu@netbsd.org    

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>