qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Mark McLoughlin <markmc@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/5] Add cpu_list() for any targets that don't already have it
Date: Thu, 13 Nov 2008 16:46:00 +0000	[thread overview]
Message-ID: <1226594763-2304-3-git-send-email-markmc@redhat.com> (raw)
In-Reply-To: <1226594763-2304-2-git-send-email-markmc@redhat.com>

This allows us to remove the "#ifdef cpu_list" from vl.c

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 target-alpha/cpu.h       |    2 ++
 target-alpha/translate.c |    5 +++++
 target-cris/cpu.h        |    2 ++
 target-cris/translate.c  |    5 +++++
 target-m68k/cpu.h        |    2 ++
 target-m68k/helper.c     |    9 +++++++++
 vl.c                     |    3 ---
 7 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 210cc55..73ffce7 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -296,6 +296,7 @@ struct CPUAlphaState {
 #define cpu_exec cpu_alpha_exec
 #define cpu_gen_code cpu_alpha_gen_code
 #define cpu_signal_handler cpu_alpha_signal_handler
+#define cpu_list cpu_alpha_list
 
 /* MMU modes definitions */
 #define MMU_MODE0_SUFFIX _kernel
@@ -401,6 +402,7 @@ enum {
 
 CPUAlphaState * cpu_alpha_init (const char *cpu_model);
 int cpu_alpha_exec(CPUAlphaState *s);
+void cpu_alpha_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
 /* you can call this signal handler from your SIGBUS and SIGSEGV
    signal handlers to inform the virtual CPU of exceptions. non zero
    is returned if the signal was handled by the virtual CPU.  */
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 23e1c6a..0987a8d 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -2365,6 +2365,11 @@ void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
     gen_intermediate_code_internal(env, tb, 1);
 }
 
+void cpu_alpha_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
+{
+    /* no cpu model variants */
+}
+
 CPUAlphaState * cpu_alpha_init (const char *cpu_model)
 {
     CPUAlphaState *env;
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index 1a8c884..8f3eeb6 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -161,6 +161,7 @@ typedef struct CPUCRISState {
 CPUCRISState *cpu_cris_init(const char *cpu_model);
 int cpu_cris_exec(CPUCRISState *s);
 void cpu_cris_close(CPUCRISState *s);
+void cpu_cris_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
 void do_interrupt(CPUCRISState *env);
 /* you can call this signal handler from your SIGBUS and SIGSEGV
    signal handlers to inform the virtual CPU of exceptions. non zero
@@ -206,6 +207,7 @@ enum {
 #define cpu_exec cpu_cris_exec
 #define cpu_gen_code cpu_cris_gen_code
 #define cpu_signal_handler cpu_cris_signal_handler
+#define cpu_list cpu_cris_list
 
 #define CPU_SAVE_VERSION 1
 
diff --git a/target-cris/translate.c b/target-cris/translate.c
index f5a7bf4..19bf2f3 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3484,6 +3484,11 @@ void cpu_dump_state (CPUState *env, FILE *f,
 
 }
 
+void cpu_cris_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
+{
+	/* no cpu model variants */
+}
+
 CPUCRISState *cpu_cris_init (const char *cpu_model)
 {
 	CPUCRISState *env;
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index a6687b1..477b46f 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -117,6 +117,7 @@ void m68k_tcg_init(void);
 CPUM68KState *cpu_m68k_init(const char *cpu_model);
 int cpu_m68k_exec(CPUM68KState *s);
 void cpu_m68k_close(CPUM68KState *s);
+void cpu_m68k_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
 void do_interrupt(int is_hw);
 /* you can call this signal handler from your SIGBUS and SIGSEGV
    signal handlers to inform the virtual CPU of exceptions. non zero
@@ -212,6 +213,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 cpu_m68k_list
 
 /* MMU modes definitions */
 #define MMU_MODE0_SUFFIX _kernel
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 405cb9a..9e13ace 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -54,6 +54,15 @@ static m68k_def_t m68k_cpu_defs[] = {
     {NULL, 0},
 };
 
+void cpu_m68k_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
+{
+    unsigned int i;
+
+    (*cpu_fprintf)(f, "Available CPUs:\n");
+    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) {
diff --git a/vl.c b/vl.c
index b53dfda..e4184d3 100644
--- a/vl.c
+++ b/vl.c
@@ -4585,10 +4585,7 @@ int main(int argc, char **argv)
             case QEMU_OPTION_cpu:
                 /* hw initialization will check this */
                 if (*optarg == '?') {
-/* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list)
                     cpu_list(stdout, &fprintf);
-#endif
                     exit(0);
                 } else {
                     cpu_model = optarg;
-- 
1.5.4.3

  reply	other threads:[~2008-11-13 16:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 16:45 [Qemu-devel] [PATCH 0/5] Add "info capabilities" monitor command Mark McLoughlin
2008-11-13 16:45 ` [Qemu-devel] [PATCH 1/5] Re-factor nic model listing Mark McLoughlin
2008-11-13 16:46   ` Mark McLoughlin [this message]
2008-11-13 16:46     ` [Qemu-devel] [PATCH 3/5] Rename xxx_cpu_list() to cpu_xxx_list() Mark McLoughlin
2008-11-13 16:46       ` [Qemu-devel] [PATCH 4/5] Add new cpu_names() function Mark McLoughlin
2008-11-13 16:46         ` [Qemu-devel] [PATCH 5/5] monitor: add "info capabilities" command Mark McLoughlin
2008-11-13 19:50           ` [Qemu-devel] " Anthony Liguori
2008-11-14 16:02             ` Mark McLoughlin
2008-11-14 10:07           ` [Qemu-devel] " Avi Kivity
2008-11-14 15:58             ` Mark McLoughlin
2008-11-16  7:17               ` Avi Kivity
2008-11-14 10:13           ` Daniel P. Berrange
2008-11-13 19:47         ` [Qemu-devel] Re: [PATCH 4/5] Add new cpu_names() function Anthony Liguori
2008-11-14 15:36           ` Mark McLoughlin
2008-11-13 18:35   ` [Qemu-devel] [PATCH 1/5] Re-factor nic model listing Paul Brook
2008-11-13 19:45     ` Anthony Liguori
2008-11-13 22:50       ` Paul Brook
2008-11-14  2:31         ` Jamie Lokier
2008-11-14  2:49           ` Anthony Liguori
2008-11-13 19:44   ` [Qemu-devel] " Anthony Liguori
2008-11-14 15:34     ` Mark McLoughlin
2008-11-13 17:49 ` [Qemu-devel] [PATCH 0/5] Add "info capabilities" monitor command Blue Swirl
2008-11-14  2:50   ` Jamie Lokier
2008-11-14 16:09     ` Mark McLoughlin
2008-11-14  3:28 ` [Qemu-devel] " Anthony Liguori
2008-11-14  3:51   ` Jamie Lokier
2008-11-14 15:56     ` Mark McLoughlin
2008-11-14 22:54       ` Jamie Lokier
2008-11-14 15:51   ` Mark McLoughlin
2008-11-14 22:52     ` Jamie Lokier
2008-11-14 10:16 ` [Qemu-devel] " Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226594763-2304-3-git-send-email-markmc@redhat.com \
    --to=markmc@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).