Turn hypervisor backends module into a library
Break out the code in the hyp module of libvmbase
into its own library such that it can be used from
other contexts such as the Trusty kernel.
Update uses in guest/{pvmfw,rialto}.
Add Trusty build rules for the new library.
Test: atest
Test: build.py generic-x86_64-test
Change-Id: I68670549c8c8e1b3c8539c2c297e2ca1ba24edfb
diff --git a/libs/libvmbase/src/entry.rs b/libs/libvmbase/src/entry.rs
index f442a32..2433722 100644
--- a/libs/libvmbase/src/entry.rs
+++ b/libs/libvmbase/src/entry.rs
@@ -15,7 +15,7 @@
//! Rust entry point.
use crate::{
- bionic, console, heap, hyp,
+ bionic, console, heap,
layout::{UART_ADDRESSES, UART_PAGE_ADDR},
logger,
memory::{PAGE_SIZE, SIZE_16KB, SIZE_4KB},
@@ -23,10 +23,11 @@
rand,
};
use core::mem::size_of;
+use hypervisor_backends::{get_mmio_guard, Error};
use static_assertions::const_assert_eq;
-fn try_console_init() -> Result<(), hyp::Error> {
- if let Some(mmio_guard) = hyp::get_mmio_guard() {
+fn try_console_init() -> Result<(), Error> {
+ if let Some(mmio_guard) = get_mmio_guard() {
mmio_guard.enroll()?;
// TODO(ptosi): Use MmioSharer::share() to properly track this MMIO_GUARD_MAP.