Path: blob/main/stand/efi/loader/arch/amd64/start.S
34907 views
/*-1* Copyright (C) 1999 Hewlett-Packard Co.2* Contributed by David Mosberger <[email protected]>.3* Copyright (C) 2005 Intel Co.4* Contributed by Fenghua Yu <[email protected]>.5* All rights reserved.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted provided that the following conditions9* are met:10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15* 3. Neither the name of Hewlett-Packard Co. nor the names of its16* contributors may be used to endorse or promote products derived17* from this software without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS20* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT21* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR22* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT23* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,24* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT25* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,26* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY27* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR28* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF29* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233/*34* crt0-efi-x86_64.S - x86_64 EFI startup code.35*/3637.text38.align 43940.globl _start41_start:42subq $8, %rsp43pushq %rcx44pushq %rdx45460:47lea ImageBase(%rip), %rdi48lea _DYNAMIC(%rip), %rsi4950popq %rcx51popq %rdx52pushq %rcx53pushq %rdx54call self_reloc5556popq %rdi57popq %rsi5859call efi_main60addq $8, %rsp6162.exit:63ret6465/*66* hand-craft a dummy .reloc section so EFI knows it's a relocatable67* executable:68*/6970.data71.section .reloc, "a"72.long 073.long 1074.word 0757677