Cleanup: Move wrapper/ headers to include/wrapper/
[lttng-modules.git] / include / wrapper / irqflags.h
diff --git a/include/wrapper/irqflags.h b/include/wrapper/irqflags.h
new file mode 100644 (file)
index 0000000..3037eae
--- /dev/null
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
+ * wrapper/irqflags.h
+ *
+ * wrapper around IRQ flags.
+ *
+ * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_WRAPPER_IRQFLAGS_H
+#define _LTTNG_WRAPPER_IRQFLAGS_H
+
+#include <linux/version.h>
+#include <linux/irqflags.h>
+
+#ifdef CONFIG_X86
+
+static inline
+int lttng_regs_irqs_disabled(struct pt_regs *regs)
+{
+       unsigned long flags = regs->flags;
+
+       return raw_irqs_disabled_flags(flags);
+}
+
+#else
+/*
+ * lttng_regs_irqs_disabled() returns -1 if irqoff state is unknown.
+ * TODO: should implement lttng_regs_irqs_disabled for each architecture
+ * to add interruptible context for kprobes and kretprobes.
+ */
+
+static inline
+int lttng_regs_irqs_disabled(struct pt_regs *regs)
+{
+       return -1;
+}
+#endif
+
+#endif /* _LTTNG_WRAPPER_IRQFLAGS_H */
This page took 0.023919 seconds and 4 git commands to generate.