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