TianoCore EDK2 master
Loading...
Searching...
No Matches
CmObjectTokenFixer.c
Go to the documentation of this file.
1
13#include <Library/DebugLib.h>
15#include "CmObjectTokenFixer.h"
16
33EFIAPI
35 IN CM_OBJ_DESCRIPTOR *CmObject,
37 )
38{
39 ASSERT (0);
40 return EFI_UNSUPPORTED;
41}
42
56EFIAPI
58 IN CM_OBJ_DESCRIPTOR *CmObject,
60 )
61{
62 ASSERT (CmObject != NULL);
63 ((CM_ARM_ITS_GROUP_NODE *)CmObject->Data)->Token = Token;
64 return EFI_SUCCESS;
65}
66
80EFIAPI
82 IN CM_OBJ_DESCRIPTOR *CmObject,
84 )
85{
86 ASSERT (CmObject != NULL);
87 ((CM_ARM_NAMED_COMPONENT_NODE *)CmObject->Data)->Token = Token;
88 return EFI_SUCCESS;
89}
90
102STATIC
104EFIAPI
106 IN CM_OBJ_DESCRIPTOR *CmObject,
107 IN CM_OBJECT_TOKEN Token
108 )
109{
110 ASSERT (CmObject != NULL);
111 ((CM_ARM_ROOT_COMPLEX_NODE *)CmObject->Data)->Token = Token;
112 return EFI_SUCCESS;
113}
114
126STATIC
128EFIAPI
130 IN CM_OBJ_DESCRIPTOR *CmObject,
131 IN CM_OBJECT_TOKEN Token
132 )
133{
134 ASSERT (CmObject != NULL);
135 ((CM_ARM_SMMUV3_NODE *)CmObject->Data)->Token = Token;
136 return EFI_SUCCESS;
137}
138
144CONST
146 NULL,
147 NULL,
148 NULL,
149 NULL,
150 NULL,
151 NULL,
152 NULL,
153 NULL,
154 NULL,
155 NULL,
156 NULL,
163 NULL,
164 NULL,
165 NULL,
166 NULL,
167 NULL,
168 NULL,
169 NULL
170};
171
186EFIAPI
188 IN CM_OBJ_DESCRIPTOR *CmObjDesc,
189 IN CM_OBJECT_TOKEN Token
190 )
191{
192 EFI_STATUS Status;
193 CM_OBJECT_TOKEN_FIXER TokenFixerFunc;
194 CM_OBJECT_ID ArmNamespaceObjId;
195
196 if (CmObjDesc == NULL) {
197 ASSERT (0);
198 return EFI_INVALID_PARAMETER;
199 }
200
201 // Only support Arm objects for now.
202 if (GET_CM_NAMESPACE_ID (CmObjDesc->ObjectId) != EObjNameSpaceArm) {
203 ASSERT (0);
204 return EFI_UNSUPPORTED;
205 }
206
207 ArmNamespaceObjId = GET_CM_OBJECT_ID (CmObjDesc->ObjectId);
208 if (ArmNamespaceObjId >= EArmObjMax) {
209 ASSERT (0);
210 return EFI_INVALID_PARAMETER;
211 }
212
213 // Fixup self-token if necessary.
214 TokenFixerFunc = TokenFixer[ArmNamespaceObjId];
215 if (TokenFixerFunc != NULL) {
216 Status = TokenFixerFunc (CmObjDesc, Token);
217 if (EFI_ERROR (Status)) {
218 ASSERT (0);
219 return Status;
220 }
221 }
222
223 return EFI_SUCCESS;
224}
STATIC EFI_STATUS EFIAPI TokenFixerRootComplexNode(IN CM_OBJ_DESCRIPTOR *CmObject, IN CM_OBJECT_TOKEN Token)
STATIC EFI_STATUS EFIAPI TokenFixerItsGroup(IN CM_OBJ_DESCRIPTOR *CmObject, IN CM_OBJECT_TOKEN Token)
CONST CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax]
STATIC EFI_STATUS EFIAPI TokenFixerNamedComponentNode(IN CM_OBJ_DESCRIPTOR *CmObject, IN CM_OBJECT_TOKEN Token)
STATIC EFI_STATUS EFIAPI TokenFixerSmmuV3Node(IN CM_OBJ_DESCRIPTOR *CmObject, IN CM_OBJECT_TOKEN Token)
STATIC EFI_STATUS EFIAPI TokenFixerNotImplemented(IN CM_OBJ_DESCRIPTOR *CmObject, IN CM_OBJECT_TOKEN Token)
EFI_STATUS EFIAPI FixupCmObjectSelfToken(IN CM_OBJ_DESCRIPTOR *CmObjDesc, IN CM_OBJECT_TOKEN Token)
EFI_STATUS(EFIAPI * CM_OBJECT_TOKEN_FIXER)(IN CM_OBJ_DESCRIPTOR *CmObject, IN CM_OBJECT_TOKEN Token)
#define GET_CM_NAMESPACE_ID(CmObjectId)
#define GET_CM_OBJECT_ID(CmObjectId)
@ EObjNameSpaceArm
ARM Objects Namespace.
UINT32 CM_OBJECT_ID
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define IN
Definition: Base.h:279
UINTN CM_OBJECT_TOKEN
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112