Re: How does cpu_idle() work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 22 Apr 2005, P.F. Tsai wrote:

> I can't understand exactly how cpu gets "stuck"...
> 
> I am wondering about what happens after the "hlt" instruction being 
> executed, do all registers still keep their values ? does program 
> counter stopped too ?

Think of "hlt" as an instruction that can take a very, very
long time to finish - perhaps even several milliseconds, or
tens of thousands of CPU cycles.

Of course, it could also finish quickly if an interrupt
comes in.

Other than that, "hlt" behaves just like any other instruction.

> or the power was shut just like I turn it off ? is there anything 
> running stealthily ?

During the execution of the "hlt" instruction, the CPU can
put itself into a lower power mode - but that's all hardware
specific and dependant on the CPU model.

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux