本文共 1660 字,大约阅读时间需要 5 分钟。
linux_4.0/kernel/irq/proc.c show_interrupts
/proc/interrupts列出当前所以系统注册的中断,记录中断号,中断发生次数,中断设备名称如下图:从右至右:中断号 中断次数 中断设备名称cat /proc/interrupts 读取到的内容从左到右,分别为:1、逻辑中断号(软件中断号,linux分配的中断号),2、中断在各CPU发生的次数,3、中断所属设备类名称,4、硬件中断号,5、中断名称。# cat interrupts CPU0 16: 31414 GIC 34 timer 17: 0 GIC 87 node_platform 29: 955 GIC 47 eth0 32: 0 GIC 41 mmci-pl18x (cmd) 33: 0 GIC 42 mmci-pl18x (pio) 34: 8 GIC 44 kmi-pl050 35: 100 GIC 45 kmi-pl050 36: 13147 GIC 37 uart-pl011 // 硬件中断号为 GIC-37 40: 0 GIC 32 node_platform 42: 0 GIC 36 rtc-pl031IPI0: 0 CPU wakeup interrupts // 从这一行开始就是核间中断IPI1: 0 Timer broadcast interruptsIPI2: 0 Rescheduling interruptsIPI3: 0 Function call interruptsIPI4: 0 Single function call interruptsIPI5: 0 CPU stop interruptsIPI6: 0 IRQ work interruptsIPI7: 0 completion interruptsErr: 0
wit@vexpress:/proc/irq/40 # ls -l -R.:total 0-r--r--r-- 1 0 0 0 Jan 15 15:51 affinity_hint-r--r--r-- 1 0 0 0 Jan 15 15:51 nodedr-xr-xr-x 2 0 0 0 Jan 15 15:51 node_platform-rw-r--r-- 1 0 0 0 Jan 15 15:51 smp_affinity-rw-r--r-- 1 0 0 0 Jan 15 15:51 smp_affinity_list-r--r--r-- 1 0 0 0 Jan 15 15:51 spurious./node_platform:total 0
软件关于中断的第一个动作保存现场软件:读 GICC_IAR寄存器,得到中断的硬件中断号,即软件响应中断 // 响应GIC的第一个动作 pending->active&pending软件:中断服务程序将中断的硬件ID号写入GICC_EOIR恢复现场
转载地址:http://goigi.baihongyu.com/