summaryrefslogtreecommitdiff
path: root/src/arch/x86/miscregfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/miscregfile.cc')
-rw-r--r--src/arch/x86/miscregfile.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/x86/miscregfile.cc b/src/arch/x86/miscregfile.cc
index 5d75af0cf..930bf53c7 100644
--- a/src/arch/x86/miscregfile.cc
+++ b/src/arch/x86/miscregfile.cc
@@ -87,6 +87,7 @@
#include "arch/x86/miscregfile.hh"
#include "arch/x86/tlb.hh"
+#include "cpu/base.hh"
#include "cpu/thread_context.hh"
#include "sim/serialize.hh"
@@ -178,6 +179,10 @@ MiscReg MiscRegFile::readReg(int miscReg, ThreadContext * tc)
break;
}
}
+ switch (miscReg) {
+ case MISCREG_TSC:
+ return regVal[MISCREG_TSC] + tc->getCpuPtr()->curCycle();
+ }
return readRegNoEffect(miscReg);
}
@@ -377,6 +382,9 @@ void MiscRegFile::setReg(int miscReg,
MISCREG_SEG_BASE_BASE)] = val;
}
break;
+ case MISCREG_TSC:
+ regVal[MISCREG_TSC] = val - tc->getCpuPtr()->curCycle();
+ return;
}
setRegNoEffect(miscReg, newVal);
}