]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/Ia32/ProcessorBind.h
2 Processor or Compiler specific defines and types for x64.
4 Copyright (c) 2006 - 2014, 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.
16 #ifndef __PROCESSOR_BIND_H__
17 #define __PROCESSOR_BIND_H__
20 // Define the processor type so other code can make processor based choices
25 // Make sure we are useing the correct packing rules per EFI specification
34 // Disable warning that make it impossible to compile at /W4
35 // This only works for Microsoft* tools
39 // Disabling bitfield type checking warnings.
41 #pragma warning ( disable : 4214 )
44 // Disabling the unreferenced formal parameter warnings.
46 #pragma warning ( disable : 4100 )
49 // Disable slightly different base types warning as CHAR8 * can not be set
50 // to a constant string.
52 #pragma warning ( disable : 4057 )
55 // ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
57 #pragma warning ( disable : 4127 )
63 #if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
65 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
71 // use Microsoft* C complier dependent integer width types
73 typedef unsigned __int64 UINT64
;
74 typedef __int64 INT64
;
75 typedef unsigned __int32 UINT32
;
76 typedef __int32 INT32
;
77 typedef unsigned short UINT16
;
78 typedef unsigned short CHAR16
;
80 typedef unsigned char BOOLEAN
;
81 typedef unsigned char UINT8
;
87 // Assume standard IA-32 alignment.
88 // BugBug: Need to check portability of long long
90 typedef unsigned long long UINT64
;
91 typedef long long INT64
;
92 typedef unsigned int UINT32
;
94 typedef unsigned short UINT16
;
95 typedef unsigned short CHAR16
;
97 typedef unsigned char BOOLEAN
;
98 typedef unsigned char UINT8
;
103 #define UINT8_MAX 0xff
107 // Use ANSI C 2000 stdint.h integer width declarations
110 typedef uint8_t BOOLEAN
;
112 typedef uint8_t UINT8
;
113 typedef int16_t INT16
;
114 typedef uint16_t UINT16
;
115 typedef int32_t INT32
;
116 typedef uint32_t UINT32
;
117 typedef int64_t INT64
;
118 typedef uint64_t UINT64
;
120 typedef uint16_t CHAR16
;
124 typedef UINT32 UINTN
;
129 // Processor specific defines
131 #define MAX_BIT 0x80000000
132 #define MAX_2_BITS 0xC0000000
135 // Maximum legal IA-32 address
137 #define MAX_ADDRESS 0xFFFFFFFF
140 // Modifier to ensure that all protocol member functions and EFI intrinsics
141 // use the correct C calling convention. All protocol member functions and
142 // EFI intrinsics are required to modify their member functions with EFIAPI.
146 // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
148 #define EFIAPI __cdecl
152 #define EFIAPI __attribute__((cdecl))
156 // The Microsoft* C compiler can removed references to unreferenced data items
157 // if the /OPT:REF linker option is used. We defined a macro as this is a
158 // a non standard extension
161 #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
163 #define GLOBAL_REMOVE_IF_UNREFERENCED