/* Setup the lapic timer in periodic or oneshot mode  */
static void lapic_timer_setup(enum clock_event_mode mode, struct clock_event_device *evt)
/* Setup the lapic timer in periodic or oneshot mode  */
static void lapic_timer_setup(enum clock_event_mode mode, struct clock_event_device *evt)
{
	unsigned long flags;
	unsigned int v;
	if (evt->features & CLOCK_EVT_FEAT_DUMMY)
		return;
	local_irq_save(flags);
	switch (mode) {
	case CLOCK_EVT_MODE_PERIODIC:
	case CLOCK_EVT_MODE_ONESHOT:
		__setup_APIC_LVTT(calibration_result,
				  mode != CLOCK_EVT_MODE_PERIODIC, 1);
		break;
	case CLOCK_EVT_MODE_UNUSED:
	case CLOCK_EVT_MODE_SHUTDOWN:
		v = apic_read(APIC_LVTT);
		v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
		apic_write(APIC_LVTT, v);
		apic_write(APIC_TMICT, 0);
		break;
	case CLOCK_EVT_MODE_RESUME:
		break;
	}
	local_irq_restore(flags);
}