Skip to contentSkip to conversation

hw/acpi: Include missing headers

PATCH In review Philippe Mathieu-Daudé 2 participants 5 messages Feb 26, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover hw/acpi: Include missing headers

Since v1:
- Addressed Zhao's review comments (typos and sort headers)

Patches extracted from an ICH9 model rework. Explicitly include required headers instead of having them being randomply pulled.

Philippe Mathieu-Daudé (2):
hw/acpi/ich9: Include missing headers hw/i386/q35: Include missing 'hw/acpi/acpi.h' header

 include/hw/acpi/ich9.h | 3 ++-
 hw/acpi/ich9.c         | 2 +-
 hw/i386/pc_q35.c       | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/2 hw/acpi/ich9: Include missing headers

The ICH9LPCPMRegs structure has MemoryRegion and Notifier fields, so requires the "qemu/notify.h" and "exec/memory.h" headers.

However nothing from "hw/acpi/acpi_dev_interface.h" is required, so reduce its inclusion to hw/acpi/ich9.c source file where it is used.

---
 include/hw/acpi/ich9.h | 3 ++-
 hw/acpi/ich9.c         | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
include/hw/acpi/ich9.h +2 -1
index 2faf7f0cae..215de3c91f 100644
@@ -21,12 +21,13 @@
 #ifndef HW_ACPI_ICH9_H
 #define HW_ACPI_ICH9_H
 
+#include "qemu/notify.h"
+#include "exec/memory.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/cpu_hotplug.h"
 #include "hw/acpi/cpu.h"
 #include "hw/acpi/pcihp.h"
 #include "hw/acpi/memory_hotplug.h"
-#include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/ich9_tco.h"
 
 #define ACPI_PCIHP_ADDR_ICH9 0x0cc0
hw/acpi/ich9.c +1 -1
index 573d032e8e..6205de6046 100644
@@ -34,8 +34,8 @@
 #include "sysemu/reset.h"
 #include "sysemu/runstate.h"
 #include "hw/acpi/acpi.h"
+#include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/ich9_tco.h"
-
 #include "hw/southbridge/ich9.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/nvdimm.h"
Signature · 1 line
2.41.0
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] hw/acpi/ich9: Include missing headers

Quoted 7 lines · Philippe Mathieu-Daudé

Date: Mon, 26 Feb 2024 10:05:59 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v2 1/2] hw/acpi/ich9: Include missing headers
X-Mailer: git-send-email 2.41.0

The ICH9LPCPMRegs structure has MemoryRegion and Notifier fields, so requires the "qemu/notify.h"

Just nit ;-)

s/requires/it requires/

Quoted 11 lines

and "exec/memory.h" headers.

However nothing from "hw/acpi/acpi_dev_interface.h" is required, so reduce its inclusion to hw/acpi/ich9.c source file where it is used.

---
 include/hw/acpi/ich9.h | 3 ++-
 hw/acpi/ich9.c         | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Thanks!

Quoted 37 lines
include/hw/acpi/ich9.h +2 -1
index 2faf7f0cae..215de3c91f 100644
@@ -21,12 +21,13 @@
 #ifndef HW_ACPI_ICH9_H
 #define HW_ACPI_ICH9_H
 
+#include "qemu/notify.h"
+#include "exec/memory.h"
 #include "hw/acpi/acpi.h"
 #include "hw/acpi/cpu_hotplug.h"
 #include "hw/acpi/cpu.h"
 #include "hw/acpi/pcihp.h"
 #include "hw/acpi/memory_hotplug.h"
-#include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/ich9_tco.h"
 
 #define ACPI_PCIHP_ADDR_ICH9 0x0cc0
hw/acpi/ich9.c +1 -1
index 573d032e8e..6205de6046 100644
@@ -34,8 +34,8 @@
 #include "sysemu/reset.h"
 #include "sysemu/runstate.h"
 #include "hw/acpi/acpi.h"
+#include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/ich9_tco.h"
-
 #include "hw/southbridge/ich9.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/nvdimm.h"
Signature · 1 line
2.41.0
#3 lore raw

PATCH v2 2/2 hw/i386/q35: Include missing 'hw/acpi/acpi.h' header

In reply to Philippe Mathieu-Daudé

"hw/acpi/acpi.h" is implicitly included. Include it explicitly to avoid the following error when refactoring headers:

hw/i386/pc_q35.c:209:43: error: use of undeclared identifier 'ACPI_PM_PROP_ACPI_PCIHP_BRIDGE'

                              ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
                              ^
---
 hw/i386/pc_q35.c | 1 +
 1 file changed, 1 insertion(+)
hw/i386/pc_q35.c +1 -0
index e0b3f55a02..45a4102e75 100644
@@ -30,6 +30,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "hw/acpi/acpi.h"
 #include "hw/char/parallel-isa.h"
 #include "hw/loader.h"
 #include "hw/i2c/smbus_eeprom.h"
Signature · 1 line
2.41.0
Reviewed-by on v2 2/2
#4 lore raw

Re: [PATCH v2 2/2] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header

Quoted 9 lines · Philippe Mathieu-Daudé

Date: Mon, 26 Feb 2024 10:06:00 +0100
From: Philippe Mathieu-Daudé <[email protected]>
Subject: [PATCH v2 2/2] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header
X-Mailer: git-send-email 2.41.0

"hw/acpi/acpi.h" is implicitly included. Include it explicitly to avoid the following error when refactoring headers:

Quoted 8 lines

hw/i386/pc_q35.c:209:43: error: use of undeclared identifier 'ACPI_PM_PROP_ACPI_PCIHP_BRIDGE'

                              ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
                              ^
---
 hw/i386/pc_q35.c | 1 +
 1 file changed, 1 insertion(+)

Thanks!

Quoted 16 lines
hw/i386/pc_q35.c +1 -0
index e0b3f55a02..45a4102e75 100644
@@ -30,6 +30,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "hw/acpi/acpi.h"
 #include "hw/char/parallel-isa.h"
 #include "hw/loader.h"
 #include "hw/i2c/smbus_eeprom.h"
Signature · 1 line
2.41.0