From owner-freebsd-arch Thu Sep 27 0:11:51 2001 Delivered-To: freebsd-arch@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id 7FFEF37B430 for ; Thu, 27 Sep 2001 00:11:47 -0700 (PDT) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f8R7BlI29280 for ; Thu, 27 Sep 2001 00:11:47 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.11.6/8.11.5) id f8R7BkW11296 for arch@FreeBSD.org; Thu, 27 Sep 2001 00:11:46 -0700 (PDT) (envelope-from marcel) Date: Thu, 27 Sep 2001 00:11:46 -0700 From: Marcel Moolenaar To: arch@FreeBSD.org Subject: makesyscalls.sh: Fix for NODEF type Message-ID: <20010927001146.A11131@athlon.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline User-Agent: Mutt/1.3.21i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Background: The Linuxulator port for alpha has the unique problem that two syscall numbers/entries map to the same syscall function. The syscall in question is setpgid()/linux_setpgid(). One of them is nothing more than a stub to work around a limitation in our syscall table generation. The following is a way to avoid having to create a stub in this case. When two identical syscalls are defined as having type NOPROTO, the only problem that remains is the fact that there will be a duplicate definition in *syscall.h. In sys/kern/makesyscalls.sh there's a way to suppress this: mark the syscall as type NODEF. Unfortunately this breaks the declaration of the syscall in *proto.h and is therefore useless in it's current form. The attached patch makes type NODEF work in follows. Assume we have the following entry in syscalls.master: 1 NODEF BSD foobar The only code generated for syscall 1 will be an entry in the syscall table (struct sysent sysent[]): { AS(foobar_args), (sy_call_t *)foobar }, /* 1 = NODEF */ This allows syscall functions to have multiple syscall number or entries. Is this an acceptable fix and/or interpretation for NODEF? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="nodef.diff" Index: makesyscalls.sh =================================================================== RCS file: /home/ncvs/src/sys/kern/makesyscalls.sh,v retrieving revision 1.48 diff -u -r1.48 makesyscalls.sh --- makesyscalls.sh 12 Sep 2001 08:37:45 -0000 1.48 +++ makesyscalls.sh 27 Sep 2001 06:50:59 -0000 @@ -208,6 +208,7 @@ } if ($2 == "NODEF") { funcname=$4 + argssize = "AS(" $4 "_args)" return } if ($f != "{") @@ -320,7 +321,7 @@ argalias) > sysarg } if ($2 != "NOPROTO" && (!nosys || funcname != "nosys") && \ - (!lkmnosys || funcname != "lkmnosys")) { + (!lkmnosys || funcname != "lkmnosys") && $2 != "NODEF") { printf("%s\t%s __P((struct thread *, struct %s *))", rettype, funcname, argalias) > sysdcl printf(";\n") > sysdcl --n8g4imXOkfNTN/H1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message