]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Include/ConfigurationManagerObject.h
3bd4273d252d6114d5091cc032d2a36d0590d32e
[mirror_edk2.git] / DynamicTablesPkg / Include / ConfigurationManagerObject.h
1 /** @file
2
3 Copyright (c) 2017 - 2019, 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 - Platform Generic Watchdog
67 14 - PCI Configuration Space Info
68 15 - Hypervisor Vendor Id
69 16 - Fixed feature flags for FADT
70 */
71 typedef UINT32 CM_OBJECT_ID;
72
73 /** A mask for Object ID
74 */
75 #define OBJECT_ID_MASK 0xFF
76
77 /** A mask for Namespace ID
78 */
79 #define NAMESPACE_ID_MASK 0xF
80
81 /** Starting bit position for Namespace ID
82 */
83 #define NAMESPACE_ID_BIT_SHIFT 28
84
85 /** The EOBJECT_NAMESPACE_ID enum describes the defined namespaces
86 for the Configuration Manager Objects.
87 */
88 typedef enum ObjectNameSpaceID {
89 EObjNameSpaceStandard, ///< Standard Objects Namespace
90 EObjNameSpaceArm, ///< ARM Objects Namespace
91 EObjNameSpaceOem = 0x8, ///< OEM Objects Namespace
92 EObjNameSpaceMax
93 } EOBJECT_NAMESPACE_ID;
94
95 /** A descriptor for Configuration Manager Objects.
96
97 The Configuration Manager Protocol interface uses this descriptor
98 to return the Configuration Manager Objects.
99 */
100 typedef struct CmObjDescriptor {
101 /// Object Id
102 CM_OBJECT_ID ObjectId;
103
104 /// Size of the described Object or Object List
105 UINT32 Size;
106
107 /// Pointer to the described Object or Object List
108 VOID * Data;
109
110 /// Count of objects in the list
111 UINT32 Count;
112 } CM_OBJ_DESCRIPTOR;
113
114 #pragma pack()
115
116 /** This macro returns the namespace ID from the CmObjectID.
117
118 @param [in] CmObjectId The Configuration Manager Object ID.
119
120 @retval Returns the Namespace ID corresponding to the CmObjectID.
121 **/
122 #define GET_CM_NAMESPACE_ID(CmObjectId) \
123 (((CmObjectId) >> NAMESPACE_ID_BIT_SHIFT) & \
124 NAMESPACE_ID_MASK)
125
126 /** This macro returns the Object ID from the CmObjectID.
127
128 @param [in] CmObjectId The Configuration Manager Object ID.
129
130 @retval Returns the Object ID corresponding to the CmObjectID.
131 **/
132 #define GET_CM_OBJECT_ID(CmObjectId) ((CmObjectId) & OBJECT_ID_MASK)
133
134 /** This macro returns a Configuration Manager Object ID
135 from the NameSpace ID and the ObjectID.
136
137 @param [in] NameSpaceId The namespace ID for the Object.
138 @param [in] ObjectId The Object ID.
139
140 @retval Returns the Configuration Manager Object ID.
141 **/
142 #define CREATE_CM_OBJECT_ID(NameSpaceId, ObjectId) \
143 ((((NameSpaceId) & NAMESPACE_ID_MASK) << NAMESPACE_ID_BIT_SHIFT) | \
144 ((ObjectId) & OBJECT_ID_MASK))
145
146 /** This macro returns a Configuration Manager Object ID
147 in the Standard Object Namespace.
148
149 @param [in] ObjectId The Object ID.
150
151 @retval Returns a Standard Configuration Manager Object ID.
152 **/
153 #define CREATE_CM_STD_OBJECT_ID(ObjectId) \
154 (CREATE_CM_OBJECT_ID (EObjNameSpaceStandard, ObjectId))
155
156 /** This macro returns a Configuration Manager Object ID
157 in the ARM Object Namespace.
158
159 @param [in] ObjectId The Object ID.
160
161 @retval Returns an ARM Configuration Manager Object ID.
162 **/
163 #define CREATE_CM_ARM_OBJECT_ID(ObjectId) \
164 (CREATE_CM_OBJECT_ID (EObjNameSpaceArm, ObjectId))
165
166 /** This macro returns a Configuration Manager Object ID
167 in the OEM Object Namespace.
168
169 @param [in] ObjectId The Object ID.
170
171 @retval Returns an OEM Configuration Manager Object ID.
172 **/
173 #define CREATE_CM_OEM_OBJECT_ID(ObjectId) \
174 (CREATE_CM_OBJECT_ID (EObjNameSpaceOem, ObjectId))
175
176 #endif // CONFIGURATION_MANAGER_OBJECT_H_