diff -r 2c368ad58001 -r fabe224177b7 src/arch/x86/interrupts.cc --- a/src/arch/x86/interrupts.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/arch/x86/interrupts.cc Tue Sep 04 21:13:34 2012 +0100 @@ -371,9 +371,9 @@ X86ISA::Interrupts::getAddrRanges() const { AddrRangeList ranges; - Range range = RangeEx(x86LocalAPICAddress(initialApicId, 0), - x86LocalAPICAddress(initialApicId, 0) + - PageBytes); + AddrRange range = RangeEx(x86LocalAPICAddress(initialApicId, 0), + x86LocalAPICAddress(initialApicId, 0) + + PageBytes); ranges.push_back(range); return ranges; } diff -r 2c368ad58001 -r fabe224177b7 src/base/addr_range.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base/addr_range.hh Tue Sep 04 21:13:34 2012 +0100 @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2012 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * + * Copyright (c) 2002-2005 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Nathan Binkert + * Steve Reinhardt + * Andreas Hansson + */ + +#ifndef __BASE_ADDR_RANGE_HH__ +#define __BASE_ADDR_RANGE_HH__ + +#include "base/types.hh" + +class AddrRange +{ + + public: + + Addr start; + Addr end; + + AddrRange() + : start(1), end(0) + {} + + AddrRange(Addr _start, Addr _end) + : start(_start), end(_end) + {} + + AddrRange(const std::pair &r) + : start(r.first), end(r.second) + {} + + Addr size() const { return end - start + 1; } + bool valid() const { return start < end; } +}; + +/** + * Keep the operators away from SWIG. + */ +#ifndef SWIG + +/** + * @param range1 is a range. + * @param range2 is a range. + * @return if range1 is less than range2 and does not overlap range1. + */ +inline bool +operator<(const AddrRange& range1, const AddrRange& range2) +{ + return range1.start < range2.start; +} + +/** + * @param addr address in the range + * @param range range compared against. + * @return indicates that the address is not within the range. + */ +inline bool +operator!=(const Addr& addr, const AddrRange& range) +{ + return addr < range.start || addr > range.end; +} + +/** + * @param range range compared against. + * @param pos position compared to the range. + * @return indicates that position pos is within the range. + */ +inline bool +operator==(const AddrRange& range, const Addr& addr) +{ + return addr >= range.start && addr <= range.end; +} + +inline AddrRange +RangeEx(Addr start, Addr end) +{ return std::make_pair(start, end - 1); } + +inline AddrRange +RangeIn(Addr start, Addr end) +{ return std::make_pair(start, end); } + +inline AddrRange +RangeSize(Addr start, Addr size) +{ return std::make_pair(start, start + size - 1); } + +#endif // SWIG + +#endif // __BASE_ADDR_RANGE_HH__ diff -r 2c368ad58001 -r fabe224177b7 src/base/addr_range_map.hh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/base/addr_range_map.hh Tue Sep 04 21:13:34 2012 +0100 @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2012 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * + * Copyright (c) 2006 The Regents of The University of Michigan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi + * Andreas Hansson + */ + +#ifndef __BASE_ADDR_RANGE_MAP_HH__ +#define __BASE_ADDR_RANGE_MAP_HH__ + +#include +#include + +#include "base/addr_range.hh" + +/** + * The AddrRangeMap uses an STL map to implement an interval tree for + * address decoding. The value stored is a template type and can be + * e.g. a port identifier, or a pointer. + */ +template +class AddrRangeMap +{ + private: + typedef std::map RangeMap; + RangeMap tree; + + public: + typedef typename RangeMap::iterator iterator; + typedef typename RangeMap::const_iterator const_iterator; + + const_iterator + find(const AddrRange &r) const + { + const_iterator i; + + i = tree.upper_bound(r); + + if (i == tree.begin()) { + if (i->first.start <= r.end && i->first.end >= r.start) + return i; + else + // Nothing could match, so return end() + return tree.end(); + } + + --i; + + if (i->first.start <= r.end && i->first.end >= r.start) + return i; + + return tree.end(); + } + + iterator + find(const AddrRange &r) + { + iterator i; + + i = tree.upper_bound(r); + + if (i == tree.begin()) { + if (i->first.start <= r.end && i->first.end >= r.start) + return i; + else + // Nothing could match, so return end() + return tree.end(); + } + + --i; + + if (i->first.start <= r.end && i->first.end >= r.start) + return i; + + return tree.end(); + } + + const_iterator + find(const Addr &r) const + { + return find(RangeSize(r, 1)); + } + + iterator + find(const Addr &r) + { + return find(RangeSize(r, 1)); + } + + bool + intersect(const AddrRange &r) + { + iterator i; + i = find(r); + if (i != tree.end()) + return true; + return false; + } + + iterator + insert(const AddrRange &r, const V& d) + { + if (intersect(r)) + return tree.end(); + + return tree.insert(std::make_pair(r, d)).first; + } + + std::size_t + erase(Addr k) + { + return tree.erase(k); + } + + void + erase(iterator p) + { + tree.erase(p); + } + + void + erase(iterator p, iterator q) + { + tree.erase(p,q); + } + + void + clear() + { + tree.erase(tree.begin(), tree.end()); + } + + const_iterator + begin() const + { + return tree.begin(); + } + + iterator + begin() + { + return tree.begin(); + } + + const_iterator + end() const + { + return tree.end(); + } + + iterator + end() + { + return tree.end(); + } + + std::size_t + size() const + { + return tree.size(); + } + + bool + empty() const + { + return tree.empty(); + } +}; + +#endif //__BASE_ADDR_RANGE_MAP_HH__ diff -r 2c368ad58001 -r fabe224177b7 src/base/inet.hh --- a/src/base/inet.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/base/inet.hh Tue Sep 04 21:13:34 2012 +0100 @@ -39,7 +39,6 @@ #include #include -#include "base/range.hh" #include "base/types.hh" #include "dev/etherpkt.hh" #include "dnet/os.h" diff -r 2c368ad58001 -r fabe224177b7 src/base/random.hh --- a/src/base/random.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/base/random.hh Tue Sep 04 21:13:34 2012 +0100 @@ -42,7 +42,6 @@ #include #include -#include "base/range.hh" #include "base/types.hh" class Checkpoint; @@ -210,13 +209,6 @@ return _random(min, max); } - template - T - random(const Range &range) - { - return _random(range.start, range.end); - } - // [0,1] double gen_real1() diff -r 2c368ad58001 -r fabe224177b7 src/base/range.hh --- a/src/base/range.hh Tue Sep 04 21:13:33 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2002-2005 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: Nathan Binkert - * Steve Reinhardt - */ - -#ifndef __BASE_RANGE_HH__ -#define __BASE_RANGE_HH__ - -template -struct Range -{ - T start; - T end; - - Range() { invalidate(); } - - template - Range(const std::pair &r) - : start(r.first), end(r.second) - {} - - template - Range(const Range &r) - : start(r.start), end(r.end) - {} - - template - const Range &operator=(const Range &r) - { - start = r.start; - end = r.end; - return *this; - } - - template - const Range &operator=(const std::pair &r) - { - start = r.first; - end = r.second; - return *this; - } - - void invalidate() { start = 1; end = 0; } - T size() const { return end - start + 1; } - bool valid() const { return start < end; } -}; - -template -inline Range -RangeEx(T start, T end) -{ return std::make_pair(start, end - 1); } - -template -inline Range -RangeIn(T start, T end) -{ return std::make_pair(start, end); } - -template -inline Range -RangeSize(T start, U size) -{ return std::make_pair(start, start + size - 1); } - -//////////////////////////////////////////////////////////////////////// -// -// Range to Range Comparisons -// - -/** - * @param range1 is a range. - * @param range2 is a range. - * @return if range1 and range2 are identical. - */ -template -inline bool -operator==(const Range &range1, const Range &range2) -{ - return range1.start == range2.start && range1.end == range2.end; -} - -/** - * @param range1 is a range. - * @param range2 is a range. - * @return if range1 and range2 are not identical. - */ -template -inline bool -operator!=(const Range &range1, const Range &range2) -{ - return range1.start != range2.start || range1.end != range2.end; -} - -/** - * @param range1 is a range. - * @param range2 is a range. - * @return if range1 is less than range2 and does not overlap range1. - */ -template -inline bool -operator<(const Range &range1, const Range &range2) -{ - return range1.start < range2.start; -} - -/** - * @param range1 is a range. - * @param range2 is a range. - * @return if range1 is less than range2. range1 may overlap range2, - * but not extend beyond the end of range2. - */ -template -inline bool -operator<=(const Range &range1, const Range &range2) -{ - return range1.start <= range2.start; -} - -/** - * @param range1 is a range. - * @param range2 is a range. - * @return if range1 is greater than range2 and does not overlap range2. - */ -template -inline bool -operator>(const Range &range1, const Range &range2) -{ - return range1.start > range2.start; -} - -/** - * @param range1 is a range. - * @param range2 is a range. - * @return if range1 is greater than range2. range1 may overlap range2, - * but not extend beyond the beginning of range2. - */ -template -inline bool -operator>=(const Range &range1, const Range &range2) -{ - return range1.start >= range2.start; -} - -//////////////////////////////////////////////////////////////////////// -// -// Position to Range Comparisons -// - -/** - * @param pos position compared to the range. - * @param range range compared against. - * @return indicates that position pos is within the range. - */ -template -inline bool -operator==(const T &pos, const Range &range) -{ - return pos >= range.start && pos <= range.end; -} - -/** - * @param pos position compared to the range. - * @param range range compared against. - * @return indicates that position pos is not within the range. - */ -template -inline bool -operator!=(const T &pos, const Range &range) -{ - return pos < range.start || pos > range.end; -} - -/** - * @param pos position compared to the range. - * @param range range compared against. - * @return indicates that position pos is below the range. - */ -template -inline bool -operator<(const T &pos, const Range &range) -{ - return pos < range.start; -} - -/** - * @param pos position compared to the range. - * @param range range compared against. - * @return indicates that position pos is below or in the range. - */ -template -inline bool -operator<=(const T &pos, const Range &range) -{ - return pos <= range.end; -} - -/** - * @param pos position compared to the range. - * @param range range compared against. - * @return indicates that position pos is above the range. - */ -template -inline bool -operator>(const T &pos, const Range &range) -{ - return pos > range.end; -} - -/** - * @param pos position compared to the range. - * @param range range compared against. - * @return indicates that position pos is above or in the range. - */ -template -inline bool -operator>=(const T &pos, const Range &range) -{ - return pos >= range.start; -} - -//////////////////////////////////////////////////////////////////////// -// -// Range to Position Comparisons (for symmetry) -// - -/** - * @param range range compared against. - * @param pos position compared to the range. - * @return indicates that position pos is within the range. - */ -template -inline bool -operator==(const Range &range, const U &pos) -{ - return pos >= range.start && pos <= range.end; -} - -/** - * @param range range compared against. - * @param pos position compared to the range. - * @return indicates that position pos is not within the range. - */ -template -inline bool -operator!=(const Range &range, const U &pos) -{ - return pos < range.start || pos > range.end; -} - -/** - * @param range range compared against. - * @param pos position compared to the range. - * @return indicates that position pos is above the range. - */ -template -inline bool -operator<(const Range &range, const U &pos) -{ - // with -std=gnu++0x, gcc and clang get confused when range.end is - // compared to pos using the operator "<", and the parser expects it - // to be the opening bracket for a template parameter, - // i.e. range.end(...);, the reason seems to be the range-type - // iteration introduced in c++11 where begin and end are members - // that return iterators - return operator<(range.end, pos); -} - -/** - * @param range range compared against. - * @param pos position compared to the range. - * @return indicates that position pos is above or in the range. - */ -template -inline bool -operator<=(const Range &range, const U &pos) -{ - return range.start <= pos; -} - -/** - * @param range range compared against. - * @param pos position compared to the range. - * 'range > pos' indicates that position pos is below the range. - */ -template -inline bool -operator>(const Range &range, const U &pos) -{ - return range.start > pos; -} - -/** - * @param range range compared against. - * @param pos position compared to the range. - * 'range >= pos' indicates that position pos is below or in the range. - */ -template -inline bool -operator>=(const Range &range, const U &pos) -{ - return range.end >= pos; -} - -#endif // __BASE_RANGE_HH__ diff -r 2c368ad58001 -r fabe224177b7 src/base/range_map.hh --- a/src/base/range_map.hh Tue Sep 04 21:13:33 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2006 The Regents of The University of Michigan - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: Ali Saidi - */ - -#ifndef __BASE_RANGE_MAP_HH__ -#define __BASE_RANGE_MAP_HH__ - -#include -#include - -#include "base/range.hh" - -/** - * The range_map uses an STL map to implement an interval tree. The - * type of both the key (range) and the value are template - * parameters. It can, for example, be used for address decoding, - * using a range of addresses to map to ports. - */ -template -class range_map -{ - private: - typedef std::map,V> RangeMap; - RangeMap tree; - - public: - typedef typename RangeMap::iterator iterator; - typedef typename RangeMap::const_iterator const_iterator; - - template - const_iterator - find(const Range &r) const - { - const_iterator i; - - i = tree.upper_bound(r); - - if (i == tree.begin()) { - if (i->first.start <= r.end && i->first.end >= r.start) - return i; - else - // Nothing could match, so return end() - return tree.end(); - } - - --i; - - if (i->first.start <= r.end && i->first.end >= r.start) - return i; - - return tree.end(); - } - - template - iterator - find(const Range &r) - { - iterator i; - - i = tree.upper_bound(r); - - if (i == tree.begin()) { - if (i->first.start <= r.end && i->first.end >= r.start) - return i; - else - // Nothing could match, so return end() - return tree.end(); - } - - --i; - - if (i->first.start <= r.end && i->first.end >= r.start) - return i; - - return tree.end(); - } - - template - const_iterator - find(const U &r) const - { - return find(RangeSize(r, 1)); - } - - template - iterator - find(const U &r) - { - return find(RangeSize(r, 1)); - } - - template - bool - intersect(const Range &r) - { - iterator i; - i = find(r); - if (i != tree.end()) - return true; - return false; - } - - template - iterator - insert(const Range &r, const W d) - { - if (intersect(r)) - return tree.end(); - - return tree.insert(std::make_pair(r, d)).first; - } - - size_t - erase(T k) - { - return tree.erase(k); - } - - void - erase(iterator p) - { - tree.erase(p); - } - - void - erase(iterator p, iterator q) - { - tree.erase(p,q); - } - - void - clear() - { - tree.erase(tree.begin(), tree.end()); - } - - const_iterator - begin() const - { - return tree.begin(); - } - - iterator - begin() - { - return tree.begin(); - } - - const_iterator - end() const - { - return tree.end(); - } - - iterator - end() - { - return tree.end(); - } - - size_t - size() const - { - return tree.size(); - } - - bool - empty() const - { - return tree.empty(); - } -}; - -#endif //__BASE_RANGE_MAP_HH__ diff -r 2c368ad58001 -r fabe224177b7 src/cpu/simple/base.cc --- a/src/cpu/simple/base.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/cpu/simple/base.cc Tue Sep 04 21:13:34 2012 +0100 @@ -51,7 +51,6 @@ #include "base/inifile.hh" #include "base/misc.hh" #include "base/pollevent.hh" -#include "base/range.hh" #include "base/trace.hh" #include "base/types.hh" #include "config/the_isa.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/alpha/backdoor.hh --- a/src/dev/alpha/backdoor.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/alpha/backdoor.hh Tue Sep 04 21:13:34 2012 +0100 @@ -35,7 +35,6 @@ #ifndef __DEV_ALPHA_BACKDOOR_HH__ #define __DEV_ALPHA_BACKDOOR_HH__ -#include "base/range.hh" #include "base/types.hh" #include "dev/alpha/access.h" #include "dev/io_device.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/alpha/tsunami_cchip.hh --- a/src/dev/alpha/tsunami_cchip.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/alpha/tsunami_cchip.hh Tue Sep 04 21:13:34 2012 +0100 @@ -35,7 +35,6 @@ #ifndef __TSUNAMI_CCHIP_HH__ #define __TSUNAMI_CCHIP_HH__ -#include "base/range.hh" #include "dev/alpha/tsunami.hh" #include "dev/io_device.hh" #include "params/TsunamiCChip.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/alpha/tsunami_io.hh --- a/src/dev/alpha/tsunami_io.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/alpha/tsunami_io.hh Tue Sep 04 21:13:34 2012 +0100 @@ -37,7 +37,6 @@ #ifndef __DEV_TSUNAMI_IO_HH__ #define __DEV_TSUNAMI_IO_HH__ -#include "base/range.hh" #include "dev/alpha/tsunami.hh" #include "dev/intel_8254_timer.hh" #include "dev/io_device.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/alpha/tsunami_pchip.hh --- a/src/dev/alpha/tsunami_pchip.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/alpha/tsunami_pchip.hh Tue Sep 04 21:13:34 2012 +0100 @@ -35,7 +35,6 @@ #ifndef __TSUNAMI_PCHIP_HH__ #define __TSUNAMI_PCHIP_HH__ -#include "base/range.hh" #include "dev/alpha/tsunami.hh" #include "dev/io_device.hh" #include "params/TsunamiPChip.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/a9scu.hh --- a/src/dev/arm/a9scu.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/a9scu.hh Tue Sep 04 21:13:34 2012 +0100 @@ -40,7 +40,6 @@ #ifndef __DEV_ARM_A9SCU_HH__ #define __DEV_ARM_A9SCU_HH__ -#include "base/range.hh" #include "dev/io_device.hh" #include "params/A9SCU.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/amba_device.hh --- a/src/dev/arm/amba_device.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/amba_device.hh Tue Sep 04 21:13:34 2012 +0100 @@ -49,7 +49,6 @@ #ifndef __DEV_ARM_AMBA_DEVICE_HH__ #define __DEV_ARM_AMBA_DEVICE_HH__ -#include "base/range.hh" #include "dev/arm/gic.hh" #include "dev/dma_device.hh" #include "dev/io_device.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/amba_fake.hh --- a/src/dev/arm/amba_fake.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/amba_fake.hh Tue Sep 04 21:13:34 2012 +0100 @@ -51,7 +51,6 @@ #ifndef __DEV_ARM_AMBA_FAKE_H__ #define __DEV_ARM_AMBA_FAKE_H__ -#include "base/range.hh" #include "dev/arm/amba_device.hh" #include "params/AmbaFake.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/gic.hh --- a/src/dev/arm/gic.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/gic.hh Tue Sep 04 21:13:34 2012 +0100 @@ -49,7 +49,6 @@ #define __DEV_ARM_GIC_H__ #include "base/bitunion.hh" -#include "base/range.hh" #include "dev/io_device.hh" #include "dev/platform.hh" #include "cpu/intr_control.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/kmi.hh --- a/src/dev/arm/kmi.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/kmi.hh Tue Sep 04 21:13:34 2012 +0100 @@ -51,7 +51,6 @@ #include #include "base/vnc/vncserver.hh" -#include "base/range.hh" #include "dev/arm/amba_device.hh" #include "params/Pl050.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/pl011.hh --- a/src/dev/arm/pl011.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/pl011.hh Tue Sep 04 21:13:34 2012 +0100 @@ -48,7 +48,6 @@ #ifndef __DEV_ARM_PL011_H__ #define __DEV_ARM_PL011_H__ -#include "base/range.hh" #include "dev/io_device.hh" #include "dev/uart.hh" #include "params/Pl011.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/pl111.hh --- a/src/dev/arm/pl111.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/pl111.hh Tue Sep 04 21:13:34 2012 +0100 @@ -48,7 +48,6 @@ #include -#include "base/range.hh" #include "dev/arm/amba_device.hh" #include "params/Pl111.hh" #include "sim/serialize.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/rtc_pl031.hh --- a/src/dev/arm/rtc_pl031.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/rtc_pl031.hh Tue Sep 04 21:13:34 2012 +0100 @@ -40,7 +40,6 @@ #ifndef __DEV_ARM_RTC_PL310_HH__ #define __DEV_ARM_RTC_PL310_HH__ -#include "base/range.hh" #include "dev/arm/amba_device.hh" #include "params/PL031.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/rv_ctrl.hh --- a/src/dev/arm/rv_ctrl.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/rv_ctrl.hh Tue Sep 04 21:13:34 2012 +0100 @@ -41,7 +41,6 @@ #define __DEV_ARM_RV_HH__ #include "base/bitunion.hh" -#include "base/range.hh" #include "dev/io_device.hh" #include "params/RealViewCtrl.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/timer_cpulocal.hh --- a/src/dev/arm/timer_cpulocal.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/timer_cpulocal.hh Tue Sep 04 21:13:34 2012 +0100 @@ -41,7 +41,6 @@ #ifndef __DEV_ARM_LOCALTIMER_HH__ #define __DEV_ARM_LOCALTIMER_HH__ -#include "base/range.hh" #include "dev/io_device.hh" #include "params/CpuLocalTimer.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/arm/timer_sp804.hh --- a/src/dev/arm/timer_sp804.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/arm/timer_sp804.hh Tue Sep 04 21:13:34 2012 +0100 @@ -40,7 +40,6 @@ #ifndef __DEV_ARM_SP804_HH__ #define __DEV_ARM_SP804_HH__ -#include "base/range.hh" #include "dev/arm/amba_device.hh" #include "params/Sp804.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/baddev.hh --- a/src/dev/baddev.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/baddev.hh Tue Sep 04 21:13:34 2012 +0100 @@ -36,7 +36,6 @@ #ifndef __DEV_BADDEV_HH__ #define __DEV_BADDEV_HH__ -#include "base/range.hh" #include "dev/io_device.hh" #include "params/BadDevice.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/isa_fake.hh --- a/src/dev/isa_fake.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/isa_fake.hh Tue Sep 04 21:13:34 2012 +0100 @@ -37,7 +37,6 @@ #include -#include "base/range.hh" #include "dev/io_device.hh" // #include "dev/alpha/tsunami.hh" #include "mem/packet.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/mc146818.hh --- a/src/dev/mc146818.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/mc146818.hh Tue Sep 04 21:13:34 2012 +0100 @@ -33,7 +33,6 @@ #ifndef __DEV_MC146818_HH__ #define __DEV_MC146818_HH__ -#include "base/range.hh" #include "sim/eventq.hh" /** Real-Time Clock (MC146818) */ diff -r 2c368ad58001 -r fabe224177b7 src/dev/mips/malta_cchip.hh --- a/src/dev/mips/malta_cchip.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/mips/malta_cchip.hh Tue Sep 04 21:13:34 2012 +0100 @@ -36,7 +36,6 @@ #ifndef __MALTA_CCHIP_HH__ #define __MALTA_CCHIP_HH__ -#include "base/range.hh" #include "dev/mips/malta.hh" #include "dev/io_device.hh" #include "params/MaltaCChip.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/mips/malta_io.hh --- a/src/dev/mips/malta_io.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/mips/malta_io.hh Tue Sep 04 21:13:34 2012 +0100 @@ -37,7 +37,6 @@ #ifndef __DEV_MALTA_IO_HH__ #define __DEV_MALTA_IO_HH__ -#include "base/range.hh" #include "dev/mips/malta.hh" #include "dev/intel_8254_timer.hh" #include "dev/io_device.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/mips/malta_pchip.hh --- a/src/dev/mips/malta_pchip.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/mips/malta_pchip.hh Tue Sep 04 21:13:34 2012 +0100 @@ -35,7 +35,6 @@ #ifndef __MALTA_PCHIP_HH__ #define __MALTA_PCHIP_HH__ -#include "base/range.hh" #include "dev/mips/malta.hh" #include "dev/io_device.hh" #include "params/MaltaPChip.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/pciconfigall.hh --- a/src/dev/pciconfigall.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/pciconfigall.hh Tue Sep 04 21:13:34 2012 +0100 @@ -37,7 +37,6 @@ #ifndef __PCICONFIGALL_HH__ #define __PCICONFIGALL_HH__ -#include "base/range.hh" #include "dev/io_device.hh" #include "dev/pcireg.h" #include "params/PciConfigAll.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/sparc/dtod.hh --- a/src/dev/sparc/dtod.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/sparc/dtod.hh Tue Sep 04 21:13:34 2012 +0100 @@ -38,7 +38,6 @@ #include -#include "base/range.hh" #include "dev/io_device.hh" #include "params/DumbTOD.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/sparc/iob.hh --- a/src/dev/sparc/iob.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/sparc/iob.hh Tue Sep 04 21:13:34 2012 +0100 @@ -36,7 +36,6 @@ #ifndef __DEV_SPARC_IOB_HH__ #define __DEV_SPARC_IOB_HH__ -#include "base/range.hh" #include "dev/disk_image.hh" #include "dev/io_device.hh" #include "params/Iob.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/sparc/mm_disk.hh --- a/src/dev/sparc/mm_disk.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/sparc/mm_disk.hh Tue Sep 04 21:13:34 2012 +0100 @@ -36,7 +36,6 @@ #ifndef __DEV_SPARC_MM_DISK_HH__ #define __DEV_SPARC_MM_DISK_HH__ -#include "base/range.hh" #include "dev/disk_image.hh" #include "dev/io_device.hh" #include "params/MmDisk.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/uart.hh --- a/src/dev/uart.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/uart.hh Tue Sep 04 21:13:34 2012 +0100 @@ -35,7 +35,6 @@ #ifndef __UART_HH__ #define __UART_HH__ -#include "base/range.hh" #include "dev/io_device.hh" #include "params/Uart.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/uart8250.hh --- a/src/dev/uart8250.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/uart8250.hh Tue Sep 04 21:13:34 2012 +0100 @@ -35,7 +35,6 @@ #ifndef __DEV_UART8250_HH__ #define __DEV_UART8250_HH__ -#include "base/range.hh" #include "dev/io_device.hh" #include "dev/uart.hh" #include "params/Uart8250.hh" diff -r 2c368ad58001 -r fabe224177b7 src/dev/x86/i82094aa.hh --- a/src/dev/x86/i82094aa.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/dev/x86/i82094aa.hh Tue Sep 04 21:13:34 2012 +0100 @@ -34,7 +34,6 @@ #include #include "base/bitunion.hh" -#include "base/range_map.hh" #include "dev/x86/intdev.hh" #include "dev/io_device.hh" #include "params/I82094AA.hh" diff -r 2c368ad58001 -r fabe224177b7 src/mem/abstract_mem.hh --- a/src/mem/abstract_mem.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/abstract_mem.hh Tue Sep 04 21:13:34 2012 +0100 @@ -68,7 +68,7 @@ protected: // Address range of this memory - Range range; + AddrRange range; // Pointer to host memory used to implement this memory uint8_t* pmemAddr; @@ -209,7 +209,7 @@ * * @return a single contigous address range */ - Range getAddrRange() const; + AddrRange getAddrRange() const; /** * Get the memory size. diff -r 2c368ad58001 -r fabe224177b7 src/mem/abstract_mem.cc --- a/src/mem/abstract_mem.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/abstract_mem.cc Tue Sep 04 21:13:34 2012 +0100 @@ -84,9 +84,8 @@ int fd = open(params()->file.c_str(), O_RDONLY); long _size = lseek(fd, 0, SEEK_END); if (_size != range.size()) { - warn("Specified size %d does not match file %s %d\n", range.size(), - params()->file, _size); - range = RangeSize(range.start, _size); + fatal("Specified size %d does not match file %s %d\n", + range.size(), params()->file, _size); } lseek(fd, 0, SEEK_SET); pmemAddr = (uint8_t *)mmap(NULL, roundUp(_size, sysconf(_SC_PAGESIZE)), @@ -221,7 +220,7 @@ bwTotal = (bytesRead + bytesWritten) / simSeconds; } -Range +AddrRange AbstractMemory::getAddrRange() const { return range; diff -r 2c368ad58001 -r fabe224177b7 src/mem/bridge.hh --- a/src/mem/bridge.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/bridge.hh Tue Sep 04 21:13:34 2012 +0100 @@ -193,7 +193,7 @@ */ BridgeSlavePort(const std::string& _name, Bridge& _bridge, BridgeMasterPort& _masterPort, Cycles _delay, - int _resp_limit, std::vector > _ranges); + int _resp_limit, std::vector _ranges); /** * Queue a response packet to be sent out later and also schedule diff -r 2c368ad58001 -r fabe224177b7 src/mem/bridge.cc --- a/src/mem/bridge.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/bridge.cc Tue Sep 04 21:13:34 2012 +0100 @@ -57,7 +57,7 @@ Bridge& _bridge, BridgeMasterPort& _masterPort, Cycles _delay, int _resp_limit, - std::vector > _ranges) + std::vector _ranges) : SlavePort(_name, &_bridge), bridge(_bridge), masterPort(_masterPort), delay(_delay), ranges(_ranges.begin(), _ranges.end()), outstandingResponses(0), retryReq(false), diff -r 2c368ad58001 -r fabe224177b7 src/mem/bus.hh --- a/src/mem/bus.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/bus.hh Tue Sep 04 21:13:34 2012 +0100 @@ -54,8 +54,7 @@ #include #include -#include "base/range.hh" -#include "base/range_map.hh" +#include "base/addr_range_map.hh" #include "base/types.hh" #include "mem/mem_object.hh" #include "params/BaseBus.hh" @@ -233,9 +232,9 @@ /** the width of the bus in bytes */ int width; - typedef range_map::iterator PortMapIter; - typedef range_map::const_iterator PortMapConstIter; - range_map portMap; + typedef AddrRangeMap::iterator PortMapIter; + typedef AddrRangeMap::const_iterator PortMapConstIter; + AddrRangeMap portMap; AddrRangeList defaultRange; diff -r 2c368ad58001 -r fabe224177b7 src/mem/bus.cc --- a/src/mem/bus.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/bus.cc Tue Sep 04 21:13:34 2012 +0100 @@ -355,7 +355,6 @@ void BaseBus::recvRangeChange(PortID master_port_id) { - AddrRangeList ranges; AddrRangeIter iter; if (inRecvRangeChange.count(master_port_id)) @@ -394,7 +393,7 @@ } // get the address ranges of the connected slave port - ranges = port->getAddrRanges(); + AddrRangeList ranges = port->getAddrRanges(); for (iter = ranges.begin(); iter != ranges.end(); iter++) { DPRINTF(BusAddrRanges, "Adding range %#llx - %#llx for id %d\n", diff -r 2c368ad58001 -r fabe224177b7 src/mem/cache/cache_impl.hh --- a/src/mem/cache/cache_impl.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/cache/cache_impl.hh Tue Sep 04 21:13:34 2012 +0100 @@ -51,7 +51,6 @@ */ #include "base/misc.hh" -#include "base/range.hh" #include "base/types.hh" #include "debug/Cache.hh" #include "debug/CachePort.hh" diff -r 2c368ad58001 -r fabe224177b7 src/mem/physical.hh --- a/src/mem/physical.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/physical.hh Tue Sep 04 21:13:34 2012 +0100 @@ -40,7 +40,7 @@ #ifndef __PHYSICAL_MEMORY_HH__ #define __PHYSICAL_MEMORY_HH__ -#include "base/range_map.hh" +#include "base/addr_range_map.hh" #include "mem/abstract_mem.hh" #include "mem/packet.hh" @@ -55,10 +55,10 @@ private: // Global address map - range_map addrMap; + AddrRangeMap addrMap; // a mutable cache for the last range that matched an address - mutable Range rangeCache; + mutable AddrRange rangeCache; // All address-mapped memories std::vector memories; diff -r 2c368ad58001 -r fabe224177b7 src/mem/physical.cc --- a/src/mem/physical.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/physical.cc Tue Sep 04 21:13:34 2012 +0100 @@ -64,7 +64,6 @@ "Skipping memory %s that is not in global address map\n", (*m)->name()); } - rangeCache.invalidate(); } bool @@ -73,8 +72,7 @@ // see if the address is within the last matched range if (addr != rangeCache) { // lookup in the interval tree - range_map::const_iterator r = - addrMap.find(addr); + AddrRangeMap::const_iterator r = addrMap.find(addr); if (r == addrMap.end()) { // not in the cache, and not in the tree return false; @@ -110,7 +108,7 @@ { assert(pkt->isRequest()); Addr addr = pkt->getAddr(); - range_map::const_iterator m = addrMap.find(addr); + AddrRangeMap::const_iterator m = addrMap.find(addr); assert(m != addrMap.end()); m->second->access(pkt); } @@ -120,7 +118,7 @@ { assert(pkt->isRequest()); Addr addr = pkt->getAddr(); - range_map::const_iterator m = addrMap.find(addr); + AddrRangeMap::const_iterator m = addrMap.find(addr); assert(m != addrMap.end()); m->second->functionalAccess(pkt); } diff -r 2c368ad58001 -r fabe224177b7 src/mem/port.hh --- a/src/mem/port.hh Tue Sep 04 21:13:33 2012 +0100 +++ b/src/mem/port.hh Tue Sep 04 21:13:34 2012 +0100 @@ -52,7 +52,7 @@ #include -#include "base/range.hh" +#include "base/addr_range.hh" #include "mem/packet.hh" /** @@ -62,9 +62,9 @@ * defined. */ -typedef std::list > AddrRangeList; -typedef std::list >::iterator AddrRangeIter; -typedef std::list >::const_iterator AddrRangeConstIter; +typedef std::list AddrRangeList; +typedef std::list::iterator AddrRangeIter; +typedef std::list::const_iterator AddrRangeConstIter; class MemObject; diff -r 2c368ad58001 -r fabe224177b7 src/python/m5/params.py --- a/src/python/m5/params.py Tue Sep 04 21:13:33 2012 +0100 +++ b/src/python/m5/params.py Tue Sep 04 21:13:34 2012 +0100 @@ -544,7 +544,7 @@ return self.value + other class AddrRange(ParamValue): - cxx_type = 'Range' + cxx_type = 'AddrRange' def __init__(self, *args, **kwargs): def handle_kwargs(self, kwargs): @@ -588,20 +588,18 @@ @classmethod def cxx_predecls(cls, code): Addr.cxx_predecls(code) - code('#include "base/range.hh"') + code('#include "base/addr_range.hh"') @classmethod def swig_predecls(cls, code): Addr.swig_predecls(code) - code('%import "python/swig/range.i"') def getValue(self): + # Go from the Python class to the wrapped C++ class generated + # by swig from m5.internal.range import AddrRange - value = AddrRange() - value.start = long(self.start) - value.end = long(self.end) - return value + return AddrRange(long(self.start), long(self.end)) # Boolean parameter type. Python doesn't let you subclass bool, since # it doesn't want to let you create multiple instances of True and diff -r 2c368ad58001 -r fabe224177b7 src/python/swig/range.i --- a/src/python/swig/range.i Tue Sep 04 21:13:33 2012 +0100 +++ b/src/python/swig/range.i Tue Sep 04 21:13:34 2012 +0100 @@ -31,15 +31,12 @@ %module(package="m5.internal") range %{ -#include "base/range.hh" #include "base/types.hh" +#include "base/addr_range.hh" %} %include %rename(assign) *::operator=; -%include "base/range.hh" %include "base/types.hh" - -%template(AddrRange) Range; -%template(TickRange) Range; +%include "base/addr_range.hh" diff -r 2c368ad58001 -r fabe224177b7 src/unittest/rangemaptest.cc --- a/src/unittest/rangemaptest.cc Tue Sep 04 21:13:33 2012 +0100 +++ b/src/unittest/rangemaptest.cc Tue Sep 04 21:13:34 2012 +0100 @@ -1,4 +1,16 @@ /* + * Copyright (c) 2012 ARM Limited + * All rights reserved + * + * The license below extends only to copyright in the software and shall + * not be construed as granting a license to any other intellectual + * property including but not limited to intellectual property relating + * to a hardware implementation of the functionality of the software + * licensed hereunder. You may use the software subject to the license + * terms below provided that you ensure that this notice is replicated + * unmodified and in its entirety in all distributions of the software, + * modified or unmodified, in source code or in binary form. + * * Copyright (c) 2006 The Regents of The University of Michigan * All rights reserved. * @@ -31,46 +43,38 @@ #include #include -#include "base/range_map.hh" -#include "base/types.hh" +#include "base/addr_range_map.hh" using namespace std; int main() { - range_map r; + AddrRangeMap r; - range_map::iterator i; + AddrRangeMap::iterator i; - i = r.insert(RangeIn(10,40),5); + i = r.insert(RangeIn(10, 40), 5); assert(i != r.end()); - i = r.insert(RangeIn(60,90),3); + i = r.insert(RangeIn(60, 90), 3); assert(i != r.end()); - i = r.find(RangeIn(20,30)); + i = r.find(RangeIn(20, 30)); assert(i != r.end()); cout << i->first << " " << i->second << endl; - i = r.find(RangeIn(55,55)); + i = r.find(RangeIn(55, 55)); assert(i == r.end()); - i = r.insert(RangeIn(0,12),1); + i = r.insert(RangeIn(0, 12), 1); assert(i == r.end()); - i = r.insert(RangeIn(0,9),1); + i = r.insert(RangeIn(0, 9), 1); assert(i != r.end()); - i = r.find(RangeIn(20,30)); + i = r.find(RangeIn(20, 30)); assert(i != r.end()); cout << i->first << " " << i->second << endl; + return 0; } - - - - - - - -