void archconsole(void);
+/* dummy for usb */
+int
+isaconfig(char *, int, ISAConf *)
+{
+ return 0;
+}
+
/*
* entered from l.s with mmu enabled.
*
chandevreset(); /* most devices are discovered here */
pageinit();
- swapinit();
userinit();
schedinit();
panic("schedinit returned");
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();
}
{
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;
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();
}
/*
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);
/*
* 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;
+ conf.nproc*sizeof(Proc)
+ conf.nimage*sizeof(Image)
+ conf.nswap
- + conf.nswppo*sizeof(Page);
+ + conf.nswppo*sizeof(Page*);
mainmem->maxsize = kpages;
if(!cpuserver)
/*
{
return cas32(addr, old, new);
}
+
+void
+setupwatchpts(Proc *, Watchpt *, int n)
+{
+ if(n > 0)
+ error("no watchpoints");
+}