pub struct Vcpu {
pub iregs: IntRegisters,
pub fpu: FpuContext,
pub fpu_used: bool,
pub vector: Option<Box<VectorContext>>,
pub vector_used: bool,
pc: u64,
asid: usize,
mode: Mode,
}Fields§
§iregs: IntRegisters§fpu: FpuContextFloating-point register context (F/D extensions)
fpu_used: boolWhether this task has ever used the FPU (F/D).
vector: Option<Box<VectorContext>>Vector register context (V extension)
vector_used: boolWhether this task has ever used the Vector extension (V).
pc: u64§asid: usize§mode: ModeImplementations§
Source§impl Vcpu
impl Vcpu
pub fn new(mode: Mode) -> Self
pub fn set_asid(&mut self, asid: usize)
pub fn set_pc(&mut self, pc: u64)
pub fn get_pc(&self) -> u64
pub fn set_sp(&mut self, sp: usize)
pub fn get_mode(&self) -> Mode
pub fn reset_iregs(&mut self)
pub fn copy_iregs_to(&self, iregs: &mut IntRegisters)
pub fn copy_iregs_from(&mut self, iregs: &IntRegisters)
Sourcepub fn clone_to(&self, other: &mut Vcpu)
pub fn clone_to(&self, other: &mut Vcpu)
Clone the entire VCPU state to another VCPU
This copies all registers including general-purpose registers, FPU context, Vector context, and PC.
pub fn store(&mut self, trapframe: &Trapframe)
pub fn switch(&mut self, trapframe: &mut Trapframe)
Sourcepub fn get_tls_pointer(&self) -> usize
pub fn get_tls_pointer(&self) -> usize
Get the TLS (Thread Local Storage) pointer for this task
On RISC-V, TLS is stored in the tp register (x4).
Sourcepub fn set_tls_pointer(&mut self, ptr: usize)
pub fn set_tls_pointer(&mut self, ptr: usize)
Set the TLS (Thread Local Storage) pointer for this task
On RISC-V, TLS is stored in the tp register (x4).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Vcpu
impl RefUnwindSafe for Vcpu
impl Send for Vcpu
impl Sync for Vcpu
impl Unpin for Vcpu
impl UnwindSafe for Vcpu
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)