Module Name:    src
Committed By:   pooka
Date:           Sun Nov 21 22:01:16 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: rump.c rump_private.h scheduler.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.63 -r1.64 src/sys/rump/librump/rumpkern/rump_private.h
cvs rdiff -u -r1.21 -r1.22 src/sys/rump/librump/rumpkern/scheduler.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/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.203 src/sys/rump/librump/rumpkern/rump.c:1.204
--- src/sys/rump/librump/rumpkern/rump.c:1.203	Sun Nov 21 17:34:11 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Sun Nov 21 22:01:15 2010
@@ -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;

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.63 src/sys/rump/librump/rumpkern/rump_private.h:1.64
--- src/sys/rump/librump/rumpkern/rump_private.h:1.63	Wed Nov 17 21:57:33 2010
+++ src/sys/rump/librump/rumpkern/rump_private.h	Sun Nov 21 22:01:15 2010
@@ -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);

Index: src/sys/rump/librump/rumpkern/scheduler.c
diff -u src/sys/rump/librump/rumpkern/scheduler.c:1.21 src/sys/rump/librump/rumpkern/scheduler.c:1.22
--- src/sys/rump/librump/rumpkern/scheduler.c:1.21	Fri Oct 29 15:32:24 2010
+++ src/sys/rump/librump/rumpkern/scheduler.c	Sun Nov 21 22:01:15 2010
@@ -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

Reply via email to