1 /* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1)
5 * wrapper around irq_to_desc. Using KALLSYMS to get its address when
6 * available, else we need to have a kernel that exports this function to GPL
7 * modules. This export was added to the 3.4 kernels and removed in 5.11.
9 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 #include <lttng-kernel-version.h>
13 #include <linux/module.h>
15 #if (defined(CONFIG_KALLSYMS) && \
16 ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) || \
17 (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,4,0))))
19 #include <linux/kallsyms.h>
20 #include <linux/interrupt.h>
21 #include <linux/irqnr.h>
22 #include <wrapper/kallsyms.h>
23 #include <wrapper/irqdesc.h>
26 struct irq_desc
*(*irq_to_desc_sym
)(unsigned int irq
);
28 struct irq_desc
*wrapper_irq_to_desc(unsigned int irq
)
31 irq_to_desc_sym
= (void *) kallsyms_lookup_funcptr("irq_to_desc");
32 if (irq_to_desc_sym
) {
33 return irq_to_desc_sym(irq
);
35 printk_once(KERN_WARNING
"LTTng: irq_to_desc symbol lookup failed.\n");
39 EXPORT_SYMBOL_GPL(wrapper_irq_to_desc
);
43 #include <linux/interrupt.h>
44 #include <linux/irqnr.h>
46 struct irq_desc
*wrapper_irq_to_desc(unsigned int irq
)
48 return irq_to_desc(irq
);
50 EXPORT_SYMBOL_GPL(wrapper_irq_to_desc
);
This page took 0.029587 seconds and 4 git commands to generate.