Subject: Re: NetBSD ABI and library calls
To: software.au@gmail.com <software.au@gmail.com>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 10/30/2005 08:27:33
On Sun, Oct 30, 2005 at 02:20:03PM +1100, software.au@gmail.com wrote:
> How is it done in NetBSD?  Is there some kind of "ABI" like the SysV
> ABI

Yeah, we typically follow the ELF ABI for most architectures (you did post
to tech-kern instead of port-i386, but since you talk about assembler calls
you probably know that this is machine depended - for example on sparc{,64}
you do not create call frames at all, but just stick arguments in registers
and issue a trap instruction).

Two possible off-topic hints, while here:

 - if you are implementing your own syscalls, you probably want to adopt
   the SYS.h magic
 - if you are calling "standard" syscalls, it is sometimes better (or
   even necessary) to instead call the libc syscall stub, because
   libpthread intercepts those calls to do it's magic.

Martin