Use `IoMem::acquire` to get the MemoryBar access

This commit is contained in:
Yuke Peng 2025-07-25 15:42:27 +08:00 committed by Tate, Hongliang Tian
parent faee9e9808
commit 28d4d0e3ad
1 changed files with 1 additions and 9 deletions

View File

@ -330,15 +330,7 @@ impl MemoryBar {
size,
prefetchable,
address_length,
// SAFETY: The address range is initialized by the BIOS or allocated by us. It is
// guaranteed to be I/O memory.
io_memory: unsafe {
IoMem::new(
(base as usize)..((base + size) as usize),
PageFlags::RW,
CachePolicy::Uncacheable,
)
},
io_memory: IoMem::acquire((base as usize)..((base + size) as usize)).unwrap(),
})
}
}