12#ifndef __PROCESSOR_BIND_H__
13#define __PROCESSOR_BIND_H__
18#define MDE_CPU_AARCH64
23#if !defined (__GNUC__) && !defined (__ASSEMBLER__)
27#if defined (_MSC_EXTENSIONS)
36 #pragma warning ( disable : 4214 )
41 #pragma warning ( disable : 4100 )
47 #pragma warning ( disable : 4057 )
52 #pragma warning ( disable : 4127 )
57 #pragma warning ( disable : 4505 )
62 #pragma warning ( disable : 4206 )
67 #pragma warning ( disable : 4701 )
72 #pragma warning ( disable : 4703 )
77typedef unsigned __int64 UINT64;
79typedef unsigned __int32 UINT32;
81typedef unsigned short UINT16;
82typedef unsigned short CHAR16;
84typedef unsigned char BOOLEAN;
85typedef unsigned char UINT8;
87typedef signed char INT8;
94typedef unsigned long long UINT64;
95typedef long long INT64;
96typedef unsigned int UINT32;
98typedef unsigned short UINT16;
99typedef unsigned short CHAR16;
101typedef unsigned char BOOLEAN;
102typedef unsigned char UINT8;
104typedef signed char INT8;
127#define MAX_BIT 0x8000000000000000ULL
132#define MAX_2_BITS 0xC000000000000000ULL
137#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
142#define MAX_ALLOC_ADDRESS 0xFFFFFFFFFFFFULL
147#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL)
148#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL)
153#define MIN_INTN (((INTN)-9223372036854775807LL) - 1)
158#define CPU_STACK_ALIGNMENT 16
163#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
164#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x10000)
175#if defined (__GNUC__) || defined (__clang__)
180#define ASM_GLOBAL .globl
182#define GCC_ASM_EXPORT(func__) \
183 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
184 .type ASM_PFX(func__), %function
186#define GCC_ASM_IMPORT(func__) \
187 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
189 #if defined (__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1
190#define AARCH64_BTI_NOTE() \
191 .ifndef .Lgnu_bti_notesize ;\
192 .pushsection .note.gnu.property, "a" ;\
193 .set NT_GNU_PROPERTY_TYPE_0, 0x5 ;\
194 .set GNU_PROPERTY_AARCH64_FEATURE_1_AND, 0xc0000000 ;\
195 .set GNU_PROPERTY_AARCH64_FEATURE_1_BTI, 0x1 ;\
198 .long .Lgnu_bti_notesize ;\
199 .long NT_GNU_PROPERTY_TYPE_0 ;\
201 .set .Lnamesize, . - 0b ;\
2031: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND ;\
2052: .long GNU_PROPERTY_AARCH64_FEATURE_1_BTI ;\
206 .set .Lvalsize, . - 2b ;\
208 .set .Lgnu_bti_notesize, . - 1b ;\
212#define AARCH64_BTI(__type) \
213 AARCH64_BTI_NOTE() ;\
221#define AARCH64_BTI_NOTE()
222#define AARCH64_BTI(__type)
235#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
237#ifndef __USER_LABEL_PREFIX__
238#define __USER_LABEL_PREFIX__