Definition of the vCPU structure and virtualization-related interface support for x86_64 architecture.
The crate user must implement the PhysFrameIf
trait using
crate_interface::impl_interface
to provide the low-level implementantion
of the allocation and dealloction of PhysFrame
, relevant implementation can refer to ArceOS.
use x86_vcpu::PhysFrameIf;
struct PhysFrameIfImpl;
#[crate_interface::impl_interface]
impl axvm::PhysFrameIf for PhysFrameIfImpl {
fn alloc_frame() -> Option<PhysAddr> {
// Your implementation here
}
fn dealloc_frame(paddr: PhysAddr) {
// Your implementation here
}
fn phys_to_virt(paddr: PhysAddr) -> VirtAddr {
// Your implementation here
}
}