changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/bcm/main.c

revision 4993: 7e93ea0d48d1
parent 4250: d819f0505c21
child 5034: 8d305ed78c96
     1.1--- a/sys/src/9/bcm/main.c
     1.2+++ b/sys/src/9/bcm/main.c
     1.3@@ -522,39 +522,13 @@ confinit(void)
     1.4 
     1.5 }
     1.6 
     1.7-static void
     1.8-shutdown(int ispanic)
     1.9-{
    1.10-	int ms, once;
    1.11-
    1.12-	lock(&active);
    1.13-	if(ispanic)
    1.14-		active.ispanic = ispanic;
    1.15-	else if(m->machno == 0 && (active.machs & (1<<m->machno)) == 0)
    1.16-		active.ispanic = 0;
    1.17-	once = active.machs & (1<<m->machno);
    1.18-	active.machs &= ~(1<<m->machno);
    1.19-	active.exiting = 1;
    1.20-	unlock(&active);
    1.21-
    1.22-	if(once)
    1.23-		iprint("cpu%d: exiting\n", m->machno);
    1.24-	spllo();
    1.25-	for(ms = 5*1000; ms > 0; ms -= TK2MS(2)){
    1.26-		delay(TK2MS(2));
    1.27-		if(active.machs == 0 && consactive() == 0)
    1.28-			break;
    1.29-	}
    1.30-	delay(1000);
    1.31-}
    1.32-
    1.33 /*
    1.34  *  exit kernel either on a panic or user request
    1.35  */
    1.36 void
    1.37-exit(int code)
    1.38+exit(int)
    1.39 {
    1.40-	shutdown(code);
    1.41+	cpushutdown();
    1.42 	splfhi();
    1.43 	archreboot();
    1.44 }
    1.45@@ -579,17 +553,8 @@ reboot(void *entry, void *code, ulong si
    1.46 {
    1.47 	void (*f)(ulong, ulong, ulong);
    1.48 
    1.49-	print("starting reboot...");
    1.50 	writeconf();
    1.51-	shutdown(0);
    1.52-
    1.53-	/*
    1.54-	 * should be the only processor running now
    1.55-	 */
    1.56-
    1.57-	print("reboot entry %#lux code %#lux size %ld\n",
    1.58-		PADDR(entry), PADDR(code), size);
    1.59-	delay(100);
    1.60+	cpushutdown();
    1.61 
    1.62 	/* turn off buffered serial console */
    1.63 	serialoq = nil;
    1.64@@ -612,10 +577,6 @@ reboot(void *entry, void *code, ulong si
    1.65 
    1.66 	/* off we go - never to return */
    1.67 	(*f)(PADDR(entry), PADDR(code), size);
    1.68-
    1.69-	iprint("loaded kernel returned!\n");
    1.70-	delay(1000);
    1.71-	archreboot();
    1.72 }
    1.73 
    1.74 int