From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 16 11:54:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C2FBF16A4CE for ; Thu, 16 Sep 2004 11:54:48 +0000 (GMT) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [194.125.244.127]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3099043D45 for ; Thu, 16 Sep 2004 11:54:46 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0)i8GF0Vvs099717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Sep 2004 15:00:32 GMT Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 7BE3C1D7; Thu, 16 Sep 2004 14:54:42 +0300 (EEST) From: Andrey Simonenko To: gerarra@tin.it In-Reply-To: <1095269007.00132101.1095257401@10.7.7.3> X-Newsgroups: lucky.freebsd.hackers User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.9-STABLE (i386)) Message-Id: <20040916115442.7BE3C1D7@pm514-9.comsys.ntu-kpi.kiev.ua> Date: Thu, 16 Sep 2004 14:54:42 +0300 (EEST) cc: freebsd-hackers@freebsd.org Subject: Re: struct sysentvec field X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2004 11:54:48 -0000 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"