projects/linux·blob master · refs

44 lines · 1.1 KiB

1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _KERNEL_IRQ_DEBUGFS_H
3#define _KERNEL_IRQ_DEBUGFS_H
4
5#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
6#include <linux/debugfs.h>
7
8struct irq_bit_descr {
9 unsigned int mask;
10 char *name;
11};
12
13#define BIT_MASK_DESCR(m) { .mask = m, .name = #m }
14
15void irq_debug_show_bits(struct seq_file *m, int ind, unsigned int state,
16 const struct irq_bit_descr *sd, int size);
17
18void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc);
19static inline void irq_remove_debugfs_entry(struct irq_desc *desc)
20{
21 debugfs_remove(desc->debugfs_file);
22 kfree(desc->dev_name);
23}
24void irq_debugfs_copy_devname(int irq, struct device *dev);
25# ifdef CONFIG_IRQ_DOMAIN
26void irq_domain_debugfs_init(struct dentry *root);
27# else
28static inline void irq_domain_debugfs_init(struct dentry *root)
29{
30}
31# endif
32#else /* CONFIG_GENERIC_IRQ_DEBUGFS */
33static inline void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *d)
34{
35}
36static inline void irq_remove_debugfs_entry(struct irq_desc *d)
37{
38}
39static inline void irq_debugfs_copy_devname(int irq, struct device *dev)
40{
41}
42#endif /* CONFIG_GENERIC_IRQ_DEBUGFS */
43
44#endif