plan 9 kernel history: overview | file list | diff list

1990/1226/ss/clock.c (diff list | history)

ss/clock.c on 1990/1223
1990/1223    
#include	"u.h" 
#include	"lib.h" 
#include	"mem.h" 
#include	"dat.h" 
#include	"fns.h" 
#include	"io.h" 
 
#include	"ureg.h" 
 
void 
delay(int ms) 
{ 
	ulong t, *p; 
	int i; 
 
1990/1226    
	ms *= 2000;	/* experimentally determined */ 
1990/1223    
	for(i=0; i<ms; i++) 
		; 
} 
 
void 
clock(Ureg *ur) 
{ 
	Proc *p; 
 
	SYNCREG[1] = 0x5F;	/* clear interrupt */ 
	m->ticks++; 
	p = m->proc; 
	if(p){ 
		p->pc = ur->pc; 
		if (p->state==Running) 
			p->time[p->insyscall]++; 
	} 
	checkalarms(); 
	kbdclock(); 
	mouseclock(); 
1990/1226    
	if((ur->psr&SPL(7)) == 0 && p && p->state==Running){ 
1990/1223    
		sched(); 
1990/1226    
		if(u->nnote && (ur->psr&PSRSUPER)==0) 
1990/1223    
			notify(ur); 
	} 
} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)