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;
--- 152 unchanged lines hidden (view full) ---
161 uint8_t *data)
162{
163 assert(event);
164
165 int prevSize = 0;
166
167 for (ChunkGenerator gen(addr, size, peerBlockSize());
168 !gen.done(); gen.next()) {
169 Request *req = new Request(gen.addr(), gen.size(), 0);
170 Packet *pkt = new Packet(req, cmd, Packet::Broadcast);
171
172 // Increment the data pointer on a write
173 if (data)
174 pkt->dataStatic(data + prevSize);
175
176 prevSize += gen.size();
177
178 // Set the last bit of the dma as the final packet for this dma
179 // and set it's completion event.
180 if (prevSize == size) {
181 pkt->senderState = new DmaReqState(event, true);
182 }
--- 55 unchanged lines hidden ---
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;
--- 152 unchanged lines hidden (view full) ---
161 uint8_t *data)
162{
163 assert(event);
164
165 int prevSize = 0;
166
167 for (ChunkGenerator gen(addr, size, peerBlockSize());
168 !gen.done(); gen.next()) {
169 Request *req = new Request(gen.addr(), gen.size(), 0);
170 Packet *pkt = new Packet(req, cmd, Packet::Broadcast);
171
172 // Increment the data pointer on a write
173 if (data)
174 pkt->dataStatic(data + prevSize);
175
176 prevSize += gen.size();
177
178 // Set the last bit of the dma as the final packet for this dma
179 // and set it's completion event.
180 if (prevSize == size) {
181 pkt->senderState = new DmaReqState(event, true);
182 }
--- 55 unchanged lines hidden ---