]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg Base.h: Fix EBC build failure and add comments for RETURN_ADDRESS macro.
authorStar Zeng <star.zeng@intel.com>
Mon, 17 Nov 2014 01:53:41 +0000 (01:53 +0000)
committerlzeng14 <lzeng14@Edk2>
Mon, 17 Nov 2014 01:53:41 +0000 (01:53 +0000)
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

MdePkg/Include/Base.h

index 5934b0f998114cbf9628eb7a77033c4852a2ff34..def5aa61846a6da4e1686a645565a1ddfd616a49 100644 (file)
@@ -1016,24 +1016,44 @@ typedef UINTN RETURN_STATUS;
 #define SIGNATURE_64(A, B, C, D, E, F, G, H) \\r
     (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))\r
 \r
-#if defined(_MSC_EXTENSIONS)\r
-  //\r
-  // Intrinsic function provides the address of the instruction in the calling\r
-  // function that will be executed after control returns to the caller.\r
-  //\r
+#if defined(_MSC_EXTENSIONS) && !defined (MDE_CPU_EBC)\r
   #pragma intrinsic(_ReturnAddress)\r
+  /**\r
+    Get the return address of the calling funcation.\r
+\r
+    Based on intrinsic function _ReturnAddress that provides the address of\r
+    the instruction in the calling function that will be executed after\r
+    control returns to the caller.\r
+\r
+    @param L    Return Level.\r
+\r
+    @return The return address of the calling funcation or 0 if L != 0.\r
+\r
+  **/\r
   #define RETURN_ADDRESS(L)     ((L == 0) ? _ReturnAddress() : (VOID *) 0)\r
 #elif defined(__GNUC__)\r
-  //\r
-  // Built-in Function returns the return address of the current function,\r
-  // or of one of its callers.\r
-  //\r
   void * __builtin_return_address (unsigned int level);\r
+  /**\r
+    Get the return address of the calling funcation.\r
+\r
+    Based on built-in Function __builtin_return_address that returns\r
+    the return address of the current function, or of one of its callers.\r
+\r
+    @param L    Return Level.\r
+\r
+    @return The return address of the calling funcation.\r
+\r
+  **/\r
   #define RETURN_ADDRESS(L)     __builtin_return_address (L)\r
 #else\r
-  //\r
-  // Compilers don't support this feature.\r
-  //\r
+  /**\r
+    Get the return address of the calling funcation.\r
+\r
+    @param L    Return Level.\r
+\r
+    @return 0 as compilers don't support this feature.\r
+\r
+  **/\r
   #define RETURN_ADDRESS(L)     ((VOID *) 0)\r
 #endif\r
 \r