fix memory initialization in boot setup

This commit is contained in:
Alex Zenla
2024-01-10 22:42:26 -08:00
parent 629c3d81b0
commit 38a5718ca6
4 changed files with 49 additions and 14 deletions

View File

@ -3,7 +3,8 @@ pub mod memory;
pub mod sys;
use crate::sys::{
Hypercall, MmapBatch, XenCapabilitiesInfo, HYPERVISOR_XEN_VERSION, XENVER_CAPABILITIES,
Hypercall, MmapBatch, MultiCallEntry, XenCapabilitiesInfo, HYPERVISOR_MULTICALL,
HYPERVISOR_XEN_VERSION, XENVER_CAPABILITIES,
};
use libc::{mmap, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE};
use nix::errno::Errno;
@ -128,6 +129,15 @@ impl XenCall {
self.hypercall(op, [arg1, arg2, arg3, arg4, 0])
}
pub fn multicall(&self, calls: &mut [MultiCallEntry]) -> Result<(), XenCallError> {
self.hypercall2(
HYPERVISOR_MULTICALL,
calls.as_mut_ptr() as c_ulong,
calls.len() as c_ulong,
)?;
Ok(())
}
pub fn hypercall5(
&self,
op: c_ulong,