]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/kw/main.c
kernel: remove ptclbsum dependencies from configs
[plan9front.git] / sys / src / 9 / kw / main.c
index ed8aa6d3b2a9bc93f639155c77f6db4050d00ea7..ff9a7ee34a55bd1707f89a5bc84d211f48e3a881 100644 (file)
@@ -322,7 +322,6 @@ wave(' ');
        chandevreset();                 /* most devices are discovered here */
 
        pageinit();
-       swapinit();
        userinit();
        schedinit();
        panic("schedinit returned");
@@ -349,45 +348,19 @@ machinit(void)
 
        conf.nmach = 1;
 
-       active.machs = 1;
+       active.machs[0] = 1;
        active.exiting = 0;
 
        up = nil;
 }
 
-static void
-shutdown(int ispanic)
-{
-       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)
-               iprint("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;
-       }
-       delay(1000);
-}
-
 /*
  *  exit kernel either on a panic or user request
  */
 void
-exit(int code)
+exit(int)
 {
-       shutdown(code);
+       cpushutdown();
        splhi();
        archreboot();
 }
@@ -401,17 +374,8 @@ reboot(void *entry, void *code, ulong size)
 {
        void (*f)(ulong, ulong, ulong);
 
-       iprint("starting reboot...");
        writeconf();
-       
-       shutdown(0);
-
-       /*
-        * should be the only processor running now
-        */
-
-       print("shutting down...\n");
-       delay(200);
+       cpushutdown();
 
        /* turn off buffered serial console */
        serialoq = nil;
@@ -430,19 +394,10 @@ reboot(void *entry, void *code, ulong size)
        cacheuwbinv();
        l2cacheuwb();
 
-       print("rebooting...");
-       iprint("entry %#lux code %#lux size %ld\n",
-               PADDR(entry), PADDR(code), size);
-       delay(100);             /* wait for uart to quiesce */
-
        /* off we go - never to return */
        cacheuwbinv();
        l2cacheuwb();
        (*f)(PADDR(entry), PADDR(code), size);
-
-       iprint("loaded kernel returned!\n");
-       delay(1000);
-       archreboot();
 }
 
 /*
@@ -587,7 +542,7 @@ userinit(void)
        s->flushme++;
        p->seg[TSEG] = s;
        pg = newpage(1, 0, UTZERO);
-       memset(pg->cachectl, PG_TXTFLUSH, sizeof(pg->cachectl));
+       pg->txtflush = ~0;
        segpage(s, pg);
        k = kmap(s->map[0]->pages[0]);
        memmove(UINT2PTR(VA(k)), initcode, sizeof initcode);
@@ -658,8 +613,7 @@ confinit(void)
 
        /*
         * Guess how much is taken by the large permanent
-        * datastructures. Mntcache and Mntrpc are not accounted for
-        * (probably ~300KB).
+        * datastructures. Mntcache and Mntrpc are not accounted for.
         */
        kpages = conf.npage - conf.upages;
        kpages *= BY2PG;
@@ -683,3 +637,10 @@ cmpswap(long *addr, long old, long new)
 {
        return cas32(addr, old, new);
 }
+
+void
+setupwatchpts(Proc *, Watchpt *, int n)
+{
+       if(n > 0)
+               error("no watchpoints");
+}