summaryrefslogtreecommitdiff
path: root/src/arch/sparc/isa.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/isa.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/isa.hh')
-rw-r--r--src/arch/sparc/isa.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/sparc/isa.hh b/src/arch/sparc/isa.hh
index e5d258786..713f01fa5 100644
--- a/src/arch/sparc/isa.hh
+++ b/src/arch/sparc/isa.hh
@@ -71,7 +71,7 @@ class ISA
// on the previous level)
uint64_t tba; // Trap Base Address
- uint16_t pstate; // Process State Register
+ PSTATE pstate; // Process State Register
uint8_t tl; // Trap Level
uint8_t pil; // Process Interrupt Register
uint8_t cwp; // Current Window Pointer
@@ -83,7 +83,7 @@ class ISA
uint8_t gl; // Global level register
/** Hyperprivileged Registers */
- uint64_t hpstate; // Hyperprivileged State Register
+ HPSTATE hpstate; // Hyperprivileged State Register
uint64_t htstate[MaxTL];// Hyperprivileged Trap State Register
uint64_t hintp;
uint64_t htba; // Hyperprivileged Trap Base Address register
@@ -172,8 +172,8 @@ class ISA
protected:
- bool isHyperPriv() { return (hpstate & (1 << 2)); }
- bool isPriv() { return (hpstate & (1 << 2)) || (pstate & (1 << 2)); }
+ bool isHyperPriv() { return hpstate.hpriv; }
+ bool isPriv() { return hpstate.hpriv || pstate.priv; }
bool isNonPriv() { return !isPriv(); }
public: