Struct context_switch_regular::ContextRegular
source · #[repr(C, packed(1))]pub struct ContextRegular { /* private fields */ }
Expand description
The registers saved before a context switch and restored after a context switch.
Note: the order of the registers here MUST MATCH the order of
registers popped in the [restore_registers_regular!
] macro.
Implementations§
source§impl ContextRegular
impl ContextRegular
sourcepub fn new(rip: usize) -> ContextRegular
pub fn new(rip: usize) -> ContextRegular
Creates a new ContextRegular
struct that will cause the
Task containing it to begin its execution at the given rip
.
sourcepub fn set_first_register(&mut self, value: usize)
pub fn set_first_register(&mut self, value: usize)
Sets the value of the first register to the given value
.
This is useful for storing a value (e.g., task ID) in that register
and then recovering it later with read_first_register()
.
On x86_64, this sets the r15
register.
Trait Implementations§
impl FromBytes for ContextRegular
Auto Trait Implementations§
impl RefUnwindSafe for ContextRegular
impl Send for ContextRegular
impl Sync for ContextRegular
impl Unpin for ContextRegular
impl UnwindSafe for ContextRegular
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more