qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-mips: Enable access to required RDHWR hardware registers
@ 2012-08-20 23:41 Meador Inge
  2012-08-21 10:14 ` Andreas Färber
  0 siblings, 1 reply; 5+ messages in thread
From: Meador Inge @ 2012-08-20 23:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: aurelien

While running in the usermode emulator all of the MIPS32r2 *required*
RDHWR hardware registers should be accessible (the Linux kernel enables
access to these same registers).

Signed-off-by: Meador Inge <meadori@codesourcery.com>
---
 target-mips/translate.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 47daf85..849e75d 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -12768,8 +12768,11 @@ void cpu_state_reset(CPUMIPSState *env)
 
 #if defined(CONFIG_USER_ONLY)
     env->hflags = MIPS_HFLAG_UM;
-    /* Enable access to the SYNCI_Step register.  */
-    env->CP0_HWREna |= (1 << 1);
+    if (env->insn_flags & ISA_MIPS32R2) {
+        /* Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR
+           hardware registers.  */
+        env->CP0_HWREna |= 0x0000000F;
+    }
     if (env->CP0_Config1 & (1 << CP0C1_FP)) {
         env->hflags |= MIPS_HFLAG_FPU;
     }
-- 
1.7.7.6

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

end of thread, other threads:[~2012-08-21 16:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-20 23:41 [Qemu-devel] [PATCH] target-mips: Enable access to required RDHWR hardware registers Meador Inge
2012-08-21 10:14 ` Andreas Färber
2012-08-21 15:41   ` Meador Inge
2012-08-21 15:52     ` Aurelien Jarno
2012-08-21 16:04       ` Meador Inge

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