X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FX64%2FProcessorBind.h;h=e4254285877bba28a846f2103b1aa9c4f06bb67c;hb=9095d37b8fe5bfc3d02adad6ba7fd7359ebc0107;hp=974545a2c5ca65acf79a36fa4f61c4d4c2432d65;hpb=9df063a06aef048c042498e2f542fb693e93493a;p=mirror_edk2.git diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h index 974545a2c5..e425428587 100644 --- a/MdePkg/Include/X64/ProcessorBind.h +++ b/MdePkg/Include/X64/ProcessorBind.h @@ -1,14 +1,14 @@ /** @file Processor or Compiler specific defines and types x64 (Intel 64, AMD64). - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- 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 + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ 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. **/ @@ -27,6 +27,19 @@ #pragma pack() #endif +#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO) +// +// Mark all symbol declarations and references as hidden, meaning they will +// not be subject to symbol preemption. This allows the compiler to refer to +// symbols directly using relative references rather than via the GOT, which +// contains absolute symbol addresses that are subject to runtime relocation. +// +// The LTO linker will not emit GOT based relocations when all symbol +// references can be resolved locally, and so there is no need to set the +// pragma in that case (and doing so will cause other issues). +// +#pragma GCC visibility push (hidden) +#endif #if defined(__INTEL_COMPILER) // @@ -80,7 +93,7 @@ #pragma warning ( disable : 4057 ) // -// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning +// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning // #pragma warning ( disable : 4127 ) @@ -94,12 +107,32 @@ // #pragma warning ( disable : 4206 ) +#if _MSC_VER == 1800 || _MSC_VER == 1900 || _MSC_VER >= 1910 + +// +// Disable these warnings for VS2013. +// + +// +// This warning is for potentially uninitialized local variable, and it may cause false +// positive issues in VS2013 and VS2015 build +// +#pragma warning ( disable : 4701 ) + +// +// This warning is for potentially uninitialized local pointer variable, and it may cause +// false positive issues in VS2013 and VS2015 build +// +#pragma warning ( disable : 4703 ) + +#endif + #endif #if defined(_MSC_EXTENSIONS) // - // use Microsoft C complier dependent integer width types + // use Microsoft C compiler dependent integer width types // /// @@ -147,7 +180,7 @@ /// /// 1-byte signed value /// - typedef char INT8; + typedef signed char INT8; #else /// /// 8-byte unsigned value @@ -194,7 +227,7 @@ /// /// 1-byte signed value /// - typedef char INT8; + typedef signed char INT8; #endif /// @@ -227,11 +260,28 @@ typedef INT64 INTN; /// #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL +/// +/// Maximum legal x64 INTN and UINTN values. +/// +#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL) +#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL) + +/// +/// Minimum legal x64 INTN value. +/// +#define MIN_INTN (((INTN)-9223372036854775807LL) - 1) + /// /// The stack alignment required for x64 /// #define CPU_STACK_ALIGNMENT 16 +/// +/// Page allocation granularity for x64 +/// +#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000) +#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000) + // // Modifier to ensure that all protocol member functions and EFI intrinsics // use the correct C calling convention. All protocol member functions and @@ -243,25 +293,25 @@ typedef INT64 INTN; /// #elif defined(_MSC_EXTENSIONS) /// - /// Microsoft* compiler specific method for EFIAPI calling convension - /// - #define EFIAPI __cdecl + /// Microsoft* compiler specific method for EFIAPI calling convention. + /// + #define EFIAPI __cdecl #elif defined(__GNUC__) /// - /// Define the standard calling convention reguardless of optimization level. + /// Define the standard calling convention regardless of optimization level. /// The GCC support assumes a GCC compiler that supports the EFI ABI. The EFI - /// ABI is much closer to the x64 Microsoft* ABI than standard x64 (x86-64) - /// GCC ABI. Thus a standard x64 (x86-64) GCC compiler can not be used for - /// x64. Warning the assembly code in the MDE x64 does not follow the correct + /// ABI is much closer to the x64 Microsoft* ABI than standard x64 (x86-64) + /// GCC ABI. Thus a standard x64 (x86-64) GCC compiler can not be used for + /// x64. Warning the assembly code in the MDE x64 does not follow the correct /// ABI for the standard x64 (x86-64) GCC. /// - #define EFIAPI + #define EFIAPI #else /// /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI - /// is the standard. + /// is the standard. /// - #define EFIAPI + #define EFIAPI #endif #if defined(__GNUC__) @@ -274,15 +324,19 @@ typedef INT64 INTN; /** Return the pointer to the first instruction of a function given a function pointer. - On x64 CPU architectures, these two pointer values are the same, + On x64 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) +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ +#endif + #endif