Subject: Re: SYS___syscall and linux (etc) compatibility
To: None <david@l8s.co.uk>
From: Ben Harris <bjh21@netbsd.org>
List: tech-kern
Date: 07/04/2003 17:08:03
In article <20030704165105.A12254@snowdrop.l8s.co.uk> you write:
>AFAICT the kernel system call entry (esp. the i386 one) assumes that
>system call 198 is sys___syscall (ie the actual system call number
>is the first 64bit argument).
>
>However it does this before consulting the p->p_emul->e_sysent[]
>structure.
>
>This means that:
>1) Anything trying to do syscall 198 on any emulation is doomed.
>2) Anything trying to do sys___syscall on an emulation is probably doomed.
>
>Have I missed something obvious???

I think I modeled our ARMLinux emulation on the i386 code, and on ARM we
have separate linux_syscall_plain() and linux_syscall_fancy() functions
which get used in place of syscall_plain() and syscall_fancy() for Linux
processes.  swi_handler calls theough p->p_md.md_syscall to select the right
one.  I suspect i386 is similar.

On ARM, we have the added fun that Linux and NetBSD use different syscall
calling conventions, and that Linux's syscalls are in two widely-separated
ranges, so having a separate function makes a lot of sense.

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/acorn26           <URL:http://www.netbsd.org/Ports/acorn26/>