Date: Thu, 16 Sep 2004 14:54:42 +0300 (EEST) From: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> To: gerarra@tin.it Cc: freebsd-hackers@freebsd.org Subject: Re: struct sysentvec field Message-ID: <20040916115442.7BE3C1D7@pm514-9.comsys.ntu-kpi.kiev.ua> In-Reply-To: <1095269007.00132101.1095257401@10.7.7.3>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 15 Sep 2004 16:06:39 +0200 in lucky.freebsd.hackers, gerarra@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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040916115442.7BE3C1D7>