call Image/BuildKernel template for targets that export their kernel images without...
[openwrt.git] / target / linux / image / generic / lzma-loader / src / start.S
index 37c7ca3..9a85c4c 100644 (file)
@@ -34,10 +34,30 @@ LEAF(_start)
        .set    mips32
        .set noreorder
 
        .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
        /* 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 */
 
        /* 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 */
        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
        jal     entry
+#endif
        move    a3,s2                   /* dcache size */
 
        .set reorder
        move    a3,s2                   /* dcache size */
 
        .set reorder
This page took 0.026136 seconds and 4 git commands to generate.