gic驱动

本文详细解释了在Linux4.0内核的中断控制器驱动(gic_v3)中,IRQCHIP_DECLARE宏的使用以及of_device_id结构的作用,展示了gic_v3在设备树中的初始化过程。着重提到了__irqchip_of_table的定义和使用情况。

gic驱动

下面看 ./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 不过是数组
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值