V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
huangya
V2EX  ›  Linux

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

  •  
  •   huangya · 263 天前 · 687 次点击
    这是一个创建于 263 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 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

    2 条回复    2023-08-10 14:03:12 +08:00
    firstlove
        1
    firstlove  
       263 天前   ❤️ 2
    我刚刚在 stackoverflow 那边回答了, 你可以去看看
    huangya
        2
    huangya  
    OP
       261 天前
    @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? –
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3004 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:11 · PVG 16:11 · LAX 01:11 · JFK 04:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.