Deleted Added
sdiff udiff text old ( 8948:e95ee70f876c ) new ( 8975:7f36d4436074 )
full compact
1/*
2 * Copyright (c) 2012 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

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

41 * Andreas Hansson
42 */
43
44#include "debug/PacketQueue.hh"
45#include "mem/packet_queue.hh"
46
47using namespace std;
48
49PacketQueue::PacketQueue(EventManager& _em, Port& _port,
50 const std::string _label)
51 : em(_em), label(_label), sendEvent(this), drainEvent(NULL), port(_port),
52 waitingOnRetry(false)
53{
54}
55
56PacketQueue::~PacketQueue()
57{
58}
59

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

137{
138 assert(deferredPacketReady());
139
140 // take the next packet off the list here, as we might return to
141 // ourselves through the sendTiming call below
142 DeferredPacket dp = transmitList.front();
143 transmitList.pop_front();
144
145 // attempt to send the packet and remember the outcome
146 if (!dp.sendAsSnoop)
147 waitingOnRetry = !port.sendTiming(dp.pkt);
148 else
149 waitingOnRetry = !port.sendTimingSnoop(dp.pkt);
150
151 if (waitingOnRetry) {
152 // put the packet back at the front of the list (packet should
153 // not have changed since it wasn't accepted)
154 assert(!sendEvent.scheduled());
155 transmitList.push_front(dp);
156 }
157}

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

201unsigned int
202PacketQueue::drain(Event *de)
203{
204 if (transmitList.empty() && !sendEvent.scheduled())
205 return 0;
206 drainEvent = de;
207 return 1;
208}