Attach only one CPU for the bootstrap phase.
This commit is contained in:
parent
5862500201
commit
4aea95690f
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump.c,v 1.185 2010/09/06 20:10:20 pooka Exp $ */
|
||||
/* $NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 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.185 2010/09/06 20:10:20 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 pooka Exp $");
|
||||
|
||||
#include <sys/systm.h>
|
||||
#define ELFSIZE ARCH_ELFSIZE
|
||||
|
@ -313,7 +313,7 @@ rump__init(int rump_version)
|
|||
lwpinit_specificdata();
|
||||
lwp_initspecific(&lwp0);
|
||||
|
||||
rump_scheduler_init();
|
||||
rump_scheduler_init(numcpu);
|
||||
/* revert temporary context and schedule a real context */
|
||||
l->l_cpu = NULL;
|
||||
rumpuser_set_curlwp(NULL);
|
||||
|
@ -329,9 +329,15 @@ rump__init(int rump_version)
|
|||
tc_setclock(&ts);
|
||||
|
||||
/* we are mostly go. do per-cpu subsystem init */
|
||||
for (i = 0; i < ncpu; i++) {
|
||||
for (i = 0; i < numcpu; i++) {
|
||||
struct cpu_info *ci = cpu_lookup(i);
|
||||
|
||||
/* attach non-bootstrap CPUs */
|
||||
if (i > 0) {
|
||||
rump_cpu_attach(ci);
|
||||
ncpu++;
|
||||
}
|
||||
|
||||
callout_init_cpu(ci);
|
||||
softint_init(ci);
|
||||
xc_init_cpu(ci);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rump_private.h,v 1.55 2010/09/01 19:37:58 pooka Exp $ */
|
||||
/* $NetBSD: rump_private.h,v 1.56 2010/09/07 07:59:48 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -111,7 +111,7 @@ int rump_sysproxy_copyin(const void *, void *, size_t);
|
|||
struct lwp * rump__lwproc_allockernlwp(void);
|
||||
|
||||
void rump_cpus_bootstrap(int);
|
||||
void rump_scheduler_init(void);
|
||||
void rump_scheduler_init(int);
|
||||
void rump_schedule(void);
|
||||
void rump_unschedule(void);
|
||||
void rump_schedule_cpu(struct lwp *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: scheduler.c,v 1.19 2010/09/01 19:37:59 pooka Exp $ */
|
||||
/* $NetBSD: scheduler.c,v 1.20 2010/09/07 07:59:48 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.19 2010/09/01 19:37:59 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.20 2010/09/07 07:59:48 pooka Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/atomic.h>
|
||||
|
@ -136,13 +136,15 @@ rump_cpus_bootstrap(int num)
|
|||
rcpu = &rcpu_storage[i];
|
||||
ci = &rump_cpus[i];
|
||||
ci->ci_index = i;
|
||||
rump_cpu_attach(ci);
|
||||
ncpu++;
|
||||
}
|
||||
|
||||
/* attach first cpu for bootstrap */
|
||||
rump_cpu_attach(&rump_cpus[0]);
|
||||
ncpu = 1;
|
||||
}
|
||||
|
||||
void
|
||||
rump_scheduler_init()
|
||||
rump_scheduler_init(int numcpu)
|
||||
{
|
||||
struct rumpcpu *rcpu;
|
||||
struct cpu_info *ci;
|
||||
|
@ -150,7 +152,7 @@ rump_scheduler_init()
|
|||
|
||||
rumpuser_mutex_init(&lwp0mtx);
|
||||
rumpuser_cv_init(&lwp0cv);
|
||||
for (i = 0; i < ncpu; i++) {
|
||||
for (i = 0; i < numcpu; i++) {
|
||||
rcpu = &rcpu_storage[i];
|
||||
ci = &rump_cpus[i];
|
||||
rcpu->rcpu_ci = ci;
|
||||
|
|
Loading…
Reference in New Issue