如何将驱动程序代码中的函数注册为其 ISR
根据我从我之前关于 Linux 内核开发的问题得到的反馈,
我通过将驱动程序与现有驱动程序进行比较并大量“借用”其代码,编写了一个驱动程序(在 Linux 内核 v2.6.32 中)。司机注册良好。 init() 和probe() 工作正常。我还能够访问外围设备寄存器。 :-)
但是我对 IRQ/ISR 有点模糊。外围设备是一个输入设备,并在 GPIO 引脚上引发中断。
我如何从当前状态继续处理 IRQ 并执行 ISR 函数?
Following the feedback i got from my previous question on Linux Kernel development,
I have written a driver (in Linux-kernel v2.6.32) by comparing it with an existing driver and "borrowing" heavily from its code. The driver is registered fine. The init() and probe() are working fine. I am also able to access the peripheral device registers. :-)
However i am a bit hazy about the IRQ/ISR. The peripheral-device is a input device and raises an interrupt on a GPIO pin.
How do i move ahead from the current state to handle the IRQ and execute my ISR function ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您看过Linux设备驱动程序一书吗?它有一整章关于中断处理的内容。它应该提供您需要的背景信息。
Did you look at the Linux Device Drivers book? It has a whole chapter on interrupt handling. It should provide the background information you need.