qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-xtensa: make default CPU depend on target endianness
@ 2012-08-08 10:07 Max Filippov
  2012-08-08 12:10 ` Markus Armbruster
  2012-08-09 19:57 ` Blue Swirl
  0 siblings, 2 replies; 3+ messages in thread
From: Max Filippov @ 2012-08-08 10:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Filippov, Markus Armbruster

This makes usable default for -cpu option both for qemu-system-xtensa
and qemu-system-xtensaeb fixing the following error:

    $ qemu-system-xtensaeb -M sim
    Unable to find CPU definition

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 hw/xtensa_lx60.c    |    6 +++---
 hw/xtensa_sim.c     |    4 ++--
 target-xtensa/cpu.h |    6 ++++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/hw/xtensa_lx60.c b/hw/xtensa_lx60.c
index 152eed9..26a0c75 100644
--- a/hw/xtensa_lx60.c
+++ b/hw/xtensa_lx60.c
@@ -173,7 +173,7 @@ static void lx_init(const LxBoardDesc *board,
     int n;
 
     if (!cpu_model) {
-        cpu_model = "dc232b";
+        cpu_model = XTENSA_DEFAULT_CPU_MODEL;
     }
 
     for (n = 0; n < smp_cpus; n++) {
@@ -300,14 +300,14 @@ static void xtensa_lx200_init(ram_addr_t ram_size,
 
 static QEMUMachine xtensa_lx60_machine = {
     .name = "lx60",
-    .desc = "lx60 EVB (dc232b)",
+    .desc = "lx60 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
     .init = xtensa_lx60_init,
     .max_cpus = 4,
 };
 
 static QEMUMachine xtensa_lx200_machine = {
     .name = "lx200",
-    .desc = "lx200 EVB (dc232b)",
+    .desc = "lx200 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
     .init = xtensa_lx200_init,
     .max_cpus = 4,
 };
diff --git a/hw/xtensa_sim.c b/hw/xtensa_sim.c
index 1ce07fb..ed38bd4 100644
--- a/hw/xtensa_sim.c
+++ b/hw/xtensa_sim.c
@@ -102,7 +102,7 @@ static void xtensa_sim_init(ram_addr_t ram_size,
                      const char *initrd_filename, const char *cpu_model)
 {
     if (!cpu_model) {
-        cpu_model = "dc232b";
+        cpu_model = XTENSA_DEFAULT_CPU_MODEL;
     }
     sim_init(ram_size, boot_device, kernel_filename, kernel_cmdline,
             initrd_filename, cpu_model);
@@ -110,7 +110,7 @@ static void xtensa_sim_init(ram_addr_t ram_size,
 
 static QEMUMachine xtensa_sim_machine = {
     .name = "sim",
-    .desc = "sim machine (dc232b)",
+    .desc = "sim machine (" XTENSA_DEFAULT_CPU_MODEL ")",
     .init = xtensa_sim_init,
     .max_cpus = 4,
 };
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index f7db116..177094a 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -351,6 +351,12 @@ typedef struct CPUXtensaState {
 #define cpu_signal_handler cpu_xtensa_signal_handler
 #define cpu_list xtensa_cpu_list
 
+#ifdef TARGET_WORDS_BIGENDIAN
+#define XTENSA_DEFAULT_CPU_MODEL "fsf"
+#else
+#define XTENSA_DEFAULT_CPU_MODEL "dc232b"
+#endif
+
 XtensaCPU *cpu_xtensa_init(const char *cpu_model);
 
 static inline CPUXtensaState *cpu_init(const char *cpu_model)
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] target-xtensa: make default CPU depend on target endianness
  2012-08-08 10:07 [Qemu-devel] [PATCH] target-xtensa: make default CPU depend on target endianness Max Filippov
@ 2012-08-08 12:10 ` Markus Armbruster
  2012-08-09 19:57 ` Blue Swirl
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2012-08-08 12:10 UTC (permalink / raw)
  To: Max Filippov; +Cc: qemu-devel

Max Filippov <jcmvbkbc@gmail.com> writes:

> This makes usable default for -cpu option both for qemu-system-xtensa
> and qemu-system-xtensaeb fixing the following error:
>
>     $ qemu-system-xtensaeb -M sim
>     Unable to find CPU definition
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Tested-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] target-xtensa: make default CPU depend on target endianness
  2012-08-08 10:07 [Qemu-devel] [PATCH] target-xtensa: make default CPU depend on target endianness Max Filippov
  2012-08-08 12:10 ` Markus Armbruster
@ 2012-08-09 19:57 ` Blue Swirl
  1 sibling, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2012-08-09 19:57 UTC (permalink / raw)
  To: Max Filippov; +Cc: qemu-devel, Markus Armbruster

Thanks, applied.

On Wed, Aug 8, 2012 at 10:07 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> This makes usable default for -cpu option both for qemu-system-xtensa
> and qemu-system-xtensaeb fixing the following error:
>
>     $ qemu-system-xtensaeb -M sim
>     Unable to find CPU definition
>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  hw/xtensa_lx60.c    |    6 +++---
>  hw/xtensa_sim.c     |    4 ++--
>  target-xtensa/cpu.h |    6 ++++++
>  3 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/hw/xtensa_lx60.c b/hw/xtensa_lx60.c
> index 152eed9..26a0c75 100644
> --- a/hw/xtensa_lx60.c
> +++ b/hw/xtensa_lx60.c
> @@ -173,7 +173,7 @@ static void lx_init(const LxBoardDesc *board,
>      int n;
>
>      if (!cpu_model) {
> -        cpu_model = "dc232b";
> +        cpu_model = XTENSA_DEFAULT_CPU_MODEL;
>      }
>
>      for (n = 0; n < smp_cpus; n++) {
> @@ -300,14 +300,14 @@ static void xtensa_lx200_init(ram_addr_t ram_size,
>
>  static QEMUMachine xtensa_lx60_machine = {
>      .name = "lx60",
> -    .desc = "lx60 EVB (dc232b)",
> +    .desc = "lx60 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
>      .init = xtensa_lx60_init,
>      .max_cpus = 4,
>  };
>
>  static QEMUMachine xtensa_lx200_machine = {
>      .name = "lx200",
> -    .desc = "lx200 EVB (dc232b)",
> +    .desc = "lx200 EVB (" XTENSA_DEFAULT_CPU_MODEL ")",
>      .init = xtensa_lx200_init,
>      .max_cpus = 4,
>  };
> diff --git a/hw/xtensa_sim.c b/hw/xtensa_sim.c
> index 1ce07fb..ed38bd4 100644
> --- a/hw/xtensa_sim.c
> +++ b/hw/xtensa_sim.c
> @@ -102,7 +102,7 @@ static void xtensa_sim_init(ram_addr_t ram_size,
>                       const char *initrd_filename, const char *cpu_model)
>  {
>      if (!cpu_model) {
> -        cpu_model = "dc232b";
> +        cpu_model = XTENSA_DEFAULT_CPU_MODEL;
>      }
>      sim_init(ram_size, boot_device, kernel_filename, kernel_cmdline,
>              initrd_filename, cpu_model);
> @@ -110,7 +110,7 @@ static void xtensa_sim_init(ram_addr_t ram_size,
>
>  static QEMUMachine xtensa_sim_machine = {
>      .name = "sim",
> -    .desc = "sim machine (dc232b)",
> +    .desc = "sim machine (" XTENSA_DEFAULT_CPU_MODEL ")",
>      .init = xtensa_sim_init,
>      .max_cpus = 4,
>  };
> diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
> index f7db116..177094a 100644
> --- a/target-xtensa/cpu.h
> +++ b/target-xtensa/cpu.h
> @@ -351,6 +351,12 @@ typedef struct CPUXtensaState {
>  #define cpu_signal_handler cpu_xtensa_signal_handler
>  #define cpu_list xtensa_cpu_list
>
> +#ifdef TARGET_WORDS_BIGENDIAN
> +#define XTENSA_DEFAULT_CPU_MODEL "fsf"
> +#else
> +#define XTENSA_DEFAULT_CPU_MODEL "dc232b"
> +#endif
> +
>  XtensaCPU *cpu_xtensa_init(const char *cpu_model);
>
>  static inline CPUXtensaState *cpu_init(const char *cpu_model)
> --
> 1.7.7.6
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-09 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 10:07 [Qemu-devel] [PATCH] target-xtensa: make default CPU depend on target endianness Max Filippov
2012-08-08 12:10 ` Markus Armbruster
2012-08-09 19:57 ` Blue Swirl

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).