]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Include/Arm/ProcessorBind.h
2 Processor or Compiler specific defines and types for ARM.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2008 - 2009, Apple Inc. 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 using the correct packing rules per EFI specification
27 // use Microsoft* C compiler dependent integer width types
29 typedef unsigned __int64 UINT64
;
30 typedef __int64 INT64
;
31 typedef unsigned __int32 UINT32
;
32 typedef __int32 INT32
;
33 typedef unsigned short UINT16
;
34 typedef unsigned short CHAR16
;
36 typedef unsigned char BOOLEAN
;
37 typedef unsigned char UINT8
;
39 typedef signed char INT8
;
42 // Assume standard ARM alignment.
44 typedef unsigned long long UINT64
;
45 typedef long long INT64
;
46 typedef unsigned int UINT32
;
48 typedef unsigned short UINT16
;
49 typedef unsigned short CHAR16
;
51 typedef unsigned char BOOLEAN
;
52 typedef unsigned char UINT8
;
54 typedef signed char INT8
;
56 #define UINT8_MAX 0xff
60 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
61 /// 8 bytes on supported 64-bit processor instructions)
66 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
67 /// 8 bytes on supported 64-bit processor instructions)
72 // Processor specific defines
76 /// A value of native width with the highest bit set.
78 #define MAX_BIT 0x80000000
81 /// A value of native width with the two highest bits set.
83 #define MAX_2_BITS 0xC0000000
86 /// The stack alignment required for ARM
88 #define CPU_STACK_ALIGNMENT sizeof(UINT64)
91 // Modifier to ensure that all protocol member functions and EFI intrinsics
92 // use the correct C calling convention. All protocol member functions and
93 // EFI intrinsics are required to modify their member functions with EFIAPI.
99 /// For GNU assembly code, .global or .globl can declare global symbols.
100 /// Define this macro to unify the usage.
102 #define ASM_GLOBAL .globl
104 #if !defined(__APPLE__)
106 /// ARM EABI defines that the linker should not manipulate call relocations
107 /// (do bl/blx conversion) unless the target symbol has function type.
108 /// CodeSourcery 2010.09 started requiring the .type to function properly
110 #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
112 #define GCC_ASM_EXPORT(func__) \
113 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
114 .type ASM_PFX(func__), %function
116 #define GCC_ASM_IMPORT(func__) \
117 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
121 // .type not supported by Apple Xcode tools
123 #define INTERWORK_FUNC(func__)
125 #define GCC_ASM_EXPORT(func__) \
126 .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
128 #define GCC_ASM_IMPORT(name)
134 Return the pointer to the first instruction of a function given a function pointer.
135 On ARM CPU architectures, these two pointer values are the same,
136 so the implementation of this macro is very simple.
138 @param FunctionPointer A pointer to a function.
140 @return The pointer to the first instruction of a function given a function pointer.
143 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)