From c2ceaa887e07a219b16423d8f9c20624785ee4a1 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 14 Nov 2006 01:29:11 -0500 Subject: [PATCH] Make sure a POR doesn't clobber the value of the hpstate. --HG-- extra : convert_revision : 4504f08fd94792819bd4419bbd2e0ebd1d7f29e9 --- src/arch/sparc/faults.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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);