#[repr(align(64))]pub struct GlobalCpuState {
idt: UncheckedCell<InterruptDescriptorTable>,
user_code_selector: AtomicU16,
user_data_selector: AtomicU16,
}Expand description
Global CPU state such as IDT and user code/data selectors
Fields§
§idt: UncheckedCell<InterruptDescriptorTable>§user_code_selector: AtomicU16§user_data_selector: AtomicU16Implementations§
Source§impl GlobalCpuState
impl GlobalCpuState
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Constructor; returns a GlobalCpuState with an uninitialized IDT and zeroed selectors
Sourcepub unsafe fn init_idt(&'static self)
pub unsafe fn init_idt(&'static self)
Initialize the IDT
§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_user_selectors(&self, code: u16, data: u16)
pub fn set_user_selectors(&self, code: u16, data: u16)
Set the user data and code selectors
Sourcepub unsafe fn idt(&self) -> &InterruptDescriptorTable
pub unsafe fn idt(&self) -> &InterruptDescriptorTable
Getter for GlobalCpuState::Idt
§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 user_code_selector(&self) -> u16
pub fn user_code_selector(&self) -> u16
Getter for GlobalCpuState::user_code_selector
Sourcepub fn user_data_selector(&self) -> u16
pub fn user_data_selector(&self) -> u16
Getter for GlobalCpuState::user_data_selector