Module Name:    src
Committed By:   pooka
Date:           Thu Dec 30 16:49:25 UTC 2010

Modified Files:
        src/sys/kern: makesyscalls.sh
        src/sys/sys: systm.h

Log Message:
Mark syscalls not supported by a rump kernel with SYCALL_NOSYS, as
pure function pointer comparison brings weak alias confusion (weak
aliases are necessary for static linkage).


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r1.244 -r1.245 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.106 src/sys/kern/makesyscalls.sh:1.107
--- src/sys/kern/makesyscalls.sh:1.106	Thu Dec 30 13:38:10 2010
+++ src/sys/kern/makesyscalls.sh	Thu Dec 30 16:49:24 2010
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#	$NetBSD: makesyscalls.sh,v 1.106 2010/12/30 13:38:10 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.107 2010/12/30 16:49:24 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -591,9 +591,11 @@
 	if (!insysent) {
 		eno[0] = "rump_enosys"
 		eno[1] = "sys_nomodule"
-		printf("\t{ 0, 0, 0,\n\t    (sy_call_t *)%s }, \t"	\
+		flags[0] = "SYCALL_NOSYS"
+		flags[1] = "0"
+		printf("\t{ 0, 0, %s,\n\t    (sy_call_t *)%s }, \t"	\
 		    "/* %d = unrumped */\n",				\
-		    eno[modular], syscall) > rumpsysent
+		    flags[modular], eno[modular], syscall) > rumpsysent
 		return
 	}
 
@@ -768,7 +770,7 @@
 
 	printf("\t{ 0, 0, 0,\n\t    %s },\t\t\t/* %d = %s */\n", \
 	    sys_stub, syscall, comment) > sysent
-	printf("\t{ 0, 0, 0,\n\t    %s },\t\t/* %d = %s */\n", \
+	printf("\t{ 0, 0, SYCALL_NOSYS,\n\t    %s },\t\t/* %d = %s */\n", \
 	    "(sy_call_t *)rump_enosys", syscall, comment) > rumpsysent
 	printf("\t/* %3d */\t\"#%d (%s)\",\n", syscall, syscall, comment) \
 	    > sysnamesbottom
@@ -815,7 +817,7 @@
 		while (syscall < nsysent) {
 			printf("\t{ 0, 0, 0,\n\t    %s },\t\t\t/* %d = filler */\n", \
 			    sys_nosys, syscall) > sysent
-			printf("\t{ 0, 0, 0,\n\t    %s },\t\t/* %d = filler */\n", \
+			printf("\t{ 0, 0, SYCALL_NOSYS,\n\t    %s },\t\t/* %d = filler */\n", \
 			    "(sy_call_t *)rump_enosys", syscall) > rumpsysent
 			printf("\t/* %3d */\t\"# filler\",\n", syscall) \
 			    > sysnamesbottom

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.244 src/sys/sys/systm.h:1.245
--- src/sys/sys/systm.h:1.244	Thu Dec 30 12:46:34 2010
+++ src/sys/sys/systm.h	Thu Dec 30 16:49:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.244 2010/12/30 12:46:34 pooka Exp $	*/
+/*	$NetBSD: systm.h,v 1.245 2010/12/30 16:49:25 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -139,6 +139,7 @@
 #define SYCALL_ARG5_64  0x0400000
 #define SYCALL_ARG6_64  0x0800000
 #define SYCALL_ARG7_64  0x1000000
+#define SYCALL_NOSYS    0x2000000 /* permanent nosys in sysent[] */
 #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)

Reply via email to