diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-08-21 14:25:51 -0400 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-08-21 14:25:51 -0400 |
commit | 623c697a3f8ce80e417089a2e69c4bf93ae0cf26 (patch) | |
tree | 47e8385241a1f7207b895f2f69aaf1235efab915 /src/arch | |
parent | e54c5c99debbd6881dec57828d05047d7921cebd (diff) | |
download | gem5-623c697a3f8ce80e417089a2e69c4bf93ae0cf26.tar.xz |
Fixed the parameters to memset. sizeof(regSegments[x]) may have been returning the size of a pointer to an IntReg
--HG--
extra : convert_revision : 02c04ffceb447b7683ba5ebd4752819d0014cc19
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/sparc/intregfile.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/arch/sparc/intregfile.cc b/src/arch/sparc/intregfile.cc index 0cc0a886a..bef62f6ae 100644 --- a/src/arch/sparc/intregfile.cc +++ b/src/arch/sparc/intregfile.cc @@ -60,9 +60,9 @@ void IntRegFile::clear() { int x; for (x = 0; x < MaxGL; x++) - memset(regGlobals[x], 0, sizeof(regGlobals[x])); + memset(regGlobals[x], 0, sizeof(IntReg) * RegsPerFrame); for(int x = 0; x < 2 * NWindows; x++) - bzero(regSegments[x], sizeof(regSegments[x])); + bzero(regSegments[x], sizeof(IntReg) * RegsPerFrame); } IntRegFile::IntRegFile() @@ -84,8 +84,10 @@ IntReg IntRegFile::readReg(int intReg) Fault IntRegFile::setReg(int intReg, const IntReg &val) { if(intReg) + { DPRINTF(Sparc, "Wrote register %d = 0x%x\n", intReg, val); - regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask] = val; + regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask] = val; + } return NoFault; } |