问题描述
在了解上半部分和下半部分的概念时,我来了面对一个问题.
While understanding the concepts of top halves and bottom halves, I cameacross with a question.
这是我的理解:上半部分和下半部分在中断上下文中执行.唯一的区别在于下半部分在启用中断的同时执行上半部分在禁用相应的irq的情况下执行(仍然可以通过使用SA_INTERRUPT
标志克服).
Here is my understanding:Top half and Bottom half executes in interrupt context. The onlydifference being that the Bottom half executes with interrupt enabled whilethe top half executes with the corresponding irq disabled(Which can still beovercome by using SA_INTERRUPT
flag).
问题:在上半部分处理程序返回之前,return_from_intr
是叫.现在,调用调度程序并执行下半部分(如果有的话)有待处理的.由于调用了return_from_intr
,下半部分如何执行中断上下文?它将处于内核模式而不是中断模式?
The question:Just before return from the top half handler, return_from_intr
iscalled. Now the scheduler is invoked and executes the bottom halves if thereare any pending ones.Since return_from_intr
is called, how can the bottom halves execute ininterrupt context?. It will be in kernel mode rather than the interruptmode?
如果我错了,请纠正我.
Please correct me if I am wrong.
推荐答案
下半部分不在中断上下文中执行,这是将中断处理分为两半并将较慢的代码移出ISR的全部要点.但是,它们仍处于内核环境中.例如,请参见本文.
Bottom halves aren't executed in the interrupt context, which is the entire point of splitting interrupt processing into two halves and moving slower code outside of the ISRs. They're still in the kernel context, though. See this article, for example.
这篇关于Linux下半部分如何在中断上下文中执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!