Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpkern Encode smp-capability into the mak...



details:   https://anonhg.NetBSD.org/src/rev/486b1ce412f6
branches:  trunk
changeset: 758940:486b1ce412f6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Nov 21 22:17:24 2010 +0000

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

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern |  12 +++++++++++-
 sys/rump/librump/rumpkern/rump.c            |   6 +++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (62 lines):

diff -r 5a19d5136c2a -r 486b1ce412f6 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Sun Nov 21 22:01:15 2010 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Sun Nov 21 22:17:24 2010 +0000
@@ -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>
diff -r 5a19d5136c2a -r 486b1ce412f6 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Sun Nov 21 22:01:15 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Sun Nov 21 22:17:24 2010 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index