Subject: Re: Syscall interface (was: Re: Shared library support for ARM ELF
To: Ben Harris <bjh21@NetBSD.ORG>
From: Todd Vierling <>
List: port-arm
Date: 07/28/2001 13:36:05
On Mon, 23 Jul 2001, Ben Harris wrote:

: > 2) We need to have a new mechanism for passing the syscall number.
: >
: > One solution for 2 would be to pass the syscall number in r0 (or some
: > other register -- ip might be a good choice[1]); this might even be more
: > efficient, since then the kernel doesn't have to grub around decoding the
: > instruction to see which SWI is being executed.

Well, this is the way [most] other NetBSD ports do it, and:

: We already have that, in the form of syscall() (which is conveniently SWI
: 0, and hence usable on Thumb).  The only thing you can't do with it is
: invoke syscall() recursively, and that can probably be fixed fairly
: easily.

Yah, should be fixable.

Note that if you switch to using a register to pass the syscall number, you
might as well make that the default, to simplify matters.  And, after doing
that, you could make the use of SWI [1..end] conditional on COMPAT_15, for
an additional simplification.

-- Todd Vierling <>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --