diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2012-02-11 14:16:38 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2012-02-11 14:16:38 -0800 |
commit | 5b557a314f4dbde6f029b3f75c211332ac360f3a (patch) | |
tree | 8be804d79afc881903830e5281fc86b7f7d5d5dc /src/arch/sparc/miscregs.hh | |
parent | aa513a4a99cb8dfc6b605797acbbb64a5601ab6e (diff) | |
download | gem5-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/miscregs.hh')
-rw-r--r-- | src/arch/sparc/miscregs.hh | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/arch/sparc/miscregs.hh b/src/arch/sparc/miscregs.hh index 890013ec0..7008b6b36 100644 --- a/src/arch/sparc/miscregs.hh +++ b/src/arch/sparc/miscregs.hh @@ -32,6 +32,7 @@ #ifndef __ARCH_SPARC_MISCREGS_HH__ #define __ARCH_SPARC_MISCREGS_HH__ +#include "base/bitunion.hh" #include "base/types.hh" namespace SparcISA @@ -115,26 +116,25 @@ enum MiscRegIndex MISCREG_NUMMISCREGS }; -struct HPSTATE -{ - const static uint64_t id = 0x800; // this impl. dependent (id) field m - const static uint64_t ibe = 0x400; - const static uint64_t red = 0x20; - const static uint64_t hpriv = 0x4; - const static uint64_t tlz = 0x1; -}; - - -struct PSTATE -{ - const static int cle = 0x200; - const static int tle = 0x100; - const static int mm = 0xC0; - const static int pef = 0x10; - const static int am = 0x8; - const static int priv = 0x4; - const static int ie = 0x2; -}; +BitUnion64(HPSTATE) + Bitfield<0> tlz; + Bitfield<2> hpriv; + Bitfield<5> red; + Bitfield<10> ibe; + Bitfield<11> id; // this impl. dependent (id) field m +EndBitUnion(HPSTATE) + +BitUnion16(PSTATE) + Bitfield<1> ie; + Bitfield<2> priv; + Bitfield<3> am; + Bitfield<4> pef; + Bitfield<6, 7> mm; + Bitfield<8> tle; + Bitfield<9> cle; + Bitfield<10> pid0; + Bitfield<11> pid1; +EndBitUnion(PSTATE) struct STS { |