diff options
author | Korey Sewell <ksewell@umich.edu> | 2007-11-15 00:14:20 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2007-11-15 00:14:20 -0500 |
commit | 375ddf8d25c3d81a77bd5dd7b70f84a0dbe48fe8 (patch) | |
tree | 525cf56502718b69fb7f0e78162a8d5e63256489 /src/arch/x86/tlb.hh | |
parent | 2820a448e2bcb861d099b1256087004462b78895 (diff) | |
parent | 7c8e4ca3a3b66becbc3e4e7b5e106f5c44b09b6f (diff) | |
download | gem5-375ddf8d25c3d81a77bd5dd7b70f84a0dbe48fe8.tar.xz |
branch merge
--HG--
extra : convert_revision : 1c56f3c6f2c50d642d2de5ddde83a55234455cec
Diffstat (limited to 'src/arch/x86/tlb.hh')
-rw-r--r-- | src/arch/x86/tlb.hh | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/src/arch/x86/tlb.hh b/src/arch/x86/tlb.hh index 12739379c..a361c2291 100644 --- a/src/arch/x86/tlb.hh +++ b/src/arch/x86/tlb.hh @@ -59,10 +59,13 @@ #define __ARCH_X86_TLB_HH__ #include <list> +#include <vector> +#include <string> #include "arch/x86/pagetable.hh" #include "arch/x86/segmentregs.hh" #include "config/full_system.hh" +#include "mem/mem_object.hh" #include "mem/request.hh" #include "params/X86DTB.hh" #include "params/X86ITB.hh" @@ -74,16 +77,26 @@ class Packet; namespace X86ISA { + class Walker; + static const unsigned StoreCheck = 1 << NUM_SEGMENTREGS; + class TLB; + class TLB : public SimObject { -#if !FULL_SYSTEM protected: friend class FakeITLBFault; friend class FakeDTLBFault; -#endif + + bool _allowNX; + public: + bool allowNX() const + { + return _allowNX; + } + typedef X86TLBParams Params; TLB(const Params *p); @@ -91,28 +104,38 @@ namespace X86ISA TlbEntry *lookup(Addr va, bool update_lru = true); +#if FULL_SYSTEM protected: - int size; - - TlbEntry * tlb; - typedef std::list<TlbEntry *> EntryList; - EntryList freeList; - EntryList entryList; + Walker * walker; - void insert(Addr vpn, TlbEntry &entry); + void walk(ThreadContext * _tc, Addr vaddr); +#endif + public: void invalidateAll(); void invalidateNonGlobal(); void demapPage(Addr va); + protected: + int size; + + TlbEntry * tlb; + + typedef std::list<TlbEntry *> EntryList; + EntryList freeList; + EntryList entryList; + template<class TlbFault> Fault translate(RequestPtr &req, ThreadContext *tc, bool write, bool execute); public: + + void insert(Addr vpn, TlbEntry &entry); + // Checkpointing virtual void serialize(std::ostream &os); virtual void unserialize(Checkpoint *cp, const std::string §ion); @@ -124,6 +147,7 @@ namespace X86ISA typedef X86ITBParams Params; ITB(const Params *p) : TLB(p) { + _allowNX = false; } Fault translate(RequestPtr &req, ThreadContext *tc); @@ -137,6 +161,7 @@ namespace X86ISA typedef X86DTBParams Params; DTB(const Params *p) : TLB(p) { + _allowNX = true; } Fault translate(RequestPtr &req, ThreadContext *tc, bool write); #if FULL_SYSTEM |