Deleted Added
sdiff udiff text old ( 10678:d95e81d44e36 ) new ( 10853:5312e4cb6547 )
full compact
1/*
2 * Copyright (c) 2012, 2014 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

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

277 * is an address that is both in this range and the other
278 * range. No check is made to ensure either range is valid.
279 *
280 * @param r Range to intersect with
281 * @return true if the intersection of the two ranges is not empty
282 */
283 bool intersects(const AddrRange& r) const
284 {
285 if (_start > r._end || _end < r._start)
286 // start with the simple case of no overlap at all,
287 // applicable even if we have interleaved ranges
288 return false;
289 else if (!interleaved() && !r.interleaved())
290 // if neither range is interleaved, we are done
291 return true;
292
293 // now it gets complicated, focus on the cases we care about
294 if (r.size() == 1)
295 // keep it simple and check if the address is within
296 // this range
297 return contains(r.start());
298 else if (mergesWith(r))
299 // restrict the check to ranges that belong to the
300 // same chunk
301 return intlvMatch == r.intlvMatch;
302 else
303 panic("Cannot test intersection of %s and %s\n",
304 to_string(), r.to_string());
305 }
306
307 /**
308 * Determine if this range is a subset of another range, i.e. if
309 * every address in this range is also in the other range. No
310 * check is made to ensure either range is valid.
311 *
312 * @param r Range to compare with

--- 95 unchanged lines hidden ---