static void clockintr(Ureg*, void*) { Clock0link *lp; int losttick = 0; OstmrReg *ost = OSTMRREG; {static int tag, led; if(++tag >= HZ){ledset(led ^= 1);tag=0;}} m->ticks++; // ost->osmr[3] = ost->oscr + timer_incr[3]; /* restart the watchdog */ ost->osmr[0] += timer_incr[0]; /* advance the clock tick */ ost->ossr = (1<<0); /* Clear the SR */ while((ost->osmr[0] - ost->oscr) >= 0x80000000) { ost->osmr[0] += timer_incr[0]; losttick++; m->ticks++; } checkalarms(); if(canlock(&clock0lock)){ for(lp = clock0link; lp; lp = lp->link) if(lp->clock) lp->clock(); unlock(&clock0lock); } /* round robin time slice is done by trap.c and proc.c */ }
void clockintr(Ureg *ur) { Clock0link *lp; /* PIT was set to reload automatically */ puttsr(~0); m->ticks++; if(up) up->pc = ur->pc; if(archclocktick != nil) archclocktick(); checkalarms(); if(m->machno == 0) { if(kproftick != nil) (*kproftick)(ur->pc); lock(&clock0lock); for(lp = clock0link; lp; lp = lp->link) lp->clock(); unlock(&clock0lock); } if(up && up->state == Running){ if(cflag && up->type == Interp && tready(nil)) ur->cr |= 1; /* set flag in condition register for ../../interp/comp-power.c:/^schedcheck */ if(anyready()) sched(); } }
void hzclock(Ureg *ur) { m->ticks++; if(m->proc) m->proc->pc = ur->pc; if(m->flushmmu){ if(up) flushmmu(); m->flushmmu = 0; } accounttime(); kmapinval(); if(kproftimer != nil) kproftimer(ur->pc); if((active.machs&(1<<m->machno)) == 0) return; if(active.exiting) { print("someone's exiting\n"); exit(0); } checkalarms(); if(up && up->state == Running) hzsched(); /* in proc.c */ }
static void clockintr(Ureg*, void*) { Clock0link *lp; m->ticks++; checkalarms(); if(canlock(&clock0lock)){ for(lp = clock0link; lp; lp = lp->link) if (lp->clock) lp->clock(); unlock(&clock0lock); } intrclear(TIMERbit(0), 0); }
void hzclock(Ureg *ur) { Proc *up = externup(); uintptr_t pc; machp()->ticks++; if(machp()->machno == 0) sys->ticks = machp()->ticks; pc = userpc(ur); if(machp()->proc) machp()->proc->pc = pc; if(machp()->mmuflush){ if(up) mmuflush(); machp()->mmuflush = 0; } accounttime(); kmapinval(); if(kproftimer != nil) kproftimer(pc); oprof_alarm_handler(ur); if(machp()->online == 0) return; if(active.exiting) { print("someone's exiting\n"); exit(0); } if(machp()->machno == 0) { /* since sys->ticks is only updated if machp()->machno == 0 */ checkalarms(); } if(up && up->state == Running) hzsched(); /* in proc.c */ }
static void clockintr(Ureg*, void*) { Clock0link *lp; static int blip, led; if(++blip >= HZ){ blip = 0; ledset(led ^= 1); } m->ticks++; checkalarms(); if(canlock(&clock0lock)){ for(lp = clock0link; lp; lp = lp->link) if(lp->clock) lp->clock(); unlock(&clock0lock); } /* round robin time slice is done by trap.c and proc.c */ }