MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / free_bars

Method free_bars

pci/src/vfio.rs:825–845  ·  view source on GitHub ↗
(
        &mut self,
        allocator: &mut SystemAllocator,
        mmio32_allocator: &mut AddressAllocator,
        mmio64_allocator: &mut AddressAllocator,
    )

Source from the content-addressed store, hash-verified

823 // The `allocator` argument is unused on `aarch64`
824 #[allow(unused_variables)]
825 pub(crate) fn free_bars(
826 &mut self,
827 allocator: &mut SystemAllocator,
828 mmio32_allocator: &mut AddressAllocator,
829 mmio64_allocator: &mut AddressAllocator,
830 ) -> Result<(), PciDeviceError> {
831 for region in self.mmio_regions.iter() {
832 match region.type_ {
833 PciBarRegionType::IoRegion => {
834 allocator.free_io_addresses(region.start, region.length);
835 }
836 PciBarRegionType::Memory32BitRegion => {
837 mmio32_allocator.free(region.start, region.length);
838 }
839 PciBarRegionType::Memory64BitRegion => {
840 mmio64_allocator.free(region.start, region.length);
841 }
842 }
843 }
844 Ok(())
845 }
846
847 fn parse_msix_capabilities(&mut self, cap: u8) -> MsixCap {
848 let msg_ctl = self.vfio_wrapper.read_config_word((cap + 2).into());

Callers

nothing calls this directly

Calls 3

iterMethod · 0.80
free_io_addressesMethod · 0.80
freeMethod · 0.45

Tested by

no test coverage detected