fix(firmware): route hotplug/notify acpi names through get_mimic_pci_name so macos loads the dsdt

This commit is contained in:
2026-10-10 06:10:08 +02:00
parent 29fb6006f1
commit 6777e6e399
2 changed files with 75 additions and 4 deletions
+53 -4
View File
@@ -193,10 +193,9 @@ index 8837b69..4001d9d 100644
if (pcms->wdat_enabled == true) {
g_assert(pm.tco_io_base);
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 87162ff2c..3616c580a 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -687,10 +687,10 @@ void build_append_pcihp_resources(Aml *scope /* \\_SB.PCI0 */,
@@ -687,10 +687,10 @@
{
Aml *dev, *crs;
@@ -209,7 +208,7 @@ index 87162ff2c..3616c580a 100644
/* device present, functioning, decoding, not shown in UI */
aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
crs = aml_resource_template();
@@ -699,6 +699,89 @@ void build_append_pcihp_resources(Aml *scope /* \\_SB.PCI0 */,
@@ -699,6 +699,89 @@
aml_append(scope, dev);
}
@@ -299,7 +298,57 @@ index 87162ff2c..3616c580a 100644
bool build_append_notification_callback(Aml *parent_scope, const PCIBus *bus)
{
Aml *method;
@@ -912,7 +995,11 @@ void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus)
@@ -708,7 +791,9 @@
GQueue *pcnt_bus_list = g_queue_new();
QLIST_FOREACH(sec, &bus->child, sibling) {
- Aml *br_scope = aml_scope("S%.02X", sec->parent_dev->devfn);
+ char mimic_nm[5];
+ get_mimic_pci_name(mimic_nm, sec->parent_dev->devfn);
+ Aml *br_scope = aml_scope("%s", mimic_nm);
if (pci_bus_is_root(sec)) {
continue;
}
@@ -747,7 +832,9 @@
/* Notify about child bus events in any case */
while ((sec = g_queue_pop_head(pcnt_bus_list))) {
- aml_append(method, aml_name("^S%.02X.PCNT", sec->parent_dev->devfn));
+ char mimic_nm[5];
+ get_mimic_pci_name(mimic_nm, sec->parent_dev->devfn);
+ aml_append(method, aml_name("^%s.PCNT", mimic_nm));
}
aml_append(parent_scope, method);
@@ -802,9 +889,11 @@
{
Aml *if_ctx;
int32_t devfn = PCI_DEVFN(slot, 0);
+ char mimic_nm[5];
+ get_mimic_pci_name(mimic_nm, devfn);
if_ctx = aml_if(aml_and(aml_arg(0), aml_int(0x1U << slot), NULL));
- aml_append(if_ctx, aml_notify(aml_name("S%.02X", devfn), aml_arg(1)));
+ aml_append(if_ctx, aml_notify(aml_name("%s", mimic_nm), aml_arg(1)));
aml_append(method, if_ctx);
}
@@ -867,10 +956,12 @@
continue;
}
+ char mimic_nm[5];
+ get_mimic_pci_name(mimic_nm, devfn);
if (bus->devices[devfn]) {
- dev = aml_scope("S%.02X", devfn);
+ dev = aml_scope("%s", mimic_nm);
} else {
- dev = aml_device("S%.02X", devfn);
+ dev = aml_device("%s", mimic_nm);
aml_append(dev, aml_name_decl("_ADR", aml_int(adr)));
}
@@ -912,7 +1003,11 @@
}
/* start to compose PCI device descriptor */