[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/39] target/ppc: cpu_init: Move check_pow and QOM macros to a he
From: |
Cédric Le Goater |
Subject: |
[PULL 38/39] target/ppc: cpu_init: Move check_pow and QOM macros to a header |
Date: |
Fri, 18 Feb 2022 11:38:26 +0100 |
From: Fabiano Rosas <farosas@linux.ibm.com>
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>
Message-Id: <20220216162426.1885923-27-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
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 2baa750729fd..5b01d409b31a 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2732,4 +2732,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 c17994ec5876..a435525ea32f 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -2480,18 +2480,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) {
@@ -2510,31 +2498,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);
--
2.34.1
- [PULL 09/39] target/ppc: add helper for books vhyp hypercall handler, (continued)
- [PULL 09/39] target/ppc: add helper for books vhyp hypercall handler, Cédric Le Goater, 2022/02/18
- [PULL 31/39] target/ppc: cpu_init: Reuse init_proc_604 for the 604e, Cédric Le Goater, 2022/02/18
- [PULL 22/39] target/ppc: cpu_init: Deduplicate 440 SPR registration, Cédric Le Goater, 2022/02/18
- [PULL 33/39] target/ppc: cpu_init: Rename register_ne_601_sprs, Cédric Le Goater, 2022/02/18
- [PULL 19/39] target/ppc: cpu_init: Move G2 SPRs into register_G2_sprs, Cédric Le Goater, 2022/02/18
- [PULL 10/39] target/ppc: Add powerpc_reset_excp_state helper, Cédric Le Goater, 2022/02/18
- [PULL 27/39] target/ppc: cpu_init: Move 755 L2 cache SPRs into a function, Cédric Le Goater, 2022/02/18
- [PULL 25/39] target/ppc: cpu_init: Deduplicate 745/755 SPR registration, Cédric Le Goater, 2022/02/18
- [PULL 20/39] target/ppc: cpu_init: Decouple G2 SPR registration from 755, Cédric Le Goater, 2022/02/18
- [PULL 23/39] target/ppc: cpu_init: Deduplicate 603 SPR registration, Cédric Le Goater, 2022/02/18
- [PULL 38/39] target/ppc: cpu_init: Move check_pow and QOM macros to a header,
Cédric Le Goater <=
- [PULL 39/39] target/ppc: Move common SPR functions out of cpu_init, Cédric Le Goater, 2022/02/18
- [PULL 18/39] target/ppc: cpu_init: Move 405 SPRs into register_405_sprs, Cédric Le Goater, 2022/02/18
- Re: [PULL 00/39] ppc queue, Peter Maydell, 2022/02/20