Skip to main content

Crate axhvc

Crate axhvc 

Source
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:

§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§

InvalidHyperCallCode
Error returned when a raw value is not a supported hypercall code.

Enums§

HyperCallCode
Hypercall operation codes for AxVisor.
HyperCallError
Errors reported while decoding or executing a hypercall.

Type Aliases§

HyperCallResult
Result type returned by hypercall operations.