]>
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 - 2010, 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 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #ifndef __PROCESSOR_BIND_H__
19 #define __PROCESSOR_BIND_H__
22 /// Define the processor type so other code can make processor based choices
24 #define MDE_CPU_AARCH64
27 // Make sure we are using the correct packing rules per EFI specification
35 // use Microsoft* C complier dependent integer width types
37 typedef unsigned __int64 UINT64
;
38 typedef __int64 INT64
;
39 typedef unsigned __int32 UINT32
;
40 typedef __int32 INT32
;
41 typedef unsigned short UINT16
;
42 typedef unsigned short CHAR16
;
44 typedef unsigned char BOOLEAN
;
45 typedef unsigned char UINT8
;
47 typedef signed char INT8
;
50 // Assume standard AARCH64 alignment.
52 typedef unsigned long long UINT64
;
53 typedef long long INT64
;
54 typedef unsigned int UINT32
;
56 typedef unsigned short UINT16
;
57 typedef unsigned short CHAR16
;
59 typedef unsigned char BOOLEAN
;
60 typedef unsigned char UINT8
;
62 typedef signed char INT8
;
64 #define UINT8_MAX 0xff
68 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
69 /// 8 bytes on supported 64-bit processor instructions)
74 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
75 /// 8 bytes on supported 64-bit processor instructions)
80 // Processor specific defines
84 /// A value of native width with the highest bit set.
86 #define MAX_BIT 0x8000000000000000
89 /// A value of native width with the two highest bits set.
91 #define MAX_2_BITS 0xC000000000000000
94 /// Maximum legal AARCH64 address
96 #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
99 /// The stack alignment required for AARCH64
101 #define CPU_STACK_ALIGNMENT 16
104 // Modifier to ensure that all protocol member functions and EFI intrinsics
105 // use the correct C calling convention. All protocol member functions and
106 // EFI intrinsics are required to modify their member functions with EFIAPI.
110 #if defined(__GNUC__)
112 /// For GNU assembly code, .global or .globl can declare global symbols.
113 /// Define this macro to unify the usage.
115 #define ASM_GLOBAL .globl
117 #if !defined(__APPLE__)
119 /// ARM EABI defines that the linker should not manipulate call relocations
120 /// (do bl/blx conversion) unless the target symbol has function type.
121 /// CodeSourcery 2010.09 started requiring the .type to function properly
123 #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
125 #define GCC_ASM_EXPORT(func__) \
126 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
127 .type ASM_PFX(func__), %function
129 #define GCC_ASM_IMPORT(func__) \
130 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
134 // .type not supported by Apple Xcode tools
136 #define INTERWORK_FUNC(func__)
138 #define GCC_ASM_EXPORT(func__) \
139 .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
141 #define GCC_ASM_IMPORT(name)
147 Return the pointer to the first instruction of a function given a function pointer.
148 On ARM CPU architectures, these two pointer values are the same,
149 so the implementation of this macro is very simple.
151 @param FunctionPointer A pointer to a function.
153 @return The pointer to the first instruction of a function given a function pointer.
156 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)