pub struct AcpiTablesBuilder<'a, T: AcpiTopology> {
pub processor_topology: &'a ProcessorTopology<T>,
pub mem_layout: &'a MemoryLayout,
pub cache_topology: Option<&'a CacheTopology>,
pub pcie_host_bridges: &'a Vec<PcieHostBridge>,
pub arch: AcpiArchConfig,
}Expand description
Builder to construct a set of BuiltAcpiTables
Fields§
§processor_topology: &'a ProcessorTopology<T>The processor topology.
It is assumed that the MADT processor UID should start at 1 and enumerate each of these APIC IDs in turn.
mem_layout: &'a MemoryLayoutThe memory layout of the VM.
cache_topology: Option<&'a CacheTopology>The cache topology of the VM.
If and only if this is set, then the PPTT table will be generated.
pcie_host_bridges: &'a Vec<PcieHostBridge>The PCIe topology.
If and only if this has root complexes, then an MCFG will be generated.
arch: AcpiArchConfigArchitecture-specific ACPI configuration.
Implementations§
Source§impl<T: AcpiTopology> AcpiTablesBuilder<'_, T>
impl<T: AcpiTopology> AcpiTablesBuilder<'_, T>
Sourcepub fn build_acpi_tables<F>(
&self,
gpa: u64,
add_devices_to_dsdt: F,
) -> BuiltAcpiTables
pub fn build_acpi_tables<F>( &self, gpa: u64, add_devices_to_dsdt: F, ) -> BuiltAcpiTables
Build ACPI tables based on the supplied closure that adds devices to the DSDT.
The RDSP is assumed to take one whole page.
Returns tables that should be loaded at the supplied gpa.
Sourcepub fn build_acpi_tables_custom_dsdt(
&self,
gpa: u64,
dsdt: &[u8],
) -> BuiltAcpiTables
pub fn build_acpi_tables_custom_dsdt( &self, gpa: u64, dsdt: &[u8], ) -> BuiltAcpiTables
Build ACPI tables based on the supplied custom DSDT.
The RDSP is assumed to take one whole page.
Returns tables that should be loaded at the supplied gpa.
Sourcepub fn build_madt(&self) -> Vec<u8> ⓘ
pub fn build_madt(&self) -> Vec<u8> ⓘ
Helper method to construct an MADT without constructing the rest of the ACPI tables.
Sourcepub fn build_srat(&self) -> Vec<u8> ⓘ
pub fn build_srat(&self) -> Vec<u8> ⓘ
Helper method to construct an SRAT without constructing the rest of the ACPI tables.
Sourcepub fn build_mcfg(&self) -> Vec<u8> ⓘ
pub fn build_mcfg(&self) -> Vec<u8> ⓘ
Helper method to construct a MCFG without constructing the rest of the ACPI tables.
Sourcepub fn build_pptt(&self) -> Vec<u8> ⓘ
pub fn build_pptt(&self) -> Vec<u8> ⓘ
Helper method to construct a PPTT without constructing the rest of the ACPI tables.
§Panics
Panics if self.cache_topology is not set.