diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-03-16 20:22:59 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-03-16 20:22:59 +0100 |
commit | f2f46f4a33ee9ccb4f0475163408b8a699ec4f7f (patch) | |
tree | 85d1888b32ac4984282a9717612f0ad03ea2a306 /sys/src/9/pc/main.c | |
parent | 105625e10b469d4012c148154563007cfa3acc4d (diff) |
pc64: amd64 kernel reboot support
Diffstat (limited to 'sys/src/9/pc/main.c')
-rw-r--r-- | sys/src/9/pc/main.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/src/9/pc/main.c b/sys/src/9/pc/main.c index 62d6a192a..c947bb816 100644 --- a/sys/src/9/pc/main.c +++ b/sys/src/9/pc/main.c @@ -188,6 +188,7 @@ mach0init(void) active.machs = 1; active.exiting = 0; + active.rebooting = 0; } void @@ -936,8 +937,7 @@ shutdown(int ispanic) delay(5*60*1000); else delay(10000); - }else - delay(1000); + } } void @@ -959,17 +959,21 @@ reboot(void *entry, void *code, ulong size) sched(); } + lock(&active); + active.rebooting = 1; + unlock(&active); + shutdown(0); /* * should be the only processor running now */ if (m->machno != 0) - print("on cpu%d (not 0)!\n", m->machno); + iprint("on cpu%d (not 0)!\n", m->machno); if (active.machs) - print("still have active ap processors!\n"); + iprint("still have active ap processors!\n"); - print("shutting down...\n"); + iprint("shutting down...\n"); delay(200); splhi(); @@ -993,11 +997,9 @@ reboot(void *entry, void *code, ulong size) f = (void*)REBOOTADDR; memmove(f, rebootcode, sizeof(rebootcode)); - print("rebooting...\n"); - /* off we go - never to return */ coherence(); - (*f)(PADDR(entry), PADDR(code), size); + (*f)((ulong)entry & ~0xF0000000UL, PADDR(code), size); } |