summaryrefslogtreecommitdiff
path: root/src/arch/mips/tlb.cc
diff options
context:
space:
mode:
authorDerek Hower <drh5@cs.wisc.edu>2009-07-13 14:49:51 -0500
committerDerek Hower <drh5@cs.wisc.edu>2009-07-13 14:49:51 -0500
commit100da6b3267b4e3d6834cd872502b8303d289d17 (patch)
tree1a1427989468e5b6e5f8a1c1c7bb96b3bbdb6f2c /src/arch/mips/tlb.cc
parentd51445490d9f7ccd09d7003f4360044422bd7b57 (diff)
parent60577eb4caff66a756f260bff6bf3bf8cb7edcba (diff)
downloadgem5-100da6b3267b4e3d6834cd872502b8303d289d17.tar.xz
merge
Diffstat (limited to 'src/arch/mips/tlb.cc')
-rw-r--r--src/arch/mips/tlb.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/mips/tlb.cc b/src/arch/mips/tlb.cc
index 001dc2cb7..18a29122c 100644
--- a/src/arch/mips/tlb.cc
+++ b/src/arch/mips/tlb.cc
@@ -58,6 +58,21 @@ using namespace MipsISA;
#define MODE2MASK(X) (1 << (X))
+static inline mode_type
+getOperatingMode(MiscReg Stat)
+{
+ if((Stat & 0x10000006) != 0 || (Stat & 0x18) ==0) {
+ return mode_kernel;
+ } else if((Stat & 0x18) == 0x8) {
+ return mode_supervisor;
+ } else if((Stat & 0x18) == 0x10) {
+ return mode_user;
+ } else {
+ return mode_number;
+ }
+}
+
+
TLB::TLB(const Params *p)
: BaseTLB(p), size(p->size), nlu(0)
{