]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ebc/ProcessorBind.h
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 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __PROCESSOR_BIND_H__
13 #define __PROCESSOR_BIND_H__
16 /// Define the processor type so other code can make processor based choices
21 // Native integer types
25 /// 1-byte signed value
27 typedef signed char INT8
;
29 /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other
30 /// values are undefined.
32 typedef unsigned char BOOLEAN
;
34 /// 1-byte unsigned value.
36 typedef unsigned char UINT8
;
42 /// 2-byte signed value.
46 /// 2-byte unsigned value.
48 typedef unsigned short UINT16
;
50 /// 2-byte Character. Unless otherwise specified all strings are stored in the
51 /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
53 typedef unsigned short CHAR16
;
55 /// 4-byte signed value.
59 /// 4-byte unsigned value.
61 typedef unsigned int UINT32
;
63 /// 8-byte signed value.
65 typedef __int64 INT64
;
67 /// 8-byte unsigned value.
69 typedef unsigned __int64 UINT64
;
72 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,
73 /// 8 bytes on supported 64-bit processor instructions)
74 /// "long" type scales to the processor native size with EBC compiler
78 /// The unsigned 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 the EBC compiler.
82 typedef unsigned long UINTN
;
85 /// A value of native width with the highest bit set.
86 /// Scalable macro to set the most significant bit in a natural number.
88 #define MAX_BIT ((UINTN)((1ULL << (sizeof (INTN) * 8 - 1))))
90 /// A value of native width with the two highest bits set.
91 /// Scalable macro to set the most 2 significant bits in a natural number.
93 #define MAX_2_BITS ((UINTN)(3ULL << (sizeof (INTN) * 8 - 2)))
96 /// Maximum legal EBC address
98 #define MAX_ADDRESS ((UINTN)(~0ULL >> (64 - sizeof (INTN) * 8)))
101 /// Maximum usable address at boot time (48 bits using 4 KB pages)
103 #define MAX_ALLOC_ADDRESS MAX_ADDRESS
106 /// Maximum legal EBC INTN and UINTN values.
108 #define MAX_UINTN ((UINTN)(~0ULL >> (64 - sizeof (INTN) * 8)))
109 #define MAX_INTN ((INTN)(~0ULL >> (65 - sizeof (INTN) * 8)))
112 /// Minimum legal EBC INTN value.
114 #define MIN_INTN (((INTN)-MAX_INTN) - 1)
117 /// The stack alignment required for EBC
119 #define CPU_STACK_ALIGNMENT sizeof(UINTN)
122 /// Page allocation granularity for EBC
124 #define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
125 #define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)
128 /// Modifier to ensure that all protocol member functions and EFI intrinsics
129 /// use the correct C calling convention. All protocol member functions and
130 /// EFI intrinsics are required to modify their member functions with EFIAPI.
134 /// If EFIAPI is already defined, then we use that definition.
141 Return the pointer to the first instruction of a function given a function pointer.
142 On EBC architectures, these two pointer values are the same,
143 so the implementation of this macro is very simple.
145 @param FunctionPointer A pointer to a function.
147 @return The pointer to the first instruction of a function given a function pointer.
149 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
151 #ifndef __USER_LABEL_PREFIX__
152 #define __USER_LABEL_PREFIX__