qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 4/6] Add missing BUSCR/PCR CR defines, and BUSCR/PCR/CAAR CR to m68k_move_to/from
@ 2019-06-16 14:23 Lucien Murray-Pitts
  2019-07-02  9:53 ` Laurent Vivier
  0 siblings, 1 reply; 2+ messages in thread
From: Lucien Murray-Pitts @ 2019-06-16 14:23 UTC (permalink / raw)
  To: qemu-devel, Laurent Vivier, Lucien Murray-Pitts

The BUSCR/PCR CR defines were missing for 68060, and the move_to/from helper
functions were also missing a decode for the 68060 M68K_CR_CAAR CR register.

Added missing defines, and respective decodes for all three CR registers to
the helpers.

Although this patch defines them, the implementation is empty in this patch
and these registers will result in a cpu abort - which is the default prior
to this patch.

This patch aims to reach full coverage of all CR registers within the helpers.

Signed-off-by: Lucien Murray-Pitts <lucienmp.qemu@gmail.com>
---
 target/m68k/cpu.h    |  4 ++++
 target/m68k/helper.c | 14 ++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
index b5b3db01c9..2386419c42 100644
--- a/target/m68k/cpu.h
+++ b/target/m68k/cpu.h
@@ -411,6 +411,10 @@ typedef enum {
 #define M68K_CR_DACR0    0x006
 #define M68K_CR_DACR1    0x007
 
+/* MC68060 */
+#define M68K_CR_BUSCR    0x008
+#define M68K_CR_PCR      0x808
+
 #define M68K_FPIAR_SHIFT  0
 #define M68K_FPIAR        (1 << M68K_FPIAR_SHIFT)
 #define M68K_FPSR_SHIFT   1
diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 5483ce9837..47b352c9c9 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -257,6 +257,14 @@ void HELPER(m68k_movec_to)(CPUM68KState *env, uint32_t reg, uint32_t val)
     case M68K_CR_DTT1:
         env->mmu.ttr[M68K_DTTR1] = val;
         return;
+    /* Unimplemented Registers */
+    case M68K_CR_CAAR:
+    case M68K_CR_PCR:
+    case M68K_CR_BUSCR:
+        cpu_abort(CPU(cpu),
+                  "Unimplemented control register write 0x%x = 0x%x\n",
+                  reg, val);
+        return;
     }
     cpu_abort(CPU(cpu), "Unimplemented control register write 0x%x = 0x%x\n",
               reg, val);
@@ -312,6 +320,12 @@ uint32_t HELPER(m68k_movec_from)(CPUM68KState *env, uint32_t reg)
     /* MC68040/MC68LC040 */
     case M68K_CR_DTT1: /* MC68EC040 only: M68K_CR_DACR1 */
         return env->mmu.ttr[M68K_DTTR1];
+    /* Unimplemented Registers */
+    case M68K_CR_CAAR:
+    case M68K_CR_PCR:
+    case M68K_CR_BUSCR:
+        cpu_abort(CPU(cpu), "Unimplemented control register read 0x%x\n",
+                  reg);
     }
     cpu_abort(CPU(cpu), "Unimplemented control register read 0x%x\n",
               reg);
-- 
2.21.0




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

* Re: [Qemu-devel] [PATCH 4/6] Add missing BUSCR/PCR CR defines, and BUSCR/PCR/CAAR CR to m68k_move_to/from
  2019-06-16 14:23 [Qemu-devel] [PATCH 4/6] Add missing BUSCR/PCR CR defines, and BUSCR/PCR/CAAR CR to m68k_move_to/from Lucien Murray-Pitts
@ 2019-07-02  9:53 ` Laurent Vivier
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Vivier @ 2019-07-02  9:53 UTC (permalink / raw)
  To: Lucien Murray-Pitts, qemu-devel

Le 16/06/2019 à 16:23, Lucien Murray-Pitts a écrit :
> The BUSCR/PCR CR defines were missing for 68060, and the move_to/from helper
> functions were also missing a decode for the 68060 M68K_CR_CAAR CR register.
> 
> Added missing defines, and respective decodes for all three CR registers to
> the helpers.
> 
> Although this patch defines them, the implementation is empty in this patch
> and these registers will result in a cpu abort - which is the default prior
> to this patch.
> 
> This patch aims to reach full coverage of all CR registers within the helpers.
> 
> Signed-off-by: Lucien Murray-Pitts <lucienmp.qemu@gmail.com>
> ---
>  target/m68k/cpu.h    |  4 ++++
>  target/m68k/helper.c | 14 ++++++++++++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h
> index b5b3db01c9..2386419c42 100644
> --- a/target/m68k/cpu.h
> +++ b/target/m68k/cpu.h
> @@ -411,6 +411,10 @@ typedef enum {
>  #define M68K_CR_DACR0    0x006
>  #define M68K_CR_DACR1    0x007
>  
> +/* MC68060 */
> +#define M68K_CR_BUSCR    0x008
> +#define M68K_CR_PCR      0x808
> +
>  #define M68K_FPIAR_SHIFT  0
>  #define M68K_FPIAR        (1 << M68K_FPIAR_SHIFT)
>  #define M68K_FPSR_SHIFT   1
> diff --git a/target/m68k/helper.c b/target/m68k/helper.c
> index 5483ce9837..47b352c9c9 100644
> --- a/target/m68k/helper.c
> +++ b/target/m68k/helper.c
> @@ -257,6 +257,14 @@ void HELPER(m68k_movec_to)(CPUM68KState *env, uint32_t reg, uint32_t val)
>      case M68K_CR_DTT1:
>          env->mmu.ttr[M68K_DTTR1] = val;
>          return;
> +    /* Unimplemented Registers */
> +    case M68K_CR_CAAR:
> +    case M68K_CR_PCR:
> +    case M68K_CR_BUSCR:
> +        cpu_abort(CPU(cpu),
> +                  "Unimplemented control register write 0x%x = 0x%x\n",
> +                  reg, val);
> +        return;
>      }
>      cpu_abort(CPU(cpu), "Unimplemented control register write 0x%x = 0x%x\n",
>                reg, val);
> @@ -312,6 +320,12 @@ uint32_t HELPER(m68k_movec_from)(CPUM68KState *env, uint32_t reg)
>      /* MC68040/MC68LC040 */
>      case M68K_CR_DTT1: /* MC68EC040 only: M68K_CR_DACR1 */
>          return env->mmu.ttr[M68K_DTTR1];
> +    /* Unimplemented Registers */
> +    case M68K_CR_CAAR:
> +    case M68K_CR_PCR:
> +    case M68K_CR_BUSCR:
> +        cpu_abort(CPU(cpu), "Unimplemented control register read 0x%x\n",
> +                  reg);
>      }
>      cpu_abort(CPU(cpu), "Unimplemented control register read 0x%x\n",
>                reg);
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


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

end of thread, other threads:[~2019-07-02  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-16 14:23 [Qemu-devel] [PATCH 4/6] Add missing BUSCR/PCR CR defines, and BUSCR/PCR/CAAR CR to m68k_move_to/from Lucien Murray-Pitts
2019-07-02  9:53 ` Laurent Vivier

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