1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 36 unchanged lines hidden (view full) --- 45#include "arch/x86/pagetable.hh" 46#include "arch/x86/tlb.hh" 47#include "base/fast_alloc.hh" 48#include "base/types.hh" 49#include "mem/mem_object.hh" 50#include "mem/packet.hh" 51#include "params/X86PagetableWalker.hh" 52#include "sim/faults.hh" |
53#include "sim/system.hh" |
54 55class ThreadContext; 56 57namespace X86ISA 58{ 59 class Walker : public MemObject 60 { 61 protected: 62 // Port for accessing memory 63 class WalkerPort : public Port 64 { 65 public: 66 WalkerPort(const std::string &_name, Walker * _walker) : 67 Port(_name, _walker), walker(_walker) 68 {} 69 70 protected: |
71 Walker *walker; |
72 73 bool recvTiming(PacketPtr pkt); 74 Tick recvAtomic(PacketPtr pkt); 75 void recvFunctional(PacketPtr pkt); 76 void recvRangeChange(); 77 void recvRetry(); 78 bool isSnooping() { return true; } 79 }; --- 13 unchanged lines hidden (view full) --- 93 LongPML4, LongPDP, LongPD, LongPTE, 94 // PAE legacy mode 95 PAEPDP, PAEPD, PAEPTE, 96 // Non PAE legacy mode with and without PSE 97 PSEPD, PD, PTE 98 }; 99 100 protected: |
101 Walker *walker; |
102 ThreadContext *tc; 103 RequestPtr req; 104 State state; 105 State nextState; 106 int dataSize; 107 bool enableNX; 108 unsigned inflight; 109 TlbEntry entry; 110 PacketPtr read; 111 std::vector<PacketPtr> writes; 112 Fault timingFault; 113 TLB::Translation * translation; 114 BaseTLB::Mode mode; 115 bool functional; 116 bool timing; 117 bool retrying; 118 bool started; |
119 public: 120 WalkerState(Walker * _walker, BaseTLB::Translation *_translation, 121 RequestPtr _req, bool _isFunctional = false) : 122 walker(_walker), req(_req), state(Ready), 123 nextState(Ready), inflight(0), 124 translation(_translation), 125 functional(_isFunctional), timing(false), 126 retrying(false), started(false) --- 40 unchanged lines hidden (view full) --- 167 RequestPtr req, BaseTLB::Mode mode); 168 Fault startFunctional(ThreadContext * _tc, Addr &addr, 169 Addr &pageSize, BaseTLB::Mode mode); 170 171 protected: 172 // The TLB we're supposed to load. 173 TLB * tlb; 174 System * sys; |
175 MasterID masterId; |
176 177 // Functions for dealing with packets. 178 bool recvTiming(PacketPtr pkt); 179 void recvRetry(); 180 bool sendTiming(WalkerState * sendingState, PacketPtr pkt); 181 182 public: 183 184 void setTLB(TLB * _tlb) 185 { 186 tlb = _tlb; 187 } 188 189 typedef X86PagetableWalkerParams Params; 190 |
191 const Params * 192 params() const 193 { 194 return static_cast<const Params *>(_params); 195 } 196 |
197 Walker(const Params *params) : 198 MemObject(params), port(name() + ".port", this), |
199 funcState(this, NULL, NULL, true), tlb(NULL), sys(params->system), 200 masterId(sys->getMasterId(name())) |
201 { 202 } 203 }; 204} 205#endif // __ARCH_X86_PAGE_TABLE_WALKER_HH__ |