xref: /openbmc/libcper/edk/BaseTypes.h (revision 255bd81a)
1 /** @file
2   Processor or Compiler specific defines for all supported processors.
3 
4   This file is stand alone self consistent set of definitions.
5 
6   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7   SPDX-License-Identifier: BSD-2-Clause-Patent
8 
9 **/
10 
11 #ifndef CPER_BASETYPES_H
12 #define CPER_BASETYPES_H
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 ///
19 /// 8-byte unsigned value
20 ///
21 typedef unsigned long long UINT64;
22 ///
23 /// 8-byte signed value
24 ///
25 typedef long long INT64;
26 ///
27 /// 4-byte unsigned value
28 ///
29 typedef unsigned int UINT32;
30 ///
31 /// 4-byte signed value
32 ///
33 typedef int INT32;
34 ///
35 /// 2-byte unsigned value
36 ///
37 typedef unsigned short UINT16;
38 ///
39 /// 2-byte Character.  Unless otherwise specified all strings are stored in the
40 /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
41 ///
42 typedef unsigned short CHAR16;
43 ///
44 /// 2-byte signed value
45 ///
46 typedef short INT16;
47 ///
48 /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
49 /// values are undefined.
50 ///
51 typedef unsigned char BOOLEAN;
52 ///
53 /// 1-byte unsigned value
54 ///
55 typedef unsigned char UINT8;
56 ///
57 /// 1-byte Character
58 ///
59 typedef char CHAR8;
60 ///
61 /// 1-byte signed value
62 ///
63 typedef signed char INT8;
64 //
65 // Basical data type definitions introduced in UEFI.
66 //
67 typedef struct {
68 	UINT32 Data1;
69 	UINT16 Data2;
70 	UINT16 Data3;
71 	UINT8 Data4[8];
72 } EFI_GUID;
73 
74 /**
75   Returns a 16-bit signature built from 2 ASCII characters.
76 
77   This macro returns a 16-bit value built from the two ASCII characters specified
78   by A and B.
79 
80   @param  A    The first ASCII character.
81   @param  B    The second ASCII character.
82 
83   @return A 16-bit value built from the two ASCII characters specified by A and B.
84 
85 **/
86 #define SIGNATURE_16(A, B) ((A) | (B << 8))
87 /**
88   Returns a 32-bit signature built from 4 ASCII characters.
89 
90   This macro returns a 32-bit value built from the four ASCII characters specified
91   by A, B, C, and D.
92 
93   @param  A    The first ASCII character.
94   @param  B    The second ASCII character.
95   @param  C    The third ASCII character.
96   @param  D    The fourth ASCII character.
97 
98   @return A 32-bit value built from the two ASCII characters specified by A, B,
99           C and D.
100 
101 **/
102 #define SIGNATURE_32(A, B, C, D)                                               \
103 	(SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif
110