pvmfw: Integrate buddy_system_allocator
Add support for heap allocation.
Test: atest MicrodroidTestApp
Change-Id: I6b4df790b3cd86fe29db87dd312d5c671548e607
diff --git a/pvmfw/src/entry.rs b/pvmfw/src/entry.rs
index 1ea95bc..dc2087d 100644
--- a/pvmfw/src/entry.rs
+++ b/pvmfw/src/entry.rs
@@ -14,6 +14,7 @@
//! Low-level entry and exit points of pvmfw.
+use crate::heap;
use crate::helpers;
use crate::mmio_guard;
use core::arch::asm;
@@ -52,6 +53,10 @@
// - only access MMIO once (and while) it has been mapped and configured
// - only perform logging once the logger has been initialized
// - only access non-pvmfw memory once (and while) it has been mapped
+
+ // SAFETY - This function should and will only be called once, here.
+ unsafe { heap::init() };
+
logger::init(LevelFilter::Info).map_err(|_| RebootReason::InternalError)?;
const FDT_MAX_SIZE: usize = helpers::SIZE_2MB;