grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 04/23] x86/boot: call reloc() using cdecl calling conventi


From: Jan Beulich
Subject: Re: [PATCH v2 04/23] x86/boot: call reloc() using cdecl calling convention
Date: Mon, 17 Aug 2015 09:44:39 -0600

>>> On 20.07.15 at 16:28, <address@hidden> wrote:

An empty description leaves us guess at the "why".

> --- a/xen/arch/x86/boot/reloc.c
> +++ b/xen/arch/x86/boot/reloc.c
> @@ -10,15 +10,27 @@
>   *    Keir Fraser <address@hidden>
>   */
>  
> -/* 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"

What do you need this for?

>      "    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"

    push 12(%ebp)

> +    "    call reloc                    \n"
> +    "    add  $4,%esp                  \n"

If you already copy %esp to %ebp at the top,

    mov %ebp, %esp

would be the better alternative.

> +    "    pop  %ebp                     \n"

Or even just

    leave

Jan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]