A method and apparatus for managing power consumption of a processing unit
having an operating system (OS) or software system and access to at least
one hardware timer saves power by putting the processing unit into one of
at least two low power states when the OS or software system is not
expected to do work. A time period for which the software system is not
expected to perform work is determined, and a determination is made as to
which one of at least two low power states to put the processing unit in,
in response to the time period. The hardware timer is configured to
facilitate waking up the software system or OS in time for it to perform
expected work. The processing unit and software system are transitioned
into the chosen low power state. They are transitioned out of the low
power state in response to a hardware interrupt.