macro_rules! static_init_state {
($vis:vis static mut $name:ident: InitKernelState<$kernel:ty>) => { ... };
}Expand description
Initializes an InitKernelState in static storage.
§Examples
Here’s an example of using static_init_state! on Cortex-M:
struct Arch;
#[cortex_m_rt::entry]
fn main() -> ! {
Target::console_init();
kernel::static_init_state!(static mut INIT_STATE: InitKernelState<Arch>);
// SAFETY: `main` is only executed once, so we never generate more than one
// `&mut` reference to `INIT_STATE`.
kernel::Kernel::main(Arch, unsafe { &mut INIT_STATE });
}