Skip to contentSkip to conversation

Add m68k_cpu_list()

PATCH Superseded Laurent Vivier 2 participants 4 messages Apr 14, 2009 – May 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add m68k_cpu_list()

This patch adds to m68k target the missing m68k_cpu_list():

$ ./m68k-softmmu/qemu-system-m68k -cpu ?
m68k m5206
m68k m5208
m68k cfv4e
m68k any
---
 target-m68k/cpu.h    |    3 +++
 target-m68k/helper.c |    9 +++++++++
 2 files changed, 12 insertions(+)
target-m68k/cpu.h +3 -0
Index: trunk/target-m68k/cpu.h
===================================================================
@@ -199,6 +199,8 @@
     return (env->features & (1u << feature)) != 0;
 }
 
+void m68k_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
+
 void register_m68k_insns (CPUM68KState *env);
 
 #ifdef CONFIG_USER_ONLY
@@ -213,6 +215,7 @@
 #define cpu_exec cpu_m68k_exec
 #define cpu_gen_code cpu_m68k_gen_code
 #define cpu_signal_handler cpu_m68k_signal_handler
+#define cpu_list m68k_cpu_list
 
 /* MMU modes definitions */
 #define MMU_MODE0_SUFFIX _kernel
target-m68k/helper.c +9 -0
Index: trunk/target-m68k/helper.c
===================================================================
@@ -54,6 +54,15 @@
     {NULL, 0},
 };
 
+void m68k_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
+{
+    unsigned int i;
+
+    for (i = 0; m68k_cpu_defs[i].name; i++) {
+        (*cpu_fprintf)(f, "m68k %s\n", m68k_cpu_defs[i].name);
+    }
+}
+
 static int fpu_gdb_get_reg(CPUState *env, uint8_t *mem_buf, int n)
 {
     if (n < 8) {
#1 lore raw
Quoted 1 line · Laurent Vivier

This patch adds to m68k target the missing m68k_cpu_list():

The "m68k" prefix is bogus.

Paul

#2 lore raw
Quoted 4 lines · Paul Brook
Quoted 1 line · Laurent Vivier

This patch adds to m68k target the missing m68k_cpu_list():

The "m68k" prefix is bogus.

So should I remove it or replace it by something else ?

(i386/x86_64, powerpc, mips, sparc use "x86", "PowerPC", "MIPS", "Sparc")

Thank you,
Laurent

#3 lore raw

PATCH v2 1/1 Add m68k_cpu_list()

This patch adds to m68k target the missing m68k_cpu_list():

$ ./m68k-softmmu/qemu-system-m68k -cpu ?
m5206
m5208
cfv4e
any
---
 target-m68k/cpu.h    |    3 +++
 target-m68k/helper.c |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

Changelog:
v2- remove "m68k" prefix

target-m68k/cpu.h +3 -0
index e2529eb..feffb6b 100644
@@ -199,6 +199,8 @@ static inline int m68k_feature(CPUM68KState *env, int feature)
     return (env->features & (1u << feature)) != 0;
 }
 
+void m68k_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
+
 void register_m68k_insns (CPUM68KState *env);
 
 #ifdef CONFIG_USER_ONLY
@@ -213,6 +215,7 @@ void register_m68k_insns (CPUM68KState *env);
 #define cpu_exec cpu_m68k_exec
 #define cpu_gen_code cpu_m68k_gen_code
 #define cpu_signal_handler cpu_m68k_signal_handler
+#define cpu_list m68k_cpu_list
 
 /* MMU modes definitions */
 #define MMU_MODE0_SUFFIX _kernel
target-m68k/helper.c +9 -0
index ad28322..af9ce22 100644
@@ -54,6 +54,15 @@ static m68k_def_t m68k_cpu_defs[] = {
     {NULL, 0},
 };
 
+void m68k_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
+{
+    unsigned int i;
+
+    for (i = 0; m68k_cpu_defs[i].name; i++) {
+        (*cpu_fprintf)(f, "%s\n", m68k_cpu_defs[i].name);
+    }
+}
+
 static int fpu_gdb_get_reg(CPUState *env, uint8_t *mem_buf, int n)
 {
     if (n < 8) {
Signature · 1 line
1.5.6.5