@@ -13,7 +13,7 @@ $(obj)/head.o: $(head-bin-objs:.o=.bin)
CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS))
$(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS))
-CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float
+CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3
ifneq ($(abs_objtree),$(abs_srctree))
CFLAGS_x86_32 += -I$(objtree)/include
endif
@@ -20,8 +20,8 @@
/*
* This entry point is entered from xen/arch/x86/boot/head.S with:
- * - 0x4(%esp) = &cmdline,
- * - 0x8(%esp) = &early_boot_opts.
+ * - %eax = &cmdline,
+ * - %ecx = &early_boot_opts.
*/
asm (
" .text \n"
@@ -347,8 +347,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
#endif
/* SAF-1-safe */
-void __attribute__((__stdcall__))
-cmdline_parse_early(const char *cmdline, early_boot_opts_t *ebo)
+void cmdline_parse_early(const char *cmdline, early_boot_opts_t *ebo)
{
if ( !cmdline )
return;
@@ -613,10 +613,13 @@ trampoline_setup:
/* Save Multiboot / PVH info struct (after relocation) for later use. */
push %edx /* Boot video info to be filled from MB2. */
- push %ecx /* Bottom-most low-memory stack address. */
- push %ebx /* Multiboot / PVH information address. */
- push %eax /* Magic number. */
+ mov %ecx, %edx /* Bottom-most low-memory stack address. */
+ mov %ebx, %ecx /* Multiboot / PVH information address. */
+ /* Magic number. */
+ /* reloc(magic, info, trampoline, video) using fastcall(a, c, d, stk). */
call reloc
+ add $4, %esp
+
#ifdef CONFIG_PVH_GUEST
cmpb $0, sym_esi(pvh_boot)
je 1f
@@ -848,9 +851,9 @@ trampoline_setup:
testl $MBI_CMDLINE,MB_flags(%ebx)
jz 1f
- lea sym_esi(early_boot_opts),%eax
- push %eax
- pushl MB_cmdline(%ebx)
+ lea sym_esi(early_boot_opts), %ecx
+ lea MB_cmdline(%ebx), %eax
+ /* cmdline_parse_early(cmdline, opts) using fastcall(a, c). */
call cmdline_parse_early
1:
@@ -14,10 +14,10 @@
/*
* This entry point is entered from xen/arch/x86/boot/head.S with:
- * - 0x04(%esp) = MAGIC,
- * - 0x08(%esp) = INFORMATION_ADDRESS,
- * - 0x0c(%esp) = TOPMOST_LOW_MEMORY_STACK_ADDRESS.
- * - 0x10(%esp) = BOOT_VIDEO_INFO_ADDRESS.
+ * - %eax = MAGIC,
+ * - %ecx = INFORMATION_ADDRESS,
+ * - %edx = TOPMOST_LOW_MEMORY_STACK_ADDRESS.
+ * - 0x04(%esp) = BOOT_VIDEO_INFO_ADDRESS.
*/
asm (
" .text \n"
@@ -353,8 +353,8 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
}
/* SAF-1-safe */
-void *__attribute__((__stdcall__))
-reloc(uint32_t magic, uint32_t in, uint32_t trampoline, uint32_t video_info)
+void *reloc(uint32_t magic, uint32_t in, uint32_t trampoline,
+ uint32_t video_info)
{
alloc = trampoline;
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Jan Beulich <JBeulich@suse.com> CC: Roger Pau Monné <roger.pau@citrix.com> CC: Frediano Ziglio <frediano.ziglio@cloud.com> RFC. This doesn't boot, but I haven't quite figured out where yet. --- xen/arch/x86/boot/Makefile | 2 +- xen/arch/x86/boot/cmdline.c | 7 +++---- xen/arch/x86/boot/head.S | 15 +++++++++------ xen/arch/x86/boot/reloc.c | 12 ++++++------ 4 files changed, 19 insertions(+), 17 deletions(-)