qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH-for-9.1 09/29] hw/i386/pc: Pass PCMachineState argument t


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH-for-9.1 09/29] hw/i386/pc: Pass PCMachineState argument to acpi_setup()
Date: Fri, 29 Mar 2024 11:23:15 +0100
User-agent: Mozilla Thunderbird

On 28/3/24 19:45, BALATON Zoltan wrote:
On Thu, 28 Mar 2024, Philippe Mathieu-Daudé wrote:
acpi_setup() caller knows about the machine state, so pass
it as argument to avoid a qdev_get_machine() call.

We already resolved X86_MACHINE(pcms) as 'x86ms' so use the
latter.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/acpi-build.h | 3 ++-
hw/i386/acpi-build.c | 5 ++---
hw/i386/pc.c         | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h
index 0dce155c8c..31de5bddbd 100644
--- a/hw/i386/acpi-build.h
+++ b/hw/i386/acpi-build.h
@@ -2,6 +2,7 @@
#ifndef HW_I386_ACPI_BUILD_H
#define HW_I386_ACPI_BUILD_H
#include "hw/acpi/acpi-defs.h"
+#include "hw/i386/pc.h"

extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio;

@@ -9,7 +10,7 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio;
#define ACPI_PCIHP_SEJ_BASE 0x8
#define ACPI_PCIHP_BNMR_BASE 0x10

-void acpi_setup(void);
+void acpi_setup(PCMachineState *pcms);

This is changed to PcPciMachineState * in a following patch so can't you already introduce it here to avoid some churn?

Unfortunately not, because we'd need to use:

  PcPciMachineState *ppms = PC_PCI_MACHINE(pcms);

which would trigger an assertion at this point.


Regards,
BALATON Zoltan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]