summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/makesyscalls.sh30
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh
index b45adef..8194d9b 100644
--- a/sys/kern/makesyscalls.sh
+++ b/sys/kern/makesyscalls.sh
@@ -1,6 +1,6 @@
#! /bin/sh -
# @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93
-# $Id: makesyscalls.sh,v 1.32 1998/06/07 17:11:37 dfr Exp $
+# $Id: makesyscalls.sh,v 1.33 1998/06/08 11:02:00 bde Exp $
set -e
@@ -61,6 +61,7 @@ s/\$//g
syscompat = \"$syscompat\"
syscompatdcl = \"$syscompatdcl\"
sysent = \"$sysent\"
+ syssw = \"$syssw\"
sysinc = \"$sysinc\"
sysarg = \"$sysarg\"
sysnames = \"$sysnames\"
@@ -74,8 +75,8 @@ s/\$//g
infile = \"$1\"
"'
- printf "/*\n * System call switch table.\n *\n" > sysinc
- printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysinc
+ printf "/*\n * System call switch table.\n *\n" > syssw
+ printf " * DO NOT EDIT-- this file is automatically generated.\n" > syssw
printf "/*\n * System call prototypes.\n *\n" > sysarg
printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarg
@@ -96,15 +97,9 @@ s/\$//g
gsub("[$]Id: ", "", $0)
gsub(" [$]", "", $0)
- printf " * created from%s\n */\n\n", $0 > sysinc
- printf "#include \"opt_compat.h\"\n\n" > sysinc
+ printf " * created from%s\n */\n\n", $0 > syssw
- printf "\n#ifdef %s\n", compat > sysent
- printf "#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)\n" > sysent
- printf "#else\n" > sysent
- printf "#define compat(n, name) 0, (sy_call_t *)nosys\n" > sysent
- printf "#endif\n\n" > sysent
- printf "/* The casts are bogus but will do for now. */\n" > sysent
+ printf "\n/* The casts are bogus but will do for now. */\n" > sysent
printf "struct sysent %s[] = {\n",switchname > sysent
printf " * created from%s\n */\n\n", $0 > sysarg
@@ -306,6 +301,7 @@ s/\$//g
next
}
$2 == "COMPAT" || $2 == "CPT_NOA" {
+ ncompat++
parseline()
if (argc != 0 && $2 != "CPT_NOA") {
printf("struct\t%s {\n", argalias) > syscompat
@@ -332,6 +328,7 @@ s/\$//g
next
}
$2 == "LIBCOMPAT" {
+ ncompat++
parseline()
printf("%s\to%s();\n", rettype, funcname) > syscompatdcl
printf("\t{ compat(%d,%s) },\t\t/* %d = old %s */\n",
@@ -373,6 +370,15 @@ s/\$//g
exit 1
}
END {
+ if (ncompat != 0) {
+ printf "#include \"opt_compat.h\"\n\n" > syssw
+ printf "\n#ifdef %s\n", compat > sysinc
+ printf "#define compat(n, name) n, (sy_call_t *)__CONCAT(o,name)\n" > sysinc
+ printf "#else\n" > sysinc
+ printf "#define compat(n, name) 0, (sy_call_t *)nosys\n" > sysinc
+ printf "#endif\n" > sysinc
+ }
+
printf("\n#endif /* %s */\n\n", compat) > syscompatdcl
printf("#undef PAD_\n") > syscompatdcl
printf("\n#endif /* !%s */\n", sysproto_h) > syscompatdcl
@@ -383,5 +389,5 @@ s/\$//g
> syshdr
} '
-cat $sysinc $sysent >$syssw
+cat $sysinc $sysent >> $syssw
cat $sysarg $sysdcl $syscompat $syscompatdcl > $sysproto
OpenPOWER on IntegriCloud