base: Fix address range granularity calculation
authorAndreas Hansson <andreas.hansson@arm.com>
Thu, 27 Jun 2013 09:49:49 +0000 (05:49 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Thu, 27 Jun 2013 09:49:49 +0000 (05:49 -0400)
This patch fixes a bug in the granularity calculation. For example, if
the high bit is 6 (counting from 0) and we have one interleaving bit,
then the granularity is now 2 ** (6 - 1 + 1) = 64.

src/base/addr_range.hh

index 1620a00d3a296e51de1a2a01660f77e7b13c6258..7f275e5a941b3af206ad4fde997e88215832f4f0 100644 (file)
@@ -142,7 +142,7 @@ class AddrRange
      */
     uint64_t granularity() const
     {
-        return ULL(1) << (intlvHighBit - intlvBits);
+        return ULL(1) << (intlvHighBit - intlvBits + 1);
     }
 
     /**