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