Module Name: src
Committed By: matt
Date: Fri Aug 3 18:08:02 UTC 2012
Modified Files:
src/sys/kern: makesyscalls.sh
src/sys/sys: systm.h
Log Message:
If any argument of a syscall is a pointer, set SYCALL_ARG_PTR as a flag.
To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r1.256 -r1.257 src/sys/sys/systm.h
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.124 src/sys/kern/makesyscalls.sh:1.125
--- src/sys/kern/makesyscalls.sh:1.124 Fri Aug 3 11:31:33 2012
+++ src/sys/kern/makesyscalls.sh Fri Aug 3 18:08:01 2012
@@ -1,4 +1,4 @@
-# $NetBSD: makesyscalls.sh,v 1.124 2012/08/03 11:31:33 pooka Exp $
+# $NetBSD: makesyscalls.sh,v 1.125 2012/08/03 18:08:01 matt Exp $
#
# Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
# All rights reserved.
@@ -532,6 +532,7 @@ function parseline() {
isvarargs = 0;
args64 = 0;
+ ptr = 0;
while (f <= end) {
if ($f == "...") {
f++;
@@ -568,6 +569,13 @@ function parseline() {
sycall_flags = "SYCALL_ARG"argc-1"_64 | " sycall_flags;
args64++;
}
+ if (index(argtype[argc], "*") != 0 && ptr == 0) {
+ if (sycall_flags == "0")
+ sycall_flags = "SYCALL_ARG_PTR";
+ else
+ sycall_flags = "SYCALL_ARG_PTR | " sycall_flags;
+ ptr = 1;
+ }
argname[argc]=$f;
f += 2; # skip name, and any comma
}
Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.256 src/sys/sys/systm.h:1.257
--- src/sys/sys/systm.h:1.256 Sun Nov 27 11:07:21 2011
+++ src/sys/sys/systm.h Fri Aug 3 18:08:01 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: systm.h,v 1.256 2011/11/27 11:07:21 martin Exp $ */
+/* $NetBSD: systm.h,v 1.257 2012/08/03 18:08:01 matt Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@@ -143,6 +143,7 @@ extern int nsysent;
#define SYCALL_ARG6_64 0x0800000
#define SYCALL_ARG7_64 0x1000000
#define SYCALL_NOSYS 0x2000000 /* permanent nosys in sysent[] */
+#define SYCALL_ARG_PTR 0x3000000 /* at least one argument is a pointer */
#define SYCALL_RET_64_P(sy) ((sy)->sy_flags & SYCALL_RET_64)
#define SYCALL_ARG_64_P(sy, n) ((sy)->sy_flags & (SYCALL_ARG0_64 << (n)))
#define SYCALL_ARG_64_MASK(sy) (((sy)->sy_flags >> 17) & 0xff)