]>
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 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __PROCESSOR_BIND_H__
11 #define __PROCESSOR_BIND_H__
14 // Define the processor type so other code can make processor based choices
19 // Make sure we are useing the correct packing rules per EFI specification
28 // Disable warning that make it impossible to compile at /W4
29 // This only works for Microsoft* tools
33 // Disabling bitfield type checking warnings.
35 #pragma warning ( disable : 4214 )
38 // Disabling the unreferenced formal parameter warnings.
40 #pragma warning ( disable : 4100 )
43 // Disable slightly different base types warning as CHAR8 * can not be set
44 // to a constant string.
46 #pragma warning ( disable : 4057 )
49 // ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
51 #pragma warning ( disable : 4127 )
57 #if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
59 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
65 // use Microsoft* C compiler dependent integer width types
67 typedef unsigned __int64 UINT64
;
68 typedef __int64 INT64
;
69 typedef unsigned __int32 UINT32
;
70 typedef __int32 INT32
;
71 typedef unsigned short UINT16
;
72 typedef unsigned short CHAR16
;
74 typedef unsigned char BOOLEAN
;
75 typedef unsigned char UINT8
;
81 // Assume standard IA-32 alignment.
82 // BugBug: Need to check portability of long long
84 typedef unsigned long long UINT64
;
85 typedef long long INT64
;
86 typedef unsigned int UINT32
;
88 typedef unsigned short UINT16
;
89 typedef unsigned short CHAR16
;
91 typedef unsigned char BOOLEAN
;
92 typedef unsigned char UINT8
;
97 #define UINT8_MAX 0xff
101 // Use ANSI C 2000 stdint.h integer width declarations
104 typedef uint8_t BOOLEAN
;
106 typedef uint8_t UINT8
;
107 typedef int16_t INT16
;
108 typedef uint16_t UINT16
;
109 typedef int32_t INT32
;
110 typedef uint32_t UINT32
;
111 typedef int64_t INT64
;
112 typedef uint64_t UINT64
;
114 typedef uint16_t CHAR16
;
118 typedef UINT32 UINTN
;
123 // Processor specific defines
125 #define MAX_BIT 0x80000000
126 #define MAX_2_BITS 0xC0000000
129 // Modifier to ensure that all protocol member functions and EFI intrinsics
130 // use the correct C calling convention. All protocol member functions and
131 // EFI intrinsics are required to modify their member functions with EFIAPI.
135 // Microsoft* compiler requires _EFIAPI usage, __cdecl is Microsoft* specific C.
137 #define EFIAPI __cdecl
141 #define EFIAPI __attribute__((cdecl))
145 // The Microsoft* C compiler can removed references to unreferenced data items
146 // if the /OPT:REF linker option is used. We defined a macro as this is a
147 // a non standard extension
150 #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
152 #define GLOBAL_REMOVE_IF_UNREFERENCED