1 1.187 christos # $NetBSD: makesyscalls.sh,v 1.187 2023/07/28 18:19:01 christos Exp $ 2 1.9 cgd # 3 1.37 cgd # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou 4 1.12 cgd # All rights reserved. 5 1.12 cgd # 6 1.12 cgd # Redistribution and use in source and binary forms, with or without 7 1.12 cgd # modification, are permitted provided that the following conditions 8 1.12 cgd # are met: 9 1.12 cgd # 1. Redistributions of source code must retain the above copyright 10 1.12 cgd # notice, this list of conditions and the following disclaimer. 11 1.12 cgd # 2. Redistributions in binary form must reproduce the above copyright 12 1.12 cgd # notice, this list of conditions and the following disclaimer in the 13 1.12 cgd # documentation and/or other materials provided with the distribution. 14 1.12 cgd # 3. All advertising materials mentioning features or use of this software 15 1.12 cgd # must display the following acknowledgement: 16 1.12 cgd # This product includes software developed for the NetBSD Project 17 1.12 cgd # by Christopher G. Demetriou. 18 1.12 cgd # 4. The name of the author may not be used to endorse or promote products 19 1.12 cgd # derived from this software without specific prior written permission 20 1.12 cgd # 21 1.12 cgd # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 1.12 cgd # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23 1.12 cgd # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 1.12 cgd # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25 1.12 cgd # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26 1.12 cgd # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 1.12 cgd # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 1.12 cgd # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 1.12 cgd # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 1.12 cgd # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 1.14 cgd 32 1.14 cgd # @(#)makesyscalls.sh 8.1 (Berkeley) 6/10/93 33 1.1 glass 34 1.1 glass set -e 35 1.1 glass 36 1.11 cgd case $# in 37 1.11 cgd 2) ;; 38 1.11 cgd *) echo "Usage: $0 config-file input-file" 1>&2 39 1.11 cgd exit 1 40 1.11 cgd ;; 41 1.11 cgd esac 42 1.11 cgd 43 1.11 cgd # the config file sets the following variables: 44 1.134 njoly # sysalign check for alignment of off_t/dev_t/time_t 45 1.11 cgd # sysnames the syscall names file 46 1.11 cgd # sysnumhdr the syscall numbers file 47 1.11 cgd # syssw the syscall switch file 48 1.152 pgoyette # sysautoload the syscall autoload definitions file 49 1.11 cgd # sysarghdr the syscall argument struct definitions 50 1.179 dholland # sysarghdrextra extra stuff dumped into sysarghdr 51 1.179 dholland # systrace the dtrace definitions 52 1.11 cgd # compatopts those syscall types that are for 'compat' syscalls 53 1.11 cgd # switchname the name for the 'struct sysent' we define 54 1.40 mycroft # namesname the name for the 'const char *[]' we define 55 1.11 cgd # constprefix the prefix for the system call constants 56 1.162 pgoyette # emulname the emulation name 57 1.30 eeh # registertype the type for register_t 58 1.40 mycroft # nsysent the size of the sysent table 59 1.46 jdolecek # sys_nosys [optional] name of function called for unsupported 60 1.46 jdolecek # syscalls, if not sys_nosys() 61 1.186 andvar # maxsysargs [optional] the maximum number or arguments 62 1.179 dholland # rumpcalls ??? 63 1.179 dholland # rumpcallshdr ??? 64 1.179 dholland # rumpsysmap ??? 65 1.11 cgd # 66 1.56 lukem # NOTE THAT THIS makesyscalls.sh DOES NOT SUPPORT 'SYSLIBCOMPAT'. 67 1.1 glass 68 1.46 jdolecek # source the config file. 69 1.46 jdolecek sys_nosys="sys_nosys" # default is sys_nosys(), if not specified otherwise 70 1.60 dsl maxsysargs=8 # default limit is 8 (32bit) arguments 71 1.146 christos systrace="/dev/null" 72 1.153 pooka sysautoload="/dev/null" 73 1.67 njoly rumpcalls="/dev/null" 74 1.67 njoly rumpcallshdr="/dev/null" 75 1.142 pooka rumpsysmap="/dev/null" 76 1.83 pooka rumpsysent="rumpsysent.tmp" 77 1.147 christos rumpnoflags="\n\t\t.sy_flags = SYCALL_NOSYS," 78 1.174 christos rumpnosys="(sy_call_t *)(void *)rumpns_enosys" 79 1.174 christos rumpnomodule="(sy_call_t *)(void *)rumpns_sys_nomodule" 80 1.149 christos 81 1.149 christos case $1 in 82 1.149 christos /*) . $1;; 83 1.149 christos *) . ./$1;; 84 1.149 christos esac 85 1.46 jdolecek 86 1.172 kre errmsg() 87 1.172 kre { 88 1.172 kre fail=true; 89 1.172 kre printf '%s: %s\n' "$0" "$*" >&2 90 1.172 kre } 91 1.172 kre 92 1.174 christos addsuffix() 93 1.174 christos { 94 1.174 christos if [ "$1" = "/dev/null" -o -z "$2" ]; then 95 1.174 christos echo $1 96 1.174 christos else 97 1.174 christos echo $1.$2 98 1.174 christos fi 99 1.174 christos } 100 1.174 christos 101 1.171 kre fail=false 102 1.171 kre case "${nsysent:-0}" in 103 1.172 kre *[!0-9]*) errmsg "Non numeric value for nsysent:" "${nsysent}";; 104 1.171 kre esac 105 1.171 kre case "${maxsysargs:-0}" in 106 1.172 kre *[!0-9]*) errmsg "Non numeric value for maxsysargs:" "${maxsysargs}";; 107 1.171 kre esac 108 1.171 kre $fail && exit 1 109 1.171 kre 110 1.1 glass # tmp files: 111 1.174 christos sysautoloadbottom=$(addsuffix $sysautoload "bottom") 112 1.1 glass sysdcl="sysent.dcl" 113 1.16 thorpej sysprotos="sys.protos" 114 1.11 cgd syscompat_pref="sysent." 115 1.1 glass sysent="sysent.switch" 116 1.174 christos sysnamesbottom=$(addsuffix $sysnames "bottom") 117 1.174 christos sysnamesfriendly=$(addsuffix $sysnames "friendly") 118 1.109 pooka rumptypes="rumphdr.types" 119 1.109 pooka rumpprotos="rumphdr.protos" 120 1.146 christos systracetmp="systrace.$$" 121 1.146 christos systraceret="systraceret.$$" 122 1.1 glass 123 1.154 christos cleanup() { 124 1.176 jdolecek rm $sysdcl $sysprotos $sysent $sysnamesbottom $sysnamesfriendly $rumpsysent $rumptypes $rumpprotos $systracetmp $systraceret ${sysautoloadbottom#/dev/null} 125 1.154 christos } 126 1.154 christos trap "cleanup" 0 127 1.11 cgd 128 1.11 cgd # Awk program (must support nawk extensions) 129 1.11 cgd # Use "awk" at Berkeley, "nawk" or "gawk" elsewhere. 130 1.11 cgd awk=${AWK:-awk} 131 1.11 cgd 132 1.57 jdolecek # Does this awk have a "toupper" function? 133 1.146 christos have_toupper="$($awk 'BEGIN { print toupper("true"); exit; }' 2>/dev/null)" 134 1.11 cgd 135 1.11 cgd # If this awk does not define "toupper" then define our own. 136 1.57 jdolecek if [ "$have_toupper" = TRUE ] ; then 137 1.57 jdolecek # Used awk (GNU awk or nawk) provides it 138 1.11 cgd toupper= 139 1.11 cgd else 140 1.11 cgd # Provide our own toupper() 141 1.11 cgd toupper=' 142 1.11 cgd function toupper(str) { 143 1.11 cgd _toupper_cmd = "echo "str" |tr a-z A-Z" 144 1.11 cgd _toupper_cmd | getline _toupper_str; 145 1.11 cgd close(_toupper_cmd); 146 1.11 cgd return _toupper_str; 147 1.11 cgd }' 148 1.11 cgd fi 149 1.11 cgd 150 1.11 cgd # before handing it off to awk, make a few adjustments: 151 1.179 dholland # (1) insert spaces around {, }, (, ), *, |, and commas. 152 1.11 cgd # (2) get rid of any and all dollar signs (so that rcs id use safe) 153 1.11 cgd # 154 1.11 cgd # The awk script will deal with blank lines and lines that 155 1.11 cgd # start with the comment character (';'). 156 1.1 glass 157 1.11 cgd sed -e ' 158 1.11 cgd s/\$//g 159 1.11 cgd :join 160 1.11 cgd /\\$/{a\ 161 1.11 cgd 162 1.11 cgd N 163 1.11 cgd s/\\\n// 164 1.11 cgd b join 165 1.11 cgd } 166 1.11 cgd 2,${ 167 1.78 pooka /^#/!s/\([{}()*,|]\)/ \1 /g 168 1.11 cgd } 169 1.11 cgd ' < $2 | $awk " 170 1.11 cgd $toupper 171 1.11 cgd BEGIN { 172 1.70 apb # Create a NetBSD tag that does not get expanded when checking 173 1.70 apb # this script out of CVS. (This part of the awk script is in a 174 1.70 apb # shell double-quoted string, so the backslashes are eaten by 175 1.70 apb # the shell.) 176 1.70 apb tag = \"\$\" \"NetBSD\" \"\$\" 177 1.70 apb 178 1.18 cgd # to allow nested #if/#else/#endif sets 179 1.18 cgd savedepth = 0 180 1.44 jdolecek # to track already processed syscalls 181 1.18 cgd 182 1.11 cgd sysnames = \"$sysnames\" 183 1.16 thorpej sysprotos = \"$sysprotos\" 184 1.11 cgd sysnumhdr = \"$sysnumhdr\" 185 1.11 cgd sysarghdr = \"$sysarghdr\" 186 1.94 pooka sysarghdrextra = \"$sysarghdrextra\" 187 1.146 christos systrace = \"$systrace\" 188 1.146 christos systracetmp = \"$systracetmp\" 189 1.146 christos systraceret = \"$systraceret\" 190 1.152 pgoyette sysautoload = \"$sysautoload\" 191 1.174 christos sysautoloadbottom = \"$sysautoloadbottom\" 192 1.66 pooka rumpcalls = \"$rumpcalls\" 193 1.66 pooka rumpcallshdr = \"$rumpcallshdr\" 194 1.83 pooka rumpsysent = \"$rumpsysent\" 195 1.142 pooka rumpsysmap = \"$rumpsysmap\" 196 1.11 cgd switchname = \"$switchname\" 197 1.11 cgd namesname = \"$namesname\" 198 1.11 cgd constprefix = \"$constprefix\" 199 1.162 pgoyette emulname = \"$emulname\" 200 1.30 eeh registertype = \"$registertype\" 201 1.68 christos sysalign=\"$sysalign\" 202 1.30 eeh if (!registertype) { 203 1.30 eeh registertype = \"register_t\" 204 1.30 eeh } 205 1.171 kre nsysent = ${nsysent:-0} 206 1.11 cgd 207 1.11 cgd sysdcl = \"$sysdcl\" 208 1.11 cgd syscompat_pref = \"$syscompat_pref\" 209 1.11 cgd sysent = \"$sysent\" 210 1.174 christos sysnamesbottom = \"$sysnamesbottom\" 211 1.174 christos sysnamesfriendly = \"$sysnamesfriendly\" 212 1.109 pooka rumpprotos = \"$rumpprotos\" 213 1.109 pooka rumptypes = \"$rumptypes\" 214 1.46 jdolecek sys_nosys = \"$sys_nosys\" 215 1.171 kre maxsysargs = ${maxsysargs:-8} 216 1.151 christos rumpnoflags=\"$rumpnoflags\" 217 1.151 christos rumpnosys=\"$rumpnosys\" 218 1.151 christos rumpnomodule=\"$rumpnomodule\" 219 1.11 cgd infile = \"$2\" 220 1.11 cgd 221 1.11 cgd compatopts = \"$compatopts\" 222 1.11 cgd "' 223 1.11 cgd 224 1.124 pooka if (rumpcalls != "/dev/null") 225 1.124 pooka haverumpcalls = 1 226 1.124 pooka 227 1.70 apb printf "/* %s */\n\n", tag > sysdcl 228 1.11 cgd printf "/*\n * System call switch table.\n *\n" > sysdcl 229 1.11 cgd printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysdcl 230 1.11 cgd 231 1.11 cgd ncompat = split(compatopts,compat) 232 1.11 cgd for (i = 1; i <= ncompat; i++) { 233 1.11 cgd compat_upper[i] = toupper(compat[i]) 234 1.11 cgd 235 1.17 mycroft printf "\n#ifdef %s\n", compat_upper[i] > sysent 236 1.47 lukem printf "#define %s(func) __CONCAT(%s_,func)\n", compat[i], \ 237 1.17 mycroft compat[i] > sysent 238 1.17 mycroft printf "#else\n" > sysent 239 1.47 lukem printf "#define %s(func) %s\n", compat[i], sys_nosys > sysent 240 1.17 mycroft printf "#endif\n" > sysent 241 1.11 cgd } 242 1.11 cgd 243 1.60 dsl printf "\n#define\ts(type)\tsizeof(type)\n" > sysent 244 1.60 dsl printf "#define\tn(type)\t(sizeof(type)/sizeof (%s))\n", registertype > sysent 245 1.147 christos printf "#define\tns(type)\t.sy_narg = n(type), .sy_argsize = s(type)\n\n", registertype > sysent 246 1.17 mycroft printf "struct sysent %s[] = {\n",switchname > sysent 247 1.17 mycroft 248 1.70 apb printf "/* %s */\n\n", tag > sysnames 249 1.11 cgd printf "/*\n * System call names.\n *\n" > sysnames 250 1.11 cgd printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames 251 1.11 cgd 252 1.16 thorpej printf "\n/*\n * System call prototypes.\n */\n\n" > sysprotos 253 1.124 pooka if (haverumpcalls) 254 1.124 pooka printf("#ifndef RUMP_CLIENT\n") > sysprotos 255 1.16 thorpej 256 1.70 apb printf "/* %s */\n\n", tag > sysnumhdr 257 1.11 cgd printf "/*\n * System call numbers.\n *\n" > sysnumhdr 258 1.11 cgd printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnumhdr 259 1.11 cgd 260 1.70 apb printf "/* %s */\n\n", tag > sysarghdr 261 1.13 mycroft printf "/*\n * System call argument lists.\n *\n" > sysarghdr 262 1.11 cgd printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarghdr 263 1.66 pooka 264 1.152 pgoyette printf "/* %s */\n\n", tag > sysautoload 265 1.152 pgoyette printf "/*\n * System call autoload table.\n *\n" > sysautoload 266 1.152 pgoyette printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysautoload 267 1.152 pgoyette 268 1.70 apb printf "/* %s */\n\n", tag > rumpcalls 269 1.83 pooka printf "/*\n * System call vector and marshalling for rump.\n *\n" > rumpcalls 270 1.66 pooka printf " * DO NOT EDIT-- this file is automatically generated.\n" > rumpcalls 271 1.66 pooka 272 1.70 apb printf "/* %s */\n\n", tag > rumpcallshdr 273 1.66 pooka printf "/*\n * System call protos in rump namespace.\n *\n" > rumpcallshdr 274 1.66 pooka printf " * DO NOT EDIT-- this file is automatically generated.\n" > rumpcallshdr 275 1.146 christos 276 1.146 christos printf "/* %s */\n\n", tag > systrace 277 1.183 rillig printf "/*\n * System call argument to DTrace register array conversion.\n *\n" > systrace 278 1.146 christos printf " * DO NOT EDIT-- this file is automatically generated.\n" > systrace 279 1.11 cgd } 280 1.11 cgd NR == 1 { 281 1.58 perry sub(/ $/, "") 282 1.11 cgd printf " * created from%s\n */\n\n", $0 > sysdcl 283 1.70 apb printf "#include <sys/cdefs.h>\n__KERNEL_RCSID(0, \"%s\");\n\n", tag > sysdcl 284 1.11 cgd 285 1.11 cgd printf " * created from%s\n */\n\n", $0 > sysnames 286 1.70 apb printf "#include <sys/cdefs.h>\n__KERNEL_RCSID(0, \"%s\");\n\n", tag > sysnames 287 1.28 thorpej 288 1.152 pgoyette printf " * created from%s\n */\n\n", $0 > sysautoload 289 1.152 pgoyette printf "#include <sys/cdefs.h>\n__KERNEL_RCSID(0, \"%s\");\n\n", tag > sysautoload 290 1.162 pgoyette printf("static struct sc_autoload " emulname \ 291 1.173 christos "_syscalls_autoload[] = {\n") > sysautoloadbottom 292 1.152 pgoyette 293 1.66 pooka printf " * created from%s\n */\n\n", $0 > rumpcalls 294 1.127 pooka printf "#ifdef RUMP_CLIENT\n" > rumpcalls 295 1.133 pooka printf "#include <rump/rumpuser_port.h>\n" > rumpcalls 296 1.127 pooka printf "#endif /* RUMP_CLIENT */\n\n" > rumpcalls 297 1.124 pooka printf "#include <sys/param.h>\n\n" > rumpcalls 298 1.124 pooka printf "#ifdef __NetBSD__\n" > rumpcalls 299 1.70 apb printf "#include <sys/cdefs.h>\n__KERNEL_RCSID(0, \"%s\");\n\n", tag > rumpcalls 300 1.102 pooka 301 1.102 pooka printf "#include <sys/fstypes.h>\n" > rumpcalls 302 1.66 pooka printf "#include <sys/proc.h>\n" > rumpcalls 303 1.124 pooka printf "#endif /* __NetBSD__ */\n\n" > rumpcalls 304 1.102 pooka printf "#ifdef RUMP_CLIENT\n" > rumpcalls 305 1.124 pooka printf "#include <errno.h>\n" > rumpcalls 306 1.124 pooka printf "#include <stdint.h>\n" > rumpcalls 307 1.139 pooka printf "#include <stdlib.h>\n" > rumpcalls 308 1.138 pooka printf "#include <string.h>\n\n" > rumpcalls 309 1.117 pooka printf "#include <srcsys/syscall.h>\n" > rumpcalls 310 1.117 pooka printf "#include <srcsys/syscallargs.h>\n\n" > rumpcalls 311 1.102 pooka printf "#include <rump/rumpclient.h>\n\n" > rumpcalls 312 1.102 pooka printf "#define rsys_syscall(num, data, dlen, retval)\t\\\n" > rumpcalls 313 1.102 pooka printf " rumpclient_syscall(num, data, dlen, retval)\n" > rumpcalls 314 1.102 pooka printf "#define rsys_seterrno(error) errno = error\n" > rumpcalls 315 1.131 pooka printf "#else\n" > rumpcalls 316 1.117 pooka printf "#include <sys/syscall.h>\n" > rumpcalls 317 1.117 pooka printf "#include <sys/syscallargs.h>\n\n" > rumpcalls 318 1.103 pooka printf "#include <sys/syscallvar.h>\n\n" > rumpcalls 319 1.164 pooka printf "#include <rump-sys/kern.h>\n\n" > rumpcalls 320 1.80 pooka printf "#include <rump/rumpuser.h>\n" > rumpcalls 321 1.130 pooka printf "#define rsys_syscall(num, data, dlen, retval)\t\\\n" > rumpcalls 322 1.130 pooka printf " rump_syscall(num, data, dlen, retval)\n\n" > rumpcalls 323 1.131 pooka printf "#define rsys_seterrno(error) rumpuser_seterrno(error)\n" \ 324 1.131 pooka > rumpcalls 325 1.131 pooka printf "#endif\n\n" > rumpcalls 326 1.102 pooka 327 1.145 pooka printf "#ifndef RUMP_KERNEL_IS_LIBC\n" > rumpcalls 328 1.145 pooka printf "#define RUMP_SYS_COMPAT\n" > rumpcalls 329 1.145 pooka printf "#endif\n\n" > rumpcalls 330 1.132 pooka 331 1.66 pooka printf "#if\tBYTE_ORDER == BIG_ENDIAN\n" > rumpcalls 332 1.66 pooka printf "#define SPARG(p,k)\t((p)->k.be.datum)\n" > rumpcalls 333 1.66 pooka printf "#else /* LITTLE_ENDIAN, I hope dearly */\n" > rumpcalls 334 1.66 pooka printf "#define SPARG(p,k)\t((p)->k.le.datum)\n" > rumpcalls 335 1.73 pooka printf "#endif\n\n" > rumpcalls 336 1.131 pooka printf "\nvoid rumpns_sys_nomodule(void);\n" > rumpcalls 337 1.66 pooka 338 1.102 pooka printf "\n#ifndef RUMP_CLIENT\n" > rumpsysent 339 1.141 pooka printf "int rumpns_enosys(void);\n" > rumpsysent 340 1.102 pooka printf "#define\ts(type)\tsizeof(type)\n" > rumpsysent 341 1.83 pooka printf "#define\tn(type)\t(sizeof(type)/sizeof (%s))\n", registertype > rumpsysent 342 1.83 pooka printf "#define\tns(type)\tn(type), s(type)\n\n", registertype > rumpsysent 343 1.83 pooka printf "struct sysent rump_sysent[] = {\n" > rumpsysent 344 1.83 pooka 345 1.28 thorpej # System call names are included by userland (kdump(1)), so 346 1.28 thorpej # hide the include files from it. 347 1.48 mrg printf "#if defined(_KERNEL_OPT)\n" > sysnames 348 1.28 thorpej 349 1.154 christos printf "#else /* _KERNEL_OPT */\n" > sysnamesbottom 350 1.154 christos printf "#include <sys/null.h>\n" > sysnamesbottom 351 1.48 mrg printf "#endif /* _KERNEL_OPT */\n\n" > sysnamesbottom 352 1.41 mycroft printf "const char *const %s[] = {\n",namesname > sysnamesbottom 353 1.154 christos printf "\n\n/* libc style syscall names */\n" > sysnamesfriendly 354 1.154 christos printf "const char *const alt%s[] = {\n", namesname > sysnamesfriendly 355 1.11 cgd 356 1.11 cgd printf " * created from%s\n */\n\n", $0 > sysnumhdr 357 1.97 njoly printf "#ifndef _" constprefix "SYSCALL_H_\n" > sysnumhdr 358 1.97 njoly printf "#define _" constprefix "SYSCALL_H_\n\n" > sysnumhdr 359 1.11 cgd 360 1.11 cgd printf " * created from%s\n */\n\n", $0 > sysarghdr 361 1.97 njoly printf "#ifndef _" constprefix "SYSCALLARGS_H_\n" > sysarghdr 362 1.97 njoly printf "#define _" constprefix "SYSCALLARGS_H_\n\n" > sysarghdr 363 1.66 pooka 364 1.66 pooka printf " * created from%s\n */\n\n", $0 > rumpcallshdr 365 1.97 njoly printf "#ifndef _RUMP_RUMP_SYSCALLS_H_\n" > rumpcallshdr 366 1.97 njoly printf "#define _RUMP_RUMP_SYSCALLS_H_\n\n" > rumpcallshdr 367 1.96 pooka printf "#ifdef _KERNEL\n" > rumpcallshdr 368 1.96 pooka printf "#error Interface not supported inside kernel\n" > rumpcallshdr 369 1.96 pooka printf "#endif /* _KERNEL */\n\n" > rumpcallshdr 370 1.109 pooka printf "#include <rump/rump_syscalls_compat.h>\n\n" > rumpcallshdr 371 1.66 pooka 372 1.94 pooka printf "%s", sysarghdrextra > sysarghdr 373 1.169 riastrad printf "/* Forward declaration */\n" > sysarghdr 374 1.169 riastrad printf "struct lwp;\n" > sysarghdr 375 1.169 riastrad printf "\n" > sysarghdr 376 1.169 riastrad 377 1.60 dsl # Write max number of system call arguments to both headers 378 1.60 dsl printf("#define\t%sMAXSYSARGS\t%d\n\n", constprefix, maxsysargs) \ 379 1.60 dsl > sysnumhdr 380 1.60 dsl printf("#define\t%sMAXSYSARGS\t%d\n\n", constprefix, maxsysargs) \ 381 1.60 dsl > sysarghdr 382 1.30 eeh printf "#undef\tsyscallarg\n" > sysarghdr 383 1.35 thorpej printf "#define\tsyscallarg(x)\t\t\t\t\t\t\t\\\n" > sysarghdr 384 1.35 thorpej printf "\tunion {\t\t\t\t\t\t\t\t\\\n" > sysarghdr 385 1.35 thorpej printf "\t\t%s pad;\t\t\t\t\t\t\\\n", registertype > sysarghdr 386 1.35 thorpej printf "\t\tstruct { x datum; } le;\t\t\t\t\t\\\n" > sysarghdr 387 1.51 manu printf "\t\tstruct { /* LINTED zero array dimension */\t\t\\\n" \ 388 1.51 manu > sysarghdr 389 1.51 manu printf "\t\t\tint8_t pad[ /* CONSTCOND */\t\t\t\\\n" > sysarghdr 390 1.51 manu printf "\t\t\t\t(sizeof (%s) < sizeof (x))\t\\\n", \ 391 1.30 eeh registertype > sysarghdr 392 1.35 thorpej printf "\t\t\t\t? 0\t\t\t\t\t\\\n" > sysarghdr 393 1.35 thorpej printf "\t\t\t\t: sizeof (%s) - sizeof (x)];\t\\\n", \ 394 1.30 eeh registertype > sysarghdr 395 1.35 thorpej printf "\t\t\tx datum;\t\t\t\t\t\\\n" > sysarghdr 396 1.35 thorpej printf "\t\t} be;\t\t\t\t\t\t\t\\\n" > sysarghdr 397 1.35 thorpej printf "\t}\n" > sysarghdr 398 1.60 dsl printf("\n#undef check_syscall_args\n") >sysarghdr 399 1.101 pooka printf("#define check_syscall_args(call) /*LINTED*/ \\\n" \ 400 1.60 dsl "\ttypedef char call##_check_args" \ 401 1.60 dsl "[sizeof (struct call##_args) \\\n" \ 402 1.60 dsl "\t\t<= %sMAXSYSARGS * sizeof (%s) ? 1 : -1];\n", \ 403 1.60 dsl constprefix, registertype) >sysarghdr 404 1.109 pooka 405 1.146 christos printf " * This file is part of the DTrace syscall provider.\n */\n\n" > systrace 406 1.146 christos printf "static void\nsystrace_args(register_t sysnum, const void *params, uintptr_t *uarg, size_t *n_args)\n{\n" > systrace 407 1.146 christos printf "\tintptr_t *iarg = (intptr_t *)uarg;\n" > systrace 408 1.146 christos printf "\tswitch (sysnum) {\n" > systrace 409 1.146 christos 410 1.146 christos printf "static void\nsystrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systracetmp 411 1.146 christos printf "\tswitch (sysnum) {\n" > systracetmp 412 1.146 christos 413 1.146 christos printf "static void\nsystrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)\n{\n\tconst char *p = NULL;\n" > systraceret 414 1.146 christos printf "\tswitch (sysnum) {\n" > systraceret 415 1.146 christos 416 1.109 pooka # compat types from syscalls.master. this is slightly ugly, 417 1.109 pooka # but given that we have so few compats from over 17 years, 418 1.109 pooka # a more complicated solution is not currently warranted. 419 1.109 pooka uncompattypes["struct timeval50"] = "struct timeval"; 420 1.109 pooka uncompattypes["struct timespec50"] = "struct timespec"; 421 1.109 pooka uncompattypes["struct stat30"] = "struct stat"; 422 1.187 christos uncompattypes["struct kevent100"] = "struct kevent"; 423 1.109 pooka 424 1.11 cgd next 425 1.11 cgd } 426 1.11 cgd NF == 0 || $1 ~ /^;/ { 427 1.11 cgd next 428 1.11 cgd } 429 1.40 mycroft $0 ~ /^%%$/ { 430 1.40 mycroft intable = 1 431 1.40 mycroft next 432 1.40 mycroft } 433 1.11 cgd $1 ~ /^#[ ]*include/ { 434 1.11 cgd print > sysdcl 435 1.27 thorpej print > sysnames 436 1.173 christos print > sysautoload 437 1.11 cgd next 438 1.11 cgd } 439 1.40 mycroft $1 ~ /^#/ && !intable { 440 1.40 mycroft print > sysdcl 441 1.40 mycroft print > sysnames 442 1.173 christos print > sysautoload 443 1.11 cgd next 444 1.11 cgd } 445 1.40 mycroft $1 ~ /^#/ && intable { 446 1.40 mycroft if ($1 ~ /^#[ ]*if/) { 447 1.40 mycroft savedepth++ 448 1.40 mycroft savesyscall[savedepth] = syscall 449 1.40 mycroft } 450 1.40 mycroft if ($1 ~ /^#[ ]*else/) { 451 1.40 mycroft if (savedepth <= 0) { 452 1.40 mycroft printf("%s: line %d: unbalanced #else\n", \ 453 1.40 mycroft infile, NR) 454 1.40 mycroft exit 1 455 1.40 mycroft } 456 1.40 mycroft syscall = savesyscall[savedepth] 457 1.18 cgd } 458 1.18 cgd if ($1 ~ /^#[ ]*endif/) { 459 1.18 cgd if (savedepth <= 0) { 460 1.40 mycroft printf("%s: line %d: unbalanced #endif\n", \ 461 1.40 mycroft infile, NR) 462 1.18 cgd exit 1 463 1.18 cgd } 464 1.40 mycroft savedepth-- 465 1.18 cgd } 466 1.11 cgd print > sysent 467 1.54 christos print > sysarghdr 468 1.54 christos print > sysnumhdr 469 1.16 thorpej print > sysprotos 470 1.173 christos print > sysautoloadbottom 471 1.27 thorpej print > sysnamesbottom 472 1.154 christos print > sysnamesfriendly 473 1.146 christos print > systrace 474 1.146 christos print > systracetmp 475 1.146 christos print > systraceret 476 1.83 pooka 477 1.83 pooka # XXX: technically we do not want to have conditionals in rump, 478 1.83 pooka # but it is easier to just let the cpp handle them than try to 479 1.83 pooka # figure out what we want here in this script 480 1.83 pooka print > rumpsysent 481 1.11 cgd next 482 1.11 cgd } 483 1.11 cgd syscall != $1 { 484 1.11 cgd printf "%s: line %d: syscall number out of sync at %d\n", \ 485 1.11 cgd infile, NR, syscall 486 1.11 cgd printf "line is:\n" 487 1.11 cgd print 488 1.11 cgd exit 1 489 1.11 cgd } 490 1.165 christos function isarg64(type) { 491 1.165 christos gsub("netbsd32_", "", type); 492 1.165 christos return type == "quad_t" || type == "off_t" \ 493 1.165 christos || type == "dev_t" || type == "time_t"; 494 1.165 christos } 495 1.11 cgd function parserr(was, wanted) { 496 1.77 pooka printf "%s: line %d: unexpected %s (expected <%s>)\n", \ 497 1.11 cgd infile, NR, was, wanted 498 1.32 christos printf "line is:\n" 499 1.32 christos print 500 1.11 cgd exit 1 501 1.11 cgd } 502 1.147 christos function fillerpsysent(syscall, flags, name, comment) { 503 1.148 christos return sprintf("\t{%s\n\t\t.sy_call = %s,\n\t},\t\t/* %d = filler */",\ 504 1.147 christos flags, name, syscall, comment); 505 1.147 christos } 506 1.11 cgd function parseline() { 507 1.11 cgd f=3 # toss number and type 508 1.60 dsl if ($2 == "INDIR") 509 1.60 dsl sycall_flags="SYCALL_INDIRECT" 510 1.60 dsl else 511 1.60 dsl sycall_flags="0" 512 1.11 cgd if ($NF != "}") { 513 1.11 cgd funcalias=$NF 514 1.11 cgd end=NF-1 515 1.11 cgd } else { 516 1.11 cgd funcalias="" 517 1.11 cgd end=NF 518 1.43 jdolecek } 519 1.61 dsl if ($f == "INDIR") { # allow for "NOARG INDIR" 520 1.61 dsl sycall_flags = "SYCALL_INDIRECT | " sycall_flags 521 1.61 dsl f++ 522 1.61 dsl } 523 1.74 ad if ($f == "MODULAR") { # registered at runtime 524 1.74 ad modular = 1 525 1.74 ad f++ 526 1.152 pgoyette modname = $f 527 1.152 pgoyette f++ 528 1.74 ad } else { 529 1.74 ad modular = 0; 530 1.74 ad } 531 1.66 pooka if ($f == "RUMP") { 532 1.66 pooka rumpable = 1 533 1.66 pooka f++ 534 1.66 pooka } else { 535 1.66 pooka rumpable = 0 536 1.66 pooka } 537 1.43 jdolecek if ($f ~ /^[a-z0-9_]*$/) { # allow syscall alias 538 1.43 jdolecek funcalias=$f 539 1.43 jdolecek f++ 540 1.11 cgd } 541 1.11 cgd if ($f != "{") 542 1.11 cgd parserr($f, "{") 543 1.11 cgd f++ 544 1.11 cgd if ($end != "}") 545 1.11 cgd parserr($end, "}") 546 1.11 cgd end-- 547 1.11 cgd if ($end != ";") 548 1.11 cgd parserr($end, ";") 549 1.11 cgd end-- 550 1.11 cgd if ($end != ")") 551 1.11 cgd parserr($end, ")") 552 1.11 cgd end-- 553 1.11 cgd 554 1.19 cgd returntype = oldf = ""; 555 1.19 cgd do { 556 1.19 cgd if (returntype != "" && oldf != "*") 557 1.19 cgd returntype = returntype" "; 558 1.19 cgd returntype = returntype$f; 559 1.19 cgd oldf = $f; 560 1.19 cgd f++ 561 1.78 pooka } while ($f != "|" && f < (end-1)) 562 1.19 cgd if (f == (end - 1)) { 563 1.78 pooka parserr($f, "function argument definition (maybe \"|\"?)"); 564 1.78 pooka } 565 1.78 pooka f++ 566 1.78 pooka 567 1.78 pooka fprefix=$f 568 1.78 pooka f++ 569 1.78 pooka if ($f != "|") { 570 1.78 pooka parserr($f, "function compat delimiter (maybe \"|\"?)"); 571 1.78 pooka } 572 1.78 pooka f++ 573 1.78 pooka 574 1.78 pooka fcompat="" 575 1.78 pooka if ($f != "|") { 576 1.78 pooka fcompat=$f 577 1.78 pooka f++ 578 1.78 pooka } 579 1.78 pooka 580 1.78 pooka if ($f != "|") { 581 1.78 pooka parserr($f, "function name delimiter (maybe \"|\"?)"); 582 1.78 pooka } 583 1.78 pooka f++ 584 1.78 pooka fbase=$f 585 1.78 pooka 586 1.90 pooka # pipe is special in how to returns its values. 587 1.90 pooka # So just generate it manually if present. 588 1.90 pooka if (rumpable == 1 && fbase == "pipe") { 589 1.90 pooka rumpable = 0; 590 1.90 pooka rumphaspipe = 1; 591 1.90 pooka } 592 1.90 pooka 593 1.78 pooka if (fcompat != "") { 594 1.78 pooka funcname=fprefix "___" fbase "" fcompat 595 1.78 pooka } else { 596 1.109 pooka funcname=fprefix "_" fbase 597 1.19 cgd } 598 1.165 christos if (isarg64(returntype)) { 599 1.92 matt if (sycall_flags == "0") 600 1.92 matt sycall_flags = "SYCALL_RET_64"; 601 1.92 matt else 602 1.92 matt sycall_flags = "SYCALL_RET_64 | " sycall_flags; 603 1.92 matt } 604 1.11 cgd 605 1.17 mycroft if (funcalias == "") { 606 1.11 cgd funcalias=funcname 607 1.17 mycroft sub(/^([^_]+_)*sys_/, "", funcalias) 608 1.109 pooka realname=fbase 609 1.178 kamil rumpfname=realname "" fcompat 610 1.109 pooka } else { 611 1.109 pooka realname=funcalias 612 1.178 kamil rumpfname=realname 613 1.17 mycroft } 614 1.178 kamil 615 1.11 cgd f++ 616 1.11 cgd 617 1.11 cgd if ($f != "(") 618 1.76 pooka parserr($f, "(") 619 1.11 cgd f++ 620 1.11 cgd 621 1.19 cgd argc=0; 622 1.63 yamt argalign=0; 623 1.11 cgd if (f == end) { 624 1.11 cgd if ($f != "void") 625 1.11 cgd parserr($f, "argument definition") 626 1.19 cgd isvarargs = 0; 627 1.19 cgd varargc = 0; 628 1.80 pooka argtype[0]="void"; 629 1.11 cgd return 630 1.11 cgd } 631 1.11 cgd 632 1.19 cgd # some system calls (open() and fcntl()) can accept a variable 633 1.19 cgd # number of arguments. If syscalls accept a variable number of 634 1.19 cgd # arguments, they must still have arguments specified for 635 1.19 cgd # the remaining argument "positions," because of the way the 636 1.19 cgd # kernel system call argument handling works. 637 1.19 cgd # 638 1.19 cgd # Indirect system calls, e.g. syscall(), are exceptions to this 639 1.19 cgd # rule, since they are handled entirely by machine-dependent code 640 1.19 cgd # and do not need argument structures built. 641 1.19 cgd 642 1.19 cgd isvarargs = 0; 643 1.92 matt args64 = 0; 644 1.125 matt ptr = 0; 645 1.11 cgd while (f <= end) { 646 1.19 cgd if ($f == "...") { 647 1.19 cgd f++; 648 1.19 cgd isvarargs = 1; 649 1.19 cgd varargc = argc; 650 1.19 cgd continue; 651 1.19 cgd } 652 1.11 cgd argc++ 653 1.11 cgd argtype[argc]="" 654 1.14 cgd oldf="" 655 1.11 cgd while (f < end && $(f+1) != ",") { 656 1.14 cgd if (argtype[argc] != "" && oldf != "*") 657 1.11 cgd argtype[argc] = argtype[argc]" "; 658 1.11 cgd argtype[argc] = argtype[argc]$f; 659 1.14 cgd oldf = $f; 660 1.11 cgd f++ 661 1.11 cgd } 662 1.11 cgd if (argtype[argc] == "") 663 1.11 cgd parserr($f, "argument definition") 664 1.86 pooka if (argtype[argc] == "off_t" \ 665 1.86 pooka || argtype[argc] == "dev_t" \ 666 1.86 pooka || argtype[argc] == "time_t") { 667 1.68 christos if ((argalign % 2) != 0 && sysalign && 668 1.63 yamt funcname != "sys_posix_fadvise") # XXX for now 669 1.63 yamt parserr($f, "a padding argument") 670 1.63 yamt } else { 671 1.63 yamt argalign++; 672 1.63 yamt } 673 1.165 christos if (isarg64(argtype[argc])) { 674 1.92 matt if (sycall_flags == "0") 675 1.92 matt sycall_flags = "SYCALL_ARG"argc-1"_64"; 676 1.92 matt else 677 1.92 matt sycall_flags = "SYCALL_ARG"argc-1"_64 | " sycall_flags; 678 1.92 matt args64++; 679 1.92 matt } 680 1.125 matt if (index(argtype[argc], "*") != 0 && ptr == 0) { 681 1.125 matt if (sycall_flags == "0") 682 1.125 matt sycall_flags = "SYCALL_ARG_PTR"; 683 1.125 matt else 684 1.125 matt sycall_flags = "SYCALL_ARG_PTR | " sycall_flags; 685 1.125 matt ptr = 1; 686 1.125 matt } 687 1.11 cgd argname[argc]=$f; 688 1.11 cgd f += 2; # skip name, and any comma 689 1.11 cgd } 690 1.92 matt if (args64 > 0) 691 1.92 matt sycall_flags = "SYCALL_NARGS64_VAL("args64") | " sycall_flags; 692 1.19 cgd # must see another argument after varargs notice. 693 1.19 cgd if (isvarargs) { 694 1.61 dsl if (argc == varargc) 695 1.19 cgd parserr($f, "argument definition") 696 1.19 cgd } else 697 1.19 cgd varargc = argc; 698 1.11 cgd } 699 1.54 christos 700 1.54 christos function printproto(wrap) { 701 1.54 christos printf("/* syscall: \"%s%s\" ret: \"%s\" args:", wrap, funcalias, 702 1.54 christos returntype) > sysnumhdr 703 1.54 christos for (i = 1; i <= varargc; i++) 704 1.54 christos printf(" \"%s\"", argtype[i]) > sysnumhdr 705 1.54 christos if (isvarargs) 706 1.54 christos printf(" \"...\"") > sysnumhdr 707 1.54 christos printf(" */\n") > sysnumhdr 708 1.54 christos printf("#define\t%s%s%s\t%d\n\n", constprefix, wrap, funcalias, 709 1.54 christos syscall) > sysnumhdr 710 1.66 pooka 711 1.152 pgoyette # output entry for syscall autoload table, if modular 712 1.173 christos if (modular) { 713 1.152 pgoyette printf("\t { %s%s%s, \"%s\" },\n", constprefix, wrap, 714 1.173 christos funcalias, modname) > sysautoloadbottom 715 1.152 pgoyette } 716 1.152 pgoyette 717 1.152 pgoyette 718 1.66 pooka # rumpalooza 719 1.66 pooka if (!rumpable) 720 1.66 pooka return 721 1.66 pooka 722 1.109 pooka # accumulate fbases we have seen. we want the last 723 1.182 msaitoh # occurrence for the default __RENAME() 724 1.178 kamil seen = funcseen[realname] 725 1.178 kamil funcseen[realname] = rumpfname 726 1.143 justin # special case for mknod as type of last argument changed from 727 1.143 justin # uint32_t to dev_t 728 1.143 justin if ((seen && fbase != "mknod") || (!seen && fbase == "mknod")) 729 1.109 pooka return 730 1.109 pooka 731 1.109 pooka printf("%s rump_sys_%s(", returntype, realname) > rumpprotos 732 1.109 pooka 733 1.88 pooka for (i = 1; i < varargc; i++) 734 1.87 pooka if (argname[i] != "PAD") 735 1.109 pooka printf("%s, ", uncompattype(argtype[i])) > rumpprotos 736 1.109 pooka 737 1.88 pooka if (isvarargs) 738 1.109 pooka printf("%s, ...)", uncompattype(argtype[varargc]))>rumpprotos 739 1.88 pooka else 740 1.109 pooka printf("%s)", uncompattype(argtype[argc])) > rumpprotos 741 1.109 pooka 742 1.178 kamil printf(" __RENAME(RUMP_SYS_RENAME_%s)", toupper(realname))> rumpprotos 743 1.109 pooka printf(";\n") > rumpprotos 744 1.109 pooka 745 1.109 pooka # generate forward-declares for types, apart from the 746 1.109 pooka # braindead typedef jungle we cannot easily handle here 747 1.109 pooka for (i = 1; i <= varargc; i++) { 748 1.109 pooka type=uncompattype(argtype[i]) 749 1.109 pooka sub("const ", "", type) 750 1.140 pooka ntype=type 751 1.140 pooka sub(" *\\*.*", "", ntype); 752 1.140 pooka if (!typeseen[ntype] && \ 753 1.109 pooka match(type, "struct") && match(type, "\\*")) { 754 1.140 pooka typeseen[ntype] = 1 755 1.140 pooka printf("%s;\n", ntype) > rumptypes 756 1.109 pooka } 757 1.109 pooka } 758 1.54 christos } 759 1.54 christos 760 1.180 dholland function printrumpsysent(insysent, compatwrap_) { 761 1.147 christos if (modular) { 762 1.147 christos fn = rumpnomodule 763 1.147 christos flags = rumpnoflags 764 1.147 christos } else { 765 1.147 christos fn = rumpnosys 766 1.147 christos flags = "" 767 1.147 christos } 768 1.90 pooka if (!insysent) { 769 1.147 christos printf("\t{%s\n\t\t.sy_call = %s,\n},\t\t/* %d = %s */\n", \ 770 1.147 christos flags, fn, syscall, funcalias) > rumpsysent 771 1.90 pooka return 772 1.90 pooka } 773 1.90 pooka 774 1.147 christos printf("\t{") > rumpsysent 775 1.147 christos if (argc != 0) { 776 1.177 kamil printf("\n\t\tns(struct %s%s_args),", compatwrap_, funcname) > rumpsysent 777 1.109 pooka } 778 1.109 pooka 779 1.147 christos printf("\n\t\t.sy_call = %s,\n\t},", fn) > rumpsysent 780 1.147 christos printf("\t\t/* %d = %s%s */\n", syscall, compatwrap_, funcalias) > rumpsysent 781 1.90 pooka } 782 1.90 pooka 783 1.109 pooka function iscompattype(type) { 784 1.109 pooka for (var in uncompattypes) { 785 1.109 pooka if (match(type, var)) { 786 1.109 pooka return 1 787 1.109 pooka } 788 1.109 pooka } 789 1.109 pooka 790 1.109 pooka return 0 791 1.109 pooka } 792 1.109 pooka 793 1.109 pooka function uncompattype(type) { 794 1.109 pooka for (var in uncompattypes) { 795 1.109 pooka if (match(type, var)) { 796 1.109 pooka sub(var, uncompattypes[var], type) 797 1.109 pooka return type 798 1.109 pooka } 799 1.109 pooka } 800 1.109 pooka 801 1.109 pooka return type 802 1.109 pooka } 803 1.109 pooka 804 1.142 pooka function printrumpsysmap(syscall, wfn, funcalias, rumpentry) { 805 1.142 pooka printf("%-4d %-22s %-18s %s\n", 806 1.142 pooka syscall, wfn, funcalias, rumpentry) > rumpsysmap 807 1.142 pooka } 808 1.142 pooka 809 1.184 christos function fixarray(arg) { 810 1.184 christos iii = index(arg, "[") 811 1.184 christos if (iii == 0) { 812 1.185 christos return arg 813 1.184 christos } else { 814 1.185 christos return substr(arg, 1, iii - 1) "[0]" 815 1.184 christos } 816 1.184 christos } 817 1.184 christos 818 1.146 christos function putsystrace(type, compatwrap_) { 819 1.146 christos printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace 820 1.146 christos printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp 821 1.146 christos printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systraceret 822 1.146 christos if (argc > 0) { 823 1.146 christos printf("\t\tswitch(ndx) {\n") > systracetmp 824 1.166 christos printf("\t\tconst struct %s%s_args *p = params;\n", compatwrap_, funcname) > systrace 825 1.146 christos for (i = 1; i <= argc; i++) { 826 1.146 christos arg = argtype[i] 827 1.146 christos sub("__restrict$", "", arg) 828 1.146 christos printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, arg) > systracetmp 829 1.146 christos if (arg ~ /.*p_t$/ || arg ~ /.*p$/ || arg ~ /.*_t_p$/ || 830 1.168 christos arg ~ /.*_pointer_t$/) 831 1.146 christos printf("\t\tuarg[%d] = (intptr_t) SCARG(p, %s).i32; /* %s */\n", \ 832 1.146 christos i - 1, \ 833 1.146 christos argname[i], arg) > systrace 834 1.168 christos else if (index(arg, "*") > 0 || arg == "caddr_t" || 835 1.185 christos arg ~ /.*_handler_t$/) 836 1.146 christos printf("\t\tuarg[%d] = (intptr_t) SCARG(p, %s); /* %s */\n", \ 837 1.146 christos i - 1, \ 838 1.184 christos fixarray(argname[i]), arg) > systrace 839 1.146 christos else if (substr(arg, 1, 1) == "u" || arg == "size_t") 840 1.146 christos printf("\t\tuarg[%d] = SCARG(p, %s); /* %s */\n", \ 841 1.146 christos i - 1, \ 842 1.146 christos argname[i], arg) > systrace 843 1.146 christos else 844 1.146 christos printf("\t\tiarg[%d] = SCARG(p, %s); /* %s */\n", \ 845 1.146 christos i - 1, \ 846 1.185 christos fixarray(argname[i]), arg) > systrace 847 1.146 christos } 848 1.146 christos printf("\t\tdefault:\n\t\t\tbreak;\n\t\t};\n") > systracetmp 849 1.146 christos 850 1.146 christos printf("\t\tif (ndx == 0 || ndx == 1)\n") > systraceret 851 1.146 christos printf("\t\t\tp = \"%s\";\n", returntype) > systraceret 852 1.146 christos printf("\t\tbreak;\n") > systraceret 853 1.146 christos } 854 1.146 christos printf("\t\t*n_args = %d;\n\t\tbreak;\n\t}\n", argc) > systrace 855 1.146 christos printf("\t\tbreak;\n") > systracetmp 856 1.146 christos } 857 1.146 christos 858 1.61 dsl function putent(type, compatwrap) { 859 1.60 dsl # output syscall declaration for switch table. 860 1.60 dsl if (compatwrap == "") 861 1.60 dsl compatwrap_ = "" 862 1.60 dsl else 863 1.60 dsl compatwrap_ = compatwrap "_" 864 1.62 dsl if (argc == 0) 865 1.62 dsl arg_type = "void"; 866 1.62 dsl else { 867 1.62 dsl arg_type = "struct " compatwrap_ funcname "_args"; 868 1.62 dsl } 869 1.146 christos putsystrace(type, compatwrap_) 870 1.62 dsl proto = "int\t" compatwrap_ funcname "(struct lwp *, const " \ 871 1.62 dsl arg_type " *, register_t *);\n" 872 1.60 dsl if (sysmap[proto] != 1) { 873 1.60 dsl sysmap[proto] = 1; 874 1.60 dsl print proto > sysprotos; 875 1.21 cgd } 876 1.11 cgd 877 1.11 cgd # output syscall switch entry 878 1.150 christos printf("\t{") > sysent 879 1.147 christos if (argc != 0) { 880 1.150 christos printf("\n\t\tns(struct %s%s_args),", compatwrap_, funcname) > sysent 881 1.19 cgd } 882 1.170 pgoyette if (modular) { 883 1.141 pooka wfn = "sys_nomodule"; 884 1.170 pgoyette idx = int(syscall / 32); 885 1.170 pgoyette bit = 2 ^ (syscall % 32); 886 1.170 pgoyette nomodbits[ idx ] += bit; 887 1.170 pgoyette } else if (compatwrap == "") 888 1.141 pooka wfn = funcname; 889 1.60 dsl else 890 1.141 pooka wfn = compatwrap "(" funcname ")"; 891 1.141 pooka wfn_cast="(sy_call_t *)" wfn 892 1.147 christos if (sycall_flags != "0") 893 1.147 christos flags = "\n\t\t.sy_flags = " sycall_flags "," 894 1.147 christos else 895 1.147 christos flags = "" 896 1.147 christos printf("%s\n\t\t.sy_call = %s\n\t},", flags, wfn_cast) > sysent 897 1.147 christos printf("\t\t/* %d = %s%s */\n", syscall, compatwrap_, funcalias) > sysent 898 1.11 cgd 899 1.11 cgd # output syscall name for names table 900 1.60 dsl printf("\t/* %3d */\t\"%s%s\",\n", syscall, compatwrap_, funcalias) \ 901 1.60 dsl > sysnamesbottom 902 1.154 christos if (compatwrap_ != "" || fbase == funcalias) 903 1.154 christos printf("\t/* %3d */\tNULL, /* %s%s */\n", syscall, \ 904 1.154 christos compatwrap_, funcalias) > sysnamesfriendly 905 1.154 christos else 906 1.154 christos printf("\t/* %3d */\t\"%s%s\",\n", syscall, compatwrap_, \ 907 1.154 christos fbase) > sysnamesfriendly 908 1.11 cgd 909 1.11 cgd # output syscall number of header, if appropriate 910 1.111 pooka if (type == "STD" || type == "NOARGS" || type == "INDIR" || \ 911 1.111 pooka type == "NOERR") { 912 1.19 cgd # output a prototype, to be used to generate lint stubs in 913 1.19 cgd # libc. 914 1.54 christos printproto("") 915 1.120 christos } else if (type == "COMPAT" || type == "EXTERN") { 916 1.29 thorpej # Just define the syscall number with a comment. These 917 1.29 thorpej # may be used by compatibility stubs in libc. 918 1.60 dsl printproto(compatwrap_) 919 1.60 dsl } 920 1.11 cgd 921 1.11 cgd # output syscall argument structure, if it has arguments 922 1.62 dsl if (argc != 0) { 923 1.124 pooka printf("\n") > sysarghdr 924 1.124 pooka if (haverumpcalls && !rumpable) 925 1.124 pooka printf("#ifndef RUMP_CLIENT\n") > sysarghdr 926 1.124 pooka printf("struct %s%s_args", compatwrap_, funcname) > sysarghdr 927 1.62 dsl if (type != "NOARGS") { 928 1.62 dsl print " {" >sysarghdr; 929 1.62 dsl for (i = 1; i <= argc; i++) 930 1.62 dsl printf("\tsyscallarg(%s) %s;\n", argtype[i], 931 1.62 dsl argname[i]) > sysarghdr 932 1.62 dsl printf "}" >sysarghdr; 933 1.62 dsl } 934 1.62 dsl printf(";\n") > sysarghdr 935 1.62 dsl if (type != "NOARGS" && type != "INDIR") { 936 1.60 dsl printf("check_syscall_args(%s%s)\n", compatwrap_, 937 1.60 dsl funcname) >sysarghdr 938 1.60 dsl } 939 1.124 pooka if (haverumpcalls && !rumpable) 940 1.124 pooka printf("#endif /* !RUMP_CLIENT */\n") > sysarghdr 941 1.11 cgd } 942 1.66 pooka 943 1.90 pooka if (!rumpable) { 944 1.142 pooka if (funcname == "sys_pipe" && rumphaspipe == 1) { 945 1.90 pooka insysent = 1 946 1.142 pooka printrumpsysmap(syscall, 947 1.142 pooka funcname, funcalias, "rump_sys_pipe") 948 1.142 pooka } else { 949 1.90 pooka insysent = 0 950 1.142 pooka } 951 1.90 pooka } else { 952 1.90 pooka insysent = 1 953 1.90 pooka } 954 1.180 dholland printrumpsysent(insysent, compatwrap_) 955 1.90 pooka 956 1.66 pooka # output rump marshalling code if necessary 957 1.83 pooka if (!rumpable) { 958 1.66 pooka return 959 1.83 pooka } 960 1.66 pooka 961 1.142 pooka printrumpsysmap(syscall, wfn, funcalias, "rump___sysimpl_" rumpfname) 962 1.142 pooka 963 1.145 pooka printf("\n") > rumpcalls 964 1.145 pooka 965 1.145 pooka if (compatwrap) 966 1.145 pooka printf("#ifdef RUMP_SYS_COMPAT\n") > rumpcalls 967 1.145 pooka 968 1.78 pooka # need a local prototype, we export the re-re-named one in .h 969 1.145 pooka printf("%s rump___sysimpl_%s(", returntype, rumpfname) \ 970 1.109 pooka > rumpcalls 971 1.80 pooka for (i = 1; i < argc; i++) { 972 1.87 pooka if (argname[i] != "PAD") 973 1.109 pooka printf("%s, ", uncompattype(argtype[i])) > rumpcalls 974 1.78 pooka } 975 1.109 pooka printf("%s);", uncompattype(argtype[argc])) > rumpcalls 976 1.78 pooka 977 1.109 pooka printf("\n%s\nrump___sysimpl_%s(", returntype, rumpfname) > rumpcalls 978 1.80 pooka for (i = 1; i < argc; i++) { 979 1.87 pooka if (argname[i] != "PAD") 980 1.109 pooka printf("%s %s, ", uncompattype(argtype[i]), \ 981 1.109 pooka argname[i]) > rumpcalls 982 1.66 pooka } 983 1.109 pooka printf("%s %s)\n", uncompattype(argtype[argc]), argname[argc]) \ 984 1.109 pooka > rumpcalls 985 1.135 pooka printf("{\n\tregister_t retval[2];\n") > rumpcalls 986 1.115 pooka if (returntype != "void") { 987 1.115 pooka if (type != "NOERR") { 988 1.115 pooka printf("\tint error = 0;\n") > rumpcalls 989 1.115 pooka } 990 1.115 pooka # assume rumpcalls return only integral types 991 1.115 pooka printf("\t%s rv = -1;\n", returntype) > rumpcalls 992 1.115 pooka } 993 1.78 pooka 994 1.66 pooka argarg = "NULL" 995 1.83 pooka argsize = 0; 996 1.66 pooka if (argc) { 997 1.84 pooka argarg = "&callarg" 998 1.84 pooka argsize = "sizeof(callarg)" 999 1.84 pooka printf("\tstruct %s%s_args callarg;\n\n",compatwrap_,funcname) \ 1000 1.66 pooka > rumpcalls 1001 1.137 pooka printf "\tmemset(&callarg, 0, sizeof(callarg));\n" > rumpcalls 1002 1.66 pooka for (i = 1; i <= argc; i++) { 1003 1.87 pooka if (argname[i] == "PAD") { 1004 1.87 pooka printf("\tSPARG(&callarg, %s) = 0;\n", \ 1005 1.87 pooka argname[i]) > rumpcalls 1006 1.87 pooka } else { 1007 1.109 pooka if (iscompattype(argtype[i])) { 1008 1.109 pooka printf("\tSPARG(&callarg, %s) = " \ 1009 1.109 pooka "(%s)%s;\n", argname[i], argtype[i], \ 1010 1.109 pooka argname[i]) > rumpcalls 1011 1.109 pooka } else { 1012 1.109 pooka printf("\tSPARG(&callarg, %s) = %s;\n",\ 1013 1.109 pooka argname[i], argname[i]) > rumpcalls 1014 1.109 pooka } 1015 1.87 pooka } 1016 1.66 pooka } 1017 1.66 pooka printf("\n") > rumpcalls 1018 1.66 pooka } else { 1019 1.66 pooka printf("\n") > rumpcalls 1020 1.66 pooka } 1021 1.111 pooka printf("\t") > rumpcalls 1022 1.112 pooka if (returntype != "void" && type != "NOERR") 1023 1.111 pooka printf("error = ") > rumpcalls 1024 1.161 pgoyette else if (returntype != "void") 1025 1.161 pgoyette printf("(void)") > rumpcalls 1026 1.161 pgoyette printf("rsys_syscall(%s%s%s, " \ 1027 1.115 pooka "%s, %s, retval);\n", constprefix, compatwrap_, funcalias, \ 1028 1.83 pooka argarg, argsize) > rumpcalls 1029 1.111 pooka if (type != "NOERR") { 1030 1.111 pooka printf("\trsys_seterrno(error);\n") > rumpcalls 1031 1.115 pooka printf("\tif (error == 0) {\n") > rumpcalls 1032 1.115 pooka indent="\t\t" 1033 1.115 pooka ending="\t}\n" 1034 1.115 pooka } else { 1035 1.115 pooka indent="\t" 1036 1.115 pooka ending="" 1037 1.111 pooka } 1038 1.80 pooka if (returntype != "void") { 1039 1.115 pooka printf("%sif (sizeof(%s) > sizeof(register_t))\n", \ 1040 1.115 pooka indent, returntype) > rumpcalls 1041 1.115 pooka printf("%s\trv = *(%s *)retval;\n", \ 1042 1.115 pooka indent, returntype) > rumpcalls 1043 1.115 pooka printf("%selse\n", indent, indent) > rumpcalls 1044 1.116 pooka printf("%s\trv = *retval;\n", indent, returntype) > rumpcalls 1045 1.115 pooka printf("%s", ending) > rumpcalls 1046 1.115 pooka printf("\treturn rv;\n") > rumpcalls 1047 1.80 pooka } 1048 1.72 pooka printf("}\n") > rumpcalls 1049 1.145 pooka 1050 1.145 pooka printf("#ifdef RUMP_KERNEL_IS_LIBC\n") > rumpcalls 1051 1.145 pooka 1052 1.145 pooka # create the bog-standard, non-renamed public name. 1053 1.145 pooka # this way we get e.g. select instead of just __select50 1054 1.145 pooka if (fcompat) 1055 1.145 pooka printf("__weak_alias(%s,rump___sysimpl_%s);\n", \ 1056 1.145 pooka fbase, rumpfname) > rumpcalls 1057 1.145 pooka 1058 1.145 pooka printf("__weak_alias(%s,rump___sysimpl_%s);\n", \ 1059 1.145 pooka funcalias, rumpfname) > rumpcalls 1060 1.145 pooka printf("__weak_alias(_%s,rump___sysimpl_%s);\n", \ 1061 1.145 pooka funcalias, rumpfname) > rumpcalls 1062 1.145 pooka printf("__strong_alias(_sys_%s,rump___sysimpl_%s);\n", \ 1063 1.145 pooka funcalias, rumpfname) >rumpcalls 1064 1.145 pooka 1065 1.145 pooka printf("#endif /* RUMP_KERNEL_IS_LIBC */\n") > rumpcalls 1066 1.145 pooka 1067 1.145 pooka if (compatwrap) 1068 1.145 pooka printf("#endif /* RUMP_SYS_COMPAT */\n") > rumpcalls 1069 1.83 pooka 1070 1.11 cgd } 1071 1.111 pooka $2 == "STD" || $2 == "NODEF" || $2 == "NOARGS" || $2 == "INDIR" \ 1072 1.111 pooka || $2 == "NOERR" { 1073 1.11 cgd parseline() 1074 1.17 mycroft putent($2, "") 1075 1.11 cgd syscall++ 1076 1.11 cgd next 1077 1.11 cgd } 1078 1.64 martin $2 == "OBSOL" || $2 == "UNIMPL" || $2 == "EXCL" || $2 == "IGNORED" { 1079 1.11 cgd if ($2 == "OBSOL") 1080 1.11 cgd comment="obsolete" 1081 1.34 christos else if ($2 == "EXCL") 1082 1.34 christos comment="excluded" 1083 1.64 martin else if ($2 == "IGNORED") 1084 1.64 martin comment="ignored" 1085 1.11 cgd else 1086 1.11 cgd comment="unimplemented" 1087 1.11 cgd for (i = 3; i <= NF; i++) 1088 1.11 cgd comment=comment " " $i 1089 1.11 cgd 1090 1.64 martin if ($2 == "IGNORED") 1091 1.175 christos sys_stub = "(sy_call_t *)(void *)nullop"; 1092 1.64 martin else 1093 1.65 njoly sys_stub = sys_nosys; 1094 1.64 martin 1095 1.148 christos print fillerpsysent(syscall, "", sys_stub, comment) > sysent 1096 1.148 christos print fillerpsysent(syscall, rumpnoflags, rumpnosys, comment) > rumpsysent 1097 1.60 dsl printf("\t/* %3d */\t\"#%d (%s)\",\n", syscall, syscall, comment) \ 1098 1.60 dsl > sysnamesbottom 1099 1.154 christos printf("\t/* %3d */\tNULL, /* %s */\n", syscall, comment) \ 1100 1.154 christos > sysnamesfriendly 1101 1.11 cgd if ($2 != "UNIMPL") 1102 1.11 cgd printf("\t\t\t\t/* %d is %s */\n", syscall, comment) > sysnumhdr 1103 1.11 cgd syscall++ 1104 1.11 cgd next 1105 1.11 cgd } 1106 1.120 christos $2 == "EXTERN" { 1107 1.120 christos parseline() 1108 1.120 christos putent("EXTERN", "") 1109 1.120 christos syscall++ 1110 1.120 christos next 1111 1.120 christos } 1112 1.11 cgd { 1113 1.11 cgd for (i = 1; i <= ncompat; i++) { 1114 1.11 cgd if ($2 == compat_upper[i]) { 1115 1.11 cgd parseline(); 1116 1.29 thorpej putent("COMPAT", compat[i]) 1117 1.11 cgd syscall++ 1118 1.11 cgd next 1119 1.11 cgd } 1120 1.11 cgd } 1121 1.40 mycroft printf("%s: line %d: unrecognized keyword %s\n", infile, NR, $2) 1122 1.1 glass exit 1 1123 1.11 cgd } 1124 1.181 dholland 1125 1.181 dholland function sort(arr, n, i, j, t) { 1126 1.181 dholland # this is going to be bubble sort because I cannot be bothered to 1127 1.181 dholland # write a real sort, this whole script is hopefully going to be 1128 1.181 dholland # deprecated before much longer, and performance of a few hundred 1129 1.181 dholland # things (even interpreted in awk) should be adequate. 1130 1.181 dholland for (i = 1; i <= n; i++) { 1131 1.181 dholland for (j = i + 1; j <= n; j++) { 1132 1.181 dholland if (arr[j] < arr[i]) { 1133 1.181 dholland t = arr[i]; 1134 1.181 dholland arr[i] = arr[j]; 1135 1.181 dholland arr[j] = t; 1136 1.181 dholland } 1137 1.181 dholland } 1138 1.181 dholland } 1139 1.181 dholland return 0; 1140 1.181 dholland } 1141 1.181 dholland 1142 1.11 cgd END { 1143 1.115 pooka # output pipe() syscall with its special retval[2] handling 1144 1.90 pooka if (rumphaspipe) { 1145 1.109 pooka printf("int rump_sys_pipe(int *);\n") > rumpprotos 1146 1.90 pooka printf("\nint rump_sys_pipe(int *);\n") > rumpcalls 1147 1.90 pooka printf("int\nrump_sys_pipe(int *fd)\n{\n") > rumpcalls 1148 1.135 pooka printf("\tregister_t retval[2];\n") > rumpcalls 1149 1.90 pooka printf("\tint error = 0;\n") > rumpcalls 1150 1.102 pooka printf("\n\terror = rsys_syscall(SYS_pipe, ") > rumpcalls 1151 1.115 pooka printf("NULL, 0, retval);\n") > rumpcalls 1152 1.90 pooka printf("\tif (error) {\n") > rumpcalls 1153 1.102 pooka printf("\t\trsys_seterrno(error);\n") > rumpcalls 1154 1.115 pooka printf("\t} else {\n\t\tfd[0] = retval[0];\n") > rumpcalls 1155 1.115 pooka printf("\t\tfd[1] = retval[1];\n\t}\n") > rumpcalls 1156 1.90 pooka printf("\treturn error ? -1 : 0;\n}\n") > rumpcalls 1157 1.145 pooka printf("#ifdef RUMP_KERNEL_IS_LIBC\n") > rumpcalls 1158 1.145 pooka printf("__weak_alias(pipe,rump_sys_pipe);\n") > rumpcalls 1159 1.145 pooka printf("__weak_alias(_pipe,rump_sys_pipe);\n") > rumpcalls 1160 1.145 pooka printf("__strong_alias(_sys_pipe,rump_sys_pipe);\n") > rumpcalls 1161 1.145 pooka printf("#endif\n") > rumpcalls 1162 1.90 pooka } 1163 1.90 pooka 1164 1.109 pooka # print default rump syscall interfaces 1165 1.181 dholland # be sure to generate them in a deterministic order, not awk 1166 1.181 dholland # hash order as would happen with a plain "for (var in funcseen)" 1167 1.181 dholland numfuncseenvars = 0; 1168 1.109 pooka for (var in funcseen) { 1169 1.181 dholland funcseenvars[++numfuncseenvars] = var; 1170 1.181 dholland } 1171 1.181 dholland sort(funcseenvars, numfuncseenvars) 1172 1.181 dholland for (i = 1; i <= numfuncseenvars; i++) { 1173 1.181 dholland var = funcseenvars[i]; 1174 1.109 pooka printf("#ifndef RUMP_SYS_RENAME_%s\n", \ 1175 1.109 pooka toupper(var)) > rumpcallshdr 1176 1.109 pooka printf("#define RUMP_SYS_RENAME_%s rump___sysimpl_%s\n", \ 1177 1.109 pooka toupper(var), funcseen[var]) > rumpcallshdr 1178 1.109 pooka printf("#endif\n\n") > rumpcallshdr 1179 1.109 pooka } 1180 1.109 pooka 1181 1.40 mycroft maxsyscall = syscall 1182 1.170 pgoyette 1183 1.40 mycroft if (nsysent) { 1184 1.40 mycroft if (syscall > nsysent) { 1185 1.50 wiz printf("%s: line %d: too many syscalls [%d > %d]\n", infile, NR, syscall, nsysent) 1186 1.40 mycroft exit 1 1187 1.40 mycroft } 1188 1.40 mycroft while (syscall < nsysent) { 1189 1.148 christos print fillerpsysent(syscall, "", sys_nosys, "filler") > sysent 1190 1.148 christos print fillerpsysent(syscall, rumpnoflags, rumpnosys, "filler") > rumpsysent 1191 1.105 pooka printf("\t/* %3d */\t\"# filler\",\n", syscall) \ 1192 1.105 pooka > sysnamesbottom 1193 1.154 christos printf("\t/* %3d */\tNULL, /* filler */\n", syscall) \ 1194 1.154 christos > sysnamesfriendly 1195 1.40 mycroft syscall++ 1196 1.40 mycroft } 1197 1.40 mycroft } 1198 1.82 pooka printf("};\n") > sysent 1199 1.170 pgoyette printf("\nconst uint32_t %s_nomodbits[] = {\n", switchname) > sysent 1200 1.170 pgoyette printf("};\n") > rumpsysent 1201 1.170 pgoyette printf("\nconst uint32_t rump_sysent_nomodbits[] = {\n") > rumpsysent 1202 1.170 pgoyette for (i = 0; i < syscall / 32; i++) { 1203 1.170 pgoyette printf("\t0x%08x,\t/* syscalls %3d-%3d */\n", 1204 1.170 pgoyette nomodbits[i], i * 32, i * 32 + 31) > sysent 1205 1.170 pgoyette printf("\t0x%08x,\t/* syscalls %3d-%3d */\n", 1206 1.170 pgoyette nomodbits[i], i * 32, i * 32 + 31) > rumpsysent 1207 1.170 pgoyette } 1208 1.170 pgoyette printf("};\n") > sysent 1209 1.83 pooka printf("};\n") > rumpsysent 1210 1.83 pooka printf("CTASSERT(__arraycount(rump_sysent) == SYS_NSYSENT);\n") > rumpsysent 1211 1.131 pooka printf("__strong_alias(rumpns_sysent,rump_sysent);\n") > rumpsysent 1212 1.102 pooka printf("#endif /* RUMP_CLIENT */\n") > rumpsysent 1213 1.124 pooka if (haverumpcalls) 1214 1.124 pooka printf("#endif /* !RUMP_CLIENT */\n") > sysprotos 1215 1.27 thorpej printf("};\n") > sysnamesbottom 1216 1.154 christos printf("};\n") > sysnamesfriendly 1217 1.40 mycroft printf("#define\t%sMAXSYSCALL\t%d\n", constprefix, maxsyscall) > sysnumhdr 1218 1.40 mycroft if (nsysent) 1219 1.40 mycroft printf("#define\t%sNSYSENT\t%d\n", constprefix, nsysent) > sysnumhdr 1220 1.146 christos printf "\tdefault:\n\t\t*n_args = 0;\n\t\tbreak;\n\t};\n}\n" > systrace 1221 1.146 christos printf "\tdefault:\n\t\tbreak;\n\t};\n\tif (p != NULL)\n\t\tstrlcpy(desc, p, descsz);\n}\n" > systracetmp 1222 1.146 christos printf "\tdefault:\n\t\tbreak;\n\t};\n\tif (p != NULL)\n\t\tstrlcpy(desc, p, descsz);\n}\n" > systraceret 1223 1.11 cgd } ' 1224 1.1 glass 1225 1.17 mycroft cat $sysprotos >> $sysarghdr 1226 1.59 christos echo "#endif /* _${constprefix}SYSCALL_H_ */" >> $sysnumhdr 1227 1.59 christos echo "#endif /* _${constprefix}SYSCALLARGS_H_ */" >> $sysarghdr 1228 1.173 christos printf "\t { 0, NULL }\n" >> $sysautoloadbottom 1229 1.173 christos echo "};" >> $sysautoloadbottom 1230 1.109 pooka printf "\n#endif /* _RUMP_RUMP_SYSCALLS_H_ */\n" >> $rumpprotos 1231 1.16 thorpej cat $sysdcl $sysent > $syssw 1232 1.27 thorpej cat $sysnamesbottom >> $sysnames 1233 1.154 christos cat $sysnamesfriendly >> $sysnames 1234 1.83 pooka cat $rumpsysent >> $rumpcalls 1235 1.173 christos cat $sysautoloadbottom >> $sysautoload 1236 1.1 glass 1237 1.118 njoly touch $rumptypes 1238 1.109 pooka cat $rumptypes >> $rumpcallshdr 1239 1.109 pooka echo >> $rumpcallshdr 1240 1.109 pooka cat $rumpprotos >> $rumpcallshdr 1241 1.109 pooka 1242 1.15 christos #chmod 444 $sysnames $sysnumhdr $syssw 1243 1.136 pooka 1244 1.146 christos cat $systracetmp >> $systrace 1245 1.146 christos cat $systraceret >> $systrace 1246 1.146 christos 1247 1.136 pooka echo Generated following files: 1248 1.152 pgoyette echo $sysarghdr $sysnumhdr $syssw $sysnames $sysautoload $systrace $rumpcalls $rumpcallshdr $rumpsysmap 1249