Deleted Added
sdiff udiff text old ( 3918:1f9a98d198e8 ) new ( 4040:eb894f3fc168 )
full compact
1/*
2 * Copyright (c) 2001-2005 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;

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

87 munmap((char*)pmemAddr, params()->addrRange.size());
88 //Remove memPorts?
89}
90
91Addr
92PhysicalMemory::new_page()
93{
94 Addr return_addr = pagePtr << LogVMPageSize;
95 return_addr += params()->addrRange.start;
96
97 ++pagePtr;
98 return return_addr;
99}
100
101int
102PhysicalMemory::deviceBlockSize()
103{

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

182 }
183 else {
184 // no match: advance to next record
185 ++i;
186 }
187 }
188
189 if (isLocked) {
190 req->setScResult(success ? 1 : 0);
191 }
192
193 return success;
194}
195
196void
197PhysicalMemory::doFunctionalAccess(PacketPtr pkt)
198{
199 assert(pkt->getAddr() >= params()->addrRange.start &&
200 pkt->getAddr() + pkt->getSize() <= params()->addrRange.start +
201 params()->addrRange.size());
202
203 if (pkt->isRead()) {
204 if (pkt->req->isLocked()) {
205 trackLoadLocked(pkt->req);
206 }
207 memcpy(pkt->getPtr(),
208 pmemAddr + pkt->getAddr() - params()->addrRange.start,
209 pkt->getSize());
210#if TRACING_ON
211 switch (pkt->getSize()) {
212 case sizeof(uint64_t):
213 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x data 0x%x\n",
214 pkt->getSize(), pkt->getAddr(),pkt->get<uint64_t>());
215 break;
216 case sizeof(uint32_t):

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

228 default:
229 DPRINTF(MemoryAccess, "Read of size %i on address 0x%x\n",
230 pkt->getSize(), pkt->getAddr());
231 }
232#endif
233 }
234 else if (pkt->isWrite()) {
235 if (writeOK(pkt->req)) {
236 memcpy(pmemAddr + pkt->getAddr() - params()->addrRange.start,
237 pkt->getPtr<uint8_t>(), pkt->getSize());
238#if TRACING_ON
239 switch (pkt->getSize()) {
240 case sizeof(uint64_t):
241 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x data 0x%x\n",
242 pkt->getSize(), pkt->getAddr(),pkt->get<uint64_t>());
243 break;
244 case sizeof(uint32_t):
245 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x data 0x%x\n",

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

254 pkt->getSize(), pkt->getAddr(),pkt->get<uint8_t>());
255 break;
256 default:
257 DPRINTF(MemoryAccess, "Write of size %i on address 0x%x\n",
258 pkt->getSize(), pkt->getAddr());
259 }
260#endif
261 }
262 }
263 else if (pkt->isInvalidate()) {
264 //upgrade or invalidate
265 pkt->flags |= SATISFIED;
266 }
267 else {
268 panic("unimplemented");
269 }
270
271 pkt->result = Packet::Success;
272}
273
274Port *
275PhysicalMemory::getPort(const std::string &if_name, int idx)

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

310 memory->getAddressRanges(resp, snoop);
311}
312
313void
314PhysicalMemory::getAddressRanges(AddrRangeList &resp, AddrRangeList &snoop)
315{
316 snoop.clear();
317 resp.clear();
318 resp.push_back(RangeSize(params()->addrRange.start,
319 params()->addrRange.size()));
320}
321
322int
323PhysicalMemory::MemoryPort::deviceBlockSize()
324{
325 return memory->deviceBlockSize();
326}

--- 179 unchanged lines hidden ---