1994-05-24 10:09:53 +00:00
|
|
|
#! /bin/sh -
|
|
|
|
# @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93
|
Mega-commit for Linux emulator update.. This has been stress tested under
netscape-2.0 for Linux running all the Java stuff. The scrollbars are now
working, at least on my machine. (whew! :-)
I'm uncomfortable with the size of this commit, but it's too
inter-dependant to easily seperate out.
The main changes:
COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386
machine dependent section into the linux emulator itself. The int 0x80
syscall code was almost identical to the lcall 7,0 code and a minor tweak
allows them to both be used with the same C code. All kernels can now
just modload the lkm and it'll DTRT without having to rebuild the kernel
first. Like IBCS2, you can statically compile it in with "options LINUX".
A pile of new syscalls implemented, including getdents(), llseek(),
readv(), writev(), msync(), personality(). The Linux-ELF libraries want
to use some of these.
linux_select() now obeys Linux semantics, ie: returns the time remaining
of the timeout value rather than leaving it the original value.
Quite a few bugs removed, including incorrect arguments being used in
syscalls.. eg: mixups between passing the sigset as an int, vs passing
it as a pointer and doing a copyin(), missing return values, unhandled
cases, SIOC* ioctls, etc.
The build for the code has changed. i386/conf/files now knows how
to build linux_genassym and generate linux_assym.h on the fly.
Supporting changes elsewhere in the kernel:
The user-mode signal trampoline has moved from the U area to immediately
below the top of the stack (below PS_STRINGS). This allows the different
binary emulations to have their own signal trampoline code (which gets rid
of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so
that the emulator can provide the exact "struct sigcontext *" argument to
the program's signal handlers.
The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which
have the same values as the re-used SA_DISABLE and SA_ONSTACK which are
intended for sigaction only. This enables the support of a SA_RESETHAND
flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal
semantics where the signal handler is reset when it's triggered.
makesyscalls.sh no longer appends the struct sysentvec on the end of the
generated init_sysent.c code. It's a lot saner to have it in a seperate
file rather than trying to update the structure inside the awk script. :-)
At exec time, the dozen bytes or so of signal trampoline code are copied
to the top of the user's stack, rather than obtaining the trampoline code
the old way by getting a clone of the parent's user area. This allows
Linux and native binaries to freely exec each other without getting
trampolines mixed up.
1996-03-02 19:38:20 +00:00
|
|
|
# $Id: makesyscalls.sh,v 1.16 1995/10/07 23:56:18 swallace Exp $
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# name of compat option:
|
|
|
|
compat=COMPAT_43
|
|
|
|
|
|
|
|
# output files:
|
|
|
|
sysnames="syscalls.c"
|
1995-09-19 13:31:04 +00:00
|
|
|
sysproto="../sys/sysproto.h"
|
|
|
|
sysproto_h=_SYS_SYSPROTO_H_
|
1994-05-24 10:09:53 +00:00
|
|
|
syshdr="../sys/syscall.h"
|
|
|
|
syssw="init_sysent.c"
|
1994-09-13 02:21:48 +00:00
|
|
|
syshide="../sys/syscall-hide.h"
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
syscallprefix="SYS_"
|
|
|
|
switchname="sysent"
|
|
|
|
namesname="syscallnames"
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
# tmp files:
|
|
|
|
sysdcl="sysent.dcl"
|
|
|
|
syscompat="sysent.compat"
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
syscompatdcl="sysent.compatdcl"
|
1994-05-24 10:09:53 +00:00
|
|
|
sysent="sysent.switch"
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
sysinc="sysinc.switch"
|
|
|
|
sysarg="sysarg.switch"
|
1994-05-24 10:09:53 +00:00
|
|
|
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
trap "rm $sysdcl $syscompat $syscompatdcl $sysent $sysinc $sysarg" 0
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
case $# in
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
0) echo "Usage: $0 input-file <config-file>" 1>&2
|
1994-05-24 10:09:53 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
if [ -f $2 ]; then
|
|
|
|
. $2
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed -e '
|
|
|
|
s/\$//g
|
|
|
|
:join
|
|
|
|
/\\$/{a\
|
|
|
|
|
|
|
|
N
|
|
|
|
s/\\\n//
|
|
|
|
b join
|
|
|
|
}
|
|
|
|
2,${
|
|
|
|
/^#/!s/\([{}()*,]\)/ \1 /g
|
|
|
|
}
|
|
|
|
' < $1 | awk "
|
1994-05-24 10:09:53 +00:00
|
|
|
BEGIN {
|
|
|
|
sysdcl = \"$sysdcl\"
|
1995-09-19 13:31:04 +00:00
|
|
|
sysproto = \"$sysproto\"
|
|
|
|
sysproto_h = \"$sysproto_h\"
|
1994-05-24 10:09:53 +00:00
|
|
|
syscompat = \"$syscompat\"
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
syscompatdcl = \"$syscompatdcl\"
|
1994-05-24 10:09:53 +00:00
|
|
|
sysent = \"$sysent\"
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
sysinc = \"$sysinc\"
|
|
|
|
sysarg = \"$sysarg\"
|
1994-05-24 10:09:53 +00:00
|
|
|
sysnames = \"$sysnames\"
|
|
|
|
syshdr = \"$syshdr\"
|
|
|
|
compat = \"$compat\"
|
1994-09-13 02:21:48 +00:00
|
|
|
syshide = \"$syshide\"
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
syscallprefix = \"$syscallprefix\"
|
|
|
|
switchname = \"$switchname\"
|
|
|
|
namesname = \"$namesname\"
|
1994-05-24 10:09:53 +00:00
|
|
|
infile = \"$1\"
|
|
|
|
"'
|
|
|
|
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf "/*\n * System call switch table.\n *\n" > sysinc
|
|
|
|
printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysinc
|
1995-09-19 13:31:04 +00:00
|
|
|
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf "/*\n * System call prototypes.\n *\n" > sysarg
|
|
|
|
printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarg
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1995-09-19 13:31:04 +00:00
|
|
|
printf "\n#ifdef %s\n\n", compat > syscompat
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
printf "/*\n * System call names.\n *\n" > sysnames
|
|
|
|
printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames
|
|
|
|
|
|
|
|
printf "/*\n * System call numbers.\n *\n" > syshdr
|
|
|
|
printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr
|
1994-09-13 02:21:48 +00:00
|
|
|
printf "/*\n * System call hiders.\n *\n" > syshide
|
|
|
|
printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
}
|
|
|
|
NR == 1 {
|
1995-09-19 13:50:26 +00:00
|
|
|
gsub("[$]Id: ", "", $0)
|
|
|
|
gsub(" [$]", "", $0)
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
|
|
|
|
printf " * created from%s\n */\n\n", $0 > sysinc
|
|
|
|
|
|
|
|
printf "\n#ifdef %s\n", compat > sysent
|
1995-09-19 13:31:04 +00:00
|
|
|
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
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf "struct sysent %s[] = {\n",switchname > sysent
|
1994-05-24 10:09:53 +00:00
|
|
|
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf " * created from%s\n */\n\n", $0 > sysarg
|
|
|
|
printf("#ifndef %s\n", sysproto_h) > sysarg
|
|
|
|
printf("#define\t%s\n\n", sysproto_h) > sysarg
|
|
|
|
printf "#include <sys/types.h>\n", $0 > sysarg
|
|
|
|
printf "#include <sys/param.h>\n", $0 > sysarg
|
|
|
|
printf "#include <sys/mount.h>\n\n", $0 > sysarg
|
1995-09-19 13:31:04 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
printf " * created from%s\n */\n\n", $0 > sysnames
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf "char *%s[] = {\n", namesname > sysnames
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
printf " * created from%s\n */\n\n", $0 > syshdr
|
1994-09-13 02:21:48 +00:00
|
|
|
|
|
|
|
printf " * created from%s\n */\n\n", $0 > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
NF == 0 || $1 ~ /^;/ {
|
|
|
|
next
|
|
|
|
}
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
$1 ~ /^#[ ]*include/ {
|
|
|
|
print > sysinc
|
|
|
|
next
|
|
|
|
}
|
1994-05-24 10:09:53 +00:00
|
|
|
$1 ~ /^#[ ]*if/ {
|
|
|
|
print > sysent
|
|
|
|
print > sysdcl
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
print > sysarg
|
1994-05-24 10:09:53 +00:00
|
|
|
print > syscompat
|
|
|
|
print > sysnames
|
1994-09-13 02:21:48 +00:00
|
|
|
print > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
savesyscall = syscall
|
|
|
|
next
|
|
|
|
}
|
|
|
|
$1 ~ /^#[ ]*else/ {
|
|
|
|
print > sysent
|
|
|
|
print > sysdcl
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
print > sysarg
|
1994-05-24 10:09:53 +00:00
|
|
|
print > syscompat
|
|
|
|
print > sysnames
|
1994-09-13 02:21:48 +00:00
|
|
|
print > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall = savesyscall
|
|
|
|
next
|
|
|
|
}
|
|
|
|
$1 ~ /^#/ {
|
|
|
|
print > sysent
|
|
|
|
print > sysdcl
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
print > sysarg
|
1994-05-24 10:09:53 +00:00
|
|
|
print > syscompat
|
|
|
|
print > sysnames
|
1994-09-13 02:21:48 +00:00
|
|
|
print > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
syscall != $1 {
|
|
|
|
printf "%s: line %d: syscall number out of sync at %d\n", \
|
|
|
|
infile, NR, syscall
|
|
|
|
printf "line is:\n"
|
|
|
|
print
|
|
|
|
exit 1
|
|
|
|
}
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
function parserr(was, wanted) {
|
|
|
|
printf "%s: line %d: unexpected %s (expected %s)\n", \
|
|
|
|
infile, NR, was, wanted
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
function parseline() {
|
|
|
|
f=4 # toss number and type
|
|
|
|
argc= 0;
|
|
|
|
bigargc = 0;
|
|
|
|
if ($NF != "}") {
|
|
|
|
funcalias=$(NF-2)
|
|
|
|
argalias=$(NF-1)
|
|
|
|
rettype=$NF
|
|
|
|
end=NF-3
|
|
|
|
} else {
|
|
|
|
funcalias=""
|
|
|
|
argalias=""
|
|
|
|
rettype="int"
|
|
|
|
end=NF
|
1995-09-19 13:31:04 +00:00
|
|
|
}
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
if ($2 == "NODEF") {
|
|
|
|
funcname=$4
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if ($f != "{")
|
|
|
|
parserr($f, "{")
|
|
|
|
f++
|
|
|
|
if ($end != "}")
|
|
|
|
parserr($end, "}")
|
|
|
|
end--
|
|
|
|
if ($end != ";")
|
|
|
|
parserr($end, ";")
|
|
|
|
end--
|
|
|
|
if ($end != ")")
|
|
|
|
parserr($end, ")")
|
|
|
|
end--
|
|
|
|
|
|
|
|
f++ #function return type
|
|
|
|
|
|
|
|
funcname=$f
|
|
|
|
if (funcalias == "")
|
|
|
|
funcalias = funcname
|
|
|
|
if (argalias == "") {
|
|
|
|
argalias = funcname "_args"
|
1995-10-07 23:56:20 +00:00
|
|
|
if ($2 == "COMPAT")
|
|
|
|
argalias = "o" argalias
|
1995-09-19 13:31:04 +00:00
|
|
|
}
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
f++
|
|
|
|
|
|
|
|
if ($f != "(")
|
|
|
|
parserr($f, ")")
|
|
|
|
f++
|
|
|
|
|
|
|
|
if (f == end) {
|
|
|
|
if ($f != "void")
|
|
|
|
parserr($f, "argument definition")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
while (f <= end) {
|
|
|
|
argc++
|
|
|
|
argtype[argc]=""
|
|
|
|
oldf=""
|
|
|
|
while (f < end && $(f+1) != ",") {
|
|
|
|
if (argtype[argc] != "" && oldf != "*")
|
|
|
|
argtype[argc] = argtype[argc]" ";
|
|
|
|
argtype[argc] = argtype[argc]$f;
|
|
|
|
oldf = $f;
|
|
|
|
f++
|
|
|
|
}
|
|
|
|
if (argtype[argc] == "")
|
|
|
|
parserr($f, "argument definition")
|
|
|
|
if (argtype[argc] == "off_t")
|
|
|
|
bigargc++
|
|
|
|
argname[argc]=$f;
|
|
|
|
f += 2; # skip name, and any comma
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{ comment = $4
|
|
|
|
if (NF < 7)
|
|
|
|
for (i = 5; i <= NF; i++)
|
|
|
|
comment = comment " " $i
|
|
|
|
}
|
|
|
|
$2 == "STD" || $2 == "NODEF" || $2 == "NOARGS" || $2 == "NOPROTO" {
|
|
|
|
parseline()
|
1995-10-07 23:56:20 +00:00
|
|
|
if ((!nosys || funcname != "nosys") && \
|
|
|
|
(funcname != "lkmnosys")) {
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
if (argc != 0 && $2 != "NOARGS" && $2 != "NOPROTO") {
|
|
|
|
printf("struct\t%s {\n", argalias) > sysarg
|
|
|
|
for (i = 1; i <= argc; i++)
|
|
|
|
printf("\t%s %s;\n", argtype[i],
|
|
|
|
argname[i]) > sysarg
|
|
|
|
printf("};\n") > sysarg
|
|
|
|
}
|
1995-10-07 23:56:20 +00:00
|
|
|
else if($2 != "NOARGS" && $2 != "NOPROTO")
|
|
|
|
printf("struct\t%s {\n\tint dummy;\n};\n", \
|
|
|
|
argalias) > sysarg
|
|
|
|
}
|
|
|
|
if ($2 != "NOPROTO" && (!nosys || funcname != "nosys") && \
|
|
|
|
(!lkmnosys || funcname != "lkmnosys")) {
|
|
|
|
if (funcname == "exit")
|
|
|
|
printf("__dead ") > sysdcl
|
|
|
|
printf("%s\t%s __P((struct proc *, struct %s *, int []));\n", \
|
|
|
|
rettype, funcname, argalias) > sysdcl
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
}
|
|
|
|
if (funcname == "nosys")
|
1994-09-11 20:45:34 +00:00
|
|
|
nosys = 1
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
if (funcname == "lkmnosys")
|
1994-11-06 21:57:16 +00:00
|
|
|
lkmnosys = 1
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf("\t{ %d, (sy_call_t *)%s },\t\t", \
|
|
|
|
argc+bigargc, funcname) > sysent
|
|
|
|
if(length(funcname) < 11)
|
|
|
|
printf("\t") > sysent
|
|
|
|
printf("/* %d = %s */\n", syscall, funcalias) > sysent
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t\"%s\",\t\t\t/* %d = %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
funcalias, syscall, funcalias) > sysnames
|
|
|
|
if ($2 != "NODEF")
|
|
|
|
printf("#define\t%s%s\t%d\n", syscallprefix, \
|
|
|
|
funcalias, syscall) > syshdr
|
|
|
|
if ($3 != "NOHIDE")
|
|
|
|
printf("HIDE_%s(%s)\n", $3, funcname) > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall++
|
|
|
|
next
|
|
|
|
}
|
1995-10-07 23:56:20 +00:00
|
|
|
$2 == "COMPAT" || $2 == "CPT_NOA" {
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
parseline()
|
1995-10-07 23:56:20 +00:00
|
|
|
if (argc != 0 && $2 != "CPT_NOA") {
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf("struct\t%s {\n", argalias) > syscompat
|
|
|
|
for (i = 1; i <= argc; i++)
|
|
|
|
printf("\t%s %s;\n", argtype[i],
|
|
|
|
argname[i]) > syscompat
|
|
|
|
printf("};\n") > syscompat
|
|
|
|
}
|
1995-10-07 23:56:20 +00:00
|
|
|
else if($2 != "CPT_NOA")
|
|
|
|
printf("struct\t%s {\n\tint dummy;\n};\n", \
|
|
|
|
argalias) > sysarg
|
1995-09-19 13:31:04 +00:00
|
|
|
printf("%s\to%s __P((struct proc *, struct %s *, int []));\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
rettype, funcname, argalias) > syscompatdcl
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t{ compat(%d,%s) },\t\t/* %d = old %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
argc+bigargc, funcname, syscall, funcalias) > sysent
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t\"old.%s\",\t\t/* %d = old %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
funcalias, syscall, funcalias) > sysnames
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t\t\t\t/* %d is old %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
syscall, funcalias) > syshdr
|
|
|
|
if ($3 != "NOHIDE")
|
|
|
|
printf("HIDE_%s(%s)\n", $3, funcname) > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall++
|
|
|
|
next
|
|
|
|
}
|
|
|
|
$2 == "LIBCOMPAT" {
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
parseline()
|
|
|
|
printf("%s\to%s();\n", rettype, funcname) > syscompatdcl
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t{ compat(%d,%s) },\t\t/* %d = old %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
argc+bigargc, funcname, syscall, funcalias) > sysent
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t\"old.%s\",\t\t/* %d = old %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
funcalias, syscall, funcalias) > sysnames
|
|
|
|
printf("#define\t%s%s\t%d\t/* compatibility; still used by libc */\n", \
|
|
|
|
syscallprefix, funcalias, syscall) > syshdr
|
|
|
|
if ($3 != "NOHIDE")
|
|
|
|
printf("HIDE_%s(%s)\n", $3, funcname) > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall++
|
|
|
|
next
|
|
|
|
}
|
|
|
|
$2 == "OBSOL" {
|
1995-09-19 13:31:04 +00:00
|
|
|
printf("\t{ 0, (sy_call_t *)nosys },\t\t\t/* %d = obsolete %s */\n", \
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall, comment) > sysent
|
|
|
|
printf("\t\"obs_%s\",\t\t\t/* %d = obsolete %s */\n", \
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
$4, syscall, comment) > sysnames
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("\t\t\t\t/* %d is obsolete %s */\n", \
|
|
|
|
syscall, comment) > syshdr
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
if ($3 != "NOHIDE")
|
|
|
|
printf("HIDE_%s(%s)\n", $3, $4) > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall++
|
|
|
|
next
|
|
|
|
}
|
|
|
|
$2 == "UNIMPL" {
|
1995-09-19 13:31:04 +00:00
|
|
|
printf("\t{ 0, (sy_call_t *)nosys },\t\t\t/* %d = %s */\n", \
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall, comment) > sysent
|
|
|
|
printf("\t\"#%d\",\t\t\t/* %d = %s */\n", \
|
|
|
|
syscall, syscall, comment) > sysnames
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
if ($3 != "NOHIDE")
|
|
|
|
printf("HIDE_%s(%s)\n", $3, $4) > syshide
|
1994-05-24 10:09:53 +00:00
|
|
|
syscall++
|
|
|
|
next
|
|
|
|
}
|
|
|
|
{
|
|
|
|
printf "%s: line %d: unrecognized keyword %s\n", infile, NR, $2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
END {
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf("\n#endif /* %s */\n", compat) > syscompatdcl
|
|
|
|
printf("\n#endif /* !%s */\n", sysproto_h) > syscompatdcl
|
1994-05-24 10:09:53 +00:00
|
|
|
|
Mega-commit for Linux emulator update.. This has been stress tested under
netscape-2.0 for Linux running all the Java stuff. The scrollbars are now
working, at least on my machine. (whew! :-)
I'm uncomfortable with the size of this commit, but it's too
inter-dependant to easily seperate out.
The main changes:
COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386
machine dependent section into the linux emulator itself. The int 0x80
syscall code was almost identical to the lcall 7,0 code and a minor tweak
allows them to both be used with the same C code. All kernels can now
just modload the lkm and it'll DTRT without having to rebuild the kernel
first. Like IBCS2, you can statically compile it in with "options LINUX".
A pile of new syscalls implemented, including getdents(), llseek(),
readv(), writev(), msync(), personality(). The Linux-ELF libraries want
to use some of these.
linux_select() now obeys Linux semantics, ie: returns the time remaining
of the timeout value rather than leaving it the original value.
Quite a few bugs removed, including incorrect arguments being used in
syscalls.. eg: mixups between passing the sigset as an int, vs passing
it as a pointer and doing a copyin(), missing return values, unhandled
cases, SIOC* ioctls, etc.
The build for the code has changed. i386/conf/files now knows how
to build linux_genassym and generate linux_assym.h on the fly.
Supporting changes elsewhere in the kernel:
The user-mode signal trampoline has moved from the U area to immediately
below the top of the stack (below PS_STRINGS). This allows the different
binary emulations to have their own signal trampoline code (which gets rid
of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so
that the emulator can provide the exact "struct sigcontext *" argument to
the program's signal handlers.
The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which
have the same values as the re-used SA_DISABLE and SA_ONSTACK which are
intended for sigaction only. This enables the support of a SA_RESETHAND
flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal
semantics where the signal handler is reset when it's triggered.
makesyscalls.sh no longer appends the struct sysentvec on the end of the
generated init_sysent.c code. It's a lot saner to have it in a seperate
file rather than trying to update the structure inside the awk script. :-)
At exec time, the dozen bytes or so of signal trampoline code are copied
to the top of the user's stack, rather than obtaining the trampoline code
the old way by getting a clone of the parent's user area. This allows
Linux and native binaries to freely exec each other without getting
trampolines mixed up.
1996-03-02 19:38:20 +00:00
|
|
|
printf("};\n") > sysent
|
1994-05-24 10:09:53 +00:00
|
|
|
printf("};\n") > sysnames
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
printf("#define\t%sMAXSYSCALL\t%d\n", syscallprefix, syscall) \
|
|
|
|
> syshdr
|
1994-05-24 10:09:53 +00:00
|
|
|
} '
|
|
|
|
|
Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h
New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.
Update syscalls.master to reflect new changes. For example, read()
entry now looks like:
3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }
This is similar to how NetBSD generates these files.
1995-10-07 06:24:08 +00:00
|
|
|
cat $sysinc $sysent >$syssw
|
|
|
|
cat $sysarg $sysdcl $syscompat $syscompatdcl > $sysproto
|