class TimerQueue
Defined at line 241 of file ../../zircon/kernel/include/kernel/timer.h
Preemption Timers
Each CPU has a dedicated preemption timer that's managed using specialized
functions (prefixed with timer_preempt_).
Preemption timers are different from general timers. Preemption timers:
- are reset frequently by the scheduler so performance is important
- should not be migrated off their CPU when the CPU is shutdown
Note: A preemption timer may fire even after it has been canceled.
Public Methods
bool PreemptArmed ()
Returns true if the preemption deadline is set and will definitely fire in
the future. A false value does not definitively mean the preempt timer will
not fire, as a spurious expiration is allowed.
Defined at line 253 of file ../../zircon/kernel/include/kernel/timer.h
void PreemptReset (zx_instant_mono_t deadline)
Set/reset/cancel the preemption timer.
When the preemption timer fires, Scheduler::TimerTick is called. Set the
deadline to ZX_TIME_INFINITE to cancel the preemption timer.
Scheduler::TimerTick may be called spuriously after cancellation.
Defined at line 382 of file ../../zircon/kernel/kernel/timer.cc
void TransitionOffCpu (TimerQueue & source)
Moves |source|'s timers (except its preemption timer) to this TimerQueue.
Defined at line 618 of file ../../zircon/kernel/kernel/timer.cc
void PrintTimerQueues (char * buf, size_t len)
Prints the contents of all timer queues into |buf| of length |len| and null
terminates |buf|.
Defined at line 652 of file ../../zircon/kernel/kernel/timer.cc
void Tick (cpu_num_t cpu)
This is called periodically by timer_tick(), which itself is invoked
periodically by some hardware timer.
Defined at line 477 of file ../../zircon/kernel/kernel/timer.cc
void UpdatePlatformTimer ()
UpdatePlatformTimer updates the platform's oneshot timer to the minimum of:
1. The scheduled time of the head of the monotonic timer queue.
2. The scheduled time of the head of the boot timer queue.
3. The preemption timer deadline.
This can only be called when interrupts are disabled.
Defined at line 128 of file ../../zircon/kernel/kernel/timer.cc
void UpdatePlatformTimerLocked ()
Defined at line 133 of file ../../zircon/kernel/kernel/timer.cc
Friends
class Timer