Skip to main content

SimpleKernelState

Struct SimpleKernelState 

Source
#[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: AtomicU8

Implementations§

Source§

impl SimpleKernelState

Source

const IS_UART_INIT: u8

Source

const IS_BASIC_FB_INIT: u8

Source

const IS_BASIC_FB_FONT_INIT: u8

Source

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
Source

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
Source

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
Source

pub fn set_panic_action(&self, panic_action: PanicAction)

Move the given PanicAction into SIMPLE_STATE::panic_action

Source

pub unsafe fn uart(&self) -> &IrqMutex<Uart>

Getter for SIMPLE_STATE::uart

§Safety

The caller must guarantee the following:

  • That this value’s init method 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
Source

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 init method 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
Source

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 init method 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
Source

pub fn panic_action(&self) -> PanicAction

Getter for SIMPLE_STATE::panic_action

Source

pub fn is_uart_initialized(&self) -> bool

Check whether SIMPLE_STATE::uart is initialized

Source

pub fn is_basic_fb_initialized(&self) -> bool

Check whether SIMPLE_STATE::basic_fb is initialized

Source

pub fn is_basic_fb_psf2_font_initialized(&self) -> bool

Check whether SIMPLE_STATE::basic_fb_psf2_font is initialized

Auto Trait Implementations§

§

impl !Freeze for SimpleKernelState

§

impl !RefUnwindSafe for SimpleKernelState

§

impl Send for SimpleKernelState

§

impl Sync for SimpleKernelState

§

impl Unpin for SimpleKernelState

§

impl UnsafeUnpin for SimpleKernelState

§

impl UnwindSafe for SimpleKernelState

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = !

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.