summaryrefslogtreecommitdiff
path: root/src/arch/sparc/utility.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2012-02-11 14:16:38 -0800
committerGabe Black <gblack@eecs.umich.edu>2012-02-11 14:16:38 -0800
commit5b557a314f4dbde6f029b3f75c211332ac360f3a (patch)
tree8be804d79afc881903830e5281fc86b7f7d5d5dc /src/arch/sparc/utility.hh
parentaa513a4a99cb8dfc6b605797acbbb64a5601ab6e (diff)
downloadgem5-5b557a314f4dbde6f029b3f75c211332ac360f3a.tar.xz
SPARC: Make PSTATE and HPSTATE a BitUnion.
This gets rid of cryptic bits of code with lots of bit manipulation, and makes some comments redundant.
Diffstat (limited to 'src/arch/sparc/utility.hh')
-rw-r--r--src/arch/sparc/utility.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/sparc/utility.hh b/src/arch/sparc/utility.hh
index ee94ef29a..b8e3b3f0e 100644
--- a/src/arch/sparc/utility.hh
+++ b/src/arch/sparc/utility.hh
@@ -58,8 +58,9 @@ uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp);
static inline bool
inUserMode(ThreadContext *tc)
{
- return !((tc->readMiscRegNoEffect(MISCREG_PSTATE) & (1 << 2)) ||
- (tc->readMiscRegNoEffect(MISCREG_HPSTATE) & (1 << 2)));
+ PSTATE pstate = tc->readMiscRegNoEffect(MISCREG_PSTATE);
+ HPSTATE hpstate = tc->readMiscRegNoEffect(MISCREG_HPSTATE);
+ return !(pstate.priv || hpstate.hpriv);
}
/**