- /* FIXME: memory regions are stored in an unsorted singly-linked
- list. This probably won't scale to handle hundreds of memory
- regions --- that many could be needed to describe the allowed
- access modes for memory mapped i/o device registers. */
- struct mem_region *next;
-
+ /* Create a mem_region with default attributes. */
+
+ mem_region (CORE_ADDR lo_, CORE_ADDR hi_)
+ : lo (lo_), hi (hi_)
+ {}
+
+ /* Create a mem_region with access mode MODE_, but otherwise default
+ attributes. */
+
+ mem_region (CORE_ADDR lo_, CORE_ADDR hi_, mem_access_mode mode_)
+ : lo (lo_), hi (hi_)
+ {
+ attrib.mode = mode_;
+ }
+
+ /* Create a mem_region with attributes ATTRIB_. */
+
+ mem_region (CORE_ADDR lo_, CORE_ADDR hi_, const mem_attrib &attrib_)
+ : lo (lo_), hi (hi_), attrib (attrib_)
+ {}
+
+ bool operator< (const mem_region &other) const
+ {
+ return this->lo < other.lo;
+ }
+
+ /* Lowest address in the region. */