下面看 ./drivers/irqchip/irq-gic-v3.c
看 IRQCHIP_DECLARE(gic_v3, "arm,gic-v3", gic_of_init);
#define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn)
1185 #define OF_DECLARE_2(table, name, compat, fn) \
1186 _OF_DECLARE(table, name, compat, fn, of_init_fn_2)
_OF_DECLARE(irqchip, name, compat, fn, of_init_fn_2)
1170 #define _OF_DECLARE(table, name, compat, fn, fn_type) \
1171 static const struct of_device_id __of_table_##name \
1172 __attribute__((unused)) \
1173 = { .compatible = compat, \
1174 .data = (fn == (fn_type)NULL) ? fn : fn }
static const struct of_device_id __of_table_gic_v3 __attribute__((unused))
= {
.compatible = "arm,gic-v3",
.data = gic_of_init,
}
在4.0开发板内核中
933 #define _OF_DECLARE(table, name, compat, fn, fn_type) \
934 static const struct of_device_id __of_table_##name \
935 __used __section(__##table##_of_table) \
936 = { .compatible = compat, \
937 .data = (fn == (fn_type)NULL) ? fn : fn }
会被放到 __irqchip_of_table这个section
确认990是否也是如此
drivers/irqchip/irqchip.c:29: of_irq_init(__irqchip_of_table); 唯一一处会调用到__irqchip_of_table 不过是数组
本文详细解释了在Linux4.0内核的中断控制器驱动(gic_v3)中,IRQCHIP_DECLARE宏的使用以及of_device_id结构的作用,展示了gic_v3在设备树中的初始化过程。着重提到了__irqchip_of_table的定义和使用情况。
248

被折叠的 条评论
为什么被折叠?



