diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-10-25 14:01:10 +0200 |
---|---|---|
committer | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-10-25 14:01:10 +0200 |
commit | 143a5d325d35efb1b29dcb8d6031cf27107e183a (patch) | |
tree | def297c7608722df2b5a51e5e6acaacb1aeb1f97 /include/asm-x86 | |
parent | c9927c2bf4f45bb85e8b502ab3fb79ad6483c244 (diff) | |
download | kernel_samsung_tuna-143a5d325d35efb1b29dcb8d6031cf27107e183a.zip kernel_samsung_tuna-143a5d325d35efb1b29dcb8d6031cf27107e183a.tar.gz kernel_samsung_tuna-143a5d325d35efb1b29dcb8d6031cf27107e183a.tar.bz2 |
lockdep: fixup irq tracing
Ensure we fixup the IRQ state before we hit any locking code.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/irqflags_32.h | 21 | ||||
-rw-r--r-- | include/asm-x86/irqflags_64.h | 20 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/asm-x86/irqflags_32.h b/include/asm-x86/irqflags_32.h index d058b04..4c77200 100644 --- a/include/asm-x86/irqflags_32.h +++ b/include/asm-x86/irqflags_32.h @@ -129,6 +129,27 @@ static inline int raw_irqs_disabled(void) return raw_irqs_disabled_flags(flags); } + +/* + * makes the traced hardirq state match with the machine state + * + * should be a rarely used function, only in places where its + * otherwise impossible to know the irq state, like in traps. + */ +static inline void trace_hardirqs_fixup_flags(unsigned long flags) +{ + if (raw_irqs_disabled_flags(flags)) + trace_hardirqs_off(); + else + trace_hardirqs_on(); +} + +static inline void trace_hardirqs_fixup(void) +{ + unsigned long flags = __raw_local_save_flags(); + + trace_hardirqs_fixup_flags(flags); +} #endif /* __ASSEMBLY__ */ /* diff --git a/include/asm-x86/irqflags_64.h b/include/asm-x86/irqflags_64.h index 5341ea1..bb9163b 100644 --- a/include/asm-x86/irqflags_64.h +++ b/include/asm-x86/irqflags_64.h @@ -112,6 +112,26 @@ static inline int raw_irqs_disabled(void) } /* + * makes the traced hardirq state match with the machine state + * + * should be a rarely used function, only in places where its + * otherwise impossible to know the irq state, like in traps. + */ +static inline void trace_hardirqs_fixup_flags(unsigned long flags) +{ + if (raw_irqs_disabled_flags(flags)) + trace_hardirqs_off(); + else + trace_hardirqs_on(); +} + +static inline void trace_hardirqs_fixup(void) +{ + unsigned long flags = __raw_local_save_flags(); + + trace_hardirqs_fixup_flags(flags); +} +/* * Used in the idle loop; sti takes one instruction cycle * to complete: */ |