addr_mapper.cc (9259:fc28f3ca5b21) | addr_mapper.cc (9279:8b16c3804bda) |
---|---|
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 --- 258 unchanged lines hidden (view full) --- 267{ 268 AddrRangeList ranges; 269 AddrRangeList actualRanges = masterPort.getSlavePort().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) { | 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 --- 258 unchanged lines hidden (view full) --- 267{ 268 AddrRangeList ranges; 269 AddrRangeList actualRanges = masterPort.getSlavePort().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.start < originalRanges[j].start && 276 range.end >= originalRanges[j].start) || 277 (range.start < originalRanges[j].end && 278 range.end >= originalRanges[j].end)) | 275 if (range.intersects(originalRanges[j])) |
279 fatal("Cannot remap range that intersects the original" 280 " ranges but are not a subset.\n"); | 276 fatal("Cannot remap range that intersects the original" 277 " ranges but are not a subset.\n"); |
281 if (range.start >= originalRanges[j].start && 282 range.end <= originalRanges[j].end) { | 278 if (range.isSubset(originalRanges[j])) { |
283 // range is a subset 284 Addr offset = range.start - originalRanges[j].start; 285 range.start -= offset; 286 range.end -= offset; 287 } 288 ranges.push_back(range); 289 } 290 } 291 292 return ranges; 293} 294 295 | 279 // range is a subset 280 Addr offset = range.start - originalRanges[j].start; 281 range.start -= offset; 282 range.end -= offset; 283 } 284 ranges.push_back(range); 285 } 286 } 287 288 return ranges; 289} 290 291 |