changelog shortlog tags branches changeset file revisions annotate raw help

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

revision 6855: 01468da33a6e
parent 6851: 817828d0da99
child 7155: 85c4b38d9a82
     1.1--- a/sys/src/9/bcm/main.c
     1.2+++ b/sys/src/9/bcm/main.c
     1.3@@ -242,7 +242,7 @@ launchinit(void)
     1.4 	}
     1.5 	cachedwbse(machaddr, sizeof machaddr);
     1.6 	if((mach = startcpus(conf.nmach)) < conf.nmach)
     1.7-			print("only %d cpu%s started\n", mach, mach == 1? "" : "s");
     1.8+		print("only %d cpu%s started\n", mach, mach == 1? "" : "s");
     1.9 }
    1.10 
    1.11 static void
    1.12@@ -551,10 +551,9 @@ confinit(void)
    1.13 }
    1.14 
    1.15 static void
    1.16-rebootjump(ulong entry, ulong code, ulong size)
    1.17+rebootjump(void *entry, void *code, ulong size)
    1.18 {
    1.19-	static void (*f)(ulong, ulong, ulong);
    1.20-	static Lock lk;
    1.21+	void (*f)(void*, void*, ulong);
    1.22 
    1.23 	intrsoff();
    1.24 	intrcpushutdown();
    1.25@@ -562,17 +561,10 @@ rebootjump(ulong entry, ulong code, ulon
    1.26 	/* redo identity map */
    1.27 	mmuinit1(1);
    1.28 
    1.29-	lock(&lk);
    1.30-	if(f == nil){
    1.31-		/* setup reboot trampoline function */
    1.32-		f = (void*)REBOOTADDR;
    1.33-		memmove(f, rebootcode, sizeof(rebootcode));
    1.34-		cachedwbse(f, sizeof(rebootcode));
    1.35-	}
    1.36-	unlock(&lk);
    1.37-
    1.38+	/* setup reboot trampoline function */
    1.39+	f = (void*)REBOOTADDR;
    1.40+	memmove(f, rebootcode, sizeof(rebootcode));
    1.41 	cacheuwbinv();
    1.42-	l2cacheuwbinv();
    1.43 
    1.44 	(*f)(entry, code, size);
    1.45 
    1.46@@ -587,9 +579,9 @@ exit(int)
    1.47 {
    1.48 	cpushutdown();
    1.49 	splfhi();
    1.50-	if(m->machno != 0)
    1.51-		rebootjump(0, 0, 0);
    1.52-	archreboot();
    1.53+	if(m->machno == 0)
    1.54+		archreboot();
    1.55+	rebootjump(0, 0, 0);
    1.56 }
    1.57 
    1.58 /*
    1.59@@ -609,13 +601,13 @@ void
    1.60 reboot(void *entry, void *code, ulong size)
    1.61 {
    1.62 	writeconf();
    1.63-	if (m->machno != 0) {
    1.64+	while(m->machno != 0){
    1.65 		procwired(up, 0);
    1.66 		sched();
    1.67 	}
    1.68 
    1.69 	cpushutdown();
    1.70-	delay(1000);
    1.71+	delay(2000);
    1.72 
    1.73 	splfhi();
    1.74 
    1.75@@ -630,7 +622,7 @@ reboot(void *entry, void *code, ulong si
    1.76 	wdogoff();
    1.77 
    1.78 	/* off we go - never to return */
    1.79-	rebootjump(PADDR(entry), PADDR(code), size);
    1.80+	rebootjump(entry, code, size);
    1.81 }
    1.82 
    1.83 void