#[repr(C)]
pub struct StivaleSmpTag { pub flags: StivaleSmpHeaderTagFlags, pub bsp_lapic_id: u32, pub unused: u32, pub smp_info_array: [StivaleSmpInfo], /* private fields */ }

Fields

flags: StivaleSmpHeaderTagFlagsbsp_lapic_id: u32

LAPIC ID of the BSP (bootstrap processor).

unused: u32

Stivale specification says that this field is reserved for future use.

smp_info_array: [StivaleSmpInfo]

The variable length SMP info array (including BSP).

Implementations

Return’s the tag header

Return’s the total number of logical CPUs (including BSP).

Return’s the SMP info array pointer as a rust slice.

Return’s the SMP info array pointer as a mutable rust slice.

Safety

If this tag was returned by a bootloader mutating the slice must conform to the following rules in order to not trigger UB:

  • Writing to StivaleSmpInfo::goto_address will cause it to start executing at the provided address as such a proper stack must have been set at StivaleSmpInfo::target_stack already if a stack is needed.
  • The stack pointer written to StivaleSmpInfo::target_stack must not alias already mapped memory, this means that the memory area dedicated to the stack must be exclusively used for the AP stack and stack overflows can trigger UB (consider using a guard page).
  • The address pointed by StivaleSmpInfo::goto_address must be that of a extern "C" fn(&'static StivaleSmpInfo) -> !, this also means that once written this struct must not be mutated any further.
Safety

ptr must be a pointer to a properly initialized StivaleSmpTag struct with cpu_count entries in the smp_info_array.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more