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