struct sysentvec field

Andrey Simonenko simon at comsys.ntu-kpi.kiev.ua
Thu Sep 16 04:54:48 PDT 2004


On Wed, 15 Sep 2004 16:06:39 +0200 in lucky.freebsd.hackers, gerarra at tin.it wrote:
> I've seen  void (*sv_prepsyscall)(struct trapframe *, int *, u_int *, caddr_t
> *);  field in struct sysentvec defined in sys/sysent.h; I've seen it's call
> be the current process in syscall interrupt 0x80 handling and it seems to
> set number of arguments and base pointer for syscall arguments. It's not
> a comment in the code, somebody could tell me what is the task of this field?
> 

If a program has another idea of passing syscall's arguments to the
kernel than FreeBSD uses (arguments are stored in a stack), then
sv_prepsyscall should take actions to fetch syscall's arguments,
just because the 'base' kernel does not know to get them.

sv_prepsyscall is not NULL for process which use different ABI, than
FreeBSD ABI.  For example i386/linux/linux_sysvec.c:linux_prepsyscall()
copies syscall's arguments from registers.

Following will help you:

Handbook's: "Advanced Topics" from "Linux Binary Compatibility".

Developer's Handbook: "x86 Assembly Language Programming" 


More information about the freebsd-hackers mailing list