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