rvm-hal 0.1.1

Hardware abstraction layer for the RVM microhypervisor (ADR-133)
Documentation
  • Coverage
  • 100%
    19 out of 19 items documented0 out of 18 items with examples
  • Size
  • Source code size: 64.76 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 124.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ruvnet/rvm
    138 29 10
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ruvnet

rvm-hal

Platform-agnostic hardware abstraction traits for the RVM microhypervisor.

Defines the trait interfaces that concrete platform implementations (AArch64, RISC-V, x86-64) must satisfy. All trait methods return RvmResult and pass borrowed slices rather than owned buffers. The trait definitions themselves contain no unsafe code.

Key Traits

  • Platform -- CPU discovery, total memory query, halt
  • MmuOps -- stage-2 page table management (map, unmap, translate, TLB flush)
  • TimerOps -- monotonic nanosecond timer with one-shot deadline support
  • InterruptOps -- interrupt enable/disable, acknowledge, end-of-interrupt

Example

use rvm_hal::{Platform, MmuOps, TimerOps, InterruptOps};
use rvm_types::{GuestPhysAddr, PhysAddr};

fn map_guest_page(mmu: &mut impl MmuOps) {
    let guest = GuestPhysAddr::new(0x8000_0000);
    let host = PhysAddr::new(0x4000_0000);
    mmu.map_page(guest, host).expect("map failed");
}

Design Constraints

  • DC-15: #![no_std], #![forbid(unsafe_code)], #![deny(missing_docs)]
  • ADR-133: all trait methods return RvmResult; zero-copy semantics

Workspace Dependencies

  • rvm-types