table_walker.cc (8733:64a7bf8fa56c) table_walker.cc (8832:247fee427324)
1/*
2 * Copyright (c) 2010 ARM Limited
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

--- 38 unchanged lines hidden (view full) ---

47#include "debug/TLBVerbose.hh"
48#include "dev/io_device.hh"
49#include "sim/system.hh"
50
51using namespace ArmISA;
52
53TableWalker::TableWalker(const Params *p)
54 : MemObject(p), port(NULL), tlb(NULL), currState(NULL), pending(false),
1/*
2 * Copyright (c) 2010 ARM Limited
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

--- 38 unchanged lines hidden (view full) ---

47#include "debug/TLBVerbose.hh"
48#include "dev/io_device.hh"
49#include "sim/system.hh"
50
51using namespace ArmISA;
52
53TableWalker::TableWalker(const Params *p)
54 : MemObject(p), port(NULL), tlb(NULL), currState(NULL), pending(false),
55 masterId(p->sys->getMasterId(name())),
55 doL1DescEvent(this), doL2DescEvent(this), doProcessEvent(this)
56{
57 sctlr = 0;
58}
59
60TableWalker::~TableWalker()
61{
62 ;
63}
64
56 doL1DescEvent(this), doL2DescEvent(this), doProcessEvent(this)
57{
58 sctlr = 0;
59}
60
61TableWalker::~TableWalker()
62{
63 ;
64}
65
65
66unsigned int
67TableWalker::drain(Event *de)
68{
69 if (stateQueueL1.size() || stateQueueL2.size() || pendingQueue.size())
70 {
71 changeState(Draining);
72 DPRINTF(Checkpoint, "TableWalker busy, wait to drain\n");
73 return 1;

--- 160 unchanged lines hidden (view full) ---

234 currState = NULL;
235 } else if (!currState->functional) {
236 port->dmaAction(MemCmd::ReadReq, l1desc_addr, sizeof(uint32_t),
237 NULL, (uint8_t*)&currState->l1Desc.data,
238 currState->tc->getCpuPtr()->ticks(1), flag);
239 doL1Descriptor();
240 f = currState->fault;
241 } else {
66unsigned int
67TableWalker::drain(Event *de)
68{
69 if (stateQueueL1.size() || stateQueueL2.size() || pendingQueue.size())
70 {
71 changeState(Draining);
72 DPRINTF(Checkpoint, "TableWalker busy, wait to drain\n");
73 return 1;

--- 160 unchanged lines hidden (view full) ---

234 currState = NULL;
235 } else if (!currState->functional) {
236 port->dmaAction(MemCmd::ReadReq, l1desc_addr, sizeof(uint32_t),
237 NULL, (uint8_t*)&currState->l1Desc.data,
238 currState->tc->getCpuPtr()->ticks(1), flag);
239 doL1Descriptor();
240 f = currState->fault;
241 } else {
242 RequestPtr req = new Request(l1desc_addr, sizeof(uint32_t), flag);
242 RequestPtr req = new Request(l1desc_addr, sizeof(uint32_t), flag, masterId);
243 PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
244 pkt->dataStatic((uint8_t*)&currState->l1Desc.data);
245 port->sendFunctional(pkt);
246 doL1Descriptor();
247 delete req;
248 delete pkt;
249 f = currState->fault;
250 }

--- 327 unchanged lines hidden (view full) ---

578 &doL2DescEvent, (uint8_t*)&currState->l2Desc.data,
579 currState->tc->getCpuPtr()->ticks(1));
580 } else if (!currState->functional) {
581 port->dmaAction(MemCmd::ReadReq, l2desc_addr, sizeof(uint32_t),
582 NULL, (uint8_t*)&currState->l2Desc.data,
583 currState->tc->getCpuPtr()->ticks(1));
584 doL2Descriptor();
585 } else {
243 PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
244 pkt->dataStatic((uint8_t*)&currState->l1Desc.data);
245 port->sendFunctional(pkt);
246 doL1Descriptor();
247 delete req;
248 delete pkt;
249 f = currState->fault;
250 }

--- 327 unchanged lines hidden (view full) ---

578 &doL2DescEvent, (uint8_t*)&currState->l2Desc.data,
579 currState->tc->getCpuPtr()->ticks(1));
580 } else if (!currState->functional) {
581 port->dmaAction(MemCmd::ReadReq, l2desc_addr, sizeof(uint32_t),
582 NULL, (uint8_t*)&currState->l2Desc.data,
583 currState->tc->getCpuPtr()->ticks(1));
584 doL2Descriptor();
585 } else {
586 RequestPtr req = new Request(l2desc_addr, sizeof(uint32_t), 0);
586 RequestPtr req = new Request(l2desc_addr, sizeof(uint32_t), 0, masterId);
587 PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
588 pkt->dataStatic((uint8_t*)&currState->l2Desc.data);
589 port->sendFunctional(pkt);
590 doL2Descriptor();
591 delete req;
592 delete pkt;
593 }
594 return;

--- 161 unchanged lines hidden ---
587 PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
588 pkt->dataStatic((uint8_t*)&currState->l2Desc.data);
589 port->sendFunctional(pkt);
590 doL2Descriptor();
591 delete req;
592 delete pkt;
593 }
594 return;

--- 161 unchanged lines hidden ---