From owner-p4-projects@FreeBSD.ORG Sun Aug 31 00:18:01 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 96E101065679; Sun, 31 Aug 2008 00:18:01 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AA021065676 for ; Sun, 31 Aug 2008 00:18:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4883E8FC24 for ; Sun, 31 Aug 2008 00:18:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7V0I10M026853 for ; Sun, 31 Aug 2008 00:18:01 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7V0I1LF026851 for perforce@freebsd.org; Sun, 31 Aug 2008 00:18:01 GMT (envelope-from rpaulo@FreeBSD.org) Date: Sun, 31 Aug 2008 00:18:01 GMT Message-Id: <200808310018.m7V0I1LF026851@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo To: Perforce Change Reviews Cc: Subject: PERFORCE change 148880 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2008 00:18:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=148880 Change 148880 by rpaulo@rpaulo_alpha on 2008/08/31 00:17:48 Add a _start function based on gnu-efi. Affected files ... .. //depot/projects/efi/boot/i386/efi/start.S#2 edit Differences ... ==== //depot/projects/efi/boot/i386/efi/start.S#2 (text+ko) ==== @@ -32,9 +32,34 @@ #define EFI_SUCCESS 0 +/* + * EFI entry point. + * _start(EFI_IMAGE image_handle, EFI_SYSTEM_TABLE *system_table); + * + * We calculate the base address along with _DYNAMIC, relocate us and finally + * pass control to efi_main. + */ + ENTRY(_start) - // TBD - leave + pushl %ebp + movl %esp, %ebp + + pushl 12(%ebp) /* image_handle */ + pushl 8(%ebp) /* system_table */ + call 0f +0: popl %eax + movl %eax, %ebx + addl $ImageBase-0b, %eax + addl $_DYNAMIC-0b, %ebx + pushl %ebx /* dynamic */ + pushl %eax /* ImageBase */ + call _reloc + cmpl $EFI_SUCCESS, %eax + jne 1f + popl %ebx /* remove ImageBase from the stack */ + popl %ebx /* remove dynamic from the stack */ + call efi_main +1: leave ret END(_start) @@ -42,4 +67,4 @@ .section .reloc, "a" .long 0 .long 10 - .word (0 << 12) + .word 0