Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Mark syscalls not supported by a rump kernel with SYCALL...



details:   https://anonhg.NetBSD.org/src/rev/becc985e1456
branches:  trunk
changeset: 760190:becc985e1456
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Dec 30 16:49:24 2010 +0000

description:
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).

diffstat:

 sys/kern/makesyscalls.sh |  12 +++++++-----
 sys/sys/systm.h          |   3 ++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 01c924323bdb -r becc985e1456 sys/kern/makesyscalls.sh
--- a/sys/kern/makesyscalls.sh  Thu Dec 30 16:46:32 2010 +0000
+++ b/sys/kern/makesyscalls.sh  Thu Dec 30 16:49:24 2010 +0000
@@ -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
diff -r 01c924323bdb -r becc985e1456 sys/sys/systm.h
--- a/sys/sys/systm.h   Thu Dec 30 16:46:32 2010 +0000
+++ b/sys/sys/systm.h   Thu Dec 30 16:49:24 2010 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index