[英]linux disable_irq() and local_irq_save()
I have a piece of code where there is:我有一段代码,其中有:
disable_irq(irq_clk);
local_irq_save(flags);
I found that the disable_irq() disables a specific interrupt, on the other hand local_irq_save() disables all the interrupt.我发现 disable_irq() 禁用特定中断,另一方面 local_irq_save() 禁用所有中断。
So I wonder the meaning of the above code.所以我想知道上面代码的含义。
This makes sense, because interrupts are disabled at different levels.这是有道理的,因为中断在不同级别被禁用。
disable_irq(irq_clk);
This code disables (masks) interrupt in interrupt controller
.此代码禁用(屏蔽) interrupt controller
中的interrupt controller
。 If you have disabled interrupt at this level, the interrupt wouldn't be passed to internal interrupt controller pipeline.如果您在此级别禁用了中断,则中断不会传递到内部中断控制器管道。 It would not be prioritized, it would not be routed to the destination CPU.它不会被优先处理,也不会被路由到目标 CPU。
local_irq_save(flags);
This code disables all interrupts at the level of CPU IRQ interface.此代码禁用 CPU IRQ 接口级别的所有中断。 Interrupts are passed to CPU IRQ interface after they have passed priority & routing pipeline of the interrupt controller and have been asserted to the CPU.中断在通过中断控制器的优先级和路由管道并已被断言给 CPU 后被传递到 CPU IRQ 接口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.