summaryrefslogtreecommitdiff
path: root/src/arch/mips/vtophys.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/mips/vtophys.hh')
-rw-r--r--src/arch/mips/vtophys.hh17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/arch/mips/vtophys.hh b/src/arch/mips/vtophys.hh
index 2e9ced9d4..e38182181 100644
--- a/src/arch/mips/vtophys.hh
+++ b/src/arch/mips/vtophys.hh
@@ -34,7 +34,6 @@
#define __ARCH_MIPS_VTOPHYS_H__
#include "arch/mips/isa_traits.hh"
-#include "arch/mips/pagetable.hh"
#include "arch/mips/utility.hh"
@@ -42,6 +41,22 @@ class ThreadContext;
class FunctionalPort;
namespace MipsISA {
+ inline Addr PteAddr(Addr a) { return (a & PteMask) << PteShift; }
+
+ // User Virtual
+ inline bool IsUSeg(Addr a) { return USegBase <= a && a <= USegEnd; }
+
+ inline bool IsKSeg0(Addr a) { return KSeg0Base <= a && a <= KSeg0End; }
+
+ inline Addr KSeg02Phys(Addr addr) { return addr & KSeg0Mask; }
+
+ inline Addr KSeg12Phys(Addr addr) { return addr & KSeg1Mask; }
+
+ inline bool IsKSeg1(Addr a) { return KSeg1Base <= a && a <= KSeg1End; }
+
+ inline bool IsKSSeg(Addr a) { return KSSegBase <= a && a <= KSSegEnd; }
+
+ inline bool IsKSeg3(Addr a) { return KSeg3Base <= a && a <= KSeg3End; }
Addr vtophys(Addr vaddr);