vm-allocator: Add new function to free 32 bits MMIO address space

The allocator already had functions to allocate and free both IO and 64
bits MMIO address spaces, but it only had an allocating function for 32
bits MMIO address space.

With this new function, it will be now possible to remove cleanly some
ranges from the 32 bits MMIO address space.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-03-11 09:30:57 +01:00 committed by Rob Bradford
parent f3dc245c4f
commit b8e1cf2d4e

View File

@ -131,4 +131,10 @@ impl SystemAllocator {
pub fn free_mmio_addresses(&mut self, address: GuestAddress, size: GuestUsize) {
self.mmio_address_space.free(address, size)
}
/// Free an MMIO address range from the 32 bits hole.
/// We can only free a range if it matches exactly an already allocated range.
pub fn free_mmio_hole_addresses(&mut self, address: GuestAddress, size: GuestUsize) {
self.mmio_hole_address_space.free(address, size)
}
}