#[repr(align(64))]pub struct SimpleKernelState {
is_init: AtomicU8,
uart: UncheckedCell<IrqMutex<Uart>>,
basic_fb: UncheckedCell<IrqMutex<BasicFramebuffer>>,
basic_fb_psf2_font: UncheckedCell<Psf2Font>,
panic_action: AtomicU8,
}Fields§
§is_init: AtomicU8§uart: UncheckedCell<IrqMutex<Uart>>§basic_fb: UncheckedCell<IrqMutex<BasicFramebuffer>>§basic_fb_psf2_font: UncheckedCell<Psf2Font>§panic_action: AtomicU8Implementations§
Source§impl SimpleKernelState
impl SimpleKernelState
const IS_UART_INIT: u8
const IS_BASIC_FB_INIT: u8
const IS_BASIC_FB_FONT_INIT: u8
Sourcepub unsafe fn init_uart(&self, uart: Uart)
pub unsafe fn init_uart(&self, uart: Uart)
Move the given Uart into SIMPLE_STATE::uart
§Safety
The caller must guarantee the following:
- That this method has never been called before and will never be called again
- That at the time of calling this method, no references or pointers to this data exist
- While this method is being called, no other CPU is working with the given data
Sourcepub unsafe fn init_basic_fb(&self, basic_fb: BasicFramebuffer)
pub unsafe fn init_basic_fb(&self, basic_fb: BasicFramebuffer)
Move the given BasicFramebuffer into SIMPLE_STATE::basic_fb
§Safety
The caller must guarantee the following:
- That this method has never been called before and will never be called again
- That at the time of calling this method, no references or pointers to this data exist
- While this method is being called, no other CPU is working with the given data
Sourcepub unsafe fn init_basic_fb_psf2_font(&self, basic_fb_psf2_font: Psf2Font)
pub unsafe fn init_basic_fb_psf2_font(&self, basic_fb_psf2_font: Psf2Font)
Move the given Psf2Font into SIMPLE_STATE::basic_fb_psf2_font
§Safety
The caller must guarantee the following:
- That this method has never been called before and will never be called again
- That at the time of calling this method, no references or pointers to this data exist
- While this method is being called, no other CPU is working with the given data
Sourcepub fn set_panic_action(&self, panic_action: PanicAction)
pub fn set_panic_action(&self, panic_action: PanicAction)
Move the given PanicAction into SIMPLE_STATE::panic_action
Sourcepub unsafe fn uart(&self) -> &IrqMutex<Uart>
pub unsafe fn uart(&self) -> &IrqMutex<Uart>
Getter for SIMPLE_STATE::uart
§Safety
The caller must guarantee the following:
- That this value’s
initmethod has already been called before - That at this method’s entire execution time, no mutable references or pointers to this data exist or will exist
Sourcepub unsafe fn basic_fb(&self) -> &IrqMutex<BasicFramebuffer>
pub unsafe fn basic_fb(&self) -> &IrqMutex<BasicFramebuffer>
Getter for SIMPLE_STATE::basic_fb
§Safety
The caller must guarantee the following:
- That this value’s
initmethod has already been called before - That at this method’s entire execution time, no mutable references or pointers to this data exist or will exist
Sourcepub unsafe fn basic_fb_psf2_font(&self) -> &Psf2Font
pub unsafe fn basic_fb_psf2_font(&self) -> &Psf2Font
Getter for SIMPLE_STATE::basic_fb_psf2_font
§Safety
The caller must guarantee the following:
- That this value’s
initmethod has already been called before - That at this method’s entire execution time, no mutable references or pointers to this data exist or will exist
Sourcepub fn panic_action(&self) -> PanicAction
pub fn panic_action(&self) -> PanicAction
Getter for SIMPLE_STATE::panic_action
Sourcepub fn is_uart_initialized(&self) -> bool
pub fn is_uart_initialized(&self) -> bool
Check whether SIMPLE_STATE::uart is initialized
Sourcepub fn is_basic_fb_initialized(&self) -> bool
pub fn is_basic_fb_initialized(&self) -> bool
Check whether SIMPLE_STATE::basic_fb is initialized
Sourcepub fn is_basic_fb_psf2_font_initialized(&self) -> bool
pub fn is_basic_fb_psf2_font_initialized(&self) -> bool
Check whether SIMPLE_STATE::basic_fb_psf2_font is initialized