]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/Ia32/ProcessorBind.h
Check In tool source code based on Build tool project revision r1655.
[mirror_edk2.git] / BaseTools / Source / C / Include / Ia32 / ProcessorBind.h
1 /** @file
2 Processor or Compiler specific defines and types for x64.
3
4 Copyright (c) 2006 - 2008, Intel Corporation All rights reserved.
5
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
10
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.
13
14 File Name: ProcessorBind.h
15
16 **/
17
18 #ifndef __PROCESSOR_BIND_H__
19 #define __PROCESSOR_BIND_H__
20
21 //
22 // Define the processor type so other code can make processor based choices
23 //
24 #define MDE_CPU_IA32
25
26 //
27 // Make sure we are useing the correct packing rules per EFI specification
28 //
29 #ifndef __GNUC__
30 #pragma pack()
31 #endif
32
33 #if _MSC_EXTENSIONS
34
35 //
36 // Disable warning that make it impossible to compile at /W4
37 // This only works for Microsoft* tools
38 //
39
40 //
41 // Disabling bitfield type checking warnings.
42 //
43 #pragma warning ( disable : 4214 )
44
45 //
46 // Disabling the unreferenced formal parameter warnings.
47 //
48 #pragma warning ( disable : 4100 )
49
50 //
51 // Disable slightly different base types warning as CHAR8 * can not be set
52 // to a constant string.
53 //
54 #pragma warning ( disable : 4057 )
55
56 //
57 // ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
58 //
59 #pragma warning ( disable : 4127 )
60
61
62 #endif
63
64
65 #if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
66 //
67 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
68 //
69
70 #if _MSC_EXTENSIONS
71
72 //
73 // use Microsoft* C complier dependent interger width types
74 //
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;
81 typedef short INT16;
82 typedef unsigned char BOOLEAN;
83 typedef unsigned char UINT8;
84 typedef char CHAR8;
85 typedef char INT8;
86 #else
87
88 //
89 // Assume standard IA-32 alignment.
90 // BugBug: Need to check portability of long long
91 //
92 typedef unsigned long long UINT64;
93 typedef long long INT64;
94 typedef unsigned int UINT32;
95 typedef int INT32;
96 typedef unsigned short UINT16;
97 typedef unsigned short CHAR16;
98 typedef short INT16;
99 typedef unsigned char BOOLEAN;
100 typedef unsigned char UINT8;
101 typedef char CHAR8;
102 typedef char INT8;
103 #endif
104
105 #define UINT8_MAX 0xff
106
107 #else
108 //
109 // Use ANSI C 2000 stdint.h integer width declarations
110 //
111 #include "stdint.h"
112 typedef uint8_t BOOLEAN;
113 typedef int8_t INT8;
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;
121 typedef char CHAR8;
122 typedef uint16_t CHAR16;
123
124 #endif
125
126 typedef UINT32 UINTN;
127 typedef INT32 INTN;
128
129
130 //
131 // Processor specific defines
132 //
133 #define MAX_BIT 0x80000000
134 #define MAX_2_BITS 0xC0000000
135
136 //
137 // Maximum legal IA-32 address
138 //
139 #define MAX_ADDRESS 0xFFFFFFFF
140
141 //
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 thier member functions with EFIAPI.
145 //
146 #if _MSC_EXTENSIONS
147 //
148 // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
149 //
150 #define EFIAPI __cdecl
151 #endif
152
153 #if __GNUC__
154 #define EFIAPI __attribute__((cdecl))
155 #endif
156
157 //
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
161 //
162 #if _MSC_EXTENSIONS
163 #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
164 #else
165 #define GLOBAL_REMOVE_IF_UNREFERENCED
166 #endif
167
168 #endif