Expand description
AxVisor HyperCall definitions.
This crate provides the hypercall interface for AxVisor, a type-1 hypervisor based on ArceOS. It defines the hypercall codes and result types used for communication between guest VMs and the hypervisor.
§Overview
Hypercalls are the primary mechanism for guest VMs to request services from the hypervisor. This crate defines:
HyperCallCode: An enumeration of all supported hypercall operationsHyperCallResult: The result type returned by hypercall handlers
§Supported Hypercalls
The following hypercall categories are supported:
- Hypervisor Control: Enable/disable hypervisor functionality
- Inter-VM Communication (IVC): Shared memory channels between VMs
§Example
ⓘ
use axhvc::{HyperCallCode, HyperCallResult};
fn handle_hypercall(code: HyperCallCode) -> HyperCallResult {
match code {
HyperCallCode::HypervisorDisable => {
// Handle hypervisor disable request
Ok(0)
}
_ => Err(axhvc::HyperCallError::Unsupported {
code,
detail: "not implemented by this handler".into(),
}),
}
}§Features
This crate is no_std compatible and can be used in bare-metal environments.
Structs§
- Invalid
Hyper Call Code - Error returned when a raw value is not a supported hypercall code.
Enums§
- Hyper
Call Code - Hypercall operation codes for AxVisor.
- Hyper
Call Error - Errors reported while decoding or executing a hypercall.
Type Aliases§
- Hyper
Call Result - Result type returned by hypercall operations.