From 9fe3610b32545b33767fc22b9fdd7f19046077d0 Mon Sep 17 00:00:00 2001 From: Chander Sudanthi Date: Thu, 16 Jun 2011 15:08:11 -0500 Subject: [PATCH] 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. --- src/arch/arm/tlb.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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++; } -- 2.30.2