Some CPU POST tests did not disable the interrupts while running. This
seems to be necessary to protect this self modifying code.
Signed-off-by: Stefan Roese <sr@denx.de>
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
if (ret == 0)
{
}
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
for (i = 0; i < cpu_post_cmp_size && ret == 0; i++)
{
}
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
for (i = 0; i < cpu_post_cmpi_size && ret == 0; i++)
{
}
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
int cpu_post_test_complex (void)
{
int ret = 0;
+ int flag = disable_interrupts();
if (ret == 0)
{
post_log ("Error at complex test !\n");
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
int ret = 0;
unsigned int i;
unsigned long cr_sav;
+ int flag = disable_interrupts();
asm ( "mfcr %0" : "=r" (cr_sav) : );
asm ( "mtcr %0" : : "r" (cr_sav));
+ if (flag)
+ enable_interrupts();
+
return ret;
}
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
for (i = 0; i < cpu_post_load_size && ret == 0; i++)
{
}
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
if (ret == 0)
{
post_log ("Error at multi test !\n");
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
for (i = 0; i < cpu_post_store_size && ret == 0; i++)
{
}
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}
{
int ret = 0;
unsigned int i;
+ int flag = disable_interrupts();
if (ret == 0)
{
post_log ("Error at string test !\n");
}
+ if (flag)
+ enable_interrupts();
+
return ret;
}