#include <memory>
+#include "arch/x86/faults.hh"
#include "arch/x86/pagetable.hh"
#include "arch/x86/tlb.hh"
#include "arch/x86/vtophys.hh"
}
-BaseMasterPort &
-Walker::getMasterPort(const std::string &if_name, PortID idx)
+Port &
+Walker::getPort(const std::string &if_name, PortID idx)
{
if (if_name == "port")
return port;
else
- return MemObject::getMasterPort(if_name, idx);
+ return ClockedObject::getPort(if_name, idx);
}
void
std::make_shared<UnimpFault>("Squashed Inst"),
currState->req, currState->tc, currState->mode);
- // delete the current request
- delete currState;
+ // delete the current request if there are no inflight packets.
+ // if there is something in flight, delete when the packets are
+ // received and inflight is zero.
+ if (currState->numInflight() == 0) {
+ delete currState;
+ } else {
+ currState->squash();
+ }
// check the next translation request, if it exists
if (currStates.size())
write = NULL;
PageTableEntry pte;
if (dataSize == 8)
- pte = read->get<uint64_t>();
+ pte = read->getLE<uint64_t>();
else
- pte = read->get<uint32_t>();
+ pte = read->getLE<uint32_t>();
VAddr vaddr = entry.vaddr;
bool uncacheable = pte.pcd;
Addr nextRead = 0;
// value back to memory.
if (doWrite) {
write = oldRead;
- write->set<uint64_t>(pte);
+ write->setLE<uint64_t>(pte);
write->cmd = MemCmd::WriteReq;
} else {
write = NULL;
assert(inflight);
assert(state == Waiting);
inflight--;
+ if (squashed) {
+ // if were were squashed, return true once inflight is zero and
+ // this WalkerState will be freed there.
+ return (inflight == 0);
+ }
if (pkt->isRead()) {
// should not have a pending read it we also had one outstanding
assert(!read);
}
}
+unsigned
+Walker::WalkerState::numInflight() const
+{
+ return inflight;
+}
+
bool
Walker::WalkerState::isRetrying()
{
return started;
}
+void
+Walker::WalkerState::squash()
+{
+ squashed = true;
+}
+
void
Walker::WalkerState::retry()
{