#[repr(C, align(16))]pub struct Trapframe {
pub regs: IntRegisters,
pub epc: u64,
pub _padding: u64,
}Fields§
§regs: IntRegisters§epc: u64§_padding: u64Implementations§
Source§impl Trapframe
impl Trapframe
pub fn new() -> Self
pub fn get_syscall_number(&self) -> usize
pub fn set_syscall_number(&mut self, syscall_number: usize)
pub fn get_return_value(&self) -> usize
pub fn set_return_value(&mut self, value: usize)
pub fn get_arg(&self, index: usize) -> usize
pub fn set_arg(&mut self, index: usize, value: usize)
pub fn get_current_pc(&self) -> u64
Sourcepub fn increment_pc_next(&mut self, task: &Task)
pub fn increment_pc_next(&mut self, task: &Task)
Increment the program counter (epc) to the next instruction This is typically used after handling a trap or syscall to continue execution.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trapframe
impl RefUnwindSafe for Trapframe
impl Send for Trapframe
impl Sync for Trapframe
impl Unpin for Trapframe
impl UnwindSafe for Trapframe
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)