pagetable_walker.hh (8711:c7e14f52c682) | pagetable_walker.hh (8832:247fee427324) |
---|---|
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" | 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" |
|
53 54class ThreadContext; 55 56namespace X86ISA 57{ 58 class Walker : public MemObject 59 { 60 protected: 61 // Port for accessing memory 62 class WalkerPort : public Port 63 { 64 public: 65 WalkerPort(const std::string &_name, Walker * _walker) : 66 Port(_name, _walker), walker(_walker) 67 {} 68 69 protected: | 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: |
70 Walker * walker; | 71 Walker *walker; |
71 72 bool recvTiming(PacketPtr pkt); 73 Tick recvAtomic(PacketPtr pkt); 74 void recvFunctional(PacketPtr pkt); 75 void recvRangeChange(); 76 void recvRetry(); 77 bool isSnooping() { return true; } 78 }; --- 13 unchanged lines hidden (view full) --- 92 LongPML4, LongPDP, LongPD, LongPTE, 93 // PAE legacy mode 94 PAEPDP, PAEPD, PAEPTE, 95 // Non PAE legacy mode with and without PSE 96 PSEPD, PD, PTE 97 }; 98 99 protected: | 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: |
100 Walker * walker; | 101 Walker *walker; |
101 ThreadContext *tc; 102 RequestPtr req; 103 State state; 104 State nextState; 105 int dataSize; 106 bool enableNX; 107 unsigned inflight; 108 TlbEntry entry; 109 PacketPtr read; 110 std::vector<PacketPtr> writes; 111 Fault timingFault; 112 TLB::Translation * translation; 113 BaseTLB::Mode mode; 114 bool functional; 115 bool timing; 116 bool retrying; 117 bool started; | 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; |
118 | |
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; | 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; |
|
175 176 // Functions for dealing with packets. 177 bool recvTiming(PacketPtr pkt); 178 void recvRetry(); 179 bool sendTiming(WalkerState * sendingState, PacketPtr pkt); 180 181 public: 182 183 void setTLB(TLB * _tlb) 184 { 185 tlb = _tlb; 186 } 187 188 typedef X86PagetableWalkerParams Params; 189 | 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 |
|
190 Walker(const Params *params) : 191 MemObject(params), port(name() + ".port", this), | 197 Walker(const Params *params) : 198 MemObject(params), port(name() + ".port", this), |
192 funcState(this, NULL, NULL, true), tlb(NULL), sys(params->system) | 199 funcState(this, NULL, NULL, true), tlb(NULL), sys(params->system), 200 masterId(sys->getMasterId(name())) |
193 { 194 } 195 }; 196} 197#endif // __ARCH_X86_PAGE_TABLE_WALKER_HH__ | 201 { 202 } 203 }; 204} 205#endif // __ARCH_X86_PAGE_TABLE_WALKER_HH__ |