Services
Version 1.02 12/12/00 27
Execution in the boot services environment occurs at different task priority levels, or TPLs. The
boot services environment exposes only three of these levels to EFI applications and drivers:
TPL_APPLICATION, the lowest priority level
TPL_CALLBACK, an intermediate priority level
TPL_NOTIFY, the highest priority level
Tasks that execute at a higher priority level may interrupt tasks that execute at a lower priority
level. For example, tasks that run at the TPL_NOTIFY level may interrupt tasks that run at the
TPL_APPLICATION or TPL_CALLBACK level. While TPL_NOTIFY is the highest level
exposed to the boot services applications, the firmware may have higher task priority items it deals
with. For example, the firmware may have to deal with tasks of higher priority like timer ticks and
internal devices. Consequently, there is a fourth TPL, TPL_HIGH_LEVEL, designed for use
exclusively by the firmware.
The intended usage of the priority levels is shown in Table 3-2 from the lowest level
(TPL_APPLICATION) to the highest level (TPL_HIGH_LEVEL). As the level increases, the
duration of the code and the amount of blocking allowed decrease. Execution generally occurs at
the TPL_APPLICATION level. Execution occurs at other levels as a direct result of the triggering
of an event notification function(this is typically caused by the signaling of an event). During timer
interrupts, firmware signals timer events when an events trigger time has expired. This allows
event notification functions to interrupt lower priority code to check devices (for example). The
notification function can signal other events as required. After all pending event notification
functions execute, execution continues at the TPL_APPLICATION level.
Table 3-2. TPL Usage
Task Priority Level Usage
TPL_APPLICATION This is the lowest priority level. It is the level of execution which occurs when
no event notifications are pending and which interacts with the user. User I/O
(and blocking on User I/O) can be performed at this level. The boot manager
executes at this level and passes control to other EFI applications at this level.
TPL_CALLBACK Interrupts code executing below TPL_CALLBACK level. Long term
operations (such as file system operations and disk I/O) can occur at this level.
TPL_NOTIFY Interrupts code execting below TPL_NOTIFY level. Blocking is not allowed
at this level. Code executes to completion and returns. If code requires more
processing, it needs to signal an event to wait to reobtain control at whatever
level it requires. This level is typically used to process low level IO to or from a
device.
continued