axhvc 0.2.0

AxVisor HyperCall definitions for guest-hypervisor communication
Documentation
  • Coverage
  • 100%
    12 out of 12 items documented1 out of 2 items with examples
  • Size
  • Source code size: 39.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 999.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 22s Average build duration of successful builds.
  • all releases: 22s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • arceos-hypervisor/axhvc
    0 5 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hky1999 github:arceos-hypervisor:hypervisor

axhvc

Crates.io Docs.rs CI

AxVisor HyperCall definitions for guest-hypervisor communication.

Overview

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.

Features

  • no_std compatible - suitable for bare-metal and embedded environments
  • Defines all supported hypercall operations
  • Provides type-safe hypercall codes with numeric enum conversion
  • Cross-platform support (x86_64, RISC-V, AArch64)

Supported Hypercalls

Code Name Description
0 HypervisorDisable Disable the hypervisor
1 HyperVisorPrepareDisable Prepare to disable the hypervisor
2 HyperVisorDebug Debug hypercall (development only)
3 HIVCPublishChannel Publish an IVC shared memory channel
4 HIVCSubscribChannel Subscribe to an IVC shared memory channel
5 HIVCUnPublishChannel Unpublish an IVC shared memory channel
6 HIVCUnSubscribChannel Unsubscribe from an IVC shared memory channel

Usage

Add this to your Cargo.toml:

[dependencies]
axhvc = "0.1"

Example

use axhvc::{HyperCallCode, HyperCallResult};

fn handle_hypercall(code: HyperCallCode) -> HyperCallResult {
    match code {
        HyperCallCode::HypervisorDisable => {
            // Handle hypervisor disable request
            Ok(0)
        }
        HyperCallCode::HIVCPublishChannel => {
            // Handle IVC channel publish request
            Ok(0)
        }
        _ => Err(axerrno::AxError::Unsupported),
    }
}

License

Axhvc is licensed under the Apache License, Version 2.0. See the LICENSE file for details.