Forgot to check this important file in.

This commit is contained in:
Garrett Wollman 1994-09-13 02:21:48 +00:00
parent 221a01197c
commit 181039c516

View File

@ -1,6 +1,6 @@
#! /bin/sh -
# @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93
# $Id: makesyscalls.sh,v 1.5 1994/08/26 09:33:36 sos Exp $
# $Id: makesyscalls.sh,v 1.6 1994/09/11 20:45:34 ats Exp $
set -e
@ -11,6 +11,7 @@ compat=COMPAT_43
sysnames="syscalls.c"
syshdr="../sys/syscall.h"
syssw="init_sysent.c"
syshide="../sys/syscall-hide.h"
# tmp files:
sysdcl="sysent.dcl"
@ -33,6 +34,7 @@ awk < $1 "
sysnames = \"$sysnames\"
syshdr = \"$syshdr\"
compat = \"$compat\"
syshide = \"$syshide\"
infile = \"$1\"
"'
@ -47,6 +49,8 @@ awk < $1 "
printf "/*\n * System call numbers.\n *\n" > syshdr
printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr
printf "/*\n * System call hiders.\n *\n" > syshide
printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshide
}
NR == 1 {
printf " * created from%s\n */\n\n", $0 > sysdcl
@ -60,6 +64,8 @@ awk < $1 "
printf "char *syscallnames[] = {\n" > sysnames
printf " * created from%s\n */\n\n", $0 > syshdr
printf " * created from%s\n */\n\n", $0 > syshide
next
}
NF == 0 || $1 ~ /^;/ {
@ -70,6 +76,7 @@ awk < $1 "
print > sysdcl
print > syscompat
print > sysnames
print > syshide
savesyscall = syscall
next
}
@ -78,6 +85,7 @@ awk < $1 "
print > sysdcl
print > syscompat
print > sysnames
print > syshide
syscall = savesyscall
next
}
@ -86,6 +94,7 @@ awk < $1 "
print > sysdcl
print > syscompat
print > sysnames
print > syshide
next
}
syscall != $1 {
@ -95,46 +104,48 @@ awk < $1 "
print
exit 1
}
{ comment = $4
for (i = 5; i <= NF; i++)
{ comment = $5
for (i = 6; i <= NF; i++)
comment = comment " " $i
if (NF < 5)
$5 = $4
if (NF < 6)
$6 = $5
if ($4 != "NOHIDE")
printf("HIDE_%s(%s)\n", $4, $5) > syshide
}
$2 == "STD" || $2 == "NODEF" {
if (!nosys || $4 != "nosys")
printf("int\t%s();\n", $4) > sysdcl
if ($4 == "nosys")
if (!nosys || $5 != "nosys")
printf("int\t%s();\n", $5) > sysdcl
if ($5 == "nosys")
nosys = 1
printf("\t{ %d, %s },\t\t\t/* %d = %s */\n", \
$3, $4, syscall, $5) > sysent
$3, $5, syscall, $6) > sysent
printf("\t\"%s\",\t\t\t/* %d = %s */\n", \
$5, syscall, $5) > sysnames
$6, syscall, $6) > sysnames
if ($2 == "STD")
printf("#define\tSYS_%s\t%d\n", \
$5, syscall) > syshdr
$6, syscall) > syshdr
syscall++
next
}
$2 == "COMPAT" {
printf("int\to%s();\n", $4) > syscompat
printf("int\to%s();\n", $5) > syscompat
printf("\t{ compat(%d,%s) },\t\t/* %d = old %s */\n", \
$3, $4, syscall, $5) > sysent
$3, $5, syscall, $6) > sysent
printf("\t\"old.%s\",\t\t/* %d = old %s */\n", \
$5, syscall, $5) > sysnames
$6, syscall, $6) > 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("int\to%s();\n", $5) > syscompat
printf("\t{ compat(%d,%s) },\t\t/* %d = old %s */\n", \
$3, $4, syscall, $5) > sysent
$3, $5, syscall, $6) > sysent
printf("\t\"old.%s\",\t\t/* %d = old %s */\n", \
$5, syscall, $5) > sysnames
$6, syscall, $6) > sysnames
printf("#define\tSYS_%s\t%d\t/* compatibility; still used by libc */\n", \
$5, syscall) > syshdr
$6, syscall) > syshdr
syscall++
next
}
@ -142,7 +153,7 @@ awk < $1 "
printf("\t{ 0, nosys },\t\t\t/* %d = obsolete %s */\n", \
syscall, comment) > sysent
printf("\t\"obs_%s\",\t\t\t/* %d = obsolete %s */\n", \
$4, syscall, comment) > sysnames
$5, syscall, comment) > sysnames
printf("\t\t\t\t/* %d is obsolete %s */\n", \
syscall, comment) > syshdr
syscall++
@ -175,4 +186,5 @@ awk < $1 "
cat $sysdcl $syscompat $sysent >$syssw
chmod 444 $sysnames $syshdr $syssw
chmod 444 $sysnames $syshdr $syssw $syshide