+ -
当前位置:首页 → 问答吧 → 中断处理函数 IRQn_interupt 在那里定义的

中断处理函数 IRQn_interupt 在那里定义的

时间:2011-09-07

来源:互联网

#define IRQ(x,y) \
IRQ##x##y##_interrupt

#define IRQLIST_16(x) \
IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
IRQ(x,4), IRQ(x,5), IRQ(x,6), IRQ(x,7), \
IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)

#define IRQLIST_14(x) \
IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
IRQ(x,4), IRQ(x,5), IRQ(x,6), IRQ(x,7), \
IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
IRQ(x,c), IRQ(x,d)

void (*interrupt[NR_IRQS])(void) = {
IRQLIST_16(0x0),

#ifdef CONFIG_X86_IO_APIC
IRQLIST_16(0x1), IRQLIST_16(0x2), IRQLIST_16(0x3),
IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
IRQLIST_16(0xc), IRQLIST_16(0xd)

#ifdef CONFIG_PCI_MSI
, IRQLIST_14(0xe)
#endif

#endif
};


IRQ01_interrupt等我在代码里没有搜索到,请问是在那里定义的

作者: wyfwx   发布时间: 2011-09-07

#define IRQ(x,y) \
IRQ##x##y##_interrupt

IRQ01_interrupt 其实只要通过IRQ(0,1)便可以了. 宏替换后,就出来了.

##是字符串连接作用.

作者: zmlovelx   发布时间: 2011-09-07

IRQLIST_16(0x0),

#define IRQLIST_16(x) \
IRQ(x,0), IRQ(x,1),...........

IRQLIST_16(0x0) 就是 IRQ(0x0,0), IRQ(0x0,1) ............
这里的
IRQ(0x0,1) 我怎么觉得应该是IRQ0x01_interrupt

作者: zmlovelx   发布时间: 2011-09-07