summaryrefslogtreecommitdiffstats
path: root/sys/kern/makesyscalls.sh
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-06-09 03:32:05 +0000
committerbde <bde@FreeBSD.org>1998-06-09 03:32:05 +0000
commitaf177df3632aaf9f0208f5c6555e739a8a72bcd6 (patch)
treee7df819840d0004558a0ca1ff4858c7534589e25 /sys/kern/makesyscalls.sh
parentdb50a6d67732abc73cee5aa9b2068d86a756b6d0 (diff)
downloadFreeBSD-src-af177df3632aaf9f0208f5c6555e739a8a72bcd6.zip
FreeBSD-src-af177df3632aaf9f0208f5c6555e739a8a72bcd6.tar.gz
Don't generate COMPAT_43 cruft if there are no COMPAT_43 syscalls.
In particular, don't generate an include of "opt_compat.h" if it wouldn't affect anything we create. This will fix recent breakage of the ibcs2 LKM. The ibcs2 syscall files were not regenerated properly, so the LKM didn't break immediately when we started generating this extraneous include.
Diffstat (limited to 'sys/kern/makesyscalls.sh')
-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