Merge remote-tracking branch 'regulator/topic/core' into regulator-next
[cascardo/linux.git] / arch / x86 / boot / compressed / head_32.S
index d6b8aa4..1d7fbbc 100644 (file)
 #include <asm/boot.h>
 #include <asm/asm-offsets.h>
 
-/*
- * Adjust our own GOT
- *
- * The relocation base must be in %ebx
- *
- * It is safe to call this macro more than once, because in some of the
- * code paths multiple invocations are inevitable, e.g. via the efi*
- * entry points.
- *
- * Relocation is only performed the first time.
- */
-.macro FIXUP_GOT
-       cmpb    $1, got_fixed(%ebx)
-       je      2f
-
-       leal    _got(%ebx), %edx
-       leal    _egot(%ebx), %ecx
-1:
-       cmpl    %ecx, %edx
-       jae     2f
-       addl    %ebx, (%edx)
-       addl    $4, %edx
-       jmp     1b
-2:
-       movb    $1, got_fixed(%ebx)
-.endm
-
        __HEAD
 ENTRY(startup_32)
 #ifdef CONFIG_EFI_STUB
@@ -83,9 +56,6 @@ ENTRY(efi_pe_entry)
        add     %esi, 88(%eax)
        pushl   %eax
 
-       movl    %esi, %ebx
-       FIXUP_GOT
-
        call    make_boot_params
        cmpl    $0, %eax
        je      fail
@@ -111,10 +81,6 @@ ENTRY(efi32_stub_entry)
        leal    efi32_config(%esi), %eax
        add     %esi, 88(%eax)
        pushl   %eax
-
-       movl    %esi, %ebx
-       FIXUP_GOT
-
 2:
        call    efi_main
        cmpl    $0, %eax
@@ -224,12 +190,25 @@ relocated:
        shrl    $2, %ecx
        rep     stosl
 
-       FIXUP_GOT
+/*
+ * Adjust our own GOT
+ */
+       leal    _got(%ebx), %edx
+       leal    _egot(%ebx), %ecx
+1:
+       cmpl    %ecx, %edx
+       jae     2f
+       addl    %ebx, (%edx)
+       addl    $4, %edx
+       jmp     1b
+2:
+
 /*
  * Do the decompression, and jump to the new kernel..
  */
                                /* push arguments for decompress_kernel: */
-       pushl   $z_output_len   /* decompressed length */
+       pushl   $z_run_size     /* size of kernel with .bss and .brk */
+       pushl   $z_output_len   /* decompressed length, end of relocs */
        leal    z_extract_offset_negative(%ebx), %ebp
        pushl   %ebp            /* output address */
        pushl   $z_input_len    /* input_len */
@@ -239,7 +218,7 @@ relocated:
        pushl   %eax            /* heap area */
        pushl   %esi            /* real mode pointer */
        call    decompress_kernel /* returns kernel location in %eax */
-       addl    $24, %esp
+       addl    $28, %esp
 
 /*
  * Jump to the decompressed kernel.
@@ -247,12 +226,8 @@ relocated:
        xorl    %ebx, %ebx
        jmp     *%eax
 
-       .data
-/* Have we relocated the GOT? */
-got_fixed:
-       .byte 0
-
 #ifdef CONFIG_EFI_STUB
+       .data
 efi32_config:
        .fill 11,8,0
        .long efi_call_phys