]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Arm/ProcessorBind.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Arm / ProcessorBind.h
1 /** @file
2 Processor or Compiler specific defines and types for ARM.
3
4 Copyright (c) 2006 - 2010, 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
10
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.
13
14 **/
15
16 #ifndef __PROCESSOR_BIND_H__
17 #define __PROCESSOR_BIND_H__
18
19 ///
20 /// Define the processor type so other code can make processor based choices
21 ///
22 #define MDE_CPU_ARM
23
24 //
25 // Make sure we are using the correct packing rules per EFI specification
26 //
27 #ifndef __GNUC__
28 #pragma pack()
29 #endif
30
31 #if _MSC_EXTENSIONS
32 //
33 // use Microsoft* C complier dependent interger width types
34 //
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;
41 typedef short INT16;
42 typedef unsigned char BOOLEAN;
43 typedef unsigned char UINT8;
44 typedef char CHAR8;
45 typedef char INT8;
46 #else
47 //
48 // Assume standard ARM alignment.
49 // Need to check portability of long long
50 //
51 typedef unsigned long long UINT64;
52 typedef long long INT64;
53 typedef unsigned int UINT32;
54 typedef int INT32;
55 typedef unsigned short UINT16;
56 typedef unsigned short CHAR16;
57 typedef short INT16;
58 typedef unsigned char BOOLEAN;
59 typedef unsigned char UINT8;
60 typedef char CHAR8;
61 typedef char INT8;
62 #endif
63
64 ///
65 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
66 /// 8 bytes on supported 64-bit processor instructions)
67 ///
68 typedef UINT32 UINTN;
69
70 ///
71 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
72 /// 8 bytes on supported 64-bit processor instructions)
73 ///
74 typedef INT32 INTN;
75
76 //
77 // Processor specific defines
78 //
79
80 ///
81 /// A value of native width with the highest bit set.
82 ///
83 #define MAX_BIT 0x80000000
84
85 ///
86 /// A value of native width with the two highest bits set.
87 ///
88 #define MAX_2_BITS 0xC0000000
89
90 ///
91 /// Maximum legal ARM address
92 ///
93 #define MAX_ADDRESS 0xFFFFFFFF
94
95 ///
96 /// The stack alignment required for ARM
97 ///
98 #define CPU_STACK_ALIGNMENT sizeof(UINT64)
99
100 //
101 // Modifier to ensure that all protocol member functions and EFI intrinsics
102 // use the correct C calling convention. All protocol member functions and
103 // EFI intrinsics are required to modify their member functions with EFIAPI.
104 //
105 #define EFIAPI
106
107 #if defined(__GNUC__)
108 ///
109 /// For GNU assembly code, .global or .globl can declare global symbols.
110 /// Define this macro to unify the usage.
111 ///
112 #define ASM_GLOBAL .globl
113 #endif
114
115 /**
116 Return the pointer to the first instruction of a function given a function pointer.
117 On ARM CPU architectures, these two pointer values are the same,
118 so the implementation of this macro is very simple.
119
120 @param FunctionPointer A pointer to a function.
121
122 @return The pointer to the first instruction of a function given a function pointer.
123
124 **/
125 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
126
127 #endif