diff options
author | Star Zeng <star.zeng@intel.com> | 2014-11-17 01:53:41 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@Edk2> | 2014-11-17 01:53:41 +0000 |
commit | 1db55d6a827cc2625a48a494e426e64f0b36ac0e (patch) | |
tree | b172891803f6e8fabe1c850b852a55a35057b560 /MdePkg/Include | |
parent | 46133008955b67110fff82b2f3af123143e492a1 (diff) | |
download | edk2-platforms-1db55d6a827cc2625a48a494e426e64f0b36ac0e.tar.xz |
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 <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16395 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r-- | MdePkg/Include/Base.h | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 5934b0f998..def5aa6184 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -1016,24 +1016,44 @@ typedef UINTN RETURN_STATUS; #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
|