]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ebc/ProcessorBind.h
Update copyright for files modified in this year
[mirror_edk2.git] / MdePkg / Include / Ebc / ProcessorBind.h
1 /** @file
2 Processor or compiler specific defines and types for EBC.
3
4 We currently only have one EBC complier so there may be some Intel compiler
5 specific functions in this file.
6
7 Copyright (c) 2006 - 2008, Intel Corporation<BR>
8 All rights reserved. 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
12
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.
15
16 **/
17
18 #ifndef __PROCESSOR_BIND_H__
19 #define __PROCESSOR_BIND_H__
20
21 ///
22 /// Define the processor type so other code can make processor based choices
23 ///
24 #define MDE_CPU_EBC
25
26 //
27 // Native integer types
28 //
29
30 ///
31 /// 1-byte signed value
32 ///
33 typedef char INT8;
34 ///
35 /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other
36 /// values are undefined.
37 ///
38 typedef unsigned char BOOLEAN;
39 ///
40 /// 1-byte unsigned value
41 ///
42 typedef unsigned char UINT8;
43 ///
44 /// 1-byte Character
45 ///
46 typedef char CHAR8;
47 ///
48 /// 2-byte signed value
49 ///
50 typedef short INT16;
51 ///
52 /// 2-byte unsigned value
53 ///
54 typedef unsigned short UINT16;
55 ///
56 /// 2-byte Character. Unless otherwise specified all strings are stored in the
57 /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
58 ///
59 typedef unsigned short CHAR16;
60 ///
61 /// 4-byte signed value
62 ///
63 typedef int INT32;
64 ///
65 /// 4-byte unsigned value
66 ///
67 typedef unsigned int UINT32;
68 ///
69 /// 8-byte signed value
70 ///
71 typedef __int64 INT64;
72 ///
73 /// 8-byte unsigned value
74 ///
75 typedef unsigned __int64 UINT64;
76
77 ///
78 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
79 /// 8 bytes on supported 64-bit processor instructions)
80 /// "long" type scales to the processor native size with EBC compiler
81 ///
82 typedef long INTN;
83 ///
84 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,
85 /// 8 bytes on supported 64-bit processor instructions)
86 /// "long" type scales to the processor native size with EBC compiler
87 ///
88 typedef unsigned long UINTN;
89
90 ///
91 /// A value of native width with the highest bit set.
92 /// Scalable macro to set the most significant bit in a natural number
93 ///
94 #define MAX_BIT (1ULL << (sizeof (INTN) * 8 - 1))
95 ///
96 /// A value of native width with the two highest bits set.
97 /// Scalable macro to set the most 2 significant bits in a natural number
98 ///
99 #define MAX_2_BITS (3ULL << (sizeof (INTN) * 8 - 2))
100
101 ///
102 /// Maximum legal EBC address
103 ///
104 #define MAX_ADDRESS ((UINTN) ~0)
105
106 ///
107 /// The stack alignment required for EBC
108 ///
109 #define CPU_STACK_ALIGNMENT sizeof(UINTN)
110
111 ///
112 /// Modifier to ensure that all protocol member functions and EFI intrinsics
113 /// use the correct C calling convention. All protocol member functions and
114 /// EFI intrinsics are required to modify their member functions with EFIAPI.
115 ///
116 #define EFIAPI
117
118 ///
119 /// The Microsoft* C compiler can removed references to unreferenced data items
120 /// if the /OPT:REF linker option is used. We defined a macro as this is a
121 /// a non standard extension. Currently not supported by the EBC compiler
122 ///
123 #define GLOBAL_REMOVE_IF_UNREFERENCED
124
125
126 /**
127 Return the pointer to the first instruction of a function given a function pointer.
128 On EBC architectures, these two pointer values are the same,
129 so the implementation of this macro is very simple.
130
131 @param FunctionPointer A pointer to a function.
132
133 @return The pointer to the first instruction of a function given a function pointer.
134 **/
135 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
136
137 #endif
138