diff mbox series

[7/7] target/ppc: Move powerpc_input_t definition to 'cpu.h'

Message ID 20231013125630.95116-8-philmd@linaro.org
State Superseded
Headers show
Series target/ppc: Move most of 'cpu-qom.h' definitions to 'cpu.h' | expand

Commit Message

Philippe Mathieu-Daudé Oct. 13, 2023, 12:56 p.m. UTC
The powerpc_input_t definition is only used by target/ppc/, no need
to expose it. Restrict it by moving it to "target/ppc/cpu.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/ppc/cpu-qom.h | 21 ---------------------
 target/ppc/cpu.h     | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 21 deletions(-)

Comments

Richard Henderson Oct. 13, 2023, 1:45 p.m. UTC | #1
On 10/13/23 05:56, Philippe Mathieu-Daudé wrote:
> The powerpc_input_t definition is only used by target/ppc/, no need
> to expose it. Restrict it by moving it to "target/ppc/cpu.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/ppc/cpu-qom.h | 21 ---------------------
>   target/ppc/cpu.h     | 20 ++++++++++++++++++++
>   2 files changed, 20 insertions(+), 21 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Cédric Le Goater Oct. 13, 2023, 2:05 p.m. UTC | #2
On 10/13/23 14:56, Philippe Mathieu-Daudé wrote:
> The powerpc_input_t definition is only used by target/ppc/, no need
> to expose it. Restrict it by moving it to "target/ppc/cpu.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.


> ---
>   target/ppc/cpu-qom.h | 21 ---------------------
>   target/ppc/cpu.h     | 20 ++++++++++++++++++++
>   2 files changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h
> index 5bdca472be..6d39ad451c 100644
> --- a/target/ppc/cpu-qom.h
> +++ b/target/ppc/cpu-qom.h
> @@ -36,25 +36,4 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU)
>   
>   #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host")
>   
> -/*****************************************************************************/
> -/* Input pins model                                                          */
> -typedef enum powerpc_input_t powerpc_input_t;
> -enum powerpc_input_t {
> -    PPC_FLAGS_INPUT_UNKNOWN = 0,
> -    /* PowerPC 6xx bus                  */
> -    PPC_FLAGS_INPUT_6xx,
> -    /* BookE bus                        */
> -    PPC_FLAGS_INPUT_BookE,
> -    /* PowerPC 405 bus                  */
> -    PPC_FLAGS_INPUT_405,
> -    /* PowerPC 970 bus                  */
> -    PPC_FLAGS_INPUT_970,
> -    /* PowerPC POWER7 bus               */
> -    PPC_FLAGS_INPUT_POWER7,
> -    /* PowerPC POWER9 bus               */
> -    PPC_FLAGS_INPUT_POWER9,
> -    /* Freescale RCPU bus               */
> -    PPC_FLAGS_INPUT_RCPU,
> -};
> -
>   #endif
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index c2cd069095..4b8b5d3d3e 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -259,6 +259,26 @@ static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model)
>       return mmu_model & POWERPC_MMU_64;
>   }
>   
> +/*****************************************************************************/
> +/* Input pins model                                                          */
> +typedef enum powerpc_input_t {
> +    PPC_FLAGS_INPUT_UNKNOWN = 0,
> +    /* PowerPC 6xx bus                  */
> +    PPC_FLAGS_INPUT_6xx,
> +    /* BookE bus                        */
> +    PPC_FLAGS_INPUT_BookE,
> +    /* PowerPC 405 bus                  */
> +    PPC_FLAGS_INPUT_405,
> +    /* PowerPC 970 bus                  */
> +    PPC_FLAGS_INPUT_970,
> +    /* PowerPC POWER7 bus               */
> +    PPC_FLAGS_INPUT_POWER7,
> +    /* PowerPC POWER9 bus               */
> +    PPC_FLAGS_INPUT_POWER9,
> +    /* Freescale RCPU bus               */
> +    PPC_FLAGS_INPUT_RCPU,
> +} powerpc_input_t;
> +
>   #define PPC_INPUT(env) ((env)->bus_model)
>   
>   /*****************************************************************************/
diff mbox series

Patch

diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h
index 5bdca472be..6d39ad451c 100644
--- a/target/ppc/cpu-qom.h
+++ b/target/ppc/cpu-qom.h
@@ -36,25 +36,4 @@  OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU)
 
 #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host")
 
-/*****************************************************************************/
-/* Input pins model                                                          */
-typedef enum powerpc_input_t powerpc_input_t;
-enum powerpc_input_t {
-    PPC_FLAGS_INPUT_UNKNOWN = 0,
-    /* PowerPC 6xx bus                  */
-    PPC_FLAGS_INPUT_6xx,
-    /* BookE bus                        */
-    PPC_FLAGS_INPUT_BookE,
-    /* PowerPC 405 bus                  */
-    PPC_FLAGS_INPUT_405,
-    /* PowerPC 970 bus                  */
-    PPC_FLAGS_INPUT_970,
-    /* PowerPC POWER7 bus               */
-    PPC_FLAGS_INPUT_POWER7,
-    /* PowerPC POWER9 bus               */
-    PPC_FLAGS_INPUT_POWER9,
-    /* Freescale RCPU bus               */
-    PPC_FLAGS_INPUT_RCPU,
-};
-
 #endif
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index c2cd069095..4b8b5d3d3e 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -259,6 +259,26 @@  static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model)
     return mmu_model & POWERPC_MMU_64;
 }
 
+/*****************************************************************************/
+/* Input pins model                                                          */
+typedef enum powerpc_input_t {
+    PPC_FLAGS_INPUT_UNKNOWN = 0,
+    /* PowerPC 6xx bus                  */
+    PPC_FLAGS_INPUT_6xx,
+    /* BookE bus                        */
+    PPC_FLAGS_INPUT_BookE,
+    /* PowerPC 405 bus                  */
+    PPC_FLAGS_INPUT_405,
+    /* PowerPC 970 bus                  */
+    PPC_FLAGS_INPUT_970,
+    /* PowerPC POWER7 bus               */
+    PPC_FLAGS_INPUT_POWER7,
+    /* PowerPC POWER9 bus               */
+    PPC_FLAGS_INPUT_POWER9,
+    /* Freescale RCPU bus               */
+    PPC_FLAGS_INPUT_RCPU,
+} powerpc_input_t;
+
 #define PPC_INPUT(env) ((env)->bus_model)
 
 /*****************************************************************************/