]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/AArch64/ProcessorBind.h
2 Processor or Compiler specific defines and types for AArch64.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
6 Portions copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __PROCESSOR_BIND_H__
13 #define __PROCESSOR_BIND_H__
16 /// Define the processor type so other code can make processor based choices
18 #define MDE_CPU_AARCH64
21 // Make sure we are using the correct packing rules per EFI specification
29 // use Microsoft* C compiler dependent integer width types
31 typedef unsigned __int64 UINT64
;
32 typedef __int64 INT64
;
33 typedef unsigned __int32 UINT32
;
34 typedef __int32 INT32
;
35 typedef unsigned short UINT16
;
36 typedef unsigned short CHAR16
;
38 typedef unsigned char BOOLEAN
;
39 typedef unsigned char UINT8
;
41 typedef signed char INT8
;
44 // Use ANSI C 2000 stdint.h integer width declarations
47 typedef uint8_t BOOLEAN
;
49 typedef uint8_t UINT8
;
50 typedef int16_t INT16
;
51 typedef uint16_t UINT16
;
52 typedef int32_t INT32
;
53 typedef uint32_t UINT32
;
54 typedef int64_t INT64
;
55 typedef uint64_t UINT64
;
57 typedef uint16_t CHAR16
;
62 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
63 /// 8 bytes on supported 64-bit processor instructions)
68 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
69 /// 8 bytes on supported 64-bit processor instructions)
74 // Processor specific defines
78 /// A value of native width with the highest bit set.
80 #define MAX_BIT 0x8000000000000000
83 /// A value of native width with the two highest bits set.
85 #define MAX_2_BITS 0xC000000000000000
88 /// The stack alignment required for AARCH64
90 #define CPU_STACK_ALIGNMENT 16
93 // Modifier to ensure that all protocol member functions and EFI intrinsics
94 // use the correct C calling convention. All protocol member functions and
95 // EFI intrinsics are required to modify their member functions with EFIAPI.
101 /// For GNU assembly code, .global or .globl can declare global symbols.
102 /// Define this macro to unify the usage.
104 #define ASM_GLOBAL .globl
106 #if !defined(__APPLE__)
108 /// ARM EABI defines that the linker should not manipulate call relocations
109 /// (do bl/blx conversion) unless the target symbol has function type.
110 /// CodeSourcery 2010.09 started requiring the .type to function properly
112 #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
114 #define GCC_ASM_EXPORT(func__) \
115 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
116 .type ASM_PFX(func__), %function
118 #define GCC_ASM_IMPORT(func__) \
119 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
123 // .type not supported by Apple Xcode tools
125 #define INTERWORK_FUNC(func__)
127 #define GCC_ASM_EXPORT(func__) \
128 .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
130 #define GCC_ASM_IMPORT(name)
136 Return the pointer to the first instruction of a function given a function pointer.
137 On ARM CPU architectures, these two pointer values are the same,
138 so the implementation of this macro is very simple.
140 @param FunctionPointer A pointer to a function.
142 @return The pointer to the first instruction of a function given a function pointer.
145 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)