#[repr(transparent)]pub struct MemoryType(pub u32);
Expand description
The type of a memory range.
UEFI allows firmwares and operating systems to introduce new memory types
in the 0x7000_0000..=0xFFFF_FFFF
range. Therefore, we don’t know the full set
of memory types at compile time, and it is not safe to model this C enum
as a Rust enum.
Tuple Fields§
§0: u32
Implementations§
Source§impl MemoryType
impl MemoryType
Sourcepub const RESERVED: MemoryType
pub const RESERVED: MemoryType
Not usable.
Sourcepub const LOADER_CODE: MemoryType
pub const LOADER_CODE: MemoryType
The code portions of a loaded UEFI application.
Sourcepub const LOADER_DATA: MemoryType
pub const LOADER_DATA: MemoryType
The data portions of a loaded UEFI applications, as well as any memory allocated by it.
Sourcepub const BOOT_SERVICES_CODE: MemoryType
pub const BOOT_SERVICES_CODE: MemoryType
Code of the boot drivers.
Can be reused after OS is loaded.
Sourcepub const BOOT_SERVICES_DATA: MemoryType
pub const BOOT_SERVICES_DATA: MemoryType
Memory used to store boot drivers’ data.
Can be reused after OS is loaded.
Sourcepub const RUNTIME_SERVICES_CODE: MemoryType
pub const RUNTIME_SERVICES_CODE: MemoryType
Runtime drivers’ code.
Sourcepub const RUNTIME_SERVICES_DATA: MemoryType
pub const RUNTIME_SERVICES_DATA: MemoryType
Runtime services’ code.
Sourcepub const CONVENTIONAL: MemoryType
pub const CONVENTIONAL: MemoryType
Free usable memory.
Sourcepub const UNUSABLE: MemoryType
pub const UNUSABLE: MemoryType
Memory in which errors have been detected.
Sourcepub const ACPI_RECLAIM: MemoryType
pub const ACPI_RECLAIM: MemoryType
Memory that holds ACPI tables. Can be reclaimed after they are parsed.
Sourcepub const ACPI_NON_VOLATILE: MemoryType
pub const ACPI_NON_VOLATILE: MemoryType
Firmware-reserved addresses.
Sourcepub const MMIO: MemoryType
pub const MMIO: MemoryType
A region used for memory-mapped I/O.
Sourcepub const MMIO_PORT_SPACE: MemoryType
pub const MMIO_PORT_SPACE: MemoryType
Address space used for memory-mapped port I/O.
Sourcepub const PAL_CODE: MemoryType
pub const PAL_CODE: MemoryType
Address space which is part of the processor.
Sourcepub const PERSISTENT_MEMORY: MemoryType
pub const PERSISTENT_MEMORY: MemoryType
Memory region which is usable and is also non-volatile.
Sourcepub const UNACCEPTED: MemoryType
pub const UNACCEPTED: MemoryType
Memory that must be accepted by the boot target before it can be used.
Sourcepub const MAX: MemoryType
pub const MAX: MemoryType
End of the defined memory types. Higher values are possible though, see
MemoryType::RESERVED_FOR_OEM
and MemoryType::RESERVED_FOR_OS_LOADER
.
Source§impl MemoryType
impl MemoryType
Sourcepub const RESERVED_FOR_OEM: RangeInclusive<u32>
pub const RESERVED_FOR_OEM: RangeInclusive<u32>
Range reserved for OEM use.
Sourcepub const RESERVED_FOR_OS_LOADER: RangeInclusive<u32>
pub const RESERVED_FOR_OS_LOADER: RangeInclusive<u32>
Range reserved for OS loaders.
Sourcepub const fn custom(value: u32) -> Self
pub const fn custom(value: u32) -> Self
Construct a custom MemoryType
. Values in the range 0x8000_0000..=0xffff_ffff
are free for use if you are
an OS loader.
Warning: Some EFI firmware versions (e.g., OVMF r11337) may crash or behave incorrectly when using a custom MemoryType
.
Trait Implementations§
Source§impl Clone for MemoryType
impl Clone for MemoryType
Source§fn clone(&self) -> MemoryType
fn clone(&self) -> MemoryType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more