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.
This commit is contained in:
Chander Sudanthi
2011-06-16 15:08:11 -05:00
parent 8bf92329ee
commit 9fe3610b32

View File

@@ -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++;
}