pub struct SystemAllocator {
    io_address_space: Option<AddressAllocator>,
    mmio_address_spaces: [AddressAllocator; 2],
    mmio_platform_address_spaces: Option<AddressAllocator>,
    reserved_region: Option<AddressRange>,
    pci_allocator: BTreeMap<u8, AddressAllocator>,
    irq_allocator: AddressAllocator,
    gpe_allocator: AddressAllocator,
    next_anon_id: usize,
}

Fields§

§io_address_space: Option<AddressAllocator>§mmio_address_spaces: [AddressAllocator; 2]§mmio_platform_address_spaces: Option<AddressAllocator>§reserved_region: Option<AddressRange>§pci_allocator: BTreeMap<u8, AddressAllocator>§irq_allocator: AddressAllocator§gpe_allocator: AddressAllocator§next_anon_id: usize

Implementations§

Creates a new SystemAllocator for managing addresses and irq numbers. Will return an error if base + size overflows u64 (or allowed maximum for the specific type), or if alignment isn’t a power of two.

If reserve_region_size is not None, then a region is reserved from the start of config.high_mmio before the mmio allocator is created.

If mmio_address_ranges is not empty, then config.low_mmio and config.high_mmio are intersected with the ranges specified.

Reserves the next available system irq number.

release irq to system irq number pool

Reserves the next available system irq number.

Reserve the next available system GPE number

Allocate PCI slot location.

Reserve PCI slot location.

release PCI slot location.

Allocate a memory-mapped I/O region with properties requested in opts.

Reserve specified range from pci mmio, get the overlap of specified range with mmio pools, exclude the overlap from mmio allocator.

If any part of the specified range has been allocated, return Error.

Gets an allocator to be used for platform device MMIO allocation.

Gets an allocator to be used for IO memory.

Gets an allocator to be used for MMIO allocation. MmioType::Low: low mmio allocator MmioType::High: high mmio allocator

Gets a set of allocators to be used for MMIO allocation. The set of allocators will try the low and high MMIO allocators, in that order.

Gets the pools of all mmio allocators.

Gets the reserved address space region.

Gets a unique anonymous allocation

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.