Module Name:    src
Committed By:   pooka
Date:           Sun Mar 16 15:31:03 UTC 2014

Modified Files:
        src/sys/rump: Makefile.rump README.compileopts

Log Message:
Introduce RUMP_CURLWP compile option to select curlwp scheme.
Default is still "hypercall".


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/rump/Makefile.rump
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/README.compileopts

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/Makefile.rump
diff -u src/sys/rump/Makefile.rump:1.93 src/sys/rump/Makefile.rump:1.94
--- src/sys/rump/Makefile.rump:1.93	Sun Mar 16 14:02:06 2014
+++ src/sys/rump/Makefile.rump	Sun Mar 16 15:31:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rump,v 1.93 2014/03/16 14:02:06 pooka Exp $
+#	$NetBSD: Makefile.rump,v 1.94 2014/03/16 15:31:03 pooka Exp $
 #
 
 WARNS?=		3	# XXX: src/sys won't compile with -Wsign-compare yet
@@ -53,6 +53,18 @@ LDFLAGS+=	-Wl,-T,${RUMPTOP}/ldscript.rum
 .endif
 .endif
 
+.if defined(RUMP_CURLWP)
+.if   ${RUMP_CURLWP} == "hypercall"
+CPPFLAGS+=	-DRUMP_CURLWP=RUMP_CURLWP_HYPERCALL
+.elif ${RUMP_CURLWP} == "__thread"
+CPPFLAGS+=	-DRUMP_CURLWP=RUMP_CURLWP___THREAD
+.elif ${RUMP_CURLWP} == "register"
+CPPFLAGS+=	-DRUMP_CURLWP=RUMP_CURLWP_REGISTER
+.else
+.error Unsupported curlwp scheme: ${RUMP_CURLWP}
+.endif
+.endif
+
 RUMP_DIAGNOSTIC?=yes
 .if ${RUMP_DIAGNOSTIC} == "yes"
 CPPFLAGS+=	-DDIAGNOSTIC

Index: src/sys/rump/README.compileopts
diff -u src/sys/rump/README.compileopts:1.2 src/sys/rump/README.compileopts:1.3
--- src/sys/rump/README.compileopts:1.2	Sun Mar 16 14:47:47 2014
+++ src/sys/rump/README.compileopts	Sun Mar 16 15:31:03 2014
@@ -1,4 +1,4 @@
-	$NetBSD: README.compileopts,v 1.2 2014/03/16 14:47:47 pooka Exp $
+	$NetBSD: README.compileopts,v 1.3 2014/03/16 15:31:03 pooka Exp $
 
 This file describes compile-time options for rump kernels.  Additionally,
 NetBSD build options will have an effect.  See src/share/mk/bsd.README
@@ -61,6 +61,20 @@ effect:	Iff "yes", build the virt(4) net
 	e.g. musl libc based Linux.
 
 
+    RUMP_CURLWP
+
+values: hypercall/__thread/register or <undefined>
+defval: <undefined>
+effect: Control how curlwp is obtained in a rump kernel.  This is
+	a very frequently accessed thread-local variable, and optimizing
+	access has a significant performance impact.  Note that all
+	options are not available on hosts/machine architectures.
+	<undefined> - use default implementation (currently "hypercall")
+	hypercall   - use a hypercall to fetch the value
+	__thread    - use the __thread feature to fetch value via TLS
+	register    - use a dedicated register (implies -ffixed)
+
+
 ================================================================================
 
 

Reply via email to