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

1991/0705/pc/clock.c (diff list | history)

1991/0704/sys/src/9/pc/clock.c:4,111991/0705/sys/src/9/pc/clock.c:4,22 (short | long | prev | next)
1991/0704    
#include	"dat.h" 
#include	"fns.h" 
#include	"io.h" 
#include	"ureg.h" 
 
1991/0705    
/* 
 *  8253 timer 
 */ 
enum 
{ 
	Timerctl=	0x43,		/* control port */ 
	Timercnt=	0x40,		/* timer count port (outb count-1) */ 
	Timericnt=	0x41,		/* timer count input port */ 
 
	Timerlatch=	0x40,		/* latch count into Timericnt */ 
}; 
 
1991/0704    
void 
clockinit(void) 
{ 
1991/0704/sys/src/9/pc/clock.c:12,141991/0705/sys/src/9/pc/clock.c:23,33
1991/0704    
	setvec(Clockvec, clock, SEGIG); 
} 
 
1991/0705    
void 
clock(void *arg) 
{ 
	m->ticks++; 
	if((m->ticks%185)==0) 
		print("%d secs\n", TK2SEC(m->ticks)); 
	INT0ENABLE; 
} 


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