linux - x86 架构的 Linux 内核中中断处理代码的位置

标签 linux kernel interrupt-handling

我正在进行研究,试图在 Linux 内核中找到实现中断处理的代码;特别是,我试图找到负责处理系统计时器的代码。

根据 http://www.linux-tutorial.info/modules.php?name=MContent&pageid=86

The kernel treats interrupts very similarly to the way it treats exceptions: all the general >purpose registers are pushed onto the system stack and a common interrupt handler is called. >The current interrupt priority is saved and the new priority is loaded. This prevents >interrupts at lower priority levels from interrupting the kernel while it handles this >interrupt. Then the real interrupt handler is called.

我正在寻找将所有通用寄存器压入堆栈的代码,以及通用中断处理代码。

至少将通用寄存器压入堆栈是独立于体系结构的,因此我正在寻找与 x86 体系结构关联的代码。目前我正在查看内核源代码的 3.0.4 版,但任何版本都可能没问题。我已经开始查看 kernel/irq/handle.c,但我没有看到任何看起来像保存寄存器的东西;看起来它正在调用已注册的中断处理程序。

最佳答案

32 位版本在arch/i386/kernel/entry_32.S,64 位版本在entry_64.S。搜索标记内核入口点的各种 ENTRY 宏。

关于linux - x86 架构的 Linux 内核中中断处理代码的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8995683/

相关文章:

linux - 为什么使用制表符缩进 if-else 会破坏 Makefile?

Linux:将IP地址重定向到域名

linux - 拒绝访问 android.git.kernel.org

linux - SMP 如何处理中断?

c - 用于读取的原子 block 与 ARM SysTicks

regex - 使用 grep/sed/awk 列出 2 个关键字之间的行

c - 等待用户空间中可能完成?

linux - 如何确定设备内存的页框号?

c - 8051 微 Controller 的 7 段显示屏上的数字闪烁

linux - 如何删除包含特定字符串的前 10 行?