void FakeITLBFault::invoke(ThreadContext * tc)
{
// Start the page table walker.
- tc->getITBPtr()->walk(tc, vaddr);
+ tc->getITBPtr()->walk(tc, vaddr, write, execute);
}
void FakeDTLBFault::invoke(ThreadContext * tc)
{
// Start the page table walker.
- tc->getDTBPtr()->walk(tc, vaddr);
+ tc->getDTBPtr()->walk(tc, vaddr, write, execute);
}
#else // !FULL_SYSTEM
{
protected:
Addr vaddr;
+ bool write;
+ bool execute;
public:
- FakeITLBFault(Addr _vaddr) :
+ FakeITLBFault(Addr _vaddr, bool _write, bool _execute) :
X86Fault("fake instruction tlb fault", "itlb", 0),
- vaddr(_vaddr)
+ vaddr(_vaddr), write(_write), execute(_execute)
{}
void invoke(ThreadContext * tc);
{
protected:
Addr vaddr;
+ bool write;
+ bool execute;
public:
- FakeDTLBFault(Addr _vaddr) :
+ FakeDTLBFault(Addr _vaddr, bool _write, bool _execute) :
X86Fault("fake data tlb fault", "dtlb", 0),
- vaddr(_vaddr)
+ vaddr(_vaddr), write(_write), execute(_execute)
{}
void invoke(ThreadContext * tc);
}
void
-Walker::start(ThreadContext * _tc, Addr vaddr)
+Walker::start(ThreadContext * _tc, Addr vaddr, bool _write, bool _execute)
{
assert(state == Ready);
assert(!tc);
tc = _tc;
+ execute = _execute;
+ write = _write;
VAddr addr = vaddr;
void doNext(PacketPtr &read, PacketPtr &write);
// Kick off the state machine.
- void start(ThreadContext * _tc, Addr vaddr);
+ void start(ThreadContext * _tc, Addr vaddr, bool write, bool execute);
protected:
State nextState;
int size;
bool enableNX;
+ bool write, execute;
TlbEntry entry;
+
+ Fault pageFault(bool present);
public:
#if FULL_SYSTEM
void
-TLB::walk(ThreadContext * _tc, Addr vaddr)
+TLB::walk(ThreadContext * _tc, Addr vaddr, bool write, bool execute)
{
- walker->start(_tc, vaddr);
+ walker->start(_tc, vaddr, write, execute);
}
#endif
// The vaddr already has the segment base applied.
TlbEntry *entry = lookup(vaddr);
if (!entry) {
- return new TlbFault(vaddr);
+ return new TlbFault(vaddr, write, execute);
} else {
// Do paging protection checks.
DPRINTF(TLB, "Entry found with paddr %#x, doing protection checks.\n", entry->paddr);
Walker * walker;
- void walk(ThreadContext * _tc, Addr vaddr);
+ void walk(ThreadContext * _tc, Addr vaddr, bool write, bool execute);
#endif
public: