summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-02-07 09:25:15 +0800
committerLiming Gao <liming.gao@intel.com>2018-02-07 09:49:20 +0800
commit987363c9ce12c5e5e082ce9744c9dd065373ba6a (patch)
tree8964001ca2bfc63ee2eabfb180fa812debd5596f /MdePkg
parent4344a788c472fccd9af559891363374868fb6275 (diff)
downloadedk2-987363c9ce12c5e5e082ce9744c9dd065373ba6a.tar.gz
edk2-987363c9ce12c5e5e082ce9744c9dd065373ba6a.tar.bz2
edk2-987363c9ce12c5e5e082ce9744c9dd065373ba6a.zip
MdePkg: Disable some Level 4 warnings for VS2017/ARM
We disable the exact same warnings as IA32 and X64. Also create a dummy macro for PRESERVE8, as this is not supported by the Microsoft ARM assembler. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Arm/ProcessorBind.h96
1 files changed, 75 insertions, 21 deletions
diff --git a/MdePkg/Include/Arm/ProcessorBind.h b/MdePkg/Include/Arm/ProcessorBind.h
index c30d353f40..8cca0f3bb0 100644
--- a/MdePkg/Include/Arm/ProcessorBind.h
+++ b/MdePkg/Include/Arm/ProcessorBind.h
@@ -1,15 +1,15 @@
/** @file
Processor or Compiler specific defines and types for ARM.
- Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -28,14 +28,63 @@
#pragma pack()
#endif
+#if defined(_MSC_EXTENSIONS)
+
+//
+// Disable some level 4 compilation warnings (same as IA32 and X64)
+//
+
+//
+// Disabling bitfield type checking warnings.
+//
+#pragma warning ( disable : 4214 )
+
+//
+// Disabling the unreferenced formal parameter warnings.
+//
+#pragma warning ( disable : 4100 )
+
+//
+// Disable slightly different base types warning as CHAR8 * can not be set
+// to a constant string.
+//
+#pragma warning ( disable : 4057 )
+
+//
+// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
+//
+#pragma warning ( disable : 4127 )
+
+//
+// This warning is caused by functions defined but not used. For precompiled header only.
+//
+#pragma warning ( disable : 4505 )
+
+//
+// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
+//
+#pragma warning ( disable : 4206 )
+
+//
+// Disable 'potentially uninitialized local variable X used' warnings
+//
+#pragma warning ( disable : 4701 )
+
+//
+// Disable 'potentially uninitialized local pointer variable X used' warnings
+//
+#pragma warning ( disable : 4703 )
+
+#endif
+
//
-// RVCT does not support the __builtin_unreachable() macro
+// RVCT and MSFT don't support the __builtin_unreachable() macro
//
-#ifdef __ARMCC_VERSION
+#if defined(__ARMCC_VERSION) || defined(_MSC_EXTENSIONS)
#define UNREACHABLE()
#endif
-#if _MSC_EXTENSIONS
+#if defined(_MSC_EXTENSIONS)
//
// use Microsoft* C compiler dependent integer width types
//
@@ -52,7 +101,7 @@
typedef signed char INT8;
#else
//
- // Assume standard ARM alignment.
+ // Assume standard ARM alignment.
// Need to check portability of long long
//
typedef unsigned long long UINT64;
@@ -126,7 +175,7 @@ typedef INT32 INTN;
// use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify their member functions with EFIAPI.
//
-#define EFIAPI
+#define EFIAPI
// When compiling with Clang, we still use GNU as for the assembler, so we still
// need to define the GCC_ASM* macros.
@@ -147,34 +196,39 @@ typedef INT32 INTN;
#define GCC_ASM_EXPORT(func__) \
.global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
- .type ASM_PFX(func__), %function
+ .type ASM_PFX(func__), %function
#define GCC_ASM_IMPORT(func__) \
.extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
-
+
#else
//
- // .type not supported by Apple Xcode tools
+ // .type not supported by Apple Xcode tools
//
- #define INTERWORK_FUNC(func__)
+ #define INTERWORK_FUNC(func__)
#define GCC_ASM_EXPORT(func__) \
.globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
-
- #define GCC_ASM_IMPORT(name)
+
+ #define GCC_ASM_IMPORT(name)
#endif
+#elif defined(_MSC_EXTENSIONS)
+ //
+ // PRESERVE8 is not supported by the MSFT assembler.
+ //
+ #define PRESERVE8
#endif
/**
Return the pointer to the first instruction of a function given a function pointer.
- On ARM CPU architectures, these two pointer values are the same,
+ On ARM CPU architectures, these two pointer values are the same,
so the implementation of this macro is very simple.
-
+
@param FunctionPointer A pointer to a function.
@return The pointer to the first instruction of a function given a function pointer.
-
+
**/
#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)