addr_mapper.cc (9405:c0a0593510db) addr_mapper.cc (9406:024edfcfcbbf)
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

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

260 }
261
262 return addr;
263}
264
265AddrRangeList
266RangeAddrMapper::getAddrRanges() const
267{
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

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

260 }
261
262 return addr;
263}
264
265AddrRangeList
266RangeAddrMapper::getAddrRanges() const
267{
268 AddrRangeList ranges;
269 AddrRangeList actualRanges = masterPort.getAddrRanges();
270
271 for (AddrRangeIter r = actualRanges.begin(); r != actualRanges.end(); ++r) {
272 AddrRange range = *r;
273
274 for (int j = 0; j < originalRanges.size(); ++j) {
275 if (range.intersects(originalRanges[j]))
276 fatal("Cannot remap range that intersects the original"
277 " ranges but are not a subset.\n");
278 if (range.isSubset(originalRanges[j])) {
279 // range is a subset
280 Addr offset = range.start() - originalRanges[j].start();
281 Addr start = range.start() - offset;
282 ranges.push_back(AddrRange(start, start + range.size() - 1));
283 } else {
284 ranges.push_back(range);
285 }
286 }
287 }
288
268 // Simply return the original ranges as given by the parameters
269 AddrRangeList ranges(originalRanges.begin(), originalRanges.end());
289 return ranges;
290}
291
292
270 return ranges;
271}
272
273