关于中断和中断处理的问题

发布于 2024-10-06 23:26:02 字数 94 浏览 0 评论 0原文

您能否让我知道硬件/驱动程序如何引发中断?在 SMP 中,哪个 CPU 会被中断? 如果IRQ被多个设备共享,内核如何识别哪个设备引起了中断。

/加内什

Could you please let me know how the hardware/driver raises an interrupt? and in an SMP, which CPU gets interrupted?
If IRQ is shared by multiple devices, how the kernel identifies the which device caused the interrupt.

/Ganesh

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怀中猫帐中妖 2024-10-13 23:26:02

传统上,有一条实际的中断线从设备连接到中断控制器,当它处于高电平(或低电平,或处于边沿)时,会生成中断,CPU 开始执行中断处理程序。

在现代系统中,中断往往是总线上的消息,这些消息被发送到中断控制器(或者可能有多个)。

在更多细节方面,您需要更具体,细节取决于您所讨论的硬件类型。

Traditionally there is an actual interrupt wire that runs from the device to the interrupt controller, when it is high (or low, or on an edge) an interrupt is generated and the CPU starts executing the interrupt handler.

On modern systems interrupts tend to be messages on a bus which are sent to the interrupt controller (or there may be several).

In terms of more detail you'll need to be more specific, the details vary depending on what sort of hardware you're talking about.

小巷里的女流氓 2024-10-13 23:26:02

中断处理程序也称为ISR,是操作系统中设备驱动程序的一部分。在操作系统中,每个 irq 号代表来自中断控制器的一条中断线。

这些设备硬连线到中断控制器,如果设备中产生中断,中断控制器将向相应的 CPU 发出信号。中断目标 CPU 可在中断控制器中针对每个中断线进行编程。

为了在硬件中共享中断号,例如 ARM 中的 GPIO,中断控制器或设备应该为真正的中断号提供一个额外的寄存器。此外,ISR 应查阅该寄存器以获取真实的 IRQ 编号。

The interrupt handler also called ISR is a part of device driver in OS. In OS, each irq number represents a interrupt line from the interrupt controller.

The devices are hard wired to the interrupt controller and the interrupt controller will signal the corresponding CPU if there are interrupts generated in devices. The interrupt target CPUs are programmable in interrupt controller for each interrupt lines.

For sharing interrupt numbers in hardware, like GPIO in ARM, the interrupt controller or device should provide an additional register for the real interrupt number. In addition, the ISR should consult that register for the real IRQ number.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文