From afe2ca27dd122935bc0eeaf0f3de7d34d2b68137 Mon Sep 17 00:00:00 2001 From: pooka Date: Thu, 30 Dec 2010 16:49:24 +0000 Subject: [PATCH] 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). --- sys/kern/makesyscalls.sh | 12 +++++++----- sys/sys/systm.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index 798c6795195c..c2a77fa2503f 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -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 @@ function printrumpsysent(insysent, compatwrap) { 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 @@ $2 == "OBSOL" || $2 == "UNIMPL" || $2 == "EXCL" || $2 == "IGNORED" { 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 @@ END { 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 --git a/sys/sys/systm.h b/sys/sys/systm.h index 0ae6af3f17c2..8c99edc285d1 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -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 @@ extern int nsysent; #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)