Expand description
This module maintains preemption-related information for the current task on a CPU with a single 32-bit, CPU-local integer value.
- Bits from 0 to 30 represents an unsigned counter called
guard_count
, which is the number ofDisabledPreemptGuard
instances held by the current CPU; - Bit 31 is set to
!need_preempt
, whereneed_preempt
is a boolean value that will be set by the scheduler when it decides that the current task needs to be preempted.
Thus, the current task on a CPU should be preempted if and only if this integer is equal to zero.
The initial value of this integer is equal to 1 << 31
.
This module provides a set of functions to access and manipulate
guard_count
and need_preempt
.
Constantsยง
- GUARD_
COUNT_ ๐MASK - NEED_
PREEMPT_ ๐MASK
Staticsยง
- PREEMPT_
INFO ๐
Functionsยง
- clear_
need_ ๐preempt - dec_
guard_ ๐count - get_
guard_ ๐count - inc_
guard_ ๐count - need_
preempt ๐ - set_
need_ ๐preempt - should_
preempt ๐ - Returns whether the current task should be preempted or not.