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