X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FBase.h;h=89b2aed07229f4d6eaab8d916bf71c856aa468b1;hp=4dda3c2f408684fb967b4da3e5f2c3ab0fb64fa1;hb=fed5f4475948fd09cb71ba4c9f3918af1c3a7ba6;hpb=02eef553114dea1e4d55071e91398a0625e4e18c
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 4dda3c2f40..89b2aed072 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -6,7 +6,7 @@
environment. There are a set of base libraries in the Mde Package that can
be used to implement base modules.
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -27,6 +27,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
#include
+#if defined(_MSC_EXTENSIONS)
+//
+// Disable warning when last field of data structure is a zero sized array.
+//
+#pragma warning ( disable : 4200 )
+#endif
/**
Verifies the storage size of a given data type.
@@ -934,6 +940,11 @@ typedef UINTN RETURN_STATUS;
///
#define RETURN_COMPROMISED_DATA ENCODE_ERROR (33)
+///
+/// A HTTP error occurred during the network operation.
+///
+#define RETURN_HTTP_ERROR ENCODE_ERROR (35)
+
///
/// The string contained one or more characters that
/// the device could not render and were skipped.
@@ -963,6 +974,12 @@ typedef UINTN RETURN_STATUS;
///
#define RETURN_WARN_STALE_DATA ENCODE_WARNING (5)
+///
+/// The resulting buffer contains UEFI-compliant file system.
+///
+#define RETURN_WARN_FILE_SYSTEM ENCODE_WARNING (6)
+
+
/**
Returns a 16-bit signature built from 2 ASCII characters.
@@ -1016,5 +1033,46 @@ 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) && !defined (__INTEL_COMPILER) && !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__)
+ 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
+ /**
+ 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
+
#endif