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(axerrno::AxError::Unsupported),
}
}§Features
This crate is no_std compatible and can be used in bare-metal environments.
Structs§
- Invalid
Hyper Call Code - Error type for invalid hypercall code conversion.
Enums§
- Hyper
Call Code - Hypercall operation codes for AxVisor.
Type Aliases§
- Hyper
Call Result - The result type for hypercall operations.