]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Fix CPU POST test failure
authorYuri Tikhonov <yur@emcraft.com>
Thu, 21 Feb 2008 10:06:07 +0000 (11:06 +0100)
committerWolfgang Denk <wd@denx.de>
Thu, 21 Feb 2008 10:25:47 +0000 (11:25 +0100)
The CPU POST test code (run from cpu_post_exec_31()) doesn't follow the
ABI carefully, at least the CR3, CR4, and CR5 fields of CR are clobbered
by it. The gcc-4.2 with its more aggressive optimization exposes this fact.
This patch just saves the CR value before running the test code, so allowing
it to do anything it wants with CR.

Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
Acked-by: Yuri Tikhonov <yur@emcraft.com>
--

post/lib_ppc/asm.S

index 5e72b3418f5fcbd360292e8aa7a1144fdf194adf..12791762ba27ba43a037ebd60e275f6fe057919e 100644 (file)
@@ -308,7 +308,10 @@ cpu_post_exec_31:
        lwz     r3, 0(r4)
        lwz     r4, 0(r5)
        mr      r6, r7
+
+       mfcr    r7
        blrl
+       mtcr    r7
 
        lwz     r7, 8(r1)
        stw     r3, 0(r7)