参考文档:
<IRQ-domain.txt>
http://www.wowotech.net/linux_kenrel/irq-domain.html
https://blog.youkuaiyun.com/weixin_41028621/article/details/101448227
1.irq_domain的数据结构
./include/linux/irqdomain.h
struct irq_domain {
struct list_head link;
const char *name;
const struct irq_domain_ops *ops;
void *host_data;
unsigned int flags;
unsigned int mapcount;
/* Optional data */
struct fwnode_handle *fwnode;
enum irq_domain_bus_token bus_token;
struct irq_domain_chip_generic *gc;
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
struct irq_domain *parent;
#endif
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
struct dentry *debugfs_file;
#endif
/* reverse map data. The linear map gets appended to the irq_domain */
irq_hw_number_t hwirq_max;
unsigned int revmap_direct_max_irq;
unsigned int revmap_size;
struct radix_tree_root revmap_tree;
unsigned int linear_revmap[];
};
2.详细解释
struct irq_domain_ops:
HIERARCHY英文原意为层级,等级的意思,这里是指级联,即中断控制器的级联
可以理解为:CONFIG_IRQ_DOMAIN_HIERARCHY宏为中断控制器级联开关
如果不存在中断控制器级联,则使用match/select/map/unmap/xlate
如果中断控制器存在级联,则使用alloc/free/activate/deactivate/translate