Wed Oct 9 01:43:00 2019 UTC ()
- cast through void * for rump
- don't generate bogus filenames /dev/null.bottom etc.


(christos)
diff -r1.173 -r1.174 src/sys/kern/makesyscalls.sh

cvs diff -r1.173 -r1.174 src/sys/kern/makesyscalls.sh (expand / switch to unified diff)

--- src/sys/kern/makesyscalls.sh 2019/06/18 16:24:17 1.173
+++ src/sys/kern/makesyscalls.sh 2019/10/09 01:43:00 1.174
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: makesyscalls.sh,v 1.173 2019/06/18 16:24:17 christos Exp $ 1# $NetBSD: makesyscalls.sh,v 1.174 2019/10/09 01:43:00 christos Exp $
2# 2#
3# Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou 3# Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 3. All advertising materials mentioning features or use of this software 14# 3. All advertising materials mentioning features or use of this software
@@ -60,57 +60,66 @@ esac @@ -60,57 +60,66 @@ esac
60# 60#
61# NOTE THAT THIS makesyscalls.sh DOES NOT SUPPORT 'SYSLIBCOMPAT'. 61# NOTE THAT THIS makesyscalls.sh DOES NOT SUPPORT 'SYSLIBCOMPAT'.
62 62
63# source the config file. 63# source the config file.
64sys_nosys="sys_nosys" # default is sys_nosys(), if not specified otherwise 64sys_nosys="sys_nosys" # default is sys_nosys(), if not specified otherwise
65maxsysargs=8 # default limit is 8 (32bit) arguments 65maxsysargs=8 # default limit is 8 (32bit) arguments
66systrace="/dev/null" 66systrace="/dev/null"
67sysautoload="/dev/null" 67sysautoload="/dev/null"
68rumpcalls="/dev/null" 68rumpcalls="/dev/null"
69rumpcallshdr="/dev/null" 69rumpcallshdr="/dev/null"
70rumpsysmap="/dev/null" 70rumpsysmap="/dev/null"
71rumpsysent="rumpsysent.tmp" 71rumpsysent="rumpsysent.tmp"
72rumpnoflags="\n\t\t.sy_flags = SYCALL_NOSYS," 72rumpnoflags="\n\t\t.sy_flags = SYCALL_NOSYS,"
73rumpnosys="(sy_call_t *)rumpns_enosys" 73rumpnosys="(sy_call_t *)(void *)rumpns_enosys"
74rumpnomodule="(sy_call_t *)rumpns_sys_nomodule" 74rumpnomodule="(sy_call_t *)(void *)rumpns_sys_nomodule"
75 75
76case $1 in 76case $1 in
77/*) . $1;; 77/*) . $1;;
78*) . ./$1;; 78*) . ./$1;;
79esac 79esac
80 80
81errmsg() 81errmsg()
82{ 82{
83 fail=true; 83 fail=true;
84 printf '%s: %s\n' "$0" "$*" >&2 84 printf '%s: %s\n' "$0" "$*" >&2
85} 85}
86 86
 87addsuffix()
 88{
 89 if [ "$1" = "/dev/null" -o -z "$2" ]; then
 90 echo $1
 91 else
 92 echo $1.$2
 93 fi
 94}
 95
87fail=false 96fail=false
88case "${nsysent:-0}" in 97case "${nsysent:-0}" in
89*[!0-9]*) errmsg "Non numeric value for nsysent:" "${nsysent}";; 98*[!0-9]*) errmsg "Non numeric value for nsysent:" "${nsysent}";;
90esac 99esac
91case "${maxsysargs:-0}" in 100case "${maxsysargs:-0}" in
92*[!0-9]*) errmsg "Non numeric value for maxsysargs:" "${maxsysargs}";; 101*[!0-9]*) errmsg "Non numeric value for maxsysargs:" "${maxsysargs}";;
93esac 102esac
94$fail && exit 1 103$fail && exit 1
95 104
96# tmp files: 105# tmp files:
97sysautoloadbottom="$sysautoload.bottom" 106sysautoloadbottom=$(addsuffix $sysautoload "bottom")
98sysdcl="sysent.dcl" 107sysdcl="sysent.dcl"
99sysprotos="sys.protos" 108sysprotos="sys.protos"
100syscompat_pref="sysent." 109syscompat_pref="sysent."
101sysent="sysent.switch" 110sysent="sysent.switch"
102sysnamesbottom="$sysnames.bottom" 111sysnamesbottom=$(addsuffix $sysnames "bottom")
103sysnamesfriendly="$sysnames.friendly" 112sysnamesfriendly=$(addsuffix $sysnames "friendly")
104rumptypes="rumphdr.types" 113rumptypes="rumphdr.types"
105rumpprotos="rumphdr.protos" 114rumpprotos="rumphdr.protos"
106systracetmp="systrace.$$" 115systracetmp="systrace.$$"
107systraceret="systraceret.$$" 116systraceret="systraceret.$$"
108 117
109cleanup() { 118cleanup() {
110 rm $sysdcl $sysprotos $sysent $sysnamesbottom $sysnamesfriendly $rumpsysent $rumptypes $rumpprotos $systracetmp $systraceret $sysautoloadbottom 119 rm $sysdcl $sysprotos $sysent $sysnamesbottom $sysnamesfriendly $rumpsysent $rumptypes $rumpprotos $systracetmp $systraceret $sysautoloadbottom
111} 120}
112trap "cleanup" 0 121trap "cleanup" 0
113 122
114# Awk program (must support nawk extensions) 123# Awk program (must support nawk extensions)
115# Use "awk" at Berkeley, "nawk" or "gawk" elsewhere. 124# Use "awk" at Berkeley, "nawk" or "gawk" elsewhere.
116awk=${AWK:-awk} 125awk=${AWK:-awk}
@@ -164,47 +173,47 @@ BEGIN { @@ -164,47 +173,47 @@ BEGIN {
164 # to allow nested #if/#else/#endif sets 173 # to allow nested #if/#else/#endif sets
165 savedepth = 0 174 savedepth = 0
166 # to track already processed syscalls 175 # to track already processed syscalls
167 176
168 sysnames = \"$sysnames\" 177 sysnames = \"$sysnames\"
169 sysprotos = \"$sysprotos\" 178 sysprotos = \"$sysprotos\"
170 sysnumhdr = \"$sysnumhdr\" 179 sysnumhdr = \"$sysnumhdr\"
171 sysarghdr = \"$sysarghdr\" 180 sysarghdr = \"$sysarghdr\"
172 sysarghdrextra = \"$sysarghdrextra\" 181 sysarghdrextra = \"$sysarghdrextra\"
173 systrace = \"$systrace\" 182 systrace = \"$systrace\"
174 systracetmp = \"$systracetmp\" 183 systracetmp = \"$systracetmp\"
175 systraceret = \"$systraceret\" 184 systraceret = \"$systraceret\"
176 sysautoload = \"$sysautoload\" 185 sysautoload = \"$sysautoload\"
177 sysautoloadbottom = \"${sysautoload}.bottom\" 186 sysautoloadbottom = \"$sysautoloadbottom\"
178 rumpcalls = \"$rumpcalls\" 187 rumpcalls = \"$rumpcalls\"
179 rumpcallshdr = \"$rumpcallshdr\" 188 rumpcallshdr = \"$rumpcallshdr\"
180 rumpsysent = \"$rumpsysent\" 189 rumpsysent = \"$rumpsysent\"
181 rumpsysmap = \"$rumpsysmap\" 190 rumpsysmap = \"$rumpsysmap\"
182 switchname = \"$switchname\" 191 switchname = \"$switchname\"
183 namesname = \"$namesname\" 192 namesname = \"$namesname\"
184 constprefix = \"$constprefix\" 193 constprefix = \"$constprefix\"
185 emulname = \"$emulname\" 194 emulname = \"$emulname\"
186 registertype = \"$registertype\" 195 registertype = \"$registertype\"
187 sysalign=\"$sysalign\" 196 sysalign=\"$sysalign\"
188 if (!registertype) { 197 if (!registertype) {
189 registertype = \"register_t\" 198 registertype = \"register_t\"
190 } 199 }
191 nsysent = ${nsysent:-0} 200 nsysent = ${nsysent:-0}
192 201
193 sysdcl = \"$sysdcl\" 202 sysdcl = \"$sysdcl\"
194 syscompat_pref = \"$syscompat_pref\" 203 syscompat_pref = \"$syscompat_pref\"
195 sysent = \"$sysent\" 204 sysent = \"$sysent\"
196 sysnamesbottom = \"${sysnames}.bottom\" 205 sysnamesbottom = \"$sysnamesbottom\"
197 sysnamesfriendly = \"${sysnames}.friendly\" 206 sysnamesfriendly = \"$sysnamesfriendly\"
198 rumpprotos = \"$rumpprotos\" 207 rumpprotos = \"$rumpprotos\"
199 rumptypes = \"$rumptypes\" 208 rumptypes = \"$rumptypes\"
200 sys_nosys = \"$sys_nosys\" 209 sys_nosys = \"$sys_nosys\"
201 maxsysargs = ${maxsysargs:-8} 210 maxsysargs = ${maxsysargs:-8}
202 rumpnoflags=\"$rumpnoflags\" 211 rumpnoflags=\"$rumpnoflags\"
203 rumpnosys=\"$rumpnosys\" 212 rumpnosys=\"$rumpnosys\"
204 rumpnomodule=\"$rumpnomodule\" 213 rumpnomodule=\"$rumpnomodule\"
205 infile = \"$2\" 214 infile = \"$2\"
206 215
207 compatopts = \"$compatopts\" 216 compatopts = \"$compatopts\"
208 "' 217 "'
209 218
210 if (rumpcalls != "/dev/null") 219 if (rumpcalls != "/dev/null")