summaryrefslogtreecommitdiff
path: root/src/arch/mips/tlb.cc
diff options
context:
space:
mode:
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)
{