/** @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
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\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
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
///\r
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL\r
\r
+///\r
+/// Maximum usable address at boot time (48 bits using 4 KB pages)\r
+///\r
+#define MAX_ALLOC_ADDRESS 0xFFFFFFFFFFFFULL\r
+\r
///\r
/// Maximum legal AArch64 INTN and UINTN values.\r
///\r
#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
//\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