[09/16] PPC: Add PIR register to POWER7 CPU

Message ID 1331813662-15141-10-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf March 15, 2012, 12:14 p.m.
From: Nathan Whitehorn <nwhitehorn@freebsd.org>

The POWER7 emulation is missing the Processor Identification Register,
mandatory in recent POWER CPUs, that is required for SMP on at least
some operating systems (e.g. FreeBSD) to function properly. This patch
copies the existing PIR code from the other CPUs that implement it.

Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
 target-ppc/translate_init.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index c707959..5a958b9 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -6588,6 +6588,11 @@  static void init_proc_POWER7 (CPUPPCState *env)
     /* Time base */
+    /* Processor identification */
+    spr_register(env, SPR_PIR, "PIR",
+                 SPR_NOACCESS, SPR_NOACCESS,
+                 &spr_read_generic, &spr_write_pir,
+                 0x00000000);
 #if !defined(CONFIG_USER_ONLY)
     /* PURR & SPURR: Hack - treat these as aliases for the TB for now */
     spr_register(env, SPR_PURR,   "PURR",