IPL(9) | Kernel Developer's Manual | IPL(9) |
ipl
, splraise
,
spldpc
, splx
,
splget
— raise or lower
Interrupt Priority Level (IPL)
#include
<kdk/kern.h>
ipl_t
splraise
(ipl_t
ipl);
ipl_t
spldpc
(ipl_t
ipl);
void
splx
(ipl_t
ipl);
ipl_t
splget
(void);
Interrupts are masked by priority, and priorities are hierarchical. When the interrupt priority level is raised, lower-priority interrupts are disabled until the priority level is lowered. This affects delivery of interrupts within the thread that has raised the level. Levels kIPLDPC and above prevent rescheduling, and therefore act on the CPU core as a whole.
Each interrupt handler is associated with an IPL. Entry to an interrupt handler is always at the IPL the handler is associated with. The IPL can be further raised above that level, but must return to the handler's associated IPL before return.
The rcu(9) and the spinlock(9) functionalities also modify IPL as part of their duties.
These are the interrupt priority levels from low-to-high, with each higher level blocking additional interrupts:
kIPL0
kIPLAST
kIPLDPC
This is the level at which the scheduler, DPCs, and RCU callbacks run. At this level and above, the current processor core will not be rescheduled, RCU grace periods will not end, and DPCs will not run.
kIPLDevice
kIPLClock
kIPLIPI
kIPLHigh
Note: On some architectures, consecutive subsets of the first four interrupt levels (kIPLHigh, kIPLIPI, kIPLClock, kIPLDevice) may be merged due to platform-specific limitations.
As shorthand, "low IPL" refers to IPL less than
kIPLDPC
, and "high IPL" refers to IPL
greater than or equal to kIPLDPC
.
The following functions are provided for managing the interrupt priority level:
splraise
(ipl_t
ipl)spldpc
(void)kIPLDPC
. and returns the previous IPL.splx
(ipl_t
ipl)splget
(void)The ipl
interface has always been in
Keyronex.
October 5, 2024 | Debian |