From: Chander Sudanthi Date: Thu, 16 Jun 2011 20:08:11 +0000 (-0500) Subject: ARM: Fix memset on TLB flush and initialization X-Git-Tag: stable_2012_02_02~273 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fe3610b32545b33767fc22b9fdd7f19046077d0;p=gem5.git ARM: Fix memset on TLB flush and initialization Instead of clearing the entire TLB on initialization and flush, the code was clearing only one element. This patch corrects the memsets in the init and flush routines. --- diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc index ca2b68b3b..a2b1a9d8a 100644 --- a/src/arch/arm/tlb.cc +++ b/src/arch/arm/tlb.cc @@ -75,7 +75,7 @@ TLB::TLB(const Params *p) , rangeMRU(1), miscRegValid(false) { table = new TlbEntry[size]; - memset(table, 0, sizeof(TlbEntry[size])); + memset(table, 0, sizeof(TlbEntry) * size); #if FULL_SYSTEM tableWalker->setTlb(this); @@ -192,7 +192,7 @@ TLB::flushAll() x++; } - memset(table, 0, sizeof(TlbEntry[size])); + memset(table, 0, sizeof(TlbEntry) * size); flushTlb++; }