generic lzma loader: add support for memory copying, preserve prom arguments
[openwrt.git] / target / linux / image / generic / lzma-loader / src / decompress.c
index f602276..4ed432d 100644 (file)
@@ -106,6 +106,13 @@ void entry(unsigned long icache_size, unsigned long icache_lsize,
 {
        unsigned int i;  /* temp value */
        unsigned int osize; /* uncompressed size */
 {
        unsigned int i;  /* temp value */
        unsigned int osize; /* uncompressed size */
+       volatile unsigned int arg0, arg1, arg2, arg3;
+
+       /* restore argument registers */
+       __asm__ __volatile__ ("ori %0, $12, 0":"=r"(arg0));
+       __asm__ __volatile__ ("ori %0, $13, 0":"=r"(arg1));
+       __asm__ __volatile__ ("ori %0, $14, 0":"=r"(arg2));
+       __asm__ __volatile__ ("ori %0, $15, 0":"=r"(arg3));
 
        ILzmaInCallback callback;
        CLzmaDecoderState vs;
 
        ILzmaInCallback callback;
        CLzmaDecoderState vs;
@@ -142,6 +149,6 @@ void entry(unsigned long icache_size, unsigned long icache_lsize,
                blast_icache(icache_size, icache_lsize);
 
                /* Jump to load address */
                blast_icache(icache_size, icache_lsize);
 
                /* Jump to load address */
-               ((void (*)(void)) KERNEL_ENTRY)();
+               ((void (*)(int a0, int a1, int a2, int a3)) KERNEL_ENTRY)(arg0, arg1, arg2, arg3);
        }
 }
        }
 }
This page took 0.021145 seconds and 4 git commands to generate.