diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-05-29 18:50:52 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-05-29 18:50:52 +0200 |
commit | 52464166216095a5747f7541eff179ecf8d94e1f (patch) | |
tree | 410fdc01729b45bd21abfd8feafe51a62fca4dde /sys | |
parent | 215f6cc64a65efbe0a71b8fdba72311201aca4fc (diff) |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/9/pc/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/pc/main.c | 14 | ||||
-rw-r--r-- | sys/src/9/pc/mp.c | 2 | ||||
-rw-r--r-- | sys/src/9/pc64/dat.h | 1 | ||||
-rw-r--r-- | sys/src/9/pc64/main.c | 14 |
5 files changed, 1 insertions, 31 deletions
diff --git a/sys/src/9/pc/dat.h b/sys/src/9/pc/dat.h index 5e5b4ea3a..a4544debf 100644 --- a/sys/src/9/pc/dat.h +++ b/sys/src/9/pc/dat.h @@ -279,7 +279,6 @@ struct int exiting; /* shutdown */ int ispanic; /* shutdown in response to a panic */ int thunderbirdsarego; /* lets the added processors continue to schedinit */ - int rebooting; /* about to rebooting another kernel */ }active; /* diff --git a/sys/src/9/pc/main.c b/sys/src/9/pc/main.c index 2aac28073..f1e40b6de 100644 --- a/sys/src/9/pc/main.c +++ b/sys/src/9/pc/main.c @@ -188,7 +188,6 @@ mach0init(void) active.machs = 1; active.exiting = 0; - active.rebooting = 0; } void @@ -972,21 +971,8 @@ reboot(void *entry, void *code, ulong size) procwired(up, 0); sched(); } - - lock(&active); - active.rebooting = 1; - unlock(&active); - 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"); delay(200); diff --git a/sys/src/9/pc/mp.c b/sys/src/9/pc/mp.c index a3afc885d..ef027ece6 100644 --- a/sys/src/9/pc/mp.c +++ b/sys/src/9/pc/mp.c @@ -623,7 +623,7 @@ mpshutdown(void) /* * Park application processors. */ - if(active.rebooting || m->machno != 0){ + if(m->machno != 0){ splhi(); arch->introff(); idle(); diff --git a/sys/src/9/pc64/dat.h b/sys/src/9/pc64/dat.h index d188508b0..c5426b986 100644 --- a/sys/src/9/pc64/dat.h +++ b/sys/src/9/pc64/dat.h @@ -244,7 +244,6 @@ struct int exiting; /* shutdown */ int ispanic; /* shutdown in response to a panic */ int thunderbirdsarego; /* lets the added processors continue to schedinit */ - int rebooting; /* about to rebooting another kernel */ }active; /* diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c index 31268638c..175fac319 100644 --- a/sys/src/9/pc64/main.c +++ b/sys/src/9/pc64/main.c @@ -291,7 +291,6 @@ mach0init(void) active.machs = 1; active.exiting = 0; - active.rebooting = 0; } @@ -568,21 +567,8 @@ reboot(void *entry, void *code, ulong size) procwired(up, 0); sched(); } - - lock(&active); - active.rebooting = 1; - unlock(&active); - 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"); delay(200); |