From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZHC59-0004Ay-14 for mharc-grub-devel@gnu.org; Mon, 20 Jul 2015 10:30:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHC51-00045W-OX for grub-devel@gnu.org; Mon, 20 Jul 2015 10:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHC4v-0000QA-Ue for grub-devel@gnu.org; Mon, 20 Jul 2015 10:30:07 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:48235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHC4v-0000PQ-Mg for grub-devel@gnu.org; Mon, 20 Jul 2015 10:30:01 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t6KETq5t007713 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Jul 2015 14:29:52 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t6KETqM4003607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 20 Jul 2015 14:29:52 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t6KETpWs017939; Mon, 20 Jul 2015 14:29:51 GMT Received: from olila.local.net-space.pl (/10.175.255.176) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 20 Jul 2015 07:29:51 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org, grub-devel@gnu.org Subject: [PATCH v2 04/23] x86/boot: call reloc() using cdecl calling convention Date: Mon, 20 Jul 2015 16:28:59 +0200 Message-Id: <1437402558-7313-5-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: jgross@suse.com, keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.citrix.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, phcoder@gmail.com, wei.liu2@citrix.com, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2015 14:30:09 -0000 Suggested-by: Jan Beulich Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S | 4 +++- xen/arch/x86/boot/reloc.c | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index ed42782..3cbb2e6 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -119,8 +119,10 @@ __start: /* Save the Multiboot info struct (after relocation) for later use. */ mov $sym_phys(cpu0_stack)+1024,%esp - push %ebx + push %ebx /* Multiboot information address. */ + push %eax /* Boot trampoline address. */ call reloc + add $8,%esp /* Remove reloc() args from stack. */ mov %eax,sym_phys(multiboot_ptr) /* Initialize BSS (no nasty surprises!). */ diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c index 63045c0..708898f 100644 --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -10,15 +10,27 @@ * Keir Fraser */ -/* entered with %eax = BOOT_TRAMPOLINE */ +/* + * This entry point is entered from xen/arch/x86/boot/head.S with: + * - 0x4(%esp) = BOOT_TRAMPOLINE_ADDRESS, + * - 0x8(%esp) = MULTIBOOT_INFORMATION_ADDRESS. + */ asm ( " .text \n" " .globl _start \n" "_start: \n" + " push %ebp \n" + " mov %esp,%ebp \n" " call 1f \n" - "1: pop %ebx \n" - " mov %eax,alloc-1b(%ebx) \n" - " jmp reloc \n" + "1: pop %ecx \n" + " mov 0x8(%ebp),%eax \n" + " mov %eax,alloc-1b(%ecx) \n" + " mov 0xc(%ebp),%eax \n" + " push %eax \n" + " call reloc \n" + " add $4,%esp \n" + " pop %ebp \n" + " ret \n" ); /* -- 1.7.10.4