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

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

1991/0808/sys/src/9/pc/clock.c:94,1301991/0822/sys/src/9/pc/clock.c:94,96 (short | long | prev | next)
1991/0802    
		} 
	} 
1991/0808    
} 
                 
/* 
 *  a faster (1 MS) clock tick for a non-interrupting serial port or 
 *  kernel profiling.  m->ticks still increments as usual. 
 */ 
void 
fclock(Ureg *ur) 
{ 
	static ulong ticks; 
                 
	uartintr0(ur);		/* poll the serial port */ 
	if((ticks++ % (FHZ/HZ)) == 0) 
		clock(ur); 
} 
                 
void 
fclockinit(void) 
{ 
	int x; 
                 
	/* 
	 *  set vector for clock interrupts 
	 */ 
	setvec(Clockvec, fclock); 
                 
	/* 
	 *  make clock output a square wave with a 1/FHZ period 
	 */ 
	x = splhi(); 
	outb(Tmode, Load0square); 
	outb(T0cntr, (Freq/FHZ));	/* low byte */ 
	outb(T0cntr, (Freq/FHZ)>>8);	/* high byte */ 
	splx(x); 
1991/0705    
} 


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