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 Fix situation where we try to conf...



details:   https://anonhg.NetBSD.org/src/rev/5a19d5136c2a
branches:  trunk
changeset: 758939:5a19d5136c2a
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Nov 21 22:01:15 2010 +0000

description:
Fix situation where we try to configure >MAXCPUS cpus.

diffstat:

 sys/rump/librump/rumpkern/rump.c         |   6 +++---
 sys/rump/librump/rumpkern/rump_private.h |   4 ++--
 sys/rump/librump/rumpkern/scheduler.c    |  12 +++++++-----
 3 files changed, 12 insertions(+), 10 deletions(-)

diffs (91 lines):

diff -r ff8e66e46dbc -r 5a19d5136c2a sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Sun Nov 21 21:46:43 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Sun Nov 21 22:01:15 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.203 2010/11/21 17:34:11 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.204 2010/11/21 22:01:15 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.203 2010/11/21 17:34:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.204 2010/11/21 22:01:15 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -262,7 +262,7 @@
                printf("NCPU limited to 1 on this machine architecture\n");
        numcpu = 1;
 #endif
-       rump_cpus_bootstrap(numcpu);
+       rump_cpus_bootstrap(&numcpu);
 
        rumpuser_gettime(&sec, &nsec, &error);
        boottime.tv_sec = sec;
diff -r ff8e66e46dbc -r 5a19d5136c2a sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h  Sun Nov 21 21:46:43 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h  Sun Nov 21 22:01:15 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_private.h,v 1.63 2010/11/17 21:57:33 pooka Exp $  */
+/*     $NetBSD: rump_private.h,v 1.64 2010/11/21 22:01:15 pooka Exp $  */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -96,7 +96,7 @@
 
 struct lwp *   rump__lwproc_alloclwp(struct proc *);
 
-void   rump_cpus_bootstrap(int);
+void   rump_cpus_bootstrap(int *);
 void   rump_scheduler_init(int);
 void   rump_schedule(void);
 void   rump_unschedule(void);
diff -r ff8e66e46dbc -r 5a19d5136c2a sys/rump/librump/rumpkern/scheduler.c
--- a/sys/rump/librump/rumpkern/scheduler.c     Sun Nov 21 21:46:43 2010 +0000
+++ b/sys/rump/librump/rumpkern/scheduler.c     Sun Nov 21 22:01:15 2010 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scheduler.c,v 1.21 2010/10/29 15:32:24 pooka Exp $    */
+/*      $NetBSD: scheduler.c,v 1.22 2010/11/21 22:01:15 pooka Exp $    */
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.21 2010/10/29 15:32:24 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.22 2010/11/21 22:01:15 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -120,15 +120,16 @@
 
 /* this could/should be mi_attach_cpu? */
 void
-rump_cpus_bootstrap(int num)
+rump_cpus_bootstrap(int *nump)
 {
        struct rumpcpu *rcpu;
        struct cpu_info *ci;
+       int num = *nump;
        int i;
 
        if (num > MAXCPUS) {
-               aprint_verbose("CPU limit: %d wanted, %d (MAXCPUS) available\n",
-                   num, MAXCPUS);
+               aprint_verbose("CPU limit: %d wanted, %d (MAXCPUS) "
+                   "available (adjusted)\n", num, MAXCPUS);
                num = MAXCPUS;
        }
 
@@ -141,6 +142,7 @@
        /* attach first cpu for bootstrap */
        rump_cpu_attach(&rump_cpus[0]);
        ncpu = 1;
+       *nump = num;
 }
 
 void



Home | Main Index | Thread Index | Old Index