Skip to main content

axvm/
lib.rs

1// Copyright 2025 The Axvisor Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![no_std]
16
17//! This crate provides a minimal VM monitor (VMM) for running guest VMs.
18//!
19//! This crate contains:
20//! - [`AxVM`]: The main structure representing a VM.
21
22extern crate alloc;
23#[macro_use]
24extern crate log;
25
26mod hal;
27mod vcpu;
28mod vm;
29
30pub mod config;
31
32pub use vm::{AxVCpuRef, AxVM, AxVMRef, VMMemoryRegion, VMStatus};
33
34/// The architecture-independent per-CPU type.
35pub type AxVMPerCpu = axvcpu::AxPerCpu<vcpu::AxVMArchPerCpuImpl>;
36
37/// Whether the hardware has virtualization support.
38pub fn has_hardware_support() -> bool {
39    vcpu::has_hardware_support()
40}