This was mostly for GCC only. I noticed that 'cdecl' is already specified
there, i.e. it overrides default compiler calling conventions (particularly, it
should help cases when you specify -mrtd). Adding regparam(0) at least should
not hurt anything and should help to fix cases when mregparm=1,2,3.
For X64, it should not matter since mregparm is ignored.
On Sunday, March 8, 2015 11:10 PM, "Tian, Feng" <[email protected]>
wrote:
#yiv0995187787 #yiv0995187787 -- _filtered #yiv0995187787
{font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv0995187787
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv0995187787
{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;} _filtered #yiv0995187787
{panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv0995187787
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv0995187787
{panose-1:2 1 6 0 3 1 1 1 1 1;}#yiv0995187787 #yiv0995187787
p.yiv0995187787MsoNormal, #yiv0995187787 li.yiv0995187787MsoNormal,
#yiv0995187787 div.yiv0995187787MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv0995187787 h1
{margin-right:0in;margin-left:0in;font-size:24.0pt;}#yiv0995187787 a:link,
#yiv0995187787 span.yiv0995187787MsoHyperlink
{color:#0563C1;text-decoration:underline;}#yiv0995187787 a:visited,
#yiv0995187787 span.yiv0995187787MsoHyperlinkFollowed
{color:#954F72;text-decoration:underline;}#yiv0995187787
span.yiv0995187787EmailStyle17 {color:#1F497D;}#yiv0995187787
span.yiv0995187787Heading1Char {font-weight:bold;}#yiv0995187787
.yiv0995187787MsoChpDefault {font-size:10.0pt;} _filtered #yiv0995187787
{margin:1.0in 1.25in 1.0in 1.25in;}#yiv0995187787 div.yiv0995187787WordSection1
{}#yiv0995187787 My personal idea is: user couldn’t point arbitrary compiler
options if it’s apparently disobey with UEFI calling convention limitation.
Your case is an example, but what if user try to use /Gr build option to force
fastcall for MS tool chain? How do we solve such case? And your patch is
only for IA32, I am not sure if X64/IA64 has the same issue or not? Anyway,
it’s just my personal thoughtJ Let’s see if others have input. From: Ruslan
Nikolaev [mailto:[email protected]]
Sent: Sunday, March 8, 2015 3:45 AM
To: [email protected]
Subject: [edk2] EFIAPI for x86 Hi In case if default options for GCC are
used, EFIAPI definition should be fine. However, if mregparm is set to non zero
value, it will be incorrect. Would be nice to include the following fix:
diff -urN Edk.orig/MdePkg/Include/Ia32/ProcessorBind.h
Edk/MdePkg/Include/Ia32/ProcessorBind.h
--- Edk.orig/MdePkg/Include/Ia32/ProcessorBind.h 2014-12-26
01:37:49.072607460 -0800
+++ Edk/MdePkg/Include/Ia32/ProcessorBind.h 2014-12-26 01:20:32.752651041 -0800
@@ -255,7 +255,7 @@
///^M
/// GCC specific method for EFIAPI calling convention.^M
/// ^M
- #define EFIAPI __attribute__((cdecl)) ^M
+ #define EFIAPI __attribute__((cdecl, regparm(0))) ^M
#else^M
///^M
/// The default for a non Microsoft* or GCC compiler is to assume the EFI
ABI^M
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel