Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern include #ifdefs in the syscalls autoload file and m...



details:   https://anonhg.NetBSD.org/src/rev/d9873158747c
branches:  trunk
changeset: 452110:d9873158747c
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 18 16:24:17 2019 +0000

description:
include #ifdefs in the syscalls autoload file and make it standalone.
XXX: This needs to be re-thought

diffstat:

 sys/kern/makesyscalls.sh |  42 +++++++++++++-----------------------------
 1 files changed, 13 insertions(+), 29 deletions(-)

diffs (143 lines):

diff -r 639743c46a2a -r d9873158747c sys/kern/makesyscalls.sh
--- a/sys/kern/makesyscalls.sh  Tue Jun 18 16:23:24 2019 +0000
+++ b/sys/kern/makesyscalls.sh  Tue Jun 18 16:24:17 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: makesyscalls.sh,v 1.172 2018/08/26 11:53:28 kre Exp $
+#      $NetBSD: makesyscalls.sh,v 1.173 2019/06/18 16:24:17 christos Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -94,6 +94,7 @@
 $fail && exit 1
 
 # tmp files:
+sysautoloadbottom="$sysautoload.bottom"
 sysdcl="sysent.dcl"
 sysprotos="sys.protos"
 syscompat_pref="sysent."
@@ -106,7 +107,7 @@
 systraceret="systraceret.$$"
 
 cleanup() {
-    rm $sysdcl $sysprotos $sysent $sysnamesbottom $sysnamesfriendly $rumpsysent $rumptypes $rumpprotos $systracetmp $systraceret
+    rm $sysdcl $sysprotos $sysent $sysnamesbottom $sysnamesfriendly $rumpsysent $rumptypes $rumpprotos $systracetmp $systraceret $sysautoloadbottom
 }
 trap "cleanup" 0
 
@@ -162,7 +163,6 @@
 
        # to allow nested #if/#else/#endif sets
        savedepth = 0
-       auto_skip = 0
        # to track already processed syscalls
 
        sysnames = \"$sysnames\"
@@ -174,6 +174,7 @@
        systracetmp = \"$systracetmp\"
        systraceret = \"$systraceret\"
        sysautoload = \"$sysautoload\"
+       sysautoloadbottom = \"${sysautoload}.bottom\"
        rumpcalls = \"$rumpcalls\"
        rumpcallshdr = \"$rumpcallshdr\"
        rumpsysent = \"$rumpsysent\"
@@ -272,9 +273,8 @@
 
        printf " * created from%s\n */\n\n", $0 > sysautoload
        printf "#include <sys/cdefs.h>\n__KERNEL_RCSID(0, \"%s\");\n\n", tag > sysautoload
-       printf("#include <sys/proc.h>\n")               > sysautoload
        printf("static struct sc_autoload " emulname \
-               "_syscalls_autoload[] = {\n")           > sysautoload
+               "_syscalls_autoload[] = {\n")           > sysautoloadbottom
 
        printf " * created from%s\n */\n\n", $0 > rumpcalls
        printf "#ifdef RUMP_CLIENT\n" > rumpcalls
@@ -418,30 +418,19 @@
 $1 ~ /^#[      ]*include/ {
        print > sysdcl
        print > sysnames
+       print > sysautoload
        next
 }
 $1 ~ /^#/ && !intable {
        print > sysdcl
        print > sysnames
+       print > sysautoload
        next
 }
 $1 ~ /^#/ && intable {
        if ($1 ~ /^#[   ]*if/) {
                savedepth++
                savesyscall[savedepth] = syscall
-               skip_auto[savedepth] = auto_skip
-               auto_skip = 0
-
-               # Special handling for sysautoload conditionals
-               #
-               # We ignore all conditions other than those for
-               # !defined(_LP64) which are used for SYSV* syscalls
-               # only
-
-               if ($0 ~ /!defined\(_LP64\)/) {
-                       printf("#if !defined(_LP64)\n") > sysautoload
-                       auto_skip = savedepth
-               }
        }
        if ($1 ~ /^#[   ]*else/) {
                if (savedepth <= 0) {
@@ -449,9 +438,6 @@
                            infile, NR)
                        exit 1
                }
-               if (auto_skip == savedepth) {
-                       print > sysautoload
-               }
                syscall = savesyscall[savedepth]
        }
        if ($1 ~ /^#[       ]*endif/) {
@@ -460,16 +446,13 @@
                            infile, NR)
                        exit 1
                }
-               if (auto_skip == savedepth) {
-                       print > sysautoload
-               }
-               auto_skip = skip_auto[savedepth];
                savedepth--
        }
        print > sysent
        print > sysarghdr
        print > sysnumhdr
        print > sysprotos
+       print > sysautoloadbottom
        print > sysnamesbottom
        print > sysnamesfriendly
        print > systrace
@@ -709,9 +692,9 @@
            syscall) > sysnumhdr
 
        # output entry for syscall autoload table, if modular
-       if (modular ) {
+       if (modular) {
                printf("\t    { %s%s%s, \"%s\" },\n", constprefix, wrap,
-                   funcalias, modname) > sysautoload
+                  funcalias, modname) > sysautoloadbottom
        }
 
 
@@ -1190,13 +1173,14 @@
 cat $sysprotos >> $sysarghdr
 echo "#endif /* _${constprefix}SYSCALL_H_ */" >> $sysnumhdr
 echo "#endif /* _${constprefix}SYSCALLARGS_H_ */" >> $sysarghdr
-printf "\t    { 0, NULL }\n" >> $sysautoload
-echo "};" >> $sysautoload
+printf "\t    { 0, NULL }\n" >> $sysautoloadbottom
+echo "};" >> $sysautoloadbottom
 printf "\n#endif /* _RUMP_RUMP_SYSCALLS_H_ */\n" >> $rumpprotos
 cat $sysdcl $sysent > $syssw
 cat $sysnamesbottom >> $sysnames
 cat $sysnamesfriendly >> $sysnames
 cat $rumpsysent >> $rumpcalls
+cat $sysautoloadbottom >> $sysautoload
 
 touch $rumptypes
 cat $rumptypes >> $rumpcallshdr



Home | Main Index | Thread Index | Old Index