hw/acpi: Include missing headers
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
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
@@ -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
@@ -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
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.0The 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 tohw/acpi/ich9.csource file where it is used.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- 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@@ -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 0x0cc0hw/acpi/ich9.c +1
-1@@ -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
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
@@ -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
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, ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/i386/pc_q35.c | 1 + 1 file changed, 1 insertion(+)
Thanks!
Quoted 16 lines
hw/i386/pc_q35.c +1
-0@@ -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