]> git.sur5r.net Git - u-boot/blobdiff - arch/x86/lib/crt0_x86_64_efi.S
x86: use EFI calling convention for efi_main on x86_64
[u-boot] / arch / x86 / lib / crt0_x86_64_efi.S
index 989799fb4a196224804984b51d889b0acb580f8e..bb8d3cf8a9f4f2b2022f50d3a138e253e5573362 100644 (file)
@@ -3,7 +3,7 @@
  * crt0-efi-x86_64.S - x86_64 EFI startup code.
  * Copyright (C) 1999 Hewlett-Packard Co.
  * Contributed by David Mosberger <davidm@hpl.hp.com>.
- * Copyright (C) 2005 Intel Co.
+ * Copyright (C) 2005 Intel Corporation
  * Contributed by Fenghua Yu <fenghua.yu@intel.com>.
  *
  * All rights reserved.
        .globl _start
 _start:
        subq $8, %rsp
+
        pushq %rcx
        pushq %rdx
 
-0:
-       lea image_base(%rip), %rdi
-       lea _DYNAMIC(%rip), %rsi
+       mov %rcx, %r8
+       mov %rdx, %r9
+
+       lea image_base(%rip), %rcx
+       lea _DYNAMIC(%rip), %rdx
 
-       popq %rcx
-       popq %rdx
-       pushq %rcx
-       pushq %rdx
        call _relocate
 
-       popq %rdi
-       popq %rsi
+       popq %rdx
+       popq %rcx
+
+       testq %rax, %rax
+       jnz .exit
 
        call efi_main
+.exit:
        addq $8, %rsp
 
-.exit:
        ret
 
        /*