Hardware Reference
In-Depth Information
/*-----------------------------------------------------------*/
/* wake up -- timer interrupt handling routine */
/*-----------------------------------------------------------*/
void wake up (void)
proc p;
int
count = 0;
save context();
sys clock++;
if (sys clock >= LIFETIME) abort(TIME EXPIRED);
if (vdes[pexe].type == HARD)
if (sys clock > vdes[pexe].dline)
abort(TIME OVERFLOW);
while ( !empty(zombie) &&
(firstdline(zombie) <= sys clock)) {
p = getfirst(&zombie);
util fact = util fact - vdes[p].util;
vdes[p].state = FREE;
insert(p, &freetcb);
while (!empty(idle) && (firstdline(idle) <= sys clock))
{
p = getfirst(&idle);
vdes[p].dline += (long)vdes[p].period;
vdes[p].state = READY;
insert(p, &ready);
count++;
if (count > 0) schedule();
load context();
}
Search WWH ::




Custom Search