MCPcopy Create free account
hub / github.com/equation314/RVM-Tutorial / RvmHal

Interface RvmHal

rvm/src/hal.rs:4–17  ·  view source on GitHub ↗

The interfaces which the underlying software (kernel or hypervisor) must implement.

Source from the content-addressed store, hash-verified

2
3/// The interfaces which the underlying software (kernel or hypervisor) must implement.
4pub trait RvmHal: Sized {
5 /// Allocates a 4K-sized contiguous physical page, returns its physical address.
6 fn alloc_page() -> Option<HostPhysAddr>;
7 /// Deallocates the given physical page.
8 fn dealloc_page(paddr: HostPhysAddr);
9 /// Converts a physical address to a virtual address which can access.
10 fn phys_to_virt(paddr: HostPhysAddr) -> HostVirtAddr;
11 /// Converts a virtual address to the corresponding physical address.
12 fn virt_to_phys(vaddr: HostVirtAddr) -> HostPhysAddr;
13 /// VM-Exit handler.
14 fn vmexit_handler(vcpu: &mut crate::RvmVcpu<Self>);
15 /// Current time in nanoseconds.
16 fn current_time_nanos() -> u64;
17}

Callers

nothing calls this directly

Implementers 1

hal.rshypervisor/src/hv/hal.rs

Calls

no outgoing calls

Tested by

no test coverage detected