[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 26/27] target/ppc: cpu_init: Move check_pow and QOM macros
From: |
David Gibson |
Subject: |
Re: [PATCH v2 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to a header |
Date: |
Thu, 17 Feb 2022 10:35:40 +1100 |
On Wed, Feb 16, 2022 at 01:24:25PM -0300, Fabiano Rosas wrote:
> These will need to be accessed from other files once we move the CPUs
> code to separate files.
>
> The check_pow_hid0 and check_pow_hid0_74xx are too specific to be
> moved to a header so I'll deal with them later when splitting this
> code between the multiple CPU families.
>
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> target/ppc/cpu.h | 39 +++++++++++++++++++++++++++++++++++++++
> target/ppc/cpu_init.c | 37 -------------------------------------
> 2 files changed, 39 insertions(+), 37 deletions(-)
>
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 6a06a7f533..1d33e8afea 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -2733,4 +2733,43 @@ void dump_mmu(CPUPPCState *env);
> void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len);
> void ppc_store_vscr(CPUPPCState *env, uint32_t vscr);
> uint32_t ppc_get_vscr(CPUPPCState *env);
> +
> +/*****************************************************************************/
> +/* Power management enable checks
> */
> +static inline int check_pow_none(CPUPPCState *env)
> +{
> + return 0;
> +}
> +
> +static inline int check_pow_nocheck(CPUPPCState *env)
> +{
> + return 1;
> +}
> +
> +/*****************************************************************************/
> +/* PowerPC implementations definitions
> */
> +
> +#define POWERPC_FAMILY(_name) \
> + static void \
> + glue(glue(ppc_, _name), _cpu_family_class_init)(ObjectClass *, void *); \
> + \
> + static const TypeInfo \
> + glue(glue(ppc_, _name), _cpu_family_type_info) = { \
> + .name = stringify(_name) "-family-" TYPE_POWERPC_CPU, \
> + .parent = TYPE_POWERPC_CPU, \
> + .abstract = true, \
> + .class_init = glue(glue(ppc_, _name), _cpu_family_class_init), \
> + }; \
> + \
> + static void glue(glue(ppc_, _name), _cpu_family_register_types)(void) \
> + { \
> + type_register_static( \
> + &glue(glue(ppc_, _name), _cpu_family_type_info)); \
> + } \
> + \
> + type_init(glue(glue(ppc_, _name), _cpu_family_register_types)) \
> + \
> + static void glue(glue(ppc_, _name), _cpu_family_class_init)
> +
> +
> #endif /* PPC_CPU_H */
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 4c6b462cad..5bbbcceb55 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -2484,18 +2484,6 @@ static void init_excp_POWER10(CPUPPCState *env)
>
> #endif
>
> -/*****************************************************************************/
> -/* Power management enable checks
> */
> -static int check_pow_none(CPUPPCState *env)
> -{
> - return 0;
> -}
> -
> -static int check_pow_nocheck(CPUPPCState *env)
> -{
> - return 1;
> -}
> -
> static int check_pow_hid0(CPUPPCState *env)
> {
> if (env->spr[SPR_HID0] & 0x00E00000) {
> @@ -2514,31 +2502,6 @@ static int check_pow_hid0_74xx(CPUPPCState *env)
> return 0;
> }
>
> -/*****************************************************************************/
> -/* PowerPC implementations definitions
> */
> -
> -#define POWERPC_FAMILY(_name) \
> - static void \
> - glue(glue(ppc_, _name), _cpu_family_class_init)(ObjectClass *, void *); \
> - \
> - static const TypeInfo \
> - glue(glue(ppc_, _name), _cpu_family_type_info) = { \
> - .name = stringify(_name) "-family-" TYPE_POWERPC_CPU, \
> - .parent = TYPE_POWERPC_CPU, \
> - .abstract = true, \
> - .class_init = glue(glue(ppc_, _name), _cpu_family_class_init), \
> - }; \
> - \
> - static void glue(glue(ppc_, _name), _cpu_family_register_types)(void) \
> - { \
> - type_register_static( \
> - &glue(glue(ppc_, _name), _cpu_family_type_info)); \
> - } \
> - \
> - type_init(glue(glue(ppc_, _name), _cpu_family_register_types)) \
> - \
> - static void glue(glue(ppc_, _name), _cpu_family_class_init)
> -
> static void init_proc_405(CPUPPCState *env)
> {
> register_40x_sprs(env);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [PATCH v2 12/27] target/ppc: cpu_init: Deduplicate 604 SPR registration, (continued)
- [PATCH v2 12/27] target/ppc: cpu_init: Deduplicate 604 SPR registration, Fabiano Rosas, 2022/02/16
- [PATCH v2 13/27] target/ppc: cpu_init: Deduplicate 745/755 SPR registration, Fabiano Rosas, 2022/02/16
- [PATCH v2 19/27] target/ppc: cpu_init: Reuse init_proc_604 for the 604e, Fabiano Rosas, 2022/02/16
- [PATCH v2 22/27] target/ppc: cpu_init: Remove register_usprg3_sprs, Fabiano Rosas, 2022/02/16
- [PATCH v2 23/27] target/ppc: Rename spr_tcg.h to spr_common.h, Fabiano Rosas, 2022/02/16
- [PATCH v2 20/27] target/ppc: cpu_init: Reuse init_proc_745 for the 755, Fabiano Rosas, 2022/02/16
- [PATCH v2 16/27] target/ppc: cpu_init: Move e300 SPR registration into a function, Fabiano Rosas, 2022/02/16
- [PATCH v2 14/27] target/ppc: cpu_init: Deduplicate 7xx SPR registration, Fabiano Rosas, 2022/02/16
- [PATCH v2 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to a header, Fabiano Rosas, 2022/02/16
- Re: [PATCH v2 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to a header,
David Gibson <=
- [PATCH v2 17/27] target/ppc: cpu_init: Move 604e SPR registration into a function, Fabiano Rosas, 2022/02/16
- [PATCH v2 18/27] target/ppc: cpu_init: Reuse init_proc_603 for the e300, Fabiano Rosas, 2022/02/16
- [PATCH v2 21/27] target/ppc: cpu_init: Rename register_ne_601_sprs, Fabiano Rosas, 2022/02/16
- [PATCH v2 25/27] target/ppc: cpu_init: Move SPR registration macros to a header, Fabiano Rosas, 2022/02/16
- [PATCH v2 24/27] target/ppc: cpu_init: Expose some SPR registration helpers, Fabiano Rosas, 2022/02/16
- [PATCH v2 27/27] target/ppc: Move common SPR functions out of cpu_init, Fabiano Rosas, 2022/02/16
- Re: [PATCH v2 00/27] target/ppc: SPR registration cleanups, Cédric Le Goater, 2022/02/18