mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 18:11:33 +00:00
POST: Add disable interrupts in some of the missing CPU POST tests
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>
This commit is contained in:
parent
97a3bf268d
commit
86446d3a5d
9 changed files with 36 additions and 0 deletions
|
@ -95,6 +95,7 @@ int cpu_post_test_b (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
|
@ -188,6 +189,9 @@ int cpu_post_test_b (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ int cpu_post_test_cmp (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
for (i = 0; i < cpu_post_cmp_size && ret == 0; i++)
|
for (i = 0; i < cpu_post_cmp_size && ret == 0; i++)
|
||||||
{
|
{
|
||||||
|
@ -124,6 +125,9 @@ int cpu_post_test_cmp (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ int cpu_post_test_cmpi (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
for (i = 0; i < cpu_post_cmpi_size && ret == 0; i++)
|
for (i = 0; i < cpu_post_cmpi_size && ret == 0; i++)
|
||||||
{
|
{
|
||||||
|
@ -124,6 +125,9 @@ int cpu_post_test_cmpi (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,7 @@ static int cpu_post_test_complex_2 (void)
|
||||||
int cpu_post_test_complex (void)
|
int cpu_post_test_complex (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
|
@ -117,6 +118,9 @@ int cpu_post_test_complex (void)
|
||||||
post_log ("Error at complex test !\n");
|
post_log ("Error at complex test !\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,6 +248,7 @@ int cpu_post_test_cr (void)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned long cr_sav;
|
unsigned long cr_sav;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
asm ( "mfcr %0" : "=r" (cr_sav) : );
|
asm ( "mfcr %0" : "=r" (cr_sav) : );
|
||||||
|
|
||||||
|
@ -347,6 +348,9 @@ int cpu_post_test_cr (void)
|
||||||
|
|
||||||
asm ( "mtcr %0" : : "r" (cr_sav));
|
asm ( "mtcr %0" : : "r" (cr_sav));
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,7 @@ int cpu_post_test_load (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
for (i = 0; i < cpu_post_load_size && ret == 0; i++)
|
for (i = 0; i < cpu_post_load_size && ret == 0; i++)
|
||||||
{
|
{
|
||||||
|
@ -246,6 +247,9 @@ int cpu_post_test_load (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ int cpu_post_test_multi (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
|
@ -72,6 +73,9 @@ int cpu_post_test_multi (void)
|
||||||
post_log ("Error at multi test !\n");
|
post_log ("Error at multi test !\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,7 @@ int cpu_post_test_store (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
for (i = 0; i < cpu_post_store_size && ret == 0; i++)
|
for (i = 0; i < cpu_post_store_size && ret == 0; i++)
|
||||||
{
|
{
|
||||||
|
@ -226,6 +227,9 @@ int cpu_post_test_store (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ int cpu_post_test_string (void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
int flag = disable_interrupts();
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +98,9 @@ int cpu_post_test_string (void)
|
||||||
post_log ("Error at string test !\n");
|
post_log ("Error at string test !\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
enable_interrupts();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue