Skip to content

Commit 9f01fc2

Browse files
committed
integration-test: fix compiler warning
1 parent 40bb2ea commit 9f01fc2

File tree

1 file changed

+3
-3
lines changed
  • integration-test/bins/multiboot2_chainloader/src

1 file changed

+3
-3
lines changed

integration-test/bins/multiboot2_chainloader/src/multiboot.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! Parsing the Multiboot information. Glue code for the [`multiboot`] code.
22
33
use anyhow::anyhow;
4+
use core::ptr::addr_of_mut;
45
use core::slice;
5-
pub use multiboot::information::ModuleIter;
6-
pub use multiboot::information::Multiboot as Mbi;
76
use multiboot::information::{MemoryManagement, Multiboot, PAddr, SIGNATURE_EAX};
87

98
static mut MEMORY_MANAGEMENT: Mem = Mem;
@@ -14,7 +13,8 @@ pub fn get_mbi<'a>(magic: u32, ptr: u32) -> anyhow::Result<Multiboot<'a, 'static
1413
if magic != SIGNATURE_EAX {
1514
return Err(anyhow!("Unknown Multiboot signature {magic:x}"));
1615
}
17-
unsafe { Multiboot::from_ptr(ptr as u64, &mut MEMORY_MANAGEMENT) }.ok_or(anyhow!(
16+
let mmgmt: &mut dyn MemoryManagement = unsafe { &mut *addr_of_mut!(MEMORY_MANAGEMENT) };
17+
unsafe { Multiboot::from_ptr(ptr as u64, mmgmt) }.ok_or(anyhow!(
1818
"Can't read Multiboot boot information from pointer"
1919
))
2020
}

0 commit comments

Comments
 (0)