61a62
> #include <vector>
90a92,93
> bool allowNX;
>
119,121c122,129
< // Act on the current state and determine what to do next. If the
< // walker has finished updating the TLB, this will return false.
< bool doNext(PacketPtr read, PacketPtr &write);
---
> // Act on the current state and determine what to do next. read
> // should be the packet that just came back from a read and write
> // should be NULL. When the function returns, read is either NULL
> // if the machine is finished, or points to a packet to initiate
> // the next read. If any write is required to update an "accessed"
> // bit, write will point to a packet to do the write. Otherwise it
> // will be NULL.
> void doNext(PacketPtr &read, PacketPtr &write);
123,129d130
< // This does an actual load to feed the walker. If we're in
< // atomic mode, this will drive the state machine itself until
< // the TLB is filled. If we're in timing mode, the port getting
< // a reply will drive the machine using this function which will
< // return after starting the memory operation.
< void doMemory(Addr addr);
<
131,157c132
< void start(bool _uncachable, Addr _vaddr, Addr cr3, State next)
< {
< assert(state == Ready);
< state = Waiting;
< nextState = next;
< // If PAE isn't being used, entries are 4 bytes. Otherwise
< // they're 8.
< if (next == PSEPD || next == PD || next == PTE)
< size = 4;
< else
< size = 8;
< vaddr = _vaddr;
< uncachable = _uncacheable;
< buildPacket(cr3);
< if (state == Enums::timing) {
< port->sendTiming(&packet);
< } else if (state == Enums::atomic) {
< port->sendAtomic(&packet);
< Addr addr;
< while(doNext(packet.get<uint64_t>(), addr)) {
< buildPacket(addr);
< port->sendAtomic(&packet);
< }
< } else {
< panic("Unrecognized memory system mode.\n");
< }
< };
---
> void start(ThreadContext * _tc, Addr vaddr);
161a137,158
> /*
> * State having to do with sending packets.
> */
> PacketPtr read;
> std::vector<PacketPtr> writes;
>
> // How many memory operations are in flight.
> unsigned inflight;
>
> bool retrying;
>
> /*
> * Functions for dealing with packets.
> */
> bool recvTiming(PacketPtr pkt);
> void recvRetry();
>
> void sendPackets();
>
> /*
> * Port for accessing memory
> */
167c164
< packet(NULL), snoopRangeSent(false), retrying(false)
---
> snoopRangeSent(false)
173,175d169
< PacketPtr packet;
< vector<PacketPtr> writes;
<
177d170
< bool retrying;
190,198d182
<
< public:
< bool sendTiming(PacketPtr pkt)
< {
< retrying = !Port::sendTiming(pkt);
< return !retrying;
< }
<
< bool blocked() { return retrying; }
205,207c189
< Packet packet;
< Request request;
<
---
> // The TLB we're supposed to load.
209a192,195
> /*
> * State machine state.
> */
> ThreadContext * tc;
212a199,200
> bool enableNX;
> TlbEntry entry;
214,215d201
< Addr vaddr;
<
217a204
> read(NULL), inflight(0), retrying(false),
219,220c206,207
< packet(&request, ReadExReq, Broadcast),
< tlb(_tlb), state(Ready), nextState(Ready)
---
> tlb(_tlb),
> tc(NULL), state(Ready), nextState(Ready)
223,224d209
<
<
227a213
>
229a216,217
> Port *getPort(const std::string &if_name, int idx = -1);
>
239,240d226
< Port *getPort(const std::string &if_name, int idx = -1);
<
264a251,252
> sys = p->system;
> allowNX = false;
277a266,267
> sys = p->system;
> allowNX = true;