2 Processor or Compiler specific defines and types for x64.
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at:
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 File Name: ProcessorBind.h
18 #ifndef __PROCESSOR_BIND_H__
19 #define __PROCESSOR_BIND_H__
22 // Define the processor type so other code can make processor based choices
27 // Make sure we are useing the correct packing rules per EFI specification
36 // Disable warning that make it impossible to compile at /W4
37 // This only works for Microsoft* tools
41 // Disabling bitfield type checking warnings.
43 #pragma warning ( disable : 4214 )
46 // Disabling the unreferenced formal parameter warnings.
48 #pragma warning ( disable : 4100 )
51 // Disable slightly different base types warning as CHAR8 * can not be set
52 // to a constant string.
54 #pragma warning ( disable : 4057 )
57 // ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
59 #pragma warning ( disable : 4127 )
65 #if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
67 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
73 // use Microsoft* C complier dependent integer width types
75 typedef unsigned __int64 UINT64
;
76 typedef __int64 INT64
;
77 typedef unsigned __int32 UINT32
;
78 typedef __int32 INT32
;
79 typedef unsigned short UINT16
;
80 typedef unsigned short CHAR16
;
82 typedef unsigned char BOOLEAN
;
83 typedef unsigned char UINT8
;
89 // Assume standard IA-32 alignment.
90 // BugBug: Need to check portability of long long
92 typedef unsigned long long UINT64
;
93 typedef long long INT64
;
94 typedef unsigned int UINT32
;
96 typedef unsigned short UINT16
;
97 typedef unsigned short CHAR16
;
99 typedef unsigned char BOOLEAN
;
100 typedef unsigned char UINT8
;
105 #define UINT8_MAX 0xff
109 // Use ANSI C 2000 stdint.h integer width declarations
112 typedef uint8_t BOOLEAN
;
114 typedef uint8_t UINT8
;
115 typedef int16_t INT16
;
116 typedef uint16_t UINT16
;
117 typedef int32_t INT32
;
118 typedef uint32_t UINT32
;
119 typedef int64_t INT64
;
120 typedef uint64_t UINT64
;
122 typedef uint16_t CHAR16
;
126 typedef UINT32 UINTN
;
131 // Processor specific defines
133 #define MAX_BIT 0x80000000
134 #define MAX_2_BITS 0xC0000000
137 // Maximum legal IA-32 address
139 #define MAX_ADDRESS 0xFFFFFFFF
142 // Modifier to ensure that all protocol member functions and EFI intrinsics
143 // use the correct C calling convention. All protocol member functions and
144 // EFI intrinsics are required to modify their member functions with EFIAPI.
148 // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
150 #define EFIAPI __cdecl
154 #define EFIAPI __attribute__((cdecl))
158 // The Microsoft* C compiler can removed references to unreferenced data items
159 // if the /OPT:REF linker option is used. We defined a macro as this is a
160 // a non standard extension
163 #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
165 #define GLOBAL_REMOVE_IF_UNREFERENCED