addr_range_map.hh (9235:5aa4896ed55a) addr_range_map.hh (9405:c0a0593510db)
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

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

68 const_iterator
69 find(const AddrRange &r) const
70 {
71 const_iterator i;
72
73 i = tree.upper_bound(r);
74
75 if (i == tree.begin()) {
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

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

68 const_iterator
69 find(const AddrRange &r) const
70 {
71 const_iterator i;
72
73 i = tree.upper_bound(r);
74
75 if (i == tree.begin()) {
76 if (i->first.start <= r.end && i->first.end >= r.start)
76 if (i->first.intersects(r))
77 return i;
78 else
79 // Nothing could match, so return end()
80 return tree.end();
81 }
82
83 --i;
84
77 return i;
78 else
79 // Nothing could match, so return end()
80 return tree.end();
81 }
82
83 --i;
84
85 if (i->first.start <= r.end && i->first.end >= r.start)
85 if (i->first.intersects(r))
86 return i;
87
88 return tree.end();
89 }
90
91 iterator
92 find(const AddrRange &r)
93 {
94 iterator i;
95
96 i = tree.upper_bound(r);
97
98 if (i == tree.begin()) {
86 return i;
87
88 return tree.end();
89 }
90
91 iterator
92 find(const AddrRange &r)
93 {
94 iterator i;
95
96 i = tree.upper_bound(r);
97
98 if (i == tree.begin()) {
99 if (i->first.start <= r.end && i->first.end >= r.start)
99 if (i->first.intersects(r))
100 return i;
101 else
102 // Nothing could match, so return end()
103 return tree.end();
104 }
105
106 --i;
107
100 return i;
101 else
102 // Nothing could match, so return end()
103 return tree.end();
104 }
105
106 --i;
107
108 if (i->first.start <= r.end && i->first.end >= r.start)
108 if (i->first.intersects(r))
109 return i;
110
111 return tree.end();
112 }
113
114 const_iterator
115 find(const Addr &r) const
116 {

--- 90 unchanged lines hidden ---
109 return i;
110
111 return tree.end();
112 }
113
114 const_iterator
115 find(const Addr &r) const
116 {

--- 90 unchanged lines hidden ---