]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Include/ConfigurationManagerObject.h
UefiCpuPkg: Fix SMM code hangs when InitPaging
[mirror_edk2.git] / DynamicTablesPkg / Include / ConfigurationManagerObject.h
1 /** @file
2
3 Copyright (c) 2017 - 2022, ARM Limited. All rights reserved.
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 @par Glossary:
8 - Cm or CM - Configuration Manager
9 - Obj or OBJ - Object
10 **/
11
12 #ifndef CONFIGURATION_MANAGER_OBJECT_H_
13 #define CONFIGURATION_MANAGER_OBJECT_H_
14
15 #include <ArmNameSpaceObjects.h>
16 #include <StandardNameSpaceObjects.h>
17
18 #pragma pack(1)
19
20 /** The CM_OBJECT_ID type is used to identify the Configuration Manager
21 objects.
22
23 Description of Configuration Manager Object ID
24 _______________________________________________________________________________
25 |31 |30 |29 |28 || 27 | 26 | 25 | 24 || 23 | 22 | 21 | 20 || 19 | 18 | 17 | 16|
26 -------------------------------------------------------------------------------
27 | Name Space ID || 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0|
28 _______________________________________________________________________________
29
30 Bits: [31:28] - Name Space ID
31 0000 - Standard
32 0001 - ARM
33 1000 - Custom/OEM
34 All other values are reserved.
35
36 Bits: [27:16] - Reserved.
37 _______________________________________________________________________________
38 |15 |14 |13 |12 || 11 | 10 | 9 | 8 || 7 | 6 | 5 | 4 || 3 | 2 | 1 | 0|
39 -------------------------------------------------------------------------------
40 | 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0 || Object ID |
41 _______________________________________________________________________________
42
43 Bits: [15:8] - Are reserved and must be zero.
44
45 Bits: [7:0] - Object ID
46
47 Object ID's in the Standard Namespace:
48 0 - Configuration Manager Revision
49 1 - ACPI Table List
50 2 - SMBIOS Table List
51
52 Object ID's in the ARM Namespace:
53 0 - Reserved
54 1 - Boot Architecture Info
55 2 - CPU Info
56 3 - Power Management Profile Info
57 4 - GICC Info
58 5 - GICD Info
59 6 - GIC MSI Frame Info
60 7 - GIC Redistributor Info
61 8 - GIC ITS Info
62 9 - Serial Console Port Info
63 10 - Serial Debug Port Info
64 11 - Generic Timer Info
65 12 - Platform GT Block Info
66 13 - Generic Timer Block Frame Info
67 14 - Platform Generic Watchdog
68 15 - PCI Configuration Space Info
69 16 - Hypervisor Vendor Id
70 17 - Fixed feature flags for FADT
71 18 - ITS Group
72 19 - Named Component
73 20 - Root Complex
74 21 - SMMUv1 or SMMUv2
75 22 - SMMUv3
76 23 - PMCG
77 24 - GIC ITS Identifier Array
78 25 - ID Mapping Array
79 26 - SMMU Interrupt Array
80 27 - Processor Hierarchy Info
81 28 - Cache Info
82 29 - Processor Hierarchy Node ID Info
83 30 - CM Object Reference
84 */
85 typedef UINT32 CM_OBJECT_ID;
86
87 //
88 // Helper macro to format a CM_OBJECT_ID.
89 //
90 #define FMT_CM_OBJECT_ID "0x%lx"
91
92 /** A mask for Object ID
93 */
94 #define OBJECT_ID_MASK 0xFF
95
96 /** A mask for Namespace ID
97 */
98 #define NAMESPACE_ID_MASK 0xF
99
100 /** Starting bit position for Namespace ID
101 */
102 #define NAMESPACE_ID_BIT_SHIFT 28
103
104 /** The EOBJECT_NAMESPACE_ID enum describes the defined namespaces
105 for the Configuration Manager Objects.
106 */
107 typedef enum ObjectNameSpaceID {
108 EObjNameSpaceStandard, ///< Standard Objects Namespace
109 EObjNameSpaceArm, ///< ARM Objects Namespace
110 EObjNameSpaceOem = 0x8, ///< OEM Objects Namespace
111 EObjNameSpaceMax
112 } EOBJECT_NAMESPACE_ID;
113
114 /** A descriptor for Configuration Manager Objects.
115
116 The Configuration Manager Protocol interface uses this descriptor
117 to return the Configuration Manager Objects.
118 */
119 typedef struct CmObjDescriptor {
120 /// Object Id
121 CM_OBJECT_ID ObjectId;
122
123 /// Size of the described Object or Object List
124 UINT32 Size;
125
126 /// Pointer to the described Object or Object List
127 VOID *Data;
128
129 /// Count of objects in the list
130 UINT32 Count;
131 } CM_OBJ_DESCRIPTOR;
132
133 #pragma pack()
134
135 /** This macro returns the namespace ID from the CmObjectID.
136
137 @param [in] CmObjectId The Configuration Manager Object ID.
138
139 @retval Returns the Namespace ID corresponding to the CmObjectID.
140 **/
141 #define GET_CM_NAMESPACE_ID(CmObjectId) \
142 (((CmObjectId) >> NAMESPACE_ID_BIT_SHIFT) & \
143 NAMESPACE_ID_MASK)
144
145 /** This macro returns the Object ID from the CmObjectID.
146
147 @param [in] CmObjectId The Configuration Manager Object ID.
148
149 @retval Returns the Object ID corresponding to the CmObjectID.
150 **/
151 #define GET_CM_OBJECT_ID(CmObjectId) ((CmObjectId) & OBJECT_ID_MASK)
152
153 /** This macro returns a Configuration Manager Object ID
154 from the NameSpace ID and the ObjectID.
155
156 @param [in] NameSpaceId The namespace ID for the Object.
157 @param [in] ObjectId The Object ID.
158
159 @retval Returns the Configuration Manager Object ID.
160 **/
161 #define CREATE_CM_OBJECT_ID(NameSpaceId, ObjectId) \
162 ((((NameSpaceId) & NAMESPACE_ID_MASK) << NAMESPACE_ID_BIT_SHIFT) | \
163 ((ObjectId) & OBJECT_ID_MASK))
164
165 /** This macro returns a Configuration Manager Object ID
166 in the Standard Object Namespace.
167
168 @param [in] ObjectId The Object ID.
169
170 @retval Returns a Standard Configuration Manager Object ID.
171 **/
172 #define CREATE_CM_STD_OBJECT_ID(ObjectId) \
173 (CREATE_CM_OBJECT_ID (EObjNameSpaceStandard, ObjectId))
174
175 /** This macro returns a Configuration Manager Object ID
176 in the ARM Object Namespace.
177
178 @param [in] ObjectId The Object ID.
179
180 @retval Returns an ARM Configuration Manager Object ID.
181 **/
182 #define CREATE_CM_ARM_OBJECT_ID(ObjectId) \
183 (CREATE_CM_OBJECT_ID (EObjNameSpaceArm, ObjectId))
184
185 /** This macro returns a Configuration Manager Object ID
186 in the OEM Object Namespace.
187
188 @param [in] ObjectId The Object ID.
189
190 @retval Returns an OEM Configuration Manager Object ID.
191 **/
192 #define CREATE_CM_OEM_OBJECT_ID(ObjectId) \
193 (CREATE_CM_OBJECT_ID (EObjNameSpaceOem, ObjectId))
194
195 #endif // CONFIGURATION_MANAGER_OBJECT_H_