base: Fix address range granularity calculations
authorAndreas Hansson <andreas.hansson@arm.com>
Thu, 7 Mar 2013 10:55:03 +0000 (05:55 -0500)
committerAndreas Hansson <andreas.hansson@arm.com>
Thu, 7 Mar 2013 10:55:03 +0000 (05:55 -0500)
This patch fixes a bug in the address range granularity
calculations. Previously it incorrectly used the high bit to establish
the size of the regions created, when it should really be looking at
the low bit.

src/base/addr_range.hh

index 368a96401cfa8a85e50b2d573ad0df9e6154270e..1620a00d3a296e51de1a2a01660f77e7b13c6258 100644 (file)
@@ -140,7 +140,10 @@ class AddrRange
      *
      * @return The size of the regions created by the interleaving bits
      */
-    uint64_t granularity() const { return ULL(1) << intlvHighBit; }
+    uint64_t granularity() const
+    {
+        return ULL(1) << (intlvHighBit - intlvBits);
+    }
 
     /**
      * Determine the number of interleaved address stripes this range