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