Module Name:    src
Committed By:   pooka
Date:           Tue Sep  3 21:28:24 UTC 2013

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

Log Message:
If RUMP_KERNEL_IS_LIBC is defined, alias the rump kernel syscalls to libc
syscall stub symbol names.  This allows running standalone programs in
OS-less environments such as directly on a Xen DomU backed only by a
libc and a rump kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/kern/makesyscalls.sh

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.131 src/sys/kern/makesyscalls.sh:1.132
--- src/sys/kern/makesyscalls.sh:1.131	Tue Sep  3 20:54:03 2013
+++ src/sys/kern/makesyscalls.sh	Tue Sep  3 21:28:24 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: makesyscalls.sh,v 1.131 2013/09/03 20:54:03 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.132 2013/09/03 21:28:24 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -256,6 +256,12 @@ NR == 1 {
 	printf "\t__weak_alias(nam,rump_enosys);\n" > rumpcalls
 	printf "#endif\n\n" > rumpcalls
 
+	printf "#ifdef RUMP_KERNEL_IS_LIBC\n" > rumpcalls
+	printf "#define rsys_aliases(what,where) \\\n" > rumpcalls
+	printf "\t__strong_alias(what,where); \\\n" > rumpcalls
+	printf "\t__strong_alias(_##what,where);\n" > rumpcalls
+	printf "#else\n#define rsys_aliases(a,b)\n#endif\n\n" > rumpcalls
+
 	printf "#if\tBYTE_ORDER == BIG_ENDIAN\n" > rumpcalls
 	printf "#define SPARG(p,k)\t((p)->k.be.datum)\n" > rumpcalls
 	printf "#else /* LITTLE_ENDIAN, I hope dearly */\n" > rumpcalls
@@ -869,6 +875,8 @@ function putent(type, compatwrap) {
 	printf("}\n") > rumpcalls
 	printf("rsys_define(rumpns_%s%s);\n", \
 	    compatwrap_, funcname) > rumpcalls
+	printf("rsys_aliases(%s%s,rump___sysimpl_%s);\n", \
+	    compatwrap_, funcalias, rumpfname) > rumpcalls
 
 }
 $2 == "STD" || $2 == "NODEF" || $2 == "NOARGS" || $2 == "INDIR" \
@@ -940,6 +948,7 @@ END {
 		printf("\t\tfd[1] = retval[1];\n\t}\n") > rumpcalls
 		printf("\treturn error ? -1 : 0;\n}\n") > rumpcalls
 		printf("rsys_define(rumpns_sys_pipe);\n") > rumpcalls
+		printf "rsys_aliases(pipe,rump_sys_pipe);\n" > rumpcalls
 	}
 
 	# print default rump syscall interfaces

Reply via email to