mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/acpi: Move AML building code for Generic Initiators to aml_build.c
Rather than attempting to create a generic function with mess of the two different device handle types, use a PCI handle specific variant. If the ACPI handle form is needed then that can be introduced alongside this with little duplicated code. Drop the PCIDeviceHandle in favor of just passing the bus, devfn and segment directly. devfn kept as a single byte because ARI means that in this case it is just an 8 bit function number. Suggested-by: Igor Mammedov <imammedo@redhat.com> Link: https://lore.kernel.org/qemu-devel/20240618142333.102be976@imammedo.users.ipa.redhat.com/ Tested-by: "Huang, Ying" <ying.huang@intel.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Message-Id: <20240916171017.1841767-4-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
dc55a90e29
commit
d8a4b4c3b4
4 changed files with 51 additions and 59 deletions
|
@ -19,29 +19,6 @@ typedef struct AcpiGenericInitiator {
|
|||
uint16_t node;
|
||||
} AcpiGenericInitiator;
|
||||
|
||||
/*
|
||||
* ACPI 6.3:
|
||||
* Table 5-81 Flags – Generic Initiator Affinity Structure
|
||||
*/
|
||||
typedef enum {
|
||||
/*
|
||||
* If clear, the OSPM ignores the contents of the Generic
|
||||
* Initiator/Port Affinity Structure. This allows system firmware
|
||||
* to populate the SRAT with a static number of structures, but only
|
||||
* enable them as necessary.
|
||||
*/
|
||||
GEN_AFFINITY_ENABLED = (1 << 0),
|
||||
} GenericAffinityFlags;
|
||||
|
||||
/*
|
||||
* ACPI 6.3:
|
||||
* Table 5-80 Device Handle - PCI
|
||||
*/
|
||||
typedef struct PCIDeviceHandle {
|
||||
uint16_t segment;
|
||||
uint16_t bdf;
|
||||
} PCIDeviceHandle;
|
||||
|
||||
void build_srat_generic_pci_initiator(GArray *table_data);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -486,6 +486,10 @@ Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set, uint32_t io_offset,
|
|||
void build_srat_memory(GArray *table_data, uint64_t base,
|
||||
uint64_t len, int node, MemoryAffinityFlags flags);
|
||||
|
||||
void build_srat_pci_generic_initiator(GArray *table_data, int node,
|
||||
uint16_t segment, uint8_t bus,
|
||||
uint8_t devfn);
|
||||
|
||||
void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms,
|
||||
const char *oem_id, const char *oem_table_id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue