Linux 有办法看某个特定的中断被 disable/mask 吗?

275 天前
 huangya

用 irqs_disabled()可以看 local cpu 所有中断是否被 disable/mask 。但是我想看某个特定的中断是否在 local cpu 上是否已经被 disable ( disable 的对应函数为 disable_irq()).有办法吗?我的问题与这个网友的问题[1]其实是一样的。但没人回答。

[1]https://stackoverflow.com/questions/68554488/how-can-i-check-a-specific-irq-is-disabled-in-linux-kernel

695 次点击
所在节点    Linux
2 条回复
firstlove
274 天前
我刚刚在 stackoverflow 那边回答了, 你可以去看看
huangya
272 天前
@firstlove 感谢。这两天有点忙,没来得及验证。今天验证了下,确实是这样,但是我不明白这位网友说的中断嵌套让这个问题没有意义的原因是是什么,能麻烦解释一下吗?

First of all, you need to get the idea that device IRQ can be disabled on the side of the device and/or on the side of CPU (interrupt controller). Second, the disable_irq() and enable_irq() are nested. So, why do you need that check? What for? –

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/963277

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX