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/remote_gdb.cc | |
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/remote_gdb.cc')
-rw-r--r-- | src/arch/sparc/remote_gdb.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/sparc/remote_gdb.cc b/src/arch/sparc/remote_gdb.cc index ece6ec963..1298e327e 100644 --- a/src/arch/sparc/remote_gdb.cc +++ b/src/arch/sparc/remote_gdb.cc @@ -181,9 +181,9 @@ RemoteGDB::getregs() memset(gdbregs.regs, 0, gdbregs.size); PCState pc = context->pcState(); + PSTATE pstate = context->readMiscReg(MISCREG_PSTATE); - if (context->readMiscReg(MISCREG_PSTATE) & - PSTATE::am) { + if (pstate.am) { uint32_t *regs; regs = (uint32_t*)gdbregs.regs; regs[Reg32Pc] = htobe((uint32_t)pc.pc()); @@ -192,7 +192,7 @@ RemoteGDB::getregs() regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0)); regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1)); - regs[Reg32Psr] = htobe((uint32_t)context->readMiscReg(MISCREG_PSTATE)); + regs[Reg32Psr] = htobe((uint32_t)pstate); regs[Reg32Fsr] = htobe((uint32_t)context->readMiscReg(MISCREG_FSR)); regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2)); } else { @@ -206,7 +206,7 @@ RemoteGDB::getregs() gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1)); gdbregs.regs[RegState] = htobe( context->readMiscReg(MISCREG_CWP) | - context->readMiscReg(MISCREG_PSTATE) << 8 | + pstate << 8 | context->readMiscReg(MISCREG_ASI) << 24 | context->readIntReg(NumIntArchRegs + 2) << 32); } |