summaryrefslogtreecommitdiffstats
path: root/include/asm-x86/irqflags_32.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/irqflags_32.h')
-rw-r--r--include/asm-x86/irqflags_32.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asm-x86/irqflags_32.h b/include/asm-x86/irqflags_32.h
index d058b04e0083..4c7720089cb5 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__ */
/*
OpenPOWER on IntegriCloud