Add support for COMPAT10 keywords in syscalls.master.

Approved by:	re (gjb)
Sponsored by:	DARPA, AFRL
This commit is contained in:
Brooks Davis 2016-06-22 21:12:53 +00:00
parent b60998c633
commit e52e02ba24

View File

@ -9,6 +9,7 @@ compat=COMPAT_43
compat4=COMPAT_FREEBSD4
compat6=COMPAT_FREEBSD6
compat7=COMPAT_FREEBSD7
compat10=COMPAT_FREEBSD10
# output files:
sysnames="syscalls.c"
@ -33,6 +34,8 @@ syscompat6="sysent.compat6.$$"
syscompat6dcl="sysent.compat6dcl.$$"
syscompat7="sysent.compat7.$$"
syscompat7dcl="sysent.compat7dcl.$$"
syscompat10="sysent.compat10.$$"
syscompat10dcl="sysent.compat10dcl.$$"
sysent="sysent.switch.$$"
sysinc="sysinc.switch.$$"
sysarg="sysarg.switch.$$"
@ -47,9 +50,9 @@ else
capenabled=""
fi
trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0
trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0
touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret
touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret
case $# in
0) echo "usage: $0 input-file <config-file>" 1>&2
@ -88,6 +91,8 @@ s/\$//g
syscompat6dcl = \"$syscompat6dcl\"
syscompat7 = \"$syscompat7\"
syscompat7dcl = \"$syscompat7dcl\"
syscompat10 = \"$syscompat10\"
syscompat10dcl = \"$syscompat10dcl\"
sysent = \"$sysent\"
syssw = \"$syssw\"
sysinc = \"$sysinc\"
@ -102,6 +107,7 @@ s/\$//g
compat4 = \"$compat4\"
compat6 = \"$compat6\"
compat7 = \"$compat7\"
compat10 = \"$compat10\"
syscallprefix = \"$syscallprefix\"
switchname = \"$switchname\"
namesname = \"$namesname\"
@ -123,6 +129,7 @@ s/\$//g
printf "\n#ifdef %s\n\n", compat4 > syscompat4
printf "\n#ifdef %s\n\n", compat6 > syscompat6
printf "\n#ifdef %s\n\n", compat7 > syscompat7
printf "\n#ifdef %s\n\n", compat10 > syscompat10
printf "/*\n * System call names.\n *\n" > sysnames
printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
@ -206,6 +213,7 @@ s/\$//g
print > syscompat4
print > syscompat6
print > syscompat7
print > syscompat10
print > sysnames
print > systrace
print > systracetmp
@ -221,6 +229,7 @@ s/\$//g
print > syscompat4
print > syscompat6
print > syscompat7
print > syscompat10
print > sysnames
print > systrace
print > systracetmp
@ -236,6 +245,7 @@ s/\$//g
print > syscompat4
print > syscompat6
print > syscompat7
print > syscompat10
print > sysnames
print > systrace
print > systracetmp
@ -342,6 +352,8 @@ s/\$//g
argalias = "freebsd6_" argalias
if (flag("COMPAT7"))
argalias = "freebsd7_" argalias
if (flag("COMPAT10"))
argalias = "freebsd10_" argalias
}
f++
@ -493,7 +505,7 @@ s/\$//g
next
}
type("COMPAT") || type("COMPAT4") || type("COMPAT6") || \
type("COMPAT7") {
type("COMPAT7") || type("COMPAT10") {
if (flag("COMPAT")) {
ncompat++
out = syscompat
@ -522,6 +534,13 @@ s/\$//g
wrap = "compat7"
prefix = "freebsd7_"
descr = "freebsd7"
} else if (flag("COMPAT10")) {
ncompat10++
out = syscompat10
outdcl = syscompat10dcl
wrap = "compat10"
prefix = "freebsd10_"
descr = "freebsd10"
}
parseline()
if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \
@ -559,7 +578,8 @@ s/\$//g
printf("/* %d = %s %s */\n", syscall, descr, funcalias) > sysent
printf("\t\"%s.%s\",\t\t/* %d = %s %s */\n",
wrap, funcalias, syscall, descr, funcalias) > sysnames
if (flag("COMPAT") || flag("COMPAT4") || flag("COMPAT6")) {
# XXX-BD: why no COMPAT7?
if (flag("COMPAT") || flag("COMPAT4") || flag("COMPAT6") || flag("COMPAT10")) {
printf("\t\t\t\t/* %d is %s %s */\n",
syscall, descr, funcalias) > syshdr
} else if (!flag("NODEF")) {
@ -596,7 +616,7 @@ s/\$//g
END {
printf "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n" > sysinc
if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0)
if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0 || ncompat10 != 0)
printf "#include \"opt_compat.h\"\n\n" > syssw
if (ncompat != 0) {
@ -630,11 +650,18 @@ s/\$//g
printf "#define compat7(n, name) 0, (sy_call_t *)nosys\n" > sysinc
printf "#endif\n" > sysinc
}
if (ncompat10 != 0) {
printf "\n#ifdef %s\n", compat10 > sysinc
printf "#define compat10(n, name) n, (sy_call_t *)__CONCAT(freebsd10_,name)\n" > sysinc
printf "#else\n" > sysinc
printf "#define compat10(n, name) 0, (sy_call_t *)nosys\n" > sysinc
printf "#endif\n" > sysinc
}
printf("\n#endif /* %s */\n\n", compat) > syscompatdcl
printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl
printf("\n#endif /* %s */\n\n", compat6) > syscompat6dcl
printf("\n#endif /* %s */\n\n", compat7) > syscompat7dcl
printf("\n#endif /* %s */\n\n", compat10) > syscompat10dcl
printf("\n#undef PAD_\n") > sysprotoend
printf("#undef PADL_\n") > sysprotoend
@ -657,6 +684,7 @@ cat $sysarg $sysdcl \
$syscompat4 $syscompat4dcl \
$syscompat6 $syscompat6dcl \
$syscompat7 $syscompat7dcl \
$syscompat10 $syscompat10dcl \
$sysaue $sysprotoend > $sysproto
cat $systracetmp >> $systrace
cat $systraceret >> $systrace