diff options
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/tlb.cc | 7 | ||||
-rw-r--r-- | src/sim/tlb.hh | 18 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/sim/tlb.cc b/src/sim/tlb.cc index 60ad8c155..e9a719ffa 100644 --- a/src/sim/tlb.cc +++ b/src/sim/tlb.cc @@ -34,7 +34,7 @@ #include "sim/tlb.hh" Fault -GenericTLB::translateAtomic(RequestPtr req, ThreadContext * tc, bool, bool) +GenericTLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode) { #if FULL_SYSTEM panic("Generic translation shouldn't be used in full system mode.\n"); @@ -51,11 +51,10 @@ GenericTLB::translateAtomic(RequestPtr req, ThreadContext * tc, bool, bool) void GenericTLB::translateTiming(RequestPtr req, ThreadContext *tc, - Translation *translation, bool write, bool execute) + Translation *translation, Mode mode) { assert(translation); - translation->finish(translateAtomic(req, tc, write, execute), - req, tc, write, execute); + translation->finish(translateAtomic(req, tc, mode), req, tc, mode); } void diff --git a/src/sim/tlb.hh b/src/sim/tlb.hh index 6c1bf5350..db62b691d 100644 --- a/src/sim/tlb.hh +++ b/src/sim/tlb.hh @@ -42,10 +42,14 @@ class Packet; class BaseTLB : public SimObject { protected: - BaseTLB(const Params *p) : SimObject(p) + BaseTLB(const Params *p) + : SimObject(p) {} public: + enum Mode { Read, Write, Execute }; + + public: virtual void demapPage(Addr vaddr, uint64_t asn) = 0; class Translation @@ -59,24 +63,24 @@ class BaseTLB : public SimObject * be responsible for cleaning itself up which will happen in this * function. Once it's called, the object is no longer valid. */ - virtual void finish(Fault fault, RequestPtr req, - ThreadContext *tc, bool write=false, bool execute=false) = 0; + virtual void finish(Fault fault, RequestPtr req, ThreadContext *tc, + Mode mode) = 0; }; }; class GenericTLB : public BaseTLB { protected: - GenericTLB(const Params *p) : BaseTLB(p) + GenericTLB(const Params *p) + : BaseTLB(p) {} public: void demapPage(Addr vaddr, uint64_t asn); - Fault translateAtomic(RequestPtr req, ThreadContext *tc, - bool=false, bool=false); + Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode); void translateTiming(RequestPtr req, ThreadContext *tc, - Translation *translation, bool=false, bool=false); + Translation *translation, Mode mode); }; #endif // __ARCH_SPARC_TLB_HH__ |