Enum BootMode

Source
#[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.

Trait Implementations§

Source§

impl Clone for Mode

Source§

fn clone(&self) -> Mode

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Mode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Mode

Source§

fn eq(&self, other: &Mode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u32> for Mode

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Mode

Source§

impl Eq for Mode

Source§

impl StructuralPartialEq for Mode

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.