summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-14 01:29:11 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-14 01:29:11 -0500
commitc2ceaa887e07a219b16423d8f9c20624785ee4a1 (patch)
tree1457409febcf6ac746634e34fec1023c712214a3 /src
parent6b95f24145d363ab72d26bf74a4ddb43ba9f9835 (diff)
downloadgem5-c2ceaa887e07a219b16423d8f9c20624785ee4a1.tar.xz
Make sure a POR doesn't clobber the value of the hpstate.
--HG-- extra : convert_revision : 4504f08fd94792819bd4419bbd2e0ebd1d7f29e9
Diffstat (limited to 'src')
-rw-r--r--src/arch/sparc/faults.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/arch/sparc/faults.cc b/src/arch/sparc/faults.cc
index 4cf411d3b..3ec41ba61 100644
--- a/src/arch/sparc/faults.cc
+++ b/src/arch/sparc/faults.cc
@@ -593,7 +593,16 @@ void PowerOnReset::invoke(ThreadContext * tc)
tc->setMiscReg(MISCREG_PSTATE, 1 << 4);
//Turn on red and hpriv, set everything else to 0
- tc->setMiscReg(MISCREG_HPSTATE, (1 << 5) | (1 << 2));
+ MiscReg HPSTATE = tc->readMiscReg(MISCREG_HPSTATE);
+ //HPSTATE.red = 1
+ HPSTATE |= (1 << 5);
+ //HPSTATE.hpriv = 1
+ HPSTATE |= (1 << 2);
+ //HPSTATE.ibe = 0
+ HPSTATE &= ~(1 << 10);
+ //HPSTATE.tlz = 0
+ HPSTATE &= ~(1 << 0);
+ tc->setMiscReg(MISCREG_HPSTATE, HPSTATE);
//The tick register is unreadable by nonprivileged software
tc->setMiscReg(MISCREG_TICK, 1ULL << 63);