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(axerrno::AxError::Unsupported),
    }
}

§Features

This crate is no_std compatible and can be used in bare-metal environments.

Structs§

InvalidHyperCallCode
Error type for invalid hypercall code conversion.

Enums§

HyperCallCode
Hypercall operation codes for AxVisor.

Type Aliases§

HyperCallResult
The result type for hypercall operations.