Module Name:    src
Committed By:   pooka
Date:           Sun Nov 21 22:17:24 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: Makefile.rumpkern rump.c

Log Message:
Encode smp-capability into the makefile so that it can be used to
avoid potential screwups.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.204 -r1.205 src/sys/rump/librump/rumpkern/rump.c

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/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.100 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.101
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.100	Sun Nov 21 21:46:43 2010
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Sun Nov 21 22:17:24 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.100 2010/11/21 21:46:43 pooka Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.101 2010/11/21 22:17:24 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -25,6 +25,12 @@
 SRCS+=	locks.c
 #SRCS+=	locks_up.c
 
+# Does the arch support multiple processors?
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+RUMP_SMP=		# defined
+CPPFLAGS.rump.c+=	-DRUMP_SMP
+.endif
+
 vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh ${RUMPTOP}/../sys/param.h
 	${_MKMSG_CREATE} vers.c
 	${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n
@@ -175,8 +181,12 @@
     || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
     || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
 CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
+.ifdef RUMP_SMP
+SRCS+=		atomic_cas_generic.c
+.else
 SRCS+=		atomic_cas_up.c
 .endif
+.endif
 
 .include <bsd.lib.mk>
 .include <bsd.klinks.mk>

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.204 src/sys/rump/librump/rumpkern/rump.c:1.205
--- src/sys/rump/librump/rumpkern/rump.c:1.204	Sun Nov 21 22:01:15 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Sun Nov 21 22:17:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.204 2010/11/21 22:01:15 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.205 2010/11/21 22:17:24 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.204 2010/11/21 22:01:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.205 2010/11/21 22:17:24 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -249,7 +249,7 @@
 	if (rumpuser_getenv("RUMP_NCPU", buf, sizeof(buf), &error) == 0)
 		error = 0;
 	/* non-x86 is missing CPU_INFO_FOREACH() support */
-#if defined(__i386__) || defined(__x86_64__)
+#ifdef RUMP_SMP
 	if (error == 0) {
 		numcpu = strtoll(buf, NULL, 10);
 		if (numcpu < 1)

Reply via email to