diff options
author | Nathan Binkert <nate@binkert.org> | 2009-04-08 22:21:27 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-04-08 22:21:27 -0700 |
commit | e0de2c34433be76eac7798e58e1ae02f5bffb732 (patch) | |
tree | 120f809cf3feb35e6b42e83a9896b8ae673c5445 /src/sim | |
parent | 7b5a96f06b530db35637aca6f9d0f7a2ddfa6e60 (diff) | |
download | gem5-e0de2c34433be76eac7798e58e1ae02f5bffb732.tar.xz |
tlb: More fixing of unified TLB
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__ |