V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
huangya
V2EX  ›  Linux

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

  •  
  •   huangya · Aug 8, 2023 · 1223 views
    This topic created in 1005 days ago, the information mentioned may be changed or developed.

    用 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 replies    2023-08-10 14:03:12 +08:00
    firstlove
        1
    firstlove  
       Aug 8, 2023   ❤️ 2
    我刚刚在 stackoverflow 那边回答了, 你可以去看看
    huangya
        2
    huangya  
    OP
       Aug 10, 2023
    @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? –
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3103 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 13:46 · PVG 21:46 · LAX 06:46 · JFK 09:46
    ♥ Do have faith in what you're doing.