xref: /openbmc/libcper/edk/BaseTypes.h (revision 1b0b00e3)
1 #ifndef CPER_BASETYPES_H
2 #define CPER_BASETYPES_H
3 
4 ///
5 /// 8-byte unsigned value
6 ///
7 typedef unsigned long long  UINT64;
8 ///
9 /// 8-byte signed value
10 ///
11 typedef long long           INT64;
12 ///
13 /// 4-byte unsigned value
14 ///
15 typedef unsigned int        UINT32;
16 ///
17 /// 4-byte signed value
18 ///
19 typedef int                 INT32;
20 ///
21 /// 2-byte unsigned value
22 ///
23 typedef unsigned short      UINT16;
24 ///
25 /// 2-byte Character.  Unless otherwise specified all strings are stored in the
26 /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
27 ///
28 typedef unsigned short      CHAR16;
29 ///
30 /// 2-byte signed value
31 ///
32 typedef short               INT16;
33 ///
34 /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
35 /// values are undefined.
36 ///
37 typedef unsigned char       BOOLEAN;
38 ///
39 /// 1-byte unsigned value
40 ///
41 typedef unsigned char       UINT8;
42 ///
43 /// 1-byte Character
44 ///
45 typedef char                CHAR8;
46 ///
47 /// 1-byte signed value
48 ///
49 typedef signed char         INT8;
50 //
51 // Basical data type definitions introduced in UEFI.
52 //
53 typedef struct {
54   UINT32  Data1;
55   UINT16  Data2;
56   UINT16  Data3;
57   UINT8   Data4[8];
58 } EFI_GUID;
59 
60 /**
61   Returns a 16-bit signature built from 2 ASCII characters.
62 
63   This macro returns a 16-bit value built from the two ASCII characters specified
64   by A and B.
65 
66   @param  A    The first ASCII character.
67   @param  B    The second ASCII character.
68 
69   @return A 16-bit value built from the two ASCII characters specified by A and B.
70 
71 **/
72 #define SIGNATURE_16(A, B)        ((A) | (B << 8))
73 /**
74   Returns a 32-bit signature built from 4 ASCII characters.
75 
76   This macro returns a 32-bit value built from the four ASCII characters specified
77   by A, B, C, and D.
78 
79   @param  A    The first ASCII character.
80   @param  B    The second ASCII character.
81   @param  C    The third ASCII character.
82   @param  D    The fourth ASCII character.
83 
84   @return A 32-bit value built from the two ASCII characters specified by A, B,
85           C and D.
86 
87 **/
88 #define SIGNATURE_32(A, B, C, D)  (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
89 
90 #endif