Path: blob/main/stand/efi/loader/arch/i386/start.S
34889 views
/*-1* Copyright (C) 1999 Hewlett-Packard Co.2* Contributed by David Mosberger <[email protected]>.3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13* 3. Neither the name of Hewlett-Packard Co. nor the names of its14* contributors may be used to endorse or promote products derived15* from this software without specific prior written permission.16*17* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS18* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT19* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR20* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT21* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,22* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT23* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,24* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY25* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR26* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF27* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031/*32* crt0-efi-ia32.S - x86 EFI startup code.33*/3435.text36.align 43738.globl _start39_start:40pushl %ebp41movl %esp, %ebp4243pushl 12(%ebp)44pushl 8(%ebp)4546call 0f470: popl %eax48movl %eax, %ebx4950addl $ImageBase-0b, %eax51addl $_DYNAMIC-0b, %ebx5253pushl %ebx54pushl %eax55call self_reloc56popl %ebx57popl %ebx5859call setup6061.exit:62leave63ret6465/*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