#[repr(u64)]pub enum Type {
Show 31 variants
FreeRam = 1,
Peripheral = 2,
Reserved = 3,
PoolBookkeeping = 4_294_967_296,
PhysKernel = 4_294_967_297,
PhysElf = 4_294_967_298,
PhysLog = 4_294_967_299,
Kernel = 4_294_967_300,
KernelStorage = 4_294_967_301,
DataZbi = 4_294_967_302,
TemporaryPhysHandoff = 4_294_967_303,
PermanentPhysHandoff = 4_294_967_304,
Vdso = 4_294_967_305,
Userboot = 4_294_967_306,
BootMachineStack = 4_294_967_307,
BootShadowCallStack = 4_294_967_308,
BootUnsafeStack = 4_294_967_309,
FixedAddressStagingKernel = 4_294_967_310,
FixedAddressStagingDataZbi = 4_294_967_311,
LegacyBootData = 4_294_967_312,
TemporaryIdentityPageTables = 4_294_967_313,
KernelPageTables = 4_294_967_314,
PhysDebugdata = 4_294_967_315,
DevicetreeBlob = 4_294_967_316,
PhysScratch = 4_294_967_317,
PoolTestPayload = 4_294_967_318,
ZbiTestPayload = 4_294_967_319,
TestRamReserve = 4_294_967_320,
Nvram = 4_294_967_321,
ReservedLow = 4_294_967_322,
TruncatedRam = 4_294_967_323,
}Expand description
A description of a physical memory range.
A few important sub-categories of the Type enum:
* Base types. These are the three types specified by the ZBI: `Type::FreeRam`,
`Type::Peripheral`, and `Type::Reserved`.
* Allocated types. These are all of the types which are specific to Memalloc's use
case, and are not present in the ZBI spec. For example, `Type::PoolBookkeeping`,
`Type::PhysKernel`, etc. These types are all carved out from `Type::FreeRam`.
* Ram types. This encompasses all of the allocated types plus `Type::FreeRam`Type is represented by 64 bits.
The lower 2^32 values in the space are reserved for the base types; the upper values are allocated types.
The C++ definition of this enum serves as the source of truth for all of the discriminant
values. We enforce this in Rust indirectly by assigning the variants of the enum to the
C++ values, with bindgen. The [define_type_enum!] macro makes this assignment automatic.
Variants§
FreeRam = 1
Peripheral = 2
Reserved = 3
PoolBookkeeping = 4_294_967_296
Reserved for internal bookkeeping.
PhysKernel = 4_294_967_297
The phys ZBI kernel memory image.
PhysElf = 4_294_967_298
A phys ELF memory image.
PhysLog = 4_294_967_299
A phys log file.
Kernel = 4_294_967_300
The kernel memory image.
KernelStorage = 4_294_967_301
A (decompressed) STORAGE_KERNEL ZBI payload.
DataZbi = 4_294_967_302
The data ZBI, as placed by the bootloader.
TemporaryPhysHandoff = 4_294_967_303
Memory intended to remain allocated until the end of the phys hand-off phase.
PermanentPhysHandoff = 4_294_967_304
Memory intended to remain allocated for the lifetime of the kernel.
Vdso = 4_294_967_305
A vDSO memory image.
Userboot = 4_294_967_306
A userboot memory image.
BootMachineStack = 4_294_967_307
The kernel’s boot machine stack.
BootShadowCallStack = 4_294_967_308
The kernel’s boot shadow call stack, if supported.
BootUnsafeStack = 4_294_967_309
The kernel’s boot unsafe stack, if safe stack is supported.
FixedAddressStagingKernel = 4_294_967_310
The intermediate kernel memory image used to trampoline into the same image loaded at a fixed address (i.e., as used by FixedAddressBootZbi).
FixedAddressStagingDataZbi = 4_294_967_311
The intermediate data ZBI used to trampoline into the same image loaded at a fixed address (i.e., as used by FixedAddressBootZbi).
LegacyBootData = 4_294_967_312
Data structures related to legacy boot protocols.
TemporaryIdentityPageTables = 4_294_967_313
Identity-mapping page tables intended only for the lifetime of the phys program in execution.
KernelPageTables = 4_294_967_314
Page tables that describe mappings intended to exist into the kernel’s proper lifetime.
PhysDebugdata = 4_294_967_315
A debug data blob of phys origin (e.g., related to instrumentation).
DevicetreeBlob = 4_294_967_316
A firmware-provided devicetree blob.
PhysScratch = 4_294_967_317
General scratch space used by the phys kernel, but that which is free for the next kernel as of hand-off.
PoolTestPayload = 4_294_967_318
A generic allocated type for Pool tests.
ZbiTestPayload = 4_294_967_319
A generic allocated type for ZBI tests.
TestRamReserve = 4_294_967_320
Memory carved out for the kernel.test.ram.reserve boot option.
Nvram = 4_294_967_321
Memory carved out for the ZBI_TYPE_NVRAM region.
ReservedLow = 4_294_967_322
Low memory, in an architecture-specific context, that is deemed to be unsafe for general-purpose allocation and use (e.g., BIOS-related bits below 1MiB in the case of PCs).
TruncatedRam = 4_294_967_323
RAM ‘discarded’ from a truncation of the physical address space when simulating booting contexts with less physical memory available.
Implementations§
Source§impl Type
impl Type
Sourcepub const MIN_ALLOCATED_VALUE: u64 = bindings::memalloc_kMinAllocatedTypeValue
pub const MIN_ALLOCATED_VALUE: u64 = bindings::memalloc_kMinAllocatedTypeValue
Memalloc reserves the discriminant values above 2^32 to enumerate its own types.
Sourcepub const fn is_allocated(&self) -> bool
pub const fn is_allocated(&self) -> bool
Determine if a Type is an allocated type.
Trait Implementations§
impl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DTwhere
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DTwhere
ST: ?Sized,
DT: ?Sized,
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)