[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 11/15] target: Use ArchCPU as interface to target CPU
From: |
Taylor Simpson |
Subject: |
RE: [PATCH 11/15] target: Use ArchCPU as interface to target CPU |
Date: |
Thu, 10 Feb 2022 17:35:23 +0000 |
> -----Original Message-----
> From: Richard Henderson <richard.henderson@linaro.org>
> Sent: Wednesday, February 9, 2022 4:48 PM
> To: Philippe Mathieu-Daudé <f4bug@amsat.org>; qemu-devel@nongnu.org
> Cc: Paolo Bonzini <pbonzini@redhat.com>; Thomas Huth
> <thuth@redhat.com>; Taylor Simpson <tsimpson@quicinc.com>
> Subject: Re: [PATCH 11/15] target: Use ArchCPU as interface to target CPU
>
> On 2/10/22 08:54, Philippe Mathieu-Daudé wrote:
> > diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index
> > 25c67e43a2..4dce40a360 100644
> > --- a/target/hexagon/cpu.h
> > +++ b/target/hexagon/cpu.h
> > @@ -143,7 +143,7 @@ typedef struct HexagonCPUClass {
> > DeviceReset parent_reset;
> > } HexagonCPUClass;
> >
> > -typedef struct HexagonCPU {
> > +typedef struct ArchCPU {
> > /*< private >*/
> > CPUState parent_obj;
> > /*< public >*/
>
> There's still the typedef of ArchCPU below, which ought to be redundant
> now.
> It may or may not be less confusing to separate out the typedef for
> HexagonCPU.
> It definitely would be worthwhile to convert hexagon to
> OBJECT_DECLARE_TYPE (cc Taylor).
IIUC, the change to convert to OBJECT_DECLARE_TYPE would be
diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h
index c068e219f1..3b636595a3 100644
--- a/target/hexagon/cpu.h
+++ b/target/hexagon/cpu.h
@@ -131,12 +131,7 @@ struct CPUHexagonState {
VTCMStoreLog vtcm_log;
};
-#define HEXAGON_CPU_CLASS(klass) \
- OBJECT_CLASS_CHECK(HexagonCPUClass, (klass), TYPE_HEXAGON_CPU)
-#define HEXAGON_CPU(obj) \
- OBJECT_CHECK(HexagonCPU, (obj), TYPE_HEXAGON_CPU)
-#define HEXAGON_CPU_GET_CLASS(obj) \
- OBJECT_GET_CLASS(HexagonCPUClass, (obj), TYPE_HEXAGON_CPU)
+OBJECT_DECLARE_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU)
typedef struct HexagonCPUClass {
/*< private >*/
If that's correct, the typedef struct HexagonCPUClass should NOT change to
typedef struct ArchCPU, and the typdef of ArchCPU below would stay.
So, If I submit the above as a standalone patch, then Philippe wouldn't need to
modify target/hexagon/cpu.h. Correct?
Thanks,
Taylor
- [PATCH 05/15] cpu: Add missing 'exec/exec-all.h' and 'qemu/accel.h' headers, (continued)
- [PATCH 05/15] cpu: Add missing 'exec/exec-all.h' and 'qemu/accel.h' headers, Philippe Mathieu-Daudé, 2022/02/09
- [PATCH 06/15] target/i386/cpu: Ensure accelerators set CPU addressble physical bits, Philippe Mathieu-Daudé, 2022/02/09
- [PATCH 07/15] target/i386/tcg/sysemu: Include missing 'exec/exec-all.h' header, Philippe Mathieu-Daudé, 2022/02/09
- [PATCH 08/15] target: Include missing 'cpu.h', Philippe Mathieu-Daudé, 2022/02/09
- [PATCH 09/15] target: Use forward declared type instead of structure type, Philippe Mathieu-Daudé, 2022/02/09
- [PATCH 10/15] target: Use CPUArchState as interface to target-specific CPU state, Philippe Mathieu-Daudé, 2022/02/09
- [PATCH 11/15] target: Use ArchCPU as interface to target CPU, Philippe Mathieu-Daudé, 2022/02/09
[RFC PATCH 12/15] hw/m68k: Restrict M68kCPU type to target/ code, Philippe Mathieu-Daudé, 2022/02/09
[RFC PATCH 13/15] hw/mips: Restrict MIPSCPU type to target/ code, Philippe Mathieu-Daudé, 2022/02/09
[RFC PATCH 14/15] hw/sparc: Restrict SPARCCPU type to target/ code, Philippe Mathieu-Daudé, 2022/02/09
[RFC PATCH 15/15] hw/sh4: Restrict SuperHCPU type to target/ code, Philippe Mathieu-Daudé, 2022/02/09