/*
 * Level 10 (clock) interrupts from system counter.
 */
int
clockintr_4m(void *cap)
{

	/*
	 * XXX this needs to be fixed in a more general way
	 * problem is that the kernel enables interrupts and THEN
	 * sets up clocks. In between there's an opportunity to catch
	 * a timer interrupt - if we call hardclock() at that point we'll
	 * panic
	 * so for now just bail when cold
	 *
	 * For MP, we defer calling hardclock() to the schedintr so
	 * that we call it on all cpus.
	 */
	if (cold)
		return 0;
	kpreempt_disable();
	/* read the limit register to clear the interrupt */
	*((volatile int *)&timerreg4m->t_limit);
	tickle_tc();

	/*
	 * We don't have a system-clock per-cpu, and we'd like to keep
	 * the per-cpu timer for the statclock, so, send an IPI to
	 * everyone to call hardclock.
	 */
	handle_hardclock(cap);

	kpreempt_enable();
	return (1);
}
int
clockhandler(void *cookie)
{
	struct clockframe *frame = cookie;
	tickle_tc();

	hardclock(frame);
	return 0;	/* Pass the interrupt on down the chain */
}
示例#3
0
/*
 * Level 10 (clock) interrupts from system counter.
 */
int
clockintr_4(void *cap)
{

	/* read the limit register to clear the interrupt */
	*((volatile int *)&timerreg4->t_c10.t_limit);
	tickle_tc();
	hardclock((struct clockframe *)cap);
	return (1);
}