io_device.cc (2659:e10ebef009c1) io_device.cc (2662:f24ae2d09e27)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

75 port->transmitList.push_back(packet);
76}
77
78
79
80bool
81PioPort::recvTiming(Packet *pkt)
82{
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

75 port->transmitList.push_back(packet);
76}
77
78
79
80bool
81PioPort::recvTiming(Packet *pkt)
82{
83 device->recvAtomic(pkt);
83 Tick latency = device->recvAtomic(pkt);
84 // turn packet around to go back to requester
85 pkt->makeTimingResponse();
84 // turn packet around to go back to requester
85 pkt->makeTimingResponse();
86 sendTiming(pkt, pkt->time - pkt->req->getTime());
86 sendTiming(pkt, latency);
87 return true;
88}
89
90PioDevice::~PioDevice()
91{
92 if (pioPort)
93 delete pioPort;
94}

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

138DmaDevice::DmaDevice(Params *p)
139 : PioDevice(p), dmaPort(NULL)
140{ }
141
142void
143DmaPort::recvRetry()
144{
145 Packet* pkt = transmitList.front();
87 return true;
88}
89
90PioDevice::~PioDevice()
91{
92 if (pioPort)
93 delete pioPort;
94}

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

138DmaDevice::DmaDevice(Params *p)
139 : PioDevice(p), dmaPort(NULL)
140{ }
141
142void
143DmaPort::recvRetry()
144{
145 Packet* pkt = transmitList.front();
146 bool result = true;
147 while (result && transmitList.size()) {
148 DPRINTF(DMA, "Retry on Packet %#x with senderState: %#x\n",
149 pkt, pkt->senderState);
150 result = sendTiming(pkt);
151 if (result) {
152 DPRINTF(DMA, "-- Done\n");
153 transmitList.pop_front();
154 pendingCount--;
155 assert(pendingCount >= 0);
156 } else {
157 DPRINTF(DMA, "-- Failed, queued\n");
158 }
146 DPRINTF(DMA, "Retry on Packet %#x with senderState: %#x\n",
147 pkt, pkt->senderState);
148 if (sendTiming(pkt)) {
149 DPRINTF(DMA, "-- Done\n");
150 transmitList.pop_front();
151 pendingCount--;
152 assert(pendingCount >= 0);
153 } else {
154 DPRINTF(DMA, "-- Failed, queued\n");
159 }
160}
161
162
163void
164DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
165 uint8_t *data)
166{

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

200 // some kind of selction between access methods
201 // more work is going to have to be done to make
202 // switching actually work
203 /* MemState state = device->platform->system->memState;
204
205 if (state == Timing) { */
206 DPRINTF(DMA, "Attempting to send Packet %#x with senderState: %#x\n",
207 pkt, pkt->senderState);
155 }
156}
157
158
159void
160DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
161 uint8_t *data)
162{

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

196 // some kind of selction between access methods
197 // more work is going to have to be done to make
198 // switching actually work
199 /* MemState state = device->platform->system->memState;
200
201 if (state == Timing) { */
202 DPRINTF(DMA, "Attempting to send Packet %#x with senderState: %#x\n",
203 pkt, pkt->senderState);
208 if (transmitList.size() || !sendTiming(pkt)) {
204 if (!sendTiming(pkt)) {
209 transmitList.push_back(pkt);
210 DPRINTF(DMA, "-- Failed: queued\n");
211 } else {
212 DPRINTF(DMA, "-- Done\n");
213 pendingCount--;
214 assert(pendingCount >= 0);
215 }
216 /* } else if (state == Atomic) {

--- 28 unchanged lines hidden ---
205 transmitList.push_back(pkt);
206 DPRINTF(DMA, "-- Failed: queued\n");
207 } else {
208 DPRINTF(DMA, "-- Done\n");
209 pendingCount--;
210 assert(pendingCount >= 0);
211 }
212 /* } else if (state == Atomic) {

--- 28 unchanged lines hidden ---