]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/AArch64/ProcessorBind.h
MdePkg/ProcessorBind.h AARCH64: limit MAX_ADDRESS to 48 bits
[mirror_edk2.git] / MdePkg / Include / AArch64 / ProcessorBind.h
index ce2468287bcf6046c872dd3ee38e41625b06a89d..dad75df1c5796a458a945780c7a090830afc1e37 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Processor or Compiler specific defines and types for AArch64.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
   Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>\r
 \r
 //\r
 // Make sure we are using the correct packing rules per EFI specification\r
 //\r
-#ifndef __GNUC__\r
+#if !defined(__GNUC__) && !defined(__ASSEMBLER__)\r
 #pragma pack()\r
 #endif\r
 \r
-#if _MSC_EXTENSIONS\r
+#if defined(_MSC_EXTENSIONS)\r
+\r
+//\r
+// Disable some level 4 compilation warnings (same as IA32 and X64)\r
+//\r
+\r
+//\r
+// Disabling bitfield type checking warnings.\r
+//\r
+#pragma warning ( disable : 4214 )\r
+\r
+//\r
+// Disabling the unreferenced formal parameter warnings.\r
+//\r
+#pragma warning ( disable : 4100 )\r
+\r
+//\r
+// Disable slightly different base types warning as CHAR8 * can not be set\r
+// to a constant string.\r
+//\r
+#pragma warning ( disable : 4057 )\r
+\r
+//\r
+// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning\r
+//\r
+#pragma warning ( disable : 4127 )\r
+\r
+//\r
+// This warning is caused by functions defined but not used. For precompiled header only.\r
+//\r
+#pragma warning ( disable : 4505 )\r
+\r
+//\r
+// This warning is caused by empty (after preprocessing) source file. For precompiled header only.\r
+//\r
+#pragma warning ( disable : 4206 )\r
+\r
+//\r
+// Disable 'potentially uninitialized local variable X used' warnings\r
+//\r
+#pragma warning ( disable : 4701 )\r
+\r
+//\r
+// Disable 'potentially uninitialized local pointer variable X used' warnings\r
+//\r
+#pragma warning ( disable : 4703 )\r
+\r
   //\r
-  // use Microsoft* C complier dependent integer width types \r
+  // use Microsoft* C compiler dependent integer width types\r
   //\r
   typedef unsigned __int64    UINT64;\r
   typedef __int64             INT64;\r
@@ -45,7 +91,9 @@
   typedef unsigned char       UINT8;\r
   typedef char                CHAR8;\r
   typedef signed char         INT8;\r
+\r
 #else\r
+\r
   //\r
   // Assume standard AARCH64 alignment.\r
   //\r
   typedef unsigned char       UINT8;\r
   typedef char                CHAR8;\r
   typedef signed char         INT8;\r
+\r
 #endif\r
 \r
 ///\r
@@ -89,9 +138,9 @@ typedef INT64   INTN;
 #define MAX_2_BITS  0xC000000000000000ULL\r
 \r
 ///\r
-/// Maximum legal AARCH64  address\r
+/// Maximum legal AARCH64  address (48 bits for 4 KB page size)\r
 ///\r
-#define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL\r
+#define MAX_ADDRESS   0xFFFFFFFFFFFFULL\r
 \r
 ///\r
 /// Maximum legal AArch64 INTN and UINTN values.\r
@@ -99,11 +148,22 @@ typedef INT64   INTN;
 #define MAX_INTN   ((INTN)0x7FFFFFFFFFFFFFFFULL)\r
 #define MAX_UINTN  ((UINTN)0xFFFFFFFFFFFFFFFFULL)\r
 \r
+///\r
+/// Minimum legal AArch64 INTN value.\r
+///\r
+#define MIN_INTN   (((INTN)-9223372036854775807LL) - 1)\r
+\r
 ///\r
 /// The stack alignment required for AARCH64\r
 ///\r
 #define CPU_STACK_ALIGNMENT  16\r
 \r
+///\r
+/// Page allocation granularity for AARCH64\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY   (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY   (0x10000)\r
+\r
 //\r
 // Modifier to ensure that all protocol member functions and EFI intrinsics\r
 // use the correct C calling convention. All protocol member functions and\r
@@ -111,7 +171,9 @@ typedef INT64   INTN;
 //\r
 #define EFIAPI\r
 \r
-#if defined(__GNUC__)\r
+// When compiling with Clang, we still use GNU as for the assembler, so we still\r
+// need to define the GCC_ASM* macros.\r
+#if defined(__GNUC__) || defined(__clang__)\r
   ///\r
   /// For GNU assembly code, .global or .globl can declare global symbols.\r
   /// Define this macro to unify the usage.\r
@@ -139,4 +201,8 @@ typedef INT64   INTN;
 **/\r
 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)\r
 \r
+#ifndef __USER_LABEL_PREFIX__\r
+#define __USER_LABEL_PREFIX__\r
+#endif\r
+\r
 #endif\r