gpt4 book ai didi

linux - 启动代码——用于 ARM 的 linux IRQ 中断处理程序

转载 作者:太空狗 更新时间:2023-10-29 11:29:52 24 4
gpt4 key购买 nike

最近几天我研究了很多关于 linux 第 10 章书 ldd3 的内容。我有一些疑问,请澄清一下。有些是我的分析,如有错误请指出。

For ARM there is one interrupt vector table address for -- IRQ interrupt -- 0x00000018 Then a chip manufacturer can have a separate interrupt line for there hardware like USART, SPI, I2C, External Interrupt -- and multiplex them to a single IRQ line of ARM. and have registers (of their choice) to determine which one fired the interrupt.

Also if example there is an single interrupt line available for GPIO pin level change interrupt. As per below link's single interrupt lines can be shared by many handlers of different device drivers.

fiq & irq handler -- arm Usually the interrupt controller is a hardware unit that multiplexes many interrupt lines together, generating single line to the CPU. When an interrupt occurs, the controller asserts the IRQ line. The CPU stops executing and jumps through the IRQ vector (location varies) to the interrupt handler. The interrupt handlers reads a register on interrupt controller to determine the interrupt line and, invokes the correct interrupt handler and then clears the interrupt - allowing another to occur.

http://www.makelinux.net/ldd3/chp-10-sect-2 How to register an interrupt handler is described in this link.

https://unix.stackexchange.com/questions/47306/how-does-the-linux-kernel-handle-shared-irqs Linux calls all the intruppt handler for the same shared line.

我的问题是,作为一名设备驱动程序程序员,我只调用 ....request_irq()。

谁在提供通用代码——IRQ 中断 @0x00000018 地址——它正在读取供应商特定寄存器以确定哪个中断线引发了 IRQ。然后告诉 linux 功能——调用为该 IRQ 行注册的所有共享中断处理程序?

是否是芯片组的 GCC 编译器启动代码为我们完成这项工作?

最佳答案

实际的中断处理由 linux/arch/arm/kernel/entry-armv.S 设置.然后有一长串代码涉及解码和运行中断处理程序。

实际的request_irq是通用代码,它设置了一个“描述符”,irq_desc,定义在linux/include/linux/irqdesc.h中。 .

“哪个中断是哪个”的实际处理是在板的特定设置中配置的。我在这里给出了一个 omap2/omap3 板的示例(随机选择是因为我使用过这些板,但不是在 Linux 中): linux/arch/arm/mach-omap2/irq.c

希望对您有所帮助。

关于linux - 启动代码——用于 ARM 的 linux IRQ 中断处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14082048/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com