075f768c7691b4dd3bc5c227138b7326132f9ddd
2 Processor or compiler specific defines and types for EBC.
4 We currently only have one EBC compiler so there may be some Intel compiler
5 specific functions in this file.
7 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available under
9 the terms and conditions of the BSD License that accompanies this distribution.
10 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
33 typedef signed char INT8
;
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 /// The 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 the 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 /// Maximum legal EBC INTN and UINTN values.
109 #define MAX_UINTN ((UINTN) ~0)
110 #define MAX_INTN ((INTN)~MAX_BIT)
113 /// The stack alignment required for EBC
115 #define CPU_STACK_ALIGNMENT sizeof(UINTN)
118 /// Modifier to ensure that all protocol member functions and EFI intrinsics
119 /// use the correct C calling convention. All protocol member functions and
120 /// EFI intrinsics are required to modify their member functions with EFIAPI.
124 /// If EFIAPI is already defined, then we use that definition.
131 Return the pointer to the first instruction of a function given a function pointer.
132 On EBC architectures, these two pointer values are the same,
133 so the implementation of this macro is very simple.
135 @param FunctionPointer A pointer to a function.
137 @return The pointer to the first instruction of a function given a function pointer.
139 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
141 #ifndef __USER_LABEL_PREFIX__
142 #define __USER_LABEL_PREFIX__