2 Processor or compiler specific defines and types for EBC.
4 We currently only have one EBC complier so there may be some Intel compiler
5 specific functions in this file.
7 Copyright (c) 2006 - 2009, 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
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.
18 #ifndef __PROCESSOR_BIND_H__
19 #define __PROCESSOR_BIND_H__
22 /// Define the processor type so other code can make processor based choices
27 // Native integer types
31 /// 1-byte signed value
35 /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other
36 /// values are undefined.
38 typedef unsigned char BOOLEAN
;
40 /// 1-byte unsigned value
42 typedef unsigned char UINT8
;
48 /// 2-byte signed value
52 /// 2-byte unsigned value
54 typedef unsigned short UINT16
;
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.
59 typedef unsigned short CHAR16
;
61 /// 4-byte signed value
65 /// 4-byte unsigned value
67 typedef unsigned int UINT32
;
69 /// 8-byte signed value
71 typedef __int64 INT64
;
73 /// 8-byte unsigned value
75 typedef unsigned __int64 UINT64
;
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
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
88 typedef unsigned long UINTN
;
91 /// A value of native width with the highest bit set.
92 /// Scalable macro to set the most significant bit in a natural number
94 #define MAX_BIT (1ULL << (sizeof (INTN) * 8 - 1))
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
99 #define MAX_2_BITS (3ULL << (sizeof (INTN) * 8 - 2))
102 /// Maximum legal EBC address
104 #define MAX_ADDRESS ((UINTN) ~0)
107 /// The stack alignment required for EBC
109 #define CPU_STACK_ALIGNMENT sizeof(UINTN)
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.
118 /// If EFIAPI is already defined, then we use that definition.
125 /// The Microsoft* C compiler can removed references to unreferenced data items
126 /// if the /OPT:REF linker option is used. We defined a macro as this is a
127 /// a non standard extension. Currently not supported by the EBC compiler
129 #define GLOBAL_REMOVE_IF_UNREFERENCED
133 Return the pointer to the first instruction of a function given a function pointer.
134 On EBC architectures, these two pointer values are the same,
135 so the implementation of this macro is very simple.
137 @param FunctionPointer A pointer to a function.
139 @return The pointer to the first instruction of a function given a function pointer.
141 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)