pc, pc64: simplify reboot code

as we do system reset and reboot only from boot processor cpu0 now,
theres no need for active.rebooting conditional variable.
mpshutdown() will unconditionally park application processors and
and cpu0 boots the new kernel or calls mpshutdown() causing system
reset.
This commit is contained in:
cinap_lenrek 2014-05-29 18:50:52 +02:00
parent 215f6cc64a
commit 5246416621
5 changed files with 1 additions and 31 deletions

View file

@ -279,7 +279,6 @@ struct
int exiting; /* shutdown */ int exiting; /* shutdown */
int ispanic; /* shutdown in response to a panic */ int ispanic; /* shutdown in response to a panic */
int thunderbirdsarego; /* lets the added processors continue to schedinit */ int thunderbirdsarego; /* lets the added processors continue to schedinit */
int rebooting; /* about to rebooting another kernel */
}active; }active;
/* /*

View file

@ -188,7 +188,6 @@ mach0init(void)
active.machs = 1; active.machs = 1;
active.exiting = 0; active.exiting = 0;
active.rebooting = 0;
} }
void void
@ -972,21 +971,8 @@ reboot(void *entry, void *code, ulong size)
procwired(up, 0); procwired(up, 0);
sched(); sched();
} }
lock(&active);
active.rebooting = 1;
unlock(&active);
shutdown(0); shutdown(0);
/*
* should be the only processor running now
*/
if (m->machno != 0)
iprint("on cpu%d (not 0)!\n", m->machno);
if (active.machs)
iprint("still have active ap processors!\n");
iprint("shutting down...\n"); iprint("shutting down...\n");
delay(200); delay(200);

View file

@ -623,7 +623,7 @@ mpshutdown(void)
/* /*
* Park application processors. * Park application processors.
*/ */
if(active.rebooting || m->machno != 0){ if(m->machno != 0){
splhi(); splhi();
arch->introff(); arch->introff();
idle(); idle();

View file

@ -244,7 +244,6 @@ struct
int exiting; /* shutdown */ int exiting; /* shutdown */
int ispanic; /* shutdown in response to a panic */ int ispanic; /* shutdown in response to a panic */
int thunderbirdsarego; /* lets the added processors continue to schedinit */ int thunderbirdsarego; /* lets the added processors continue to schedinit */
int rebooting; /* about to rebooting another kernel */
}active; }active;
/* /*

View file

@ -291,7 +291,6 @@ mach0init(void)
active.machs = 1; active.machs = 1;
active.exiting = 0; active.exiting = 0;
active.rebooting = 0;
} }
@ -568,21 +567,8 @@ reboot(void *entry, void *code, ulong size)
procwired(up, 0); procwired(up, 0);
sched(); sched();
} }
lock(&active);
active.rebooting = 1;
unlock(&active);
shutdown(0); shutdown(0);
/*
* should be the only processor running now
*/
if (m->machno != 0)
iprint("on cpu%d (not 0)!\n", m->machno);
if (active.machs)
iprint("still have active ap processors!\n");
iprint("shutting down...\n"); iprint("shutting down...\n");
delay(200); delay(200);