|
| From: | Richard Henderson |
| Subject: | Re: [PATCH 11/15] target: Use ArchCPU as interface to target CPU |
| Date: | Fri, 11 Feb 2022 12:21:37 +1100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 2/11/22 04:35, Taylor Simpson wrote:
-#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.
This is the change you'd make with the current state of the world, yes.
So, If I submit the above as a standalone patch, then Philippe wouldn't need to modify target/hexagon/cpu.h. Correct?
But no, Phil would need a change, because he introduces typedef struct ArchCPU ArchCPU; as a generic typedef very early. You cannot then redefine typedef struct HexagonCPU ArchCPU; which means that we still have to rearrange the direction of to typedef ArchCPU HexagonCPU; etc. But it's definitely a smaller change (and matches all of the other targets).I do think that the conversion to OBJECT_DECLARE_TYPE should happen first, via whichever tree you choose.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |