automatically determine number of uefi_call_wrapper() args on x86_64
Brought to you by:
noxorc
(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.
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.
This patch was applied in 3.0u version – posted today (12-June-13) to git tree and tarball download.
From: David Decotigny gdaviddecotigny@users.sf.netamp#103;amp#100;amp#97;amp#118;amp#105;amp#100;amp#100;amp#101;amp#99;amp#111;amp#116;amp#105;amp#103;amp#110;amp#121;amp#64;amp#117;amp#115;amp#101;amp#114;amp#115;amp#46;amp#115;amp#102;amp#46;amp#110;amp#101;amp#116;
Reply-To: Ticket 4 4@patches.gnu-efi.p.re.sf.netamp#52;amp#64;amp#112;amp#97;amp#116;amp#99;amp#104;amp#101;amp#115;amp#46;amp#103;amp#110;amp#117;amp#45;amp#101;amp#102;amp#105;amp#46;amp#112;amp#46;amp#114;amp#101;amp#46;amp#115;amp#102;amp#46;amp#110;amp#101;amp#116;
Date: Fri, 7 Jun 2013 16:52:19 +0000
To: Ticket 4 4@patches.gnu-efi.p.re.sf.netamp#52;amp#64;amp#112;amp#97;amp#116;amp#99;amp#104;amp#101;amp#115;amp#46;amp#103;amp#110;amp#117;amp#45;amp#101;amp#102;amp#105;amp#46;amp#112;amp#46;amp#114;amp#101;amp#46;amp#115;amp#102;amp#46;amp#110;amp#101;amp#116;
Subject: [gnu-efi:patches] #4 automatically determine number of uefi_call_wrapper() args on x86_64
[patches:#4]http://sourceforge.net/p/gnu-efi/patches/4/ automatically determine number of uefi_call_wrapper() args on x86_64
Status: open
Created: Fri Jun 07, 2013 04:52 PM UTC by David Decotigny
Last Updated: Fri Jun 07, 2013 04:52 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/
Related
Patches:
#4This patch was applied in 3.0u version – posted today (12-June-13) to git tree and tarball download.
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:
Related
Patches:
#4David,
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.netamp#103;amp#100;amp#97;amp#118;amp#105;amp#100;amp#100;amp#101;amp#99;amp#111;amp#116;amp#105;amp#103;amp#110;amp#121;amp#64;amp#117;amp#115;amp#101;amp#114;amp#115;amp#46;amp#115;amp#102;amp#46;amp#110;amp#101;amp#116;
Reply-To: "[gnu-efi:patches]" 4@patches.gnu-efi.p.re.sf.netamp#52;amp#64;amp#112;amp#97;amp#116;amp#99;amp#104;amp#101;amp#115;amp#46;amp#103;amp#110;amp#117;amp#45;amp#101;amp#102;amp#105;amp#46;amp#112;amp#46;amp#114;amp#101;amp#46;amp#115;amp#102;amp#46;amp#110;amp#101;amp#116;
Date: Wed, 12 Jun 2013 18:58:23 +0000
To: "[gnu-efi:patches]" 4@patches.gnu-efi.p.re.sf.netamp#52;amp#64;amp#112;amp#97;amp#116;amp#99;amp#104;amp#101;amp#115;amp#46;amp#103;amp#110;amp#117;amp#45;amp#101;amp#102;amp#105;amp#46;amp#112;amp#46;amp#114;amp#101;amp#46;amp#115;amp#102;amp#46;amp#110;amp#101;amp#116;
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/
Related
Patches:
#4Oh, 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:
Related
Patches:
#4