Cleanup: Move wrapper/ headers to include/wrapper/
[lttng-modules.git] / include / wrapper / irqflags.h
1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
2 *
3 * wrapper/irqflags.h
4 *
5 * wrapper around IRQ flags.
6 *
7 * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 */
9
10 #ifndef _LTTNG_WRAPPER_IRQFLAGS_H
11 #define _LTTNG_WRAPPER_IRQFLAGS_H
12
13 #include <linux/version.h>
14 #include <linux/irqflags.h>
15
16 #ifdef CONFIG_X86
17
18 static inline
19 int lttng_regs_irqs_disabled(struct pt_regs *regs)
20 {
21 unsigned long flags = regs->flags;
22
23 return raw_irqs_disabled_flags(flags);
24 }
25
26 #else
27 /*
28 * lttng_regs_irqs_disabled() returns -1 if irqoff state is unknown.
29 * TODO: should implement lttng_regs_irqs_disabled for each architecture
30 * to add interruptible context for kprobes and kretprobes.
31 */
32
33 static inline
34 int lttng_regs_irqs_disabled(struct pt_regs *regs)
35 {
36 return -1;
37 }
38 #endif
39
40 #endif /* _LTTNG_WRAPPER_IRQFLAGS_H */
This page took 0.028997 seconds and 4 git commands to generate.