Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
2 | Processor or compiler specific defines and types for EBC.\r | |
3 | \r | |
4 | We currently only have one EBC complier so there may be some Intel compiler\r | |
5 | specific functions in this file.\r | |
6 | \r | |
3963c4bf | 7 | Copyright (c) 2006, Intel Corporation<BR> \r |
959ccb23 | 8 | All rights reserved. This program and the accompanying materials \r |
9 | are licensed and made available under the terms and conditions of the BSD License \r | |
10 | which accompanies this distribution. The full text of the license may be found at \r | |
11 | http://opensource.org/licenses/bsd-license.php \r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
15 | \r | |
959ccb23 | 16 | **/\r |
17 | \r | |
18 | #ifndef __PROCESSOR_BIND_H__\r | |
19 | #define __PROCESSOR_BIND_H__\r | |
20 | \r | |
d484d120 | 21 | ///\r |
22 | /// Define the processor type so other code can make processor based choices\r | |
23 | ///\r | |
959ccb23 | 24 | #define MDE_CPU_EBC\r |
25 | \r | |
26 | //\r | |
27 | // Native integer types\r | |
28 | //\r | |
29 | typedef char INT8;\r | |
30 | typedef unsigned char BOOLEAN;\r | |
31 | typedef unsigned char UINT8;\r | |
7d0db9ce | 32 | typedef char CHAR8;\r |
959ccb23 | 33 | \r |
34 | typedef short INT16;\r | |
35 | typedef unsigned short UINT16;\r | |
36 | typedef unsigned short CHAR16;\r | |
37 | \r | |
38 | typedef int INT32;\r | |
39 | typedef unsigned int UINT32;\r | |
40 | \r | |
41 | typedef __int64 INT64;\r | |
42 | typedef unsigned __int64 UINT64;\r | |
43 | \r | |
d484d120 | 44 | ///\r |
45 | /// "long" type scales to the processor native size with EBC compiler\r | |
46 | ///\r | |
959ccb23 | 47 | typedef long INTN;\r |
48 | typedef unsigned long UINTN;\r | |
49 | \r | |
50 | #define UINT8_MAX 0xff\r | |
51 | \r | |
d484d120 | 52 | ///\r |
53 | /// Scalable macro to set the most significant bit in a natural number\r | |
54 | ///\r | |
959ccb23 | 55 | #define MAX_BIT (1ULL << (sizeof (INTN) * 8 - 1)) \r |
56 | #define MAX_2_BITS (3ULL << (sizeof (INTN) * 8 - 2))\r | |
57 | \r | |
d484d120 | 58 | ///\r |
59 | /// Maximum legal EBC address\r | |
60 | ///\r | |
959ccb23 | 61 | #define MAX_ADDRESS ((UINTN) ~0)\r |
62 | \r | |
d484d120 | 63 | ///\r |
64 | /// The stack alignment required for EBC\r | |
65 | ///\r | |
959ccb23 | 66 | #define CPU_STACK_ALIGNMENT sizeof(UINTN)\r |
67 | \r | |
d484d120 | 68 | ///\r |
69 | /// Modifier to ensure that all protocol member functions and EFI intrinsics\r | |
70 | /// use the correct C calling convention. All protocol member functions and\r | |
3963c4bf | 71 | /// EFI intrinsics are required to modify their member functions with EFIAPI.\r |
d484d120 | 72 | ///\r |
959ccb23 | 73 | #define EFIAPI \r |
74 | \r | |
d484d120 | 75 | ///\r |
76 | /// The Microsoft* C compiler can removed references to unreferenced data items\r | |
77 | /// if the /OPT:REF linker option is used. We defined a macro as this is a \r | |
78 | /// a non standard extension. Currently not supported by the EBC compiler\r | |
79 | ///\r | |
959ccb23 | 80 | #define GLOBAL_REMOVE_IF_UNREFERENCED\r |
81 | \r | |
3963c4bf | 82 | \r |
14996c96 LG |
83 | /**\r |
84 | Return the pointer to the first instruction of a function given a function pointer.\r | |
85 | On EBC architectures, these two pointer values are the same, \r | |
86 | so the implementation of this macro is very simple.\r | |
87 | \r | |
3963c4bf | 88 | @param FunctionPointer A pointer to a function.\r |
14996c96 LG |
89 | \r |
90 | @return The pointer to the first instruction of a function given a function pointer.\r | |
91 | **/\r | |
3963c4bf | 92 | \r |
9a1d00cb | 93 | #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)\r |
24a7505c | 94 | \r |
959ccb23 | 95 | #endif \r |
96 | \r |