194 return ((0xFFFFFFFF - t1) + t2);
195}
196
197static inline u32 ticks_elapsed_in_us(u32 t1, u32 t2)
198{
199 if (t2 >= t1)
200 return PM_TIMER_TICKS_TO_US(t2 - t1);
201 else if (!(acpi_gbl_FADT.flags & ACPI_FADT_32BIT_TIMER))
202 return PM_TIMER_TICKS_TO_US(((0x00FFFFFF - t1) + t2) & 0x00FFFFFF);
203 else
204 return PM_TIMER_TICKS_TO_US((0xFFFFFFFF - t1) + t2);
205}
206
207
208
209
210
211static void acpi_safe_halt(void)
212{
213 current_thread_info()->status &= ~TS_POLLING;
214
215
216
217
218 smp_mb();
219 if (!need_resched()) {
220 safe_halt();
221 local_irq_disable();
222 }
223 current_thread_info()->status |= TS_POLLING;
224}
225
226#ifndef CONFIG_CPU_IDLE
227
228static void
229acpi_processor_power_activate(struct acpi_processor *pr,
230 struct acpi_processor_cx *new)
231{
232 struct acpi_processor_cx *old;
233
234 if (!pr || !new)