问题描述
我从 arm 的设备驱动程序开始......我看到每个处理程序提到 --- __attribute__((interrupt( irq )))
-.我很困惑这个属性如何放置调用我们的驱动程序..??
i started with device driver for arm ... there i saw for each handler mention --- __attribute__((interrupt( irq )))
-.I am confused how this attribute will place a call to our driver routine ..??
arm 的 IRQ 有以下向量地址--- 0x00000018 (或 0xFFFF0018)因为同一行上可以有许多中断处理程序.假设我们有 4 个设备驱动程序,每个驱动程序都有自己的 IRQ 需要重新注册.
IRQ of arm have following Vector address--- 0x00000018 (or 0xFFFF0018)As there can be many interrupt handler on same line. Suppose if we have 4 device driver each with its own IRQ to be reistered.
意味着一些启动代码将由 GCC 编译器提供给 IRQ 处理程序 &编译器将在中断处理程序的启动代码中调用我们的例程..... 我对吗...?
Means some startup code will be provided by the GCC compiler for the IRQ handler & compiler will place call to our routine in that startup code for interrupt handler ..... Am i right ...?
推荐答案
来自 GCC 文档 interrupt 属性:
当此属性存在时,编译器会生成适合在中断处理程序中使用的函数进入和退出序列.
您可以轻松地使用 objdump
来查看此属性如何更改您的二进制文件,这应该会更好地为您阐明情况.
You can use objdump
easily to see how this attribute changes your binary which should clarify the situation for you much better.
这篇关于gcc --- __attribute__((interrupt(irq)))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!