]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MIPS: start.S: fix boundary check in relocate_code
authorGabor Juhos <juhosg@openwrt.org>
Thu, 24 Jan 2013 06:27:51 +0000 (06:27 +0000)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Sun, 27 Jan 2013 15:39:43 +0000 (16:39 +0100)
The loop code copies more data with one than
necessary due to the 'ble' instuction. Use the
'blt' instruction instead to fix that.

Due to the lack of suitable hardware the Xburst
specific code is compile tested only. However the
change is quite obvious.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
arch/mips/cpu/mips32/start.S
arch/mips/cpu/mips64/start.S
arch/mips/cpu/xburst/start.S

index 22a9c1bff5e181dfb0ab0bc31c802494a237a911..a4fc1ec0a48b3dbce5869c08185f964c38950103 100644 (file)
@@ -313,7 +313,7 @@ relocate_code:
        lw      t3, 0(t0)
        sw      t3, 0(t1)
        addu    t0, 4
-       ble     t0, t2, 1b
+       blt     t0, t2, 1b
         addu   t1, 4
 
        /* If caches were enabled, we would have to flush them here. */
index bc7e41eed52a650f6bdf24be927611243b2ba20b..aed82e1f07e40b2edf68416634f48148fabbf1db 100644 (file)
@@ -192,7 +192,7 @@ relocate_code:
        lw      t3, 0(t0)
        sw      t3, 0(t1)
        daddu   t0, 4
-       ble     t0, t2, 1b
+       blt     t0, t2, 1b
         daddu  t1, 4
 
        /* If caches were enabled, we would have to flush them here. */
index 3a8280cb0ab850deaf36731e4c705f449a832866..194d7452e1a6f9e959c221fb4f02703fc739ca0a 100644 (file)
@@ -87,7 +87,7 @@ relocate_code:
        lw      t3, 0(t0)
        sw      t3, 0(t1)
        addu    t0, 4
-       ble     t0, t2, 1b
+       blt     t0, t2, 1b
         addu   t1, 4
 
        /* If caches were enabled, we would have to flush them here. */