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