Module Name: src Committed By: christos Date: Tue Apr 13 22:45:32 UTC 2021
Modified Files: src/sys/kern: makesyscalls.sh Log Message: Elide [NUM] in arguments for systrace, use the first address of the array and cast to intptr_t instead. To generate a diff of this commit: cvs rdiff -u -r1.183 -r1.184 src/sys/kern/makesyscalls.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/makesyscalls.sh diff -u src/sys/kern/makesyscalls.sh:1.183 src/sys/kern/makesyscalls.sh:1.184 --- src/sys/kern/makesyscalls.sh:1.183 Wed Feb 17 01:25:10 2021 +++ src/sys/kern/makesyscalls.sh Tue Apr 13 18:45:32 2021 @@ -1,4 +1,4 @@ -# $NetBSD: makesyscalls.sh,v 1.183 2021/02/17 06:25:10 rillig Exp $ +# $NetBSD: makesyscalls.sh,v 1.184 2021/04/13 22:45:32 christos Exp $ # # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou # All rights reserved. @@ -805,6 +805,15 @@ function printrumpsysmap(syscall, wfn, f syscall, wfn, funcalias, rumpentry) > rumpsysmap } +function fixarray(arg) { + iii = index(arg, "[") + if (iii == 0) { + return arg + } else { + return substr(arg, 1, iii - 1) + } +} + function putsystrace(type, compatwrap_) { printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp @@ -822,10 +831,10 @@ function putsystrace(type, compatwrap_) i - 1, \ argname[i], arg) > systrace else if (index(arg, "*") > 0 || arg == "caddr_t" || - arg ~ /.*_handler_t$/) + arg ~ /.*_handler_t$/ || index(argname[i], "[") > 0) printf("\t\tuarg[%d] = (intptr_t) SCARG(p, %s); /* %s */\n", \ i - 1, \ - argname[i], arg) > systrace + fixarray(argname[i]), arg) > systrace else if (substr(arg, 1, 1) == "u" || arg == "size_t") printf("\t\tuarg[%d] = SCARG(p, %s); /* %s */\n", \ i - 1, \