From e37f8e40238816b7a20f0cd030d9982b5745446f Mon Sep 17 00:00:00 2001 From: cgd Date: Tue, 17 May 1994 00:00:46 +0000 Subject: [PATCH] add support for 'NCOMPAT' to deal with NetBSD compat defines --- sys/kern/makesyscalls.sh | 28 +++++++++++++++++++++++++--- sys/kern/syscalls.master | 11 ++++++----- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index e20334a5fcc5..9f695db1c10f 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,11 +1,12 @@ #! /bin/sh - # from: @(#)makesyscalls.sh 7.6 (Berkeley) 4/20/91 -# $Id: makesyscalls.sh,v 1.6 1994/03/18 19:18:07 mycroft Exp $ +# $Id: makesyscalls.sh,v 1.7 1994/05/17 00:01:00 cgd Exp $ set -e # name of compat option: compat=COMPAT_43 +ncompat=COMPAT_09 # output files: sysnames="syscalls.c" @@ -15,9 +16,10 @@ syssw="init_sysent.c" # tmp files: sysdcl="sysent.dcl" syscompat="sysent.compat" +sysncompat="sysent.ncompat" sysent="sysent.switch" -trap "rm $sysdcl $syscompat $sysent" 0 +trap "rm $sysdcl $syscompat $sysncompat $sysent" 0 case $# in 0) echo "Usage: $0 input-file" 1>&2 @@ -29,10 +31,12 @@ awk < $1 " BEGIN { sysdcl = \"$sysdcl\" syscompat = \"$syscompat\" + sysncompat = \"$sysncompat\" sysent = \"$sysent\" sysnames = \"$sysnames\" syshdr = \"$syshdr\" compat = \"$compat\" + ncompat = \"$ncompat\" infile = \"$1\" "' @@ -42,6 +46,9 @@ awk < $1 " printf "\n#ifdef %s\n", compat > syscompat printf "#define compat(n, name) n, __CONCAT(o,name)\n\n" > syscompat + printf "\n#ifdef %s\n", ncompat > sysncompat + printf "#define ncompat(n, name) n, __CONCAT(o,name)\n\n" > sysncompat + printf "/*\n * System call names.\n *\n" > sysnames printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames @@ -127,6 +134,17 @@ awk < $1 " syscall++ next } + $2 == "NCOMPAT" { + printf("int\to%s();\n", $4) > sysncompat + printf("\tncompat(%d,%s),\t\t/* %d = old %s */\n", \ + $3, $4, syscall, $5) > sysent + printf("\t\"old.%s\",\t\t/* %d = old %s */\n", \ + $5, syscall, $5) > sysnames + printf("\t\t\t\t/* %d is old %s */\n", \ + syscall, comment) > syshdr + syscall++ + next + } $2 == "LIBCOMPAT" { printf("int\to%s();\n", $4) > syscompat printf("\tcompat(%d,%s),\t\t/* %d = old %s */\n", \ @@ -165,6 +183,10 @@ awk < $1 " printf("#define compat(n, name) 0, nosys\n") > syscompat printf("#endif /* %s */\n\n", compat) > syscompat + printf("\n#else /* %s */\n", compat) > sysncompat + printf("#define ncompat(n, name) 0, nosys\n") > sysncompat + printf("#endif /* %s */\n\n", compat) > sysncompat + printf("};\n\n") > sysent printf("int\tnsysent = sizeof(sysent) / sizeof(sysent[0]);\n") > sysent @@ -174,6 +196,6 @@ awk < $1 " printf "#endif /* _SYS_SYSCALL_H */\n" > syshdr } ' -cat $sysdcl $syscompat $sysent >$syssw +cat $sysdcl $syscompat $sysncompat $sysent >$syssw #chmod 444 $sysnames $syshdr $syssw diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 52955dff5d58..6bd50bbf33eb 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,11 +1,11 @@ - $Id: syscalls.master,v 1.18 1994/05/07 00:39:06 cgd Exp $ + $Id: syscalls.master,v 1.19 1994/05/17 00:00:46 cgd Exp $ ; from: @(#)syscalls.master 7.26 (Berkeley) 3/25/91 ; System call name/number master file. ; Processed to created init_sysent.c, syscalls.c and syscall.h. ; Columns: number type nargs name altname/comments ; number system call number, must be in order -; type one of STD, OBSOL, UNIMPL, NODEF, COMPAT +; type one of STD, OBSOL, UNIMPL, NODEF, COMPAT, NCOMPAT, LIBCOMPAT ; nargs number of arguments ; name name of syscall routine ; altname name of system call if different @@ -17,6 +17,7 @@ ; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; NODEF do everything except include in syscall.h +; NCOMPAT included on NetBSD COMPAT #ifdef ; UNIMPL not implemented, placeholder only ; #ifdef's, etc. may be included, and are copied to the output files. @@ -215,9 +216,9 @@ 160 UNIMPL 0 nosys 161 UNIMPL 0 nosys #endif -162 COMPAT 2 getdomainname -163 COMPAT 2 setdomainname -164 COMPAT 1 uname +162 NCOMPAT 2 getdomainname +163 NCOMPAT 2 setdomainname +164 NCOMPAT 1 uname 165 STD 2 sysarch 166 UNIMPL 0 nosys 167 UNIMPL 0 nosys