Revision: 16395
http://sourceforge.net/p/edk2/code/16395
Author: lzeng14
Date: 2014-11-17 01:53:41 +0000 (Mon, 17 Nov 2014)
Log Message:
-----------
MdePkg Base.h: Fix EBC build failure and add comments for RETURN_ADDRESS macro.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdePkg/Include/Base.h
Modified: trunk/edk2/MdePkg/Include/Base.h
===================================================================
--- trunk/edk2/MdePkg/Include/Base.h 2014-11-14 17:35:49 UTC (rev 16394)
+++ trunk/edk2/MdePkg/Include/Base.h 2014-11-17 01:53:41 UTC (rev 16395)
@@ -1016,24 +1016,44 @@
#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
(SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
-#if defined(_MSC_EXTENSIONS)
- //
- // Intrinsic function provides the address of the instruction in the calling
- // function that will be executed after control returns to the caller.
- //
+#if defined(_MSC_EXTENSIONS) && !defined (MDE_CPU_EBC)
#pragma intrinsic(_ReturnAddress)
+ /**
+ Get the return address of the calling funcation.
+
+ Based on intrinsic function _ReturnAddress that provides the address of
+ the instruction in the calling function that will be executed after
+ control returns to the caller.
+
+ @param L Return Level.
+
+ @return The return address of the calling funcation or 0 if L != 0.
+
+ **/
#define RETURN_ADDRESS(L) ((L == 0) ? _ReturnAddress() : (VOID *) 0)
#elif defined(__GNUC__)
- //
- // Built-in Function returns the return address of the current function,
- // or of one of its callers.
- //
void * __builtin_return_address (unsigned int level);
+ /**
+ Get the return address of the calling funcation.
+
+ Based on built-in Function __builtin_return_address that returns
+ the return address of the current function, or of one of its callers.
+
+ @param L Return Level.
+
+ @return The return address of the calling funcation.
+
+ **/
#define RETURN_ADDRESS(L) __builtin_return_address (L)
#else
- //
- // Compilers don't support this feature.
- //
+ /**
+ Get the return address of the calling funcation.
+
+ @param L Return Level.
+
+ @return 0 as compilers don't support this feature.
+
+ **/
#define RETURN_ADDRESS(L) ((VOID *) 0)
#endif
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits