Menu

#4 automatically determine number of uefi_call_wrapper() args on x86_64

Unstable_(example)
closed
nobody
None
5
2013-06-12
2013-06-07
No

(patch attached, the following is the copy/paste of the commit description)

Instead of asking developers to explicitly pass the number of
parameters to the functions that get called, we determine them
automatically at preprocessing time. This should result in more robust
code.

Argument va_num is now ignored in x86_64 code, both with and without
HAVE_USE_MS_ABI.

Credits to the macro magic given in the comments.
1 Attachments

Related

Patches: #4

Discussion

  • David Decotigny

    David Decotigny - 2013-06-10

    Same thing as for 1st patch, I did not have apps/tcc.c right with 0 args. Please either fix the line of the patch that originally reads:
    #define uefi_call_wrapper(func,va_num,...) \
    - _cast64_efi_call ## va_num (func, VA_ARGS)
    + VA_ARG_NSUFFIX(_cast64_efi_call, VA_ARGS) (func, VA_ARGS)

    It now becomes:
    #define uefi_call_wrapper(func,va_num,...) \
    - _cast64_efi_call ## va_num (func , ##VA_ARGS)
    + VA_ARG_NSUFFIX(_cast64_efi_call, VA_ARGS) (func , ##VA_ARGS)

    Or apply the updated patch, attached.
    Sorry for that.

     
  • Nigel Croxon

    Nigel Croxon - 2013-06-12
    • status: open --> closed
     
  • Nigel Croxon

    Nigel Croxon - 2013-06-12

    This patch was applied in 3.0u version – posted today (12-June-13) to git tree and tarball download.

     
  • David Decotigny

    David Decotigny - 2013-06-12

    Thanks!
    Unfortunately, I should have posted an update to that patch causing
    tcc.c to not compile: please see patch attached for details of problem
    + fix.

    On Wed, Jun 12, 2013 at 9:56 AM, Nigel Croxon noxorc@users.sf.net wrote:

    status: open --> closed


    [patches:#4] automatically determine number of uefi_call_wrapper() args on
    x86_64

    Status: closed
    Created: Fri Jun 07, 2013 04:52 PM UTC by David Decotigny
    Last Updated: Wed Jun 12, 2013 04:29 PM UTC
    Owner: nobody

    (patch attached, the following is the copy/paste of the commit description)

    Instead of asking developers to explicitly pass the number of
    parameters to the functions that get called, we determine them
    automatically at preprocessing time. This should result in more robust
    code.

    Argument va_num is now ignored in x86_64 code, both with and without
    HAVE_USE_MS_ABI.

    Credits to the macro magic given in the comments.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/gnu-efi/patches/4/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #4

  • David Decotigny

    David Decotigny - 2013-06-12

    Oh, right, I should mention that the bug would manifest with:
    make GCCNEWENOUGH=no all && make GCCNEWENOUGH=no -C apps
    if this is true, then I am attaching the patch to fix it. Just in case
    it's discarded by sf.net, I'm also copy/pasting it below (it's a
    matter of adding a "##" before very last occurrence of VA_ARGS):

    diff --git a/gnu-efi-3.0/inc/x86_64/efibind.h b/gnu-efi-3.0/inc/x86_64/efibind.h
    index 065a965..2133798 100644
    --- a/gnu-efi-3.0/inc/x86_64/efibind.h
    +++ b/gnu-efi-3.0/inc/x86_64/efibind.h
    @@ -368,7 +368,7 @@ UINT64 efi_call10(void *func, UINT64 arg1, UINT64
    arg2, UINT64 arg3,

    / main wrapper (va_num ignored) /
    #define uefi_call_wrapper(func,va_num,...) \
    - VA_ARG_NSUFFIX(_cast64_efi_call, VA_ARGS) (func, VA_ARGS)
    + VA_ARG_NSUFFIX(_cast64_efi_call, VA_ARGS) (func , ##VA_ARGS)

    #endif
    #define EFI_FUNCTION attribute((ms_abi))

    On Wed, Jun 12, 2013 at 12:26 PM, Nigel Croxon noxorc@users.sf.net wrote:

    David,
    Top of tree compiles tcc.c and I tested it and works.

    Also, I don't see any attachments to your mail.

    -Nigel

    From: David Decotigny
    gdaviddecotigny@users.sf.netgdaviddecotigny@users.sf.net
    Reply-To: "[gnu-efi:patches]"
    4@patches.gnu-efi.p.re.sf.net4@patches.gnu-efi.p.re.sf.net
    Date: Wed, 12 Jun 2013 18:58:23 +0000
    To: "[gnu-efi:patches]"
    4@patches.gnu-efi.p.re.sf.net4@patches.gnu-efi.p.re.sf.net
    Subject: [gnu-efi:patches] Re: #4 automatically determine number of
    uefi_call_wrapper() args on x86_64

    Thanks!
    Unfortunately, I should have posted an update to that patch causing
    tcc.c to not compile: please see patch attached for details of problem
    + fix.

    On Wed, Jun 12, 2013 at 9:56 AM, Nigel Croxon
    noxorc@users.sf.netnoxorc@users.sf.net wrote:

    status: open --> closed


    [patches:#4]http://sourceforge.net/p/gnu-efi/patches/4/ automatically
    determine number of uefi_call_wrapper() args on
    x86_64

    Status: closed
    Created: Fri Jun 07, 2013 04:52 PM UTC by David Decotigny
    Last Updated: Wed Jun 12, 2013 04:29 PM UTC
    Owner: nobody

    (patch attached, the following is the copy/paste of the commit description)

    Instead of asking developers to explicitly pass the number of
    parameters to the functions that get called, we determine them
    automatically at preprocessing time. This should result in more robust
    code.

    Argument va_num is now ignored in x86_64 code, both with and without
    HAVE_USE_MS_ABI.

    Credits to the macro magic given in the comments.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/gnu-efi/patches/4/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/


    [patches:#4]http://sourceforge.net/p/gnu-efi/patches/4/ automatically
    determine number of uefi_call_wrapper() args on x86_64

    Status: closed
    Created: Fri Jun 07, 2013 04:52 PM UTC by David Decotigny
    Last Updated: Wed Jun 12, 2013 04:56 PM UTC
    Owner: nobody

    (patch attached, the following is the copy/paste of the commit description)

    Instead of asking developers to explicitly pass the number ofparameters to
    the functions that get called, we determine themautomatically at
    preprocessing time. This should result in more robustcode.Argument va_num is
    now ignored in x86_64 code, both with and withoutHAVE_USE_MS_ABI.Credits to
    the macro magic given in the comments.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/gnu-efi/patches/4/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/


    [patches:#4] automatically determine number of uefi_call_wrapper() args on
    x86_64

    Status: closed
    Created: Fri Jun 07, 2013 04:52 PM UTC by David Decotigny
    Last Updated: Wed Jun 12, 2013 04:56 PM UTC
    Owner: nobody

    (patch attached, the following is the copy/paste of the commit description)

    Instead of asking developers to explicitly pass the number of
    parameters to the functions that get called, we determine them
    automatically at preprocessing time. This should result in more robust
    code.

    Argument va_num is now ignored in x86_64 code, both with and without
    HAVE_USE_MS_ABI.

    Credits to the macro magic given in the comments.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/gnu-efi/patches/4/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Patches: #4


Log in to post a comment.