Patchwork ppc: provide PIR register on all book-S CPUs

login
register
mail settings
Submitter Nathan Whitehorn
Date May 31, 2011, 2:52 p.m.
Message ID <4DE500C3.80408@freebsd.org>
Download mbox | patch
Permalink /patch/98049/
State New
Headers show

Comments

Nathan Whitehorn - May 31, 2011, 2:52 p.m.
The PIR register is architecturally specified on all PowerPC 
non-embedded CPUs, but currently is only available on the 604, 620, and 
G4. Add it to all 601-derived CPUs.

  target-ppc/translate_init.c |   20 +++++---------------
  1 files changed, 5 insertions(+), 15 deletions(-)
Alexander Graf - May 31, 2011, 4:54 p.m.
On 31.05.2011, at 16:52, Nathan Whitehorn wrote:

> The PIR register is architecturally specified on all PowerPC non-embedded CPUs, but currently is only available on the 604, 620, and G4. Add it to all 601-derived CPUs.

Please add a signed-off-by line. Also, please CC me on all PPC related patches (see MAINTAINERS file) and in this particular case, please also CC David (CC'ed in this reply mail).

David, do you think this patch is correct? If so, could you please ack it?


Alex

> 
> target-ppc/translate_init.c |   20 +++++---------------
> 1 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index b511afa..1286ddf 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -670,6 +670,11 @@ static void gen_spr_ne_601 (CPUPPCState *env)
>                  SPR_NOACCESS, SPR_NOACCESS,
> &spr_read_generic, &spr_write_sdr1,
>                  0x00000000);
> +    /* Processor identification */
> +    spr_register(env, SPR_PIR, "PIR",
> +                 SPR_NOACCESS, SPR_NOACCESS,
> + &spr_read_generic, &spr_write_pir,
> +                 env->cpu_index);
> }
> 
> /* BATs 0-3 */
> @@ -1019,11 +1024,6 @@ static void gen_spr_thrm (CPUPPCState *env)
> /* SPR specific to PowerPC 604 implementation */
> static void gen_spr_604 (CPUPPCState *env)
> {
> -    /* Processor identification */
> -    spr_register(env, SPR_PIR, "PIR",
> -                 SPR_NOACCESS, SPR_NOACCESS,
> - &spr_read_generic, &spr_write_pir,
> -                 0x00000000);
>     /* Breakpoints */
>     /* XXX : not implemented */
>     spr_register(env, SPR_IABR, "IABR",
> @@ -1259,11 +1259,6 @@ static void gen_spr_601 (CPUPPCState *env)
> 
> static void gen_spr_74xx (CPUPPCState *env)
> {
> -    /* Processor identification */
> -    spr_register(env, SPR_PIR, "PIR",
> -                 SPR_NOACCESS, SPR_NOACCESS,
> - &spr_read_generic, &spr_write_pir,
> -                 0x00000000);
>     /* XXX : not implemented */
>     spr_register(env, SPR_MMCR2, "MMCR2",
>                  SPR_NOACCESS, SPR_NOACCESS,
> @@ -2118,11 +2113,6 @@ static void gen_spr_compress (CPUPPCState *env)
> /* SPR specific to PowerPC 620 */
> static void gen_spr_620 (CPUPPCState *env)
> {
> -    /* Processor identification */
> -    spr_register(env, SPR_PIR, "PIR",
> -                 SPR_NOACCESS, SPR_NOACCESS,
> - &spr_read_generic, &spr_write_pir,
> -                 0x00000000);
>     spr_register(env, SPR_ASR, "ASR",
>                  SPR_NOACCESS, SPR_NOACCESS,
> &spr_read_asr, &spr_write_asr,
>

Patch

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index b511afa..1286ddf 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -670,6 +670,11 @@  static void gen_spr_ne_601 (CPUPPCState *env)
                   SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_sdr1,
                   0x00000000);
+    /* Processor identification */
+    spr_register(env, SPR_PIR, "PIR",
+                 SPR_NOACCESS, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_pir,
+                 env->cpu_index);
  }

  /* BATs 0-3 */
@@ -1019,11 +1024,6 @@  static void gen_spr_thrm (CPUPPCState *env)
  /* SPR specific to PowerPC 604 implementation */
  static void gen_spr_604 (CPUPPCState *env)
  {
-    /* Processor identification */
-    spr_register(env, SPR_PIR, "PIR",
-                 SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, &spr_write_pir,
-                 0x00000000);
      /* Breakpoints */
      /* XXX : not implemented */
      spr_register(env, SPR_IABR, "IABR",
@@ -1259,11 +1259,6 @@  static void gen_spr_601 (CPUPPCState *env)

  static void gen_spr_74xx (CPUPPCState *env)
  {
-    /* Processor identification */
-    spr_register(env, SPR_PIR, "PIR",
-                 SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, &spr_write_pir,
-                 0x00000000);
      /* XXX : not implemented */
      spr_register(env, SPR_MMCR2, "MMCR2",
                   SPR_NOACCESS, SPR_NOACCESS,
@@ -2118,11 +2113,6 @@  static void gen_spr_compress (CPUPPCState *env)
  /* SPR specific to PowerPC 620 */
  static void gen_spr_620 (CPUPPCState *env)
  {
-    /* Processor identification */
-    spr_register(env, SPR_PIR, "PIR",
-                 SPR_NOACCESS, SPR_NOACCESS,
- &spr_read_generic, &spr_write_pir,
-                 0x00000000);
      spr_register(env, SPR_ASR, "ASR",
                   SPR_NOACCESS, SPR_NOACCESS,
&spr_read_asr, &spr_write_asr,