#[repr(align(4))]pub struct Riscv64 {
pub regs: Registers,
pub epc: u64,
pub hartid: u64,
satp: u64,
kernel_stack: u64,
kernel_trap: u64,
}
Fields§
§regs: Registers
§epc: u64
§hartid: u64
§satp: u64
§kernel_stack: u64
§kernel_trap: u64
Implementations§
Source§impl Riscv64
impl Riscv64
pub const fn new(cpu_id: usize) -> Self
pub fn get_cpuid(&self) -> usize
pub fn get_trapframe_paddr(&self) -> usize
pub fn get_trapframe(&mut self) -> &mut Trapframe
Source§impl Riscv64
impl Riscv64
pub fn set_trap_handler(&mut self, addr: usize)
pub fn set_next_address_space(&mut self, asid: u16)
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)
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 Riscv64
impl RefUnwindSafe for Riscv64
impl Send for Riscv64
impl Sync for Riscv64
impl Unpin for Riscv64
impl UnwindSafe for Riscv64
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
)