]>
Commit | Line | Data |
---|---|---|
4e094cba | 1 | |
2 | /** @file | |
3 | Processor or Compiler specific defines and types for ARM. | |
4 | ||
5 | Copyright (c) 2006 - 2009, Intel Corporation | |
6 | Portions copyright (c) 2008-2009 Apple Inc. All rights reserved. | |
7 | All rights reserved. This program and the accompanying materials | |
8 | are licensed and made available under the terms and conditions of the BSD License | |
9 | which accompanies this distribution. The full text of the license may be found at | |
10 | http://opensource.org/licenses/bsd-license.php | |
11 | ||
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
14 | ||
15 | **/ | |
16 | ||
17 | #ifndef __PROCESSOR_BIND_H__ | |
18 | #define __PROCESSOR_BIND_H__ | |
19 | ||
20 | /// | |
21 | /// Define the processor type so other code can make processor based choices | |
22 | /// | |
23 | #define MDE_CPU_ARM | |
24 | ||
25 | // | |
26 | // Make sure we are useing the correct packing rules per EFI specification | |
27 | // | |
28 | #ifndef __GNUC__ | |
29 | #pragma pack() | |
30 | #endif | |
31 | ||
32 | #if _MSC_EXTENSIONS | |
33 | // | |
34 | // use Microsoft* C complier dependent interger width types | |
35 | // | |
36 | typedef unsigned __int64 UINT64; | |
37 | typedef __int64 INT64; | |
38 | typedef unsigned __int32 UINT32; | |
39 | typedef __int32 INT32; | |
40 | typedef unsigned short UINT16; | |
41 | typedef unsigned short CHAR16; | |
42 | typedef short INT16; | |
43 | typedef unsigned char BOOLEAN; | |
44 | typedef unsigned char UINT8; | |
45 | typedef char CHAR8; | |
46 | typedef char INT8; | |
47 | #else | |
48 | // | |
49 | // Assume standard ARM alignment. | |
50 | // Need to check portability of long long | |
51 | // | |
52 | typedef unsigned long long UINT64; | |
53 | typedef long long INT64; | |
54 | typedef unsigned int UINT32; | |
55 | typedef int INT32; | |
56 | typedef unsigned short UINT16; | |
57 | typedef unsigned short CHAR16; | |
58 | typedef short INT16; | |
59 | typedef unsigned char BOOLEAN; | |
60 | typedef unsigned char UINT8; | |
61 | typedef char CHAR8; | |
62 | typedef char INT8; | |
63 | #endif | |
64 | ||
65 | ///\r | |
66 | /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,\r | |
67 | /// 8 bytes on supported 64-bit processor instructions)\r | |
68 | ///\r | |
69 | typedef UINT32 UINTN; | |
70 | ||
71 | ///\r | |
72 | /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,\r | |
73 | /// 8 bytes on supported 64-bit processor instructions)\r | |
74 | ///\r | |
75 | typedef INT32 INTN; | |
76 | ||
77 | // | |
78 | // Processor specific defines | |
79 | // | |
80 | \r | |
81 | ///\r | |
82 | /// A value of native width with the highest bit set.\r | |
83 | ///\r | |
84 | #define MAX_BIT 0x80000000 | |
85 | ||
86 | ///\r | |
87 | /// A value of native width with the two highest bits set.\r | |
88 | ///\r | |
89 | #define MAX_2_BITS 0xC0000000 | |
90 | ||
91 | /// | |
92 | /// Maximum legal ARM address | |
93 | /// | |
94 | #define MAX_ADDRESS 0xFFFFFFFF | |
95 | ||
96 | /// | |
97 | /// The stack alignment required for ARM | |
98 | /// | |
99 | #define CPU_STACK_ALIGNMENT sizeof(UINT64) | |
100 | ||
101 | // | |
102 | // Modifier to ensure that all protocol member functions and EFI intrinsics | |
103 | // use the correct C calling convention. All protocol member functions and | |
104 | // EFI intrinsics are required to modify thier member functions with EFIAPI. | |
105 | // | |
106 | #define EFIAPI | |
107 | ||
108 | #if defined(__GNUC__) | |
109 | /// | |
110 | /// For GNU assembly code, .global or .globl can declare global symbols. | |
111 | /// Define this macro to unify the usage. | |
112 | /// | |
113 | #define ASM_GLOBAL .globl | |
114 | #endif | |
115 | ||
116 | /**\r | |
117 | Return the pointer to the first instruction of a function given a function pointer.\r | |
118 | On ARM CPU architectures, these two pointer values are the same, \r | |
119 | so the implementation of this macro is very simple.\r | |
120 | \r | |
121 | @param FunctionPointer A pointer to a function.\r | |
122 | \r | |
123 | @return The pointer to the first instruction of a function given a function pointer.\r | |
124 | \r | |
125 | **/\r | |
126 | #define FUNCTION_ENTRY_POINT(FunctionPointer) (FunctionPointer) | |
127 | ||
128 | #endif |