All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Taylor Simpson" <tsimpson@quicinc.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH 11/15] target: Use ArchCPU as interface to target CPU
Date: Fri, 11 Feb 2022 12:21:37 +1100	[thread overview]
Message-ID: <048e19d0-0dc7-919e-fd46-3130f1b08111@linaro.org> (raw)
In-Reply-To: <SN4PR0201MB8808BEEAFCF4A89EDBB2165DDE2F9@SN4PR0201MB8808.namprd02.prod.outlook.com>

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~


  reply	other threads:[~2022-02-11  1:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 21:54 [PATCH 00/15] target: Use ArchCPU & CPUArchState as abstract interface to target CPU Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 01/15] meson: Display libfdt as disabled when system emulation is disabled Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 02/15] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header Philippe Mathieu-Daudé via
2022-02-09 22:11   ` Richard Henderson
2022-02-10  8:34   ` Thomas Huth
2022-02-09 21:54 ` [PATCH 03/15] hw/tricore: Remove unused and incorrect header Philippe Mathieu-Daudé via
2022-02-09 22:12   ` Richard Henderson
2022-02-10  8:26   ` Thomas Huth
2022-02-09 21:54 ` [PATCH 04/15] exec/cpu_ldst: Include 'cpu.h' to get target_ulong definition Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 05/15] cpu: Add missing 'exec/exec-all.h' and 'qemu/accel.h' headers Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 06/15] target/i386/cpu: Ensure accelerators set CPU addressble physical bits Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 07/15] target/i386/tcg/sysemu: Include missing 'exec/exec-all.h' header Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 08/15] target: Include missing 'cpu.h' Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 09/15] target: Use forward declared type instead of structure type Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 10/15] target: Use CPUArchState as interface to target-specific CPU state Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 11/15] target: Use ArchCPU as interface to target CPU Philippe Mathieu-Daudé via
2022-02-09 22:33   ` Philippe Mathieu-Daudé via
2022-02-09 22:48     ` Richard Henderson
2022-02-09 22:47   ` Richard Henderson
2022-02-10 17:35     ` Taylor Simpson
2022-02-11  1:21       ` Richard Henderson [this message]
2022-02-11  2:57         ` Taylor Simpson
2022-02-09 21:54 ` [RFC PATCH 12/15] hw/m68k: Restrict M68kCPU type to target/ code Philippe Mathieu-Daudé via
2022-02-09 22:50   ` Richard Henderson
2022-02-09 23:09     ` Philippe Mathieu-Daudé via
2022-02-09 23:18       ` Richard Henderson
2022-02-09 21:54 ` [RFC PATCH 13/15] hw/mips: Restrict MIPSCPU " Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [RFC PATCH 14/15] hw/sparc: Restrict SPARCCPU " Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [RFC PATCH 15/15] hw/sh4: Restrict SuperHCPU " Philippe Mathieu-Daudé via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=048e19d0-0dc7-919e-fd46-3130f1b08111@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=tsimpson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.