From 82f600e02ded4d7162dd9286f790462b9ab5d554 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 7 Mar 2013 05:55:03 -0500 Subject: [PATCH] base: Fix address range granularity calculations 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base/addr_range.hh b/src/base/addr_range.hh index 368a96401..1620a00d3 100644 --- a/src/base/addr_range.hh +++ b/src/base/addr_range.hh @@ -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 -- 2.30.2