Linux内核空闲循环 [英] Linux kernel idle loop
问题描述
在linux内核空闲循环,对于相当多的架构(SH,ARM,X86等。据我所知)是以下行:
Inside the linux kernel idle loop, for quite a few architectures (SH, ARM, X86 etc.. afaik) are the following lines:
if(cpuidle_idle_call())
pm_idle();
我的疑问:
目前,至少对于ARM,默认pm_idle功能包括注射用水(等待中断)指令,但令人困惑的部分是,中断被禁止再与WFI指令后启用执行时,如何做一个CPU从WFI回来在线当中断被禁用?
At-least for ARM, The default pm_idle function consists of WFI (Wait for interrupt) instruction but the confusing part is, interrupts are disabled then and are enabled after the WFI instruction executes, How does a CPU get back online from WFI when interrupts were disabled ?
我试图寻找我在linux各种版本的答案,但相关code是不变的,因为2.6.32(最后的版本我提到),所以它更有可能的是,我失去了一些东西。
I tried searching for my answers in various versions of linux, but the related code is unchanged since 2.6.32 (the last version i referred to) so it's more likely that I am missing something.
推荐答案
WFI醒来即使中断被禁止,但直到中断被再次启用ARM内核不接收中断。
WFI wakes even if interrupts are disabled, but the ARM core doesn't receive the interrupts until interrupts are enabled again.
这篇关于Linux内核空闲循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!