xref: /DragonOS/kernel/src/virt/kvm/vcpu.rs (revision bd70d2d1f490aabd570a5301b858bd5eb04149fa)
1 use system_error::SystemError;
2 
3 #[allow(dead_code)]
4 pub trait Vcpu: Send + Sync {
5     /// Virtualize the CPU
virtualize_cpu(&mut self) -> Result<(), SystemError>6     fn virtualize_cpu(&mut self) -> Result<(), SystemError>;
devirtualize_cpu(&self) -> Result<(), SystemError>7     fn devirtualize_cpu(&self) -> Result<(), SystemError>;
8     /// Gets the index of the current logical/virtual processor
id(&self) -> u329     fn id(&self) -> u32;
10 }
11