qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH-for-9.0 09/11] hw/arm/bcm2836: Allocate ARM CPU state wit


From: Richard Henderson
Subject: Re: [RFC PATCH-for-9.0 09/11] hw/arm/bcm2836: Allocate ARM CPU state with object_new()
Date: Tue, 28 Nov 2023 08:06:59 -0600
User-agent: Mozilla Thunderbird

On 11/22/23 12:30, Philippe Mathieu-Daudé wrote:
The ARMCPU type is forward declared as a pointer to all hw/ files.
Its declaration is restricted to target/arm/ files. By using a
pointer in BCM283XState instead of embedding the whole CPU state,
we don't need to include "cpu.h" which is target-specific.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  include/hw/arm/bcm2836.h |  4 ++--
  hw/arm/bcm2836.c         | 19 ++++++++++---------
  hw/arm/raspi.c           |  2 +-
  3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h
index 6f90cabfa3..784bab0aad 100644
--- a/include/hw/arm/bcm2836.h
+++ b/include/hw/arm/bcm2836.h
@@ -14,7 +14,7 @@
#include "hw/arm/bcm2835_peripherals.h"
  #include "hw/intc/bcm2836_control.h"
-#include "target/arm/cpu.h"
+#include "target/arm/cpu-qom.h"
  #include "qom/object.h"
#define TYPE_BCM283X "bcm283x"
@@ -38,7 +38,7 @@ struct BCM283XState {
      uint32_t enabled_cpus;
struct {
-        ARMCPU core;
+        ARMCPU *core;
      } cpu[BCM283X_NCPUS];

I'd be tempted to drop the unused struct:

    ARMCPU *cpu[BCM283X_NCPUS];

while you're at it.  Anyway,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

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