implement initialization of start info for x86

This commit is contained in:
Alex Zenla
2024-01-11 17:23:09 -08:00
parent 684a7d1f62
commit 492a836213
6 changed files with 327 additions and 18 deletions

View File

@ -12,7 +12,7 @@ pub struct PhysicalPage {
pub struct PhysicalPages<'a> {
domid: u32,
p2m: Vec<u64>,
pub(crate) p2m: Vec<u64>,
call: &'a XenCall,
pages: Vec<PhysicalPage>,
}
@ -31,6 +31,10 @@ impl PhysicalPages<'_> {
self.p2m = p2m;
}
pub fn p2m_size(&mut self) -> u64 {
self.p2m.len() as u64
}
pub fn pfn_to_ptr(&mut self, pfn: u64, count: u64) -> Result<u64, XenClientError> {
for page in &self.pages {
if pfn >= page.pfn + page.count {