PP: More cache invalidation fixes

Take into account the size of the pointer in the loop termination
condition.

Change-Id: Ib4f7625ef143149a0d691a2109bad67aece6241c
This commit is contained in:
Solomon Peachy 2021-04-01 10:52:51 -04:00
parent 9f7f1a841a
commit 2f785c7797

View file

@ -253,15 +253,15 @@ static void ICODE_ATTR cache_invalidate_special(void)
if (CURRENT_CORE == CPU)
{
for (p = &CACHE_STATUS_BASE_CPU;
p < (&CACHE_STATUS_BASE_CPU) + CACHE_SIZE;
p += CACHEALIGN_BITS) /* sizeof(p) * CACHEALIGN_BITS */
p < (&CACHE_STATUS_BASE_CPU) + CACHE_SIZE/sizeof(*p);
p += CACHEALIGN_SIZE/sizeof(*p))
*p = CACHE_LINE_VALID | CACHE_ADDRESS_MASK;
}
else
{
for (p = &CACHE_STATUS_BASE_COP;
p < (&CACHE_STATUS_BASE_COP) + CACHE_SIZE;
p += CACHEALIGN_BITS)
p < (&CACHE_STATUS_BASE_COP) + CACHE_SIZE/sizeof(*p);
p += CACHEALIGN_SIZE/sizeof(*p))
*p = CACHE_LINE_VALID | CACHE_ADDRESS_MASK;
}
}