48 if ((CmObjDesc ==
NULL) || (ObjNode ==
NULL)) {
50 return EFI_INVALID_PARAMETER;
56 return EFI_OUT_OF_RESOURCES;
63 Desc->ObjectId = CmObjDesc->ObjectId;
64 Desc->Size = CmObjDesc->Size;
65 Desc->Count = CmObjDesc->Count;
69 if (Desc->Data ==
NULL) {
72 return EFI_OUT_OF_RESOURCES;
95 if (ObjNode ==
NULL) {
97 return EFI_INVALID_PARAMETER;
103 Desc = &ObjNode->CmObjDesc;
104 if (Desc->Data !=
NULL) {
138 if ((This ==
NULL) ||
139 (CmObjDesc ==
NULL) ||
143 return EFI_INVALID_PARAMETER;
149 if ((CmObjDesc->Size == 0) || (CmObjDesc->Count == 0)) {
151 return EFI_INVALID_PARAMETER;
158 if (ObjId >= EArmObjMax) {
160 return EFI_INVALID_PARAMETER;
163 ObjList = &This->ArmCmObjList[ObjId];
165 if ((ObjId >= EArchCommonObjMax) ||
169 return EFI_INVALID_PARAMETER;
172 ObjList = &This->ArchCommonCmObjList[ObjId];
175 return EFI_INVALID_PARAMETER;
183 if (EFI_ERROR (Status)) {
191 if (EFI_ERROR (Status)) {
200 This->ObjectCount += 1;
245 return EFI_INVALID_PARAMETER;
249 if (ObjIndex >= EArmObjMax) {
251 return EFI_INVALID_PARAMETER;
254 ListHead = &This->ArmCmObjList[ObjIndex];
255 ObjArray = &This->ArmCmObjArray[ObjIndex];
257 if (ObjIndex >= EArchCommonObjMax) {
259 return EFI_INVALID_PARAMETER;
262 ListHead = &This->ArchCommonCmObjList[ObjIndex];
263 ObjArray = &This->ArchCommonCmObjArray[ObjIndex];
266 return EFI_INVALID_PARAMETER;
275 while (Link != ListHead) {
278 if (CmObjDesc->
ObjectId != CmObjId) {
280 return EFI_INVALID_PARAMETER;
283 if ((CmObjDesc->
Count != 1) &&
290 return EFI_INVALID_PARAMETER;
294 Size += CmObjDesc->
Size;
306 if (GroupedData ==
NULL) {
308 return EFI_OUT_OF_RESOURCES;
314 while (Link != ListHead) {
328 if (EFI_ERROR (Status)) {
333 Data += CmObjDesc->
Size;
337 CmObjDesc = ObjArray;
339 CmObjDesc->
Size = (UINT32)Size;
340 CmObjDesc->
Count = (UINT32)Count;
341 CmObjDesc->
Data = GroupedData;
370 if ((This ==
NULL) ||
374 return EFI_INVALID_PARAMETER;
382 if (EFI_ERROR (Status)) {
391 for (ObjIndex = 0; ObjIndex < EArmObjMax; ObjIndex++) {
393 if (EFI_ERROR (Status)) {
399 for (ObjIndex = 0; ObjIndex < EArchCommonObjMax; ObjIndex++) {
401 if (EFI_ERROR (Status)) {
443 if ((This ==
NULL) ||
444 (CmObjDesc ==
NULL) ||
448 return EFI_INVALID_PARAMETER;
455 if (ObjId >= EArmObjMax) {
457 return EFI_INVALID_PARAMETER;
460 Desc = &This->ArmCmObjArray[ObjId];
462 if ((ObjId >= EArchCommonObjMax) ||
468 return EFI_INVALID_PARAMETER;
471 Desc = &This->ArchCommonCmObjArray[ObjId];
474 return EFI_INVALID_PARAMETER;
490 if (Desc->Count == 0) {
491 return EFI_NOT_FOUND;
494 CmObjDesc->ObjectId = Desc->ObjectId;
495 CmObjDesc->Size = Desc->Size;
496 CmObjDesc->Data = Desc->Data;
497 CmObjDesc->Count = Desc->Count;
521 if (DynPlatRepo ==
NULL) {
523 return EFI_INVALID_PARAMETER;
529 return EFI_OUT_OF_RESOURCES;
533 for (Index = 0; Index < EArmObjMax; Index++) {
537 for (Index = 0; Index < EArchCommonObjMax; Index++) {
541 Repo->ObjectCount = 0;
569 ASSERT (DynPlatRepo !=
NULL);
572 for (Index = 0; Index < EArmObjMax; Index++) {
574 ListHead = &DynPlatRepo->ArmCmObjList[Index];
581 CmObjDesc = DynPlatRepo->ArmCmObjArray;
582 for (Index = 0; Index < EArmObjMax; Index++) {
583 Data = CmObjDesc[Index].
Data;
610 ASSERT (DynPlatRepo !=
NULL);
613 for (Index = 0; Index < EArchCommonObjMax; Index++) {
615 ListHead = &DynPlatRepo->ArchCommonCmObjList[Index];
622 CmObjDesc = DynPlatRepo->ArchCommonCmObjArray;
623 for (Index = 0; Index < EArchCommonObjMax; Index++) {
624 Data = CmObjDesc[Index].
Data;
648 if (DynPlatRepo ==
NULL) {
650 return EFI_INVALID_PARAMETER;
@ EArchCommonObjCmRef
7 - CM Object Reference
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EFIAPI FixupCmObjectSelfToken(IN CM_OBJ_DESCRIPTOR *CmObjDesc, IN CM_OBJECT_TOKEN Token)
#define CREATE_CM_OBJECT_ID(NameSpaceId, ObjectId)
#define GET_CM_NAMESPACE_ID(CmObjectId)
#define GET_CM_OBJECT_ID(CmObjectId)
@ EObjNameSpaceArm
ARM Objects Namespace.
@ EObjNameSpaceArchCommon
Arch Common Objects Namespace.
enum ObjectNameSpaceID EOBJECT_NAMESPACE_ID
STATIC VOID EFIAPI DynamicPlatRepoFreeArmObjects(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo)
STATIC EFI_STATUS EFIAPI FreeCmObjNode(IN CM_OBJ_NODE *ObjNode)
STATIC VOID EFIAPI DynamicPlatRepoFreeArchCommonObjects(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo)
EFI_STATUS EFIAPI DynamicPlatRepoGetObject(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This, IN CM_OBJECT_ID CmObjectId, IN CM_OBJECT_TOKEN Token OPTIONAL, IN OUT CM_OBJ_DESCRIPTOR *CmObjDesc)
EFI_STATUS EFIAPI DynamicPlatRepoShutdown(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo)
EFI_STATUS EFIAPI DynPlatRepoAddObject(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This, IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc, OUT CM_OBJECT_TOKEN *Token OPTIONAL)
STATIC EFI_STATUS EFIAPI AllocCmObjNode(IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc, IN CM_OBJECT_TOKEN Token, OUT CM_OBJ_NODE **ObjNode)
EFI_STATUS EFIAPI DynamicPlatRepoInit(OUT DYNAMIC_PLATFORM_REPOSITORY_INFO **DynPlatRepo)
EFI_STATUS EFIAPI DynamicPlatRepoFinalise(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This)
STATIC EFI_STATUS EFIAPI GroupCmObjNodes(IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This, IN EOBJECT_NAMESPACE_ID NamespaceId, IN UINT32 ObjIndex)
@ DynRepoTransient
Transient state - CmObjects can be added.
VOID * DYNAMIC_PLATFORM_REPOSITORY_INFO
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
CM_OBJECT_TOKEN EFIAPI GenerateToken(VOID)
EFI_STATUS EFIAPI TokenMapperInitialise(IN TOKEN_MAPPER *TokenMapper, IN UINTN DescriptorCount)
EFI_STATUS EFIAPI TokenMapperGetObject(IN TOKEN_MAPPER *TokenMapper, IN CM_OBJECT_TOKEN Token, IN CM_OBJECT_ID ObjectId, OUT CM_OBJ_DESCRIPTOR *CmObjDesc)
EFI_STATUS EFIAPI TokenMapperShutdown(IN TOKEN_MAPPER *TokenMapper)
EFI_STATUS EFIAPI TokenMapperAddObject(IN TOKEN_MAPPER *TokenMapper, IN CM_OBJECT_TOKEN Token, IN CM_OBJECT_ID ObjectId, IN UINT32 Size, IN VOID *Data)
VOID * Data
Pointer to the described Object or Object List.
UINT32 Size
Size of the described Object or Object List.
UINT32 Count
Count of objects in the list.
CM_OBJECT_ID ObjectId
Object Id.
CM_OBJ_DESCRIPTOR CmObjDesc
CM_OBJECT_TOKEN Token
Token associated with the CmObjDesc.
LIST_ENTRY Link
This must be the first field in this structure.