kernel: more kproc pexit() and sleep error handling

This commit is contained in:
cinap_lenrek 2013-11-22 22:56:34 +01:00
parent 55d31f2cab
commit 98f47d5867
10 changed files with 23 additions and 3 deletions

View file

@ -237,6 +237,9 @@ powerkproc(void*)
{
ulong xlink, xlink1;
while(waserror())
;
for(;;){
while(powerflag == 0)
sleep(&powerr, powerdown, 0);
@ -247,7 +250,6 @@ powerkproc(void*)
deepsleep();
xlink1 = getcallerpc(&xlink1);
delay(2000);
// iprint("deepsleep returned, pc = 0x%lux, sp = 0x%lux\n", xlink1, &xlink);

View file

@ -682,6 +682,8 @@ w_timer(void* arg)
Ctlr* ctlr = (Ctlr*)ether->ctlr;
ctlr->timerproc = up;
while(waserror())
;
for(;;){
tsleep(&up->sleep, return0, 0, MSperTick);
ctlr = (Ctlr*)ether->ctlr;
@ -732,7 +734,7 @@ w_timer(void* arg)
}
iunlock(ctlr);
}
pexit("terminated", 0);
pexit("terminated", 1);
}
void

View file

@ -1145,6 +1145,8 @@ ilackproc(void *x)
il = x;
while(waserror())
;
loop:
tsleep(&up->sleep, return0, 0, Iltickms);
for(s = il->conv; s && *s; s++) {

View file

@ -733,6 +733,8 @@ relackproc(void *a)
rudp = (Proto *)a;
while(waserror())
;
loop:
tsleep(&up->sleep, return0, 0, Rudptickms);

View file

@ -747,6 +747,9 @@ tcpackproc(void *a)
tcp = a;
priv = tcp->priv;
while(waserror())
;
for(;;) {
tsleep(&up->sleep, return0, 0, MSPTICK);

View file

@ -776,6 +776,8 @@ rcvproc(void* arg)
ether = arg;
ctlr = ether->ctlr;
while(waserror())
;
for(;;){
tsleep(&ctlr->rrendez, gotinput, ctlr, 10*1000);
ilock(ctlr);

View file

@ -76,6 +76,9 @@ mmusweep(void*)
int i, x, sweepcolor;
ulong *ptab, *ptabend, ptecol;
while(waserror())
;
for(;;) {
if(PIDCOLOR(m->mmupid) != m->trigcolor)
sleep(&m->sweepr, work, nil);

View file

@ -80,6 +80,9 @@ mmusweep(void*)
int i, x, sweepcolor;
ulong *ptab, *ptabend, ptecol;
while(waserror())
;
for(;;) {
if(PIDCOLOR(m->mmupid) != m->trigcolor)
sleep(&m->sweepr, work, nil);

View file

@ -855,6 +855,8 @@ rproc(void* arg)
edev = arg;
ctlr = edev->ctlr;
while(waserror())
;
for(;;){
/* wait for next interrupt */
ilock(&ctlr->reglock);

View file

@ -692,7 +692,6 @@ init0(void)
poperror();
}
kproc("alarm", alarmkproc, 0);
// kproc("startcpusproc", startcpusproc, nil);
touser(sp);
}