#[repr(u32)]pub enum BootMode {
BootWithFullConfiguration = 0,
BootWithMinimalConfiguration = 1,
BootAssumingNoConfigurationChanges = 2,
BootWithFullConfigurationPlusDiagnostic = 3,
BootWithDefaultSettings = 4,
BootOnS4Resume = 5,
BootOnS5Resume = 6,
BootWithMfgModeSettings = 7,
BootOnS2Resume = 16,
BootOnS3Resume = 17,
BootOnFlashUpdate = 18,
BootInRecoveryMode = 32,
}
Expand description
§Boot Mode
The system boot mode indicates the “mode” in which the system is booting. The boot mode concept allows the firmware to accommodate system initialization specific to a given set of circumstances represented by the boot mode. It is a single value set in the HOB producer phase (e.g. PEI) and passed to the DXE phase via the Phase Handoff Information Table (PHIT) HOB. During the HOB producer phase, various modules may modify the boot mode until it settles upon a final value before being passed to the DXE phase.
§References
§Example
use mu_pi::BootMode;
let boot_mode = BootMode::BootWithFullConfiguration;
println!("Boot Mode: {}", boot_mode);
§Note
All targets currently assume that that the boot mode is represented as a u32
Variants§
BootWithFullConfiguration = 0
The basic S0 boot path. Informs all PEIMs to do a full configuration. The basic S0 boot path must be supported.
BootWithMinimalConfiguration = 1
A variation on the basic S0 boot path. Indicates that the minimal amount of hardware should be initialized to boot the system.
BootAssumingNoConfigurationChanges = 2
A variation on the basic S0 boot path. Indicates that the configuration data from the last boot should be used without any changes.
BootWithFullConfigurationPlusDiagnostic = 3
A variation on the basic S0 boot path. Indicates that the any diagnostic code should be run.
BootWithDefaultSettings = 4
A variation on the basic S0 boot path. Indicates that a known set of safe values for programming hardware should be used.
BootOnS4Resume = 5
The current boot is a S4 (Save to Disk) hibernate resume.
BootOnS5Resume = 6
The current boot is a S5 (Soft Off) power on. Some platforms may use this mode to differentiate between a normal for example, if buttons other than the power button can wake the system.
BootWithMfgModeSettings = 7
The current boot is a manufacturing mode boot. Firmware drivers may parameterize actions based on this mode that should only occur in a factory or a manufacturing environment.
BootOnS2Resume = 16
The boot is a S2 (Sleep) resume boot.
BootOnS3Resume = 17
The boot is a S3 (Save to RAM) resume boot. Platforms that support S3 resume must take special care to preserve/restore memory and critical hardware
BootOnFlashUpdate = 18
This boot mode can be either an INIT, S3, or other means by which to restart the machine. If it is an S3, for example, the flash update cause will supersede the S3 restart. It is incumbent upon platform code, such as the Memory Initialization PEIM, to determine the exact cause and perform correct behavior (i.e., S3 state restoration versus INIT behavior).
BootInRecoveryMode = 32
The boot is in recovery mode. This mode is used to recover from a previous boot failure.