]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/mtx/main.c
kernel: get rid of active.Lock and active.thunderbirdsargo
[plan9front.git] / sys / src / 9 / mtx / main.c
index 491580101e79c2294558ee73a47c0d98f3af2195..1ce07155b55385ea4752be4f0836909935fbd9d7 100644 (file)
@@ -59,7 +59,7 @@ machinit(void)
        /* turn on caches */
        puthid0(gethid0() | BIT(16) | BIT(17));
 
-       active.machs = 1;
+       active.machs[0] = 1;
        active.exiting = 0;
 }
 
@@ -211,42 +211,12 @@ userinit(void)
 void
 reboot(void*, void*, ulong)
 {
-       exit(0);
 }
 
 void
-exit(int ispanic)
+exit(int)
 {
-       int ms, once;
-
-       lock(&active);
-       if(ispanic)
-               active.ispanic = ispanic;
-       else if(m->machno == 0 && (active.machs & (1<<m->machno)) == 0)
-               active.ispanic = 0;
-       once = active.machs & (1<<m->machno);
-       active.machs &= ~(1<<m->machno);
-       active.exiting = 1;
-       unlock(&active);
-
-       if(once)
-               print("cpu%d: exiting\n", m->machno);
-       spllo();
-       for(ms = 5*1000; ms > 0; ms -= TK2MS(2)){
-               delay(TK2MS(2));
-               if(active.machs == 0 && consactive() == 0)
-                       break;
-       }
-
-       if(active.ispanic && m->machno == 0){
-               if(cpuserver)
-                       delay(10000);
-               else if(conf.monitor)
-                       for(;;);
-       }
-       else
-               delay(1000);
-
+       cpushutdown();
        watchreset();
 }