From 7183c3fd56c4f0e8e4137795bb91dcaff312f591 Mon Sep 17 00:00:00 2001 From: Jayneel Gandhi Date: Thu, 7 Jun 2012 08:11:00 -0500 Subject: [PATCH] X86 TLB: Fix for gcc 4.4.3 Due to recent changes to X86 TLB, gem5 stopped compiling on gcc version 4.4.3. This patch provides the fix for that problem. The patch is tested on gcc 4.4.3. The change is not required for more recent versions of gcc (like on 4.6.3). --- src/arch/x86/tlb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc index 4923752ef..623e1871d 100644 --- a/src/arch/x86/tlb.cc +++ b/src/arch/x86/tlb.cc @@ -270,7 +270,8 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation, Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg)); Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg)); bool sizeOverride = (flags & (AddrSizeFlagBit << FlagShift)); - int logSize = sizeOverride ? m5Reg.altAddr : m5Reg.defAddr; + unsigned logSize = sizeOverride ? (unsigned)m5Reg.altAddr + : (unsigned)m5Reg.defAddr; int size = (1 << logSize) * 8; Addr offset = bits(vaddr - base, size - 1, 0); Addr endOffset = offset + req->getSize() - 1; -- 2.30.2