1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 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 <lttng/kernel-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 */
|