下面的这个视频解释了Linux的中断号与硬件里面中断号之间究竟是什么关系澄清关于Linux中断号的误解。

# cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       
 16:       3092       2942       1436       1997       GIC  29  twd
 17:         10          0          0          0       GIC  34  timer
 31:          4          0          0          0       GIC  47  eth0
 34:        375          0          0          0       GIC  41  mmci-pl18x (cmd)
 35:      22227          0          0          0       GIC  42  mmci-pl18x (pio)
 36:          8          0          0          0       GIC  44  kmi-pl050
 37:         98          0          0          0       GIC  45  kmi-pl050
 38:        108          0          0          0       GIC  37  uart-pl011
 44:          0          0          0          0       GIC  36  rtc-pl031
IPI0:          0          1          1          1  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:        653        682        935        364  Rescheduling interrupts
IPI3:          1          2          2          1  Function call interrupts
IPI4:          0          0          0          0  Single function call interrupts
IPI5:          0          0          0          0  CPU stop interrupts
IPI6:          0          0          0          0  IRQ work interrupts
IPI7:          0          0          0          0  completion interrupts
Err:          0


实验平台为ARM。视频解释上述/proc/interrupts里面的16,17,31,34,35,36,38,44等这些中断号与ARM GIC(Generic Interrupt Controller)里面硬件中断号之间的关系。

硬件的中断号我们一般称为“hwirq”,通常意味中断控制器里面哪个bit被设置了。Linux会建立Linux的IRQ号与hwirq的映射关系。

(END)

Linux阅码场原创精华文章汇总

更多精彩,尽在"Linux阅码场",扫描下方二维码关注

别忘了点“在看”鼓励哦~

Logo

更多推荐