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 (!interleaved()) {
286 return _start <= r._end && _end >= r._start;
287 }
288
289 // the current range is interleaved, split the check up in
290 // three cases
291 if (r.size() == 1)
292 // keep it simple and check if the address is within
293 // this range
294 return contains(r.start());
295 else if (!r.interleaved())
296 // be conservative and ignore the interleaving
297 return _start <= r._end && _end >= 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 interleaved range %s\n",
304 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 ---