diff mbox series

[17/19] target/mips: Rename translate_init.c as cpu-defs.c

Message ID 20201206233949.3783184-18-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series target/mips: Boring code reordering | expand

Commit Message

Philippe Mathieu-Daudé Dec. 6, 2020, 11:39 p.m. UTC
This file is not TCG specific, contains CPU definitions
and is consumed by cpu.c. Rename it as such.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
cpu-defs.c still contains fpu_init()/mvp_init()/msa_reset().
They are moved out in different series (already posted).
---
 target/mips/cpu.c                                    | 11 ++++++++++-
 target/mips/{translate_init.c.inc => cpu-defs.c.inc} |  9 ---------
 2 files changed, 10 insertions(+), 10 deletions(-)
 rename target/mips/{translate_init.c.inc => cpu-defs.c.inc} (99%)

Comments

Richard Henderson Dec. 8, 2020, 10:30 p.m. UTC | #1
On 12/6/20 5:39 PM, Philippe Mathieu-Daudé wrote:
> This file is not TCG specific, contains CPU definitions
> and is consumed by cpu.c. Rename it as such.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> cpu-defs.c still contains fpu_init()/mvp_init()/msa_reset().
> They are moved out in different series (already posted).

After the other functions are moved, then this file may be compiled separately?

Or... why is mips_cpu_list moved?  I guess it wouldn't be able to be separately
compiled, because of the ARRAY_SIZE.


r~
Philippe Mathieu-Daudé Dec. 14, 2020, 2:40 p.m. UTC | #2
On 12/8/20 11:30 PM, Richard Henderson wrote:
> On 12/6/20 5:39 PM, Philippe Mathieu-Daudé wrote:
>> This file is not TCG specific, contains CPU definitions
>> and is consumed by cpu.c. Rename it as such.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> cpu-defs.c still contains fpu_init()/mvp_init()/msa_reset().
>> They are moved out in different series (already posted).
> 
> After the other functions are moved, then this file may be compiled separately?
> 
> Or... why is mips_cpu_list moved?  I guess it wouldn't be able to be separately
> compiled, because of the ARRAY_SIZE.

Indeed, I missed that.

Thanks,

Phil.
diff mbox series

Patch

diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 899a746c3e5..8a4486e3ea1 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -102,7 +102,16 @@  static bool mips_cpu_has_work(CPUState *cs)
     return has_work;
 }
 
-#include "translate_init.c.inc"
+#include "cpu-defs.c.inc"
+
+void mips_cpu_list(void)
+{
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(mips_defs); i++) {
+        qemu_printf("MIPS '%s'\n", mips_defs[i].name);
+    }
+}
 
 /* TODO QOM'ify CPU reset and remove */
 static void cpu_state_reset(CPUMIPSState *env)
diff --git a/target/mips/translate_init.c.inc b/target/mips/cpu-defs.c.inc
similarity index 99%
rename from target/mips/translate_init.c.inc
rename to target/mips/cpu-defs.c.inc
index f3daf451a63..ad578cb8601 100644
--- a/target/mips/translate_init.c.inc
+++ b/target/mips/cpu-defs.c.inc
@@ -922,15 +922,6 @@  const mips_def_t mips_defs[] =
 };
 const int mips_defs_number = ARRAY_SIZE(mips_defs);
 
-void mips_cpu_list(void)
-{
-    int i;
-
-    for (i = 0; i < ARRAY_SIZE(mips_defs); i++) {
-        qemu_printf("MIPS '%s'\n", mips_defs[i].name);
-    }
-}
-
 static void fpu_init (CPUMIPSState *env, const mips_def_t *def)
 {
     int i;