From 997a6a4adda05ad1c3c205513b280214cb6e01c5 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 27 Jun 2013 05:49:49 -0400 Subject: [PATCH] base: Fix address range granularity calculation 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/addr_range.hh b/src/base/addr_range.hh index 1620a00d3..7f275e5a9 100644 --- a/src/base/addr_range.hh +++ b/src/base/addr_range.hh @@ -142,7 +142,7 @@ class AddrRange */ uint64_t granularity() const { - return ULL(1) << (intlvHighBit - intlvBits); + return ULL(1) << (intlvHighBit - intlvBits + 1); } /** -- 2.30.2