2 * Startup glue code to uncompress the kernel
4 * (C) 2017 Helge Deller <deller@gmx.de>
7 #include <linux/init.h>
8 #include <linux/linkage.h>
9 #include <asm/asm-offsets.h>
13 #include <asm/assembly.h>
16 #define BOOTADDR(x) (x)
19 .import $global$ /* forward declaration */
20 #endif /*!CONFIG_64BIT*/
27 #define PSW_W_SM 0x200
30 ;! nuke the W bit, saving original value
35 extrw,u %r1, PSW_W_BIT-32, 1, %r1
38 /* Make sure sr4-sr7 are set to zero for the kernel address space */
49 load32 BOOTADDR(_bss),%r3
50 load32 BOOTADDR(_ebss),%r4
51 ldo FRAME_SIZE(%r4),%sp /* stack at end of bss */
53 cmpb,<<,n %r3,%r4,$bss_loop
56 /* Initialize the global data pointer */
59 /* arg0..arg4 were set by palo. */
60 copy %arg1, %r6 /* command line */
61 copy %arg2, %r7 /* rd-start */
62 copy %arg3, %r8 /* rd-end */
63 load32 BOOTADDR(decompress_kernel),%r3
67 ssm PSW_W_SM, %r0 /* set W-bit */
70 load32 BOOTADDR(startup_continue), %r2
76 rsm PSW_W_SM, %r0 /* clear W-bit */
79 load32 KERNEL_BINARY_TEXT_START, %arg0 /* free mem */
80 copy %r6, %arg1 /* command line */
81 copy %r7, %arg2 /* rd-start */
82 copy %r8, %arg3 /* rd-end */