Module Name:    src
Committed By:   pooka
Date:           Sun Apr 27 14:50:23 UTC 2014

Modified Files:
        src/sys/kern: makesyscalls.sh syscalls.conf

Log Message:
Eliminate weak symbols from rump kernel syscall handlers, part 2:

Generate a file (rump.sysmap) which can be used to autogenerate the
syscall loaders.  The file contains syscall handler names and numbers.

Also store "libc" side syscall names in rump.sysmap to help with
the rumprun build process.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r1.19 -r1.20 src/sys/kern/syscalls.conf

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.141 src/sys/kern/makesyscalls.sh:1.142
--- src/sys/kern/makesyscalls.sh:1.141	Sun Apr 27 14:29:53 2014
+++ src/sys/kern/makesyscalls.sh	Sun Apr 27 14:50:23 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: makesyscalls.sh,v 1.141 2014/04/27 14:29:53 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.142 2014/04/27 14:50:23 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -63,6 +63,7 @@ sys_nosys="sys_nosys"	# default is sys_n
 maxsysargs=8		# default limit is 8 (32bit) arguments
 rumpcalls="/dev/null"
 rumpcallshdr="/dev/null"
+rumpsysmap="/dev/null"
 rumpsysent="rumpsysent.tmp"
 . ./$1
 
@@ -139,6 +140,7 @@ BEGIN {
 	rumpcalls = \"$rumpcalls\"
 	rumpcallshdr = \"$rumpcallshdr\"
 	rumpsysent = \"$rumpsysent\"
+	rumpsysmap = \"$rumpsysmap\"
 	switchname = \"$switchname\"
 	namesname = \"$namesname\"
 	constprefix = \"$constprefix\"
@@ -690,6 +692,11 @@ function uncompattype(type) {
 	return type
 }
 
+function printrumpsysmap(syscall, wfn, funcalias, rumpentry) {
+	printf("%-4d %-22s %-18s %s\n",
+	    syscall, wfn, funcalias, rumpentry) > rumpsysmap
+}
+
 function putent(type, compatwrap) {
 	# output syscall declaration for switch table.
 	if (compatwrap == "")
@@ -766,10 +773,13 @@ function putent(type, compatwrap) {
 	}
 
 	if (!rumpable) {
-		if (funcname == "sys_pipe" && rumphaspipe == 1)
+		if (funcname == "sys_pipe" && rumphaspipe == 1) {
 			insysent = 1
-		else
+			printrumpsysmap(syscall,
+			    funcname, funcalias, "rump_sys_pipe")
+		} else {
 			insysent = 0
+		}
 	} else {
 		insysent = 1
 	}
@@ -780,6 +790,8 @@ function putent(type, compatwrap) {
 		return
 	}
 
+	printrumpsysmap(syscall, wfn, funcalias, "rump___sysimpl_" rumpfname)
+
 	# need a local prototype, we export the re-re-named one in .h
 	printf("\n%s rump___sysimpl_%s(", returntype, rumpfname) \
 	    > rumpcalls
@@ -988,4 +1000,4 @@ cat $rumpprotos >> $rumpcallshdr
 #chmod 444 $sysnames $sysnumhdr $syssw
 
 echo Generated following files:
-echo $sysarghdr $sysnumhdr $syssw $sysnames $rumpcalls $rumpcallshdr
+echo $sysarghdr $sysnumhdr $syssw $sysnames $rumpcalls $rumpcallshdr $rumpsysmap

Index: src/sys/kern/syscalls.conf
diff -u src/sys/kern/syscalls.conf:1.19 src/sys/kern/syscalls.conf:1.20
--- src/sys/kern/syscalls.conf:1.19	Fri Aug  3 12:41:13 2012
+++ src/sys/kern/syscalls.conf	Sun Apr 27 14:50:23 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: syscalls.conf,v 1.19 2012/08/03 12:41:13 pooka Exp $
+#	$NetBSD: syscalls.conf,v 1.20 2014/04/27 14:50:23 pooka Exp $
 
 sysnames="syscalls.c"
 sysnumhdr="../sys/syscall.h"
@@ -8,6 +8,7 @@ sysarghdrextra='#include <sys/mount.h>\n
 sysalign=1
 rumpcalls="../rump/librump/rumpkern/rump_syscalls.c"
 rumpcallshdr="../rump/include/rump/rump_syscalls.h"
+rumpsysmap="../rump/rump.sysmap"
 compatopts="compat_43 compat_09 compat_10 compat_11 compat_12 compat_13 compat_14 compat_15 compat_16 compat_20 compat_30 compat_40 compat_50 compat_60"
 libcompatopts=""
 

Reply via email to