]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Arm/ProcessorBind.h
2 Processor or Compiler specific defines and types for ARM.
4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __PROCESSOR_BIND_H__
17 #define __PROCESSOR_BIND_H__
20 /// Define the processor type so other code can make processor based choices
25 // Make sure we are using the correct packing rules per EFI specification
33 // use Microsoft* C complier dependent integer width types
35 typedef unsigned __int64 UINT64
;
36 typedef __int64 INT64
;
37 typedef unsigned __int32 UINT32
;
38 typedef __int32 INT32
;
39 typedef unsigned short UINT16
;
40 typedef unsigned short CHAR16
;
42 typedef unsigned char BOOLEAN
;
43 typedef unsigned char UINT8
;
45 typedef signed char INT8
;
48 // Assume standard ARM alignment.
49 // Need to check portability of long long
51 typedef unsigned long long UINT64
;
52 typedef long long INT64
;
53 typedef unsigned int UINT32
;
55 typedef unsigned short UINT16
;
56 typedef unsigned short CHAR16
;
58 typedef unsigned char BOOLEAN
;
59 typedef unsigned char UINT8
;
61 typedef signed char INT8
;
65 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
66 /// 8 bytes on supported 64-bit processor instructions)
71 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
72 /// 8 bytes on supported 64-bit processor instructions)
77 // Processor specific defines
81 /// A value of native width with the highest bit set.
83 #define MAX_BIT 0x80000000
86 /// A value of native width with the two highest bits set.
88 #define MAX_2_BITS 0xC0000000
91 /// Maximum legal ARM address
93 #define MAX_ADDRESS 0xFFFFFFFF
96 /// Maximum legal ARM INTN and UINTN values.
98 #define MAX_INTN ((INTN)0x7FFFFFFF)
99 #define MAX_UINTN ((UINTN)0xFFFFFFFF)
102 /// The stack alignment required for ARM
104 #define CPU_STACK_ALIGNMENT sizeof(UINT64)
107 // Modifier to ensure that all protocol member functions and EFI intrinsics
108 // use the correct C calling convention. All protocol member functions and
109 // EFI intrinsics are required to modify their member functions with EFIAPI.
113 // When compiling with Clang, we still use GNU as for the assembler, so we still
114 // need to define the GCC_ASM* macros.
115 #if defined(__GNUC__) || defined(__clang__)
117 /// For GNU assembly code, .global or .globl can declare global symbols.
118 /// Define this macro to unify the usage.
120 #define ASM_GLOBAL .globl
122 #if !defined(__APPLE__)
124 /// ARM EABI defines that the linker should not manipulate call relocations
125 /// (do bl/blx conversion) unless the target symbol has function type.
126 /// CodeSourcery 2010.09 started requiring the .type to function properly
128 #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
130 #define GCC_ASM_EXPORT(func__) \
131 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
132 .type ASM_PFX(func__), %function
134 #define GCC_ASM_IMPORT(func__) \
135 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
139 // .type not supported by Apple Xcode tools
141 #define INTERWORK_FUNC(func__)
143 #define GCC_ASM_EXPORT(func__) \
144 .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
146 #define GCC_ASM_IMPORT(name)
152 Return the pointer to the first instruction of a function given a function pointer.
153 On ARM CPU architectures, these two pointer values are the same,
154 so the implementation of this macro is very simple.
156 @param FunctionPointer A pointer to a function.
158 @return The pointer to the first instruction of a function given a function pointer.
161 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
163 #ifndef __USER_LABEL_PREFIX__
164 #define __USER_LABEL_PREFIX__