summaryrefslogtreecommitdiffstats
path: root/target/linux/image/generic/lzma-loader/src/start.S
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-06-07 23:45:42 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-06-07 23:45:42 +0000
commit0d2d5b055d824a8eb822f29181aed5435fc3c045 (patch)
tree61eb4a590e1bd3c4e7837b17ffeac18cd5efb07f /target/linux/image/generic/lzma-loader/src/start.S
parent9e24eb2b14080e290e436deffd442c87b1d2c37e (diff)
generic lzma loader: add support for memory copying, preserve prom arguments
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3908 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/image/generic/lzma-loader/src/start.S')
-rw-r--r--target/linux/image/generic/lzma-loader/src/start.S28
1 files changed, 26 insertions, 2 deletions
diff --git a/target/linux/image/generic/lzma-loader/src/start.S b/target/linux/image/generic/lzma-loader/src/start.S
index 37c7ca36d..9a85c4c35 100644
--- a/target/linux/image/generic/lzma-loader/src/start.S
+++ b/target/linux/image/generic/lzma-loader/src/start.S
@@ -34,10 +34,30 @@ LEAF(_start)
.set mips32
.set noreorder
+ /* save argument registers */
+ move t4, a0
+ move t5, a1
+ move t6, a2
+ move t7, a3
+
/* set up stack */
li sp, 0xa0000000 + RAMSIZE - 16
-
-
+
+#ifdef IMAGE_COPY
+ /* Copy decompressor code to the right place */
+ li t2, LOADADDR
+ add a0, t2, 0
+ la a1, code_start
+ la a2, code_stop
+$L1:
+ lw t0, 0(a1)
+ sw t0, 0(a0)
+ add a1, 4
+ add a0, 4
+ blt a1, a2, $L1
+ nop
+#endif
+
/* At this point we need to invalidate dcache and */
/* icache before jumping to new code */
@@ -128,7 +148,11 @@ noic:
move a0,s3 /* icache line size */
move a1,s4 /* icache size */
move a2,s1 /* dcache line size */
+#ifdef IMAGE_COPY
+ jal t2
+#else
jal entry
+#endif
move a3,s2 /* dcache size */
.set reorder