Merge branch 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
[sfrench/cifs-2.6.git] / arch / x86 / boot / compressed / head_32.S
index f35ea2237522c0267139af7666e2875b571dd4b4..ba7736cf2ec73e8977e447a8ab852d083f079c42 100644 (file)
 #include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/boot.h>
+#include <asm/asm-offsets.h>
 
 .section ".text.head","ax",@progbits
        .globl startup_32
 
 startup_32:
        cld
+       /* test KEEP_SEGMENTS flag to see if the bootloader is asking
+        * us to not reload segments */
+       testb $(1<<6), BP_loadflags(%esi)
+       jnz 1f
+
        cli
        movl $(__BOOT_DS),%eax
        movl %eax,%ds
@@ -40,6 +46,7 @@ startup_32:
        movl %eax,%fs
        movl %eax,%gs
        movl %eax,%ss
+1:
 
 /* Calculate the delta between where we were compiled to run
  * at and where we were actually loaded at.  This can only be done
@@ -123,7 +130,7 @@ relocated:
 /*
  * Setup the stack for the decompressor
  */
-       leal stack_end(%ebx), %esp
+       leal boot_stack_end(%ebx), %esp
 
 /*
  * Do the decompression, and jump to the new kernel..
@@ -135,8 +142,8 @@ relocated:
        pushl %eax      # input_len
        leal input_data(%ebx), %eax
        pushl %eax      # input_data
-       leal _end(%ebx), %eax
-       pushl %eax      # end of the image as third argument
+       leal boot_heap(%ebx), %eax
+       pushl %eax      # heap area as third argument
        pushl %esi      # real mode pointer as second arg
        call decompress_kernel
        addl $20, %esp
@@ -174,7 +181,10 @@ relocated:
        jmp *%ebp
 
 .bss
+/* Stack and heap for uncompression */
 .balign 4
-stack:
-       .fill 4096, 1, 0
-stack_end:
+boot_heap:
+       .fill BOOT_HEAP_SIZE, 1, 0
+boot_stack:
+       .fill BOOT_STACK_SIZE, 1, 0
+boot_stack_end: