103
103
rthal_local_irq_save_hw(flags);
104
104
apic_wait_icr_idle();
105
apic_write_around(APIC_ICR,
106
106
APIC_DM_FIXED | APIC_DEST_ALLBUT | INT_DEST_ADDR_MODE
108
108
rthal_local_irq_restore_hw(flags);
132
132
struct clock_event_device *cdev),
135
unsigned long tmfreq;
135
unsigned long dummy, *tmfreq = &dummy;
136
int tickval, err, res;
138
if (cpu_timers_requested == 0) {
139
err = rthal_irq_request(RTHAL_APIC_TIMER_IPI,
140
(rthal_irq_handler_t) tick_handler,
138
146
/* This code works both for UP+LAPIC and SMP configurations. */
148
if (rthal_timerfreq_arg == 0)
149
tmfreq = &rthal_tunables.timer_freq;
140
151
#ifdef __IPIPE_FEATURE_REQUEST_TICKDEV
141
int res = ipipe_request_tickdev("lapic", mode_emul, tick_emul, cpu,
152
res = ipipe_request_tickdev("lapic", mode_emul, tick_emul, cpu,
144
int res = ipipe_request_tickdev("lapic",
145
(compat_emumode_t)mode_emul,
146
(compat_emutick_t)tick_emul,
148
tmfreq = RTHAL_COMPAT_TIMERFREQ;
155
*tmfreq = RTHAL_COMPAT_TIMERFREQ;
156
res = ipipe_request_tickdev("lapic", (compat_emumode_t)mode_emul,
157
(compat_emutick_t)tick_emul, cpu);
169
178
case CLOCK_EVT_MODE_SHUTDOWN:
183
if (cpu_timers_requested == 0)
184
rthal_irq_release(RTHAL_APIC_TIMER_IPI);
175
187
rthal_ktimer_saved_mode = res;
177
if (rthal_timerfreq_arg == 0)
178
rthal_tunables.timer_freq = tmfreq;
181
190
* The rest of the initialization should only be performed
182
191
* once by a single CPU.
184
if (cpu_timers_requested++ > 0)
187
err = rthal_irq_request(RTHAL_APIC_TIMER_IPI,
188
(rthal_irq_handler_t) tick_handler, NULL, NULL);
193
rthal_timer_set_oneshot(1);
195
rthal_nmi_init(&rthal_latency_above_max);
193
if (cpu_timers_requested++ == 0) {
194
rthal_timer_set_oneshot(1);
196
rthal_nmi_init(&rthal_latency_above_max);
271
273
rthal_nmi_release();
273
rthal_irq_release(RTHAL_APIC_TIMER_IPI);
275
275
if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
276
276
rthal_timer_set_periodic();
277
277
else if (rthal_ktimer_saved_mode == KTIMER_MODE_ONESHOT)
278
278
rthal_timer_set_oneshot(0);
280
rthal_irq_release(RTHAL_APIC_TIMER_IPI);