Skip to content
Snippets Groups Projects
Commit 7ddd4475 authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

post/lib_powerpc/multi.c: fix stack overflow error


The code and comment disagreed: the comment claimed that r6...r31
were copied, and consequently the arrays for "src" and "dst" were
declared with 26 entries, but the actual code ("lmw r5,0(r3)" and
"stmw r5,0(r4)") copied _27_ words (r5 through r31), which resulted
in false "POST cpu Error at multi test" messages.

Fix the comment and the array sizes.

Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: default avatarAnatolij Gustschin <agust@denx.de>
Tested-by: default avatarAnatolij Gustschin <agust@denx.de>
parent 38081ff7
Branches
Tags
No related merge requests found
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
* CPU test * CPU test
* Load/store multiple word instructions: lmw, stmw * Load/store multiple word instructions: lmw, stmw
* *
* 26 consecutive words are loaded from a source memory buffer * 27 consecutive words are loaded from a source memory buffer
* into GPRs r6 through r31. After that, 26 consecutive words are stored * into GPRs r5 through r31. After that, 27 consecutive words are stored
* from the GPRs r6 through r31 into a target memory buffer. The contents * from the GPRs r5 through r31 into a target memory buffer. The contents
* of the source and target buffers are then compared. * of the source and target buffers are then compared.
*/ */
...@@ -44,7 +44,7 @@ int cpu_post_test_multi(void) ...@@ -44,7 +44,7 @@ int cpu_post_test_multi(void)
{ {
int ret = 0; int ret = 0;
unsigned int i; unsigned int i;
ulong src[26], dst[26]; ulong src[27], dst[27];
int flag = disable_interrupts(); int flag = disable_interrupts();
ulong code[] = { ulong code[] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment