|
| 1 | +/** @file |
| 2 | + Dynamic Platform Info Repository |
| 3 | +
|
| 4 | + Copyright (c) 2021, Arm Limited. All rights reserved.<BR> |
| 5 | +
|
| 6 | + SPDX-License-Identifier: BSD-2-Clause-Patent |
| 7 | +
|
| 8 | + @par Glossary: |
| 9 | + - Cm or CM - Configuration Manager |
| 10 | + - Obj or OBJ - Object |
| 11 | +**/ |
| 12 | + |
| 13 | +#ifndef DYNAMIC_PLAT_REPO_H_ |
| 14 | +#define DYNAMIC_PLAT_REPO_H_ |
| 15 | + |
| 16 | +#include <Protocol/ConfigurationManagerProtocol.h> |
| 17 | + |
| 18 | +/** A structure describing the platform configuration |
| 19 | + manager repository information |
| 20 | +*/ |
| 21 | +typedef VOID *DYNAMIC_PLATFORM_REPOSITORY_INFO; |
| 22 | + |
| 23 | +/** Add an object to the dynamic platform repository. |
| 24 | +
|
| 25 | + @param [in] This This dynamic platform repository. |
| 26 | + @param [in] CmObjDesc CmObj to add. The data is copied. |
| 27 | + @param [out] Token If not NULL, token allocated to this CmObj. |
| 28 | +
|
| 29 | + @retval EFI_SUCCESS Success. |
| 30 | + @retval EFI_INVALID_PARAMETER A parameter is invalid. |
| 31 | + @retval EFI_OUT_OF_RESOURCES An allocation has failed. |
| 32 | +**/ |
| 33 | +EFI_STATUS |
| 34 | +EFIAPI |
| 35 | +DynPlatRepoAddObject ( |
| 36 | + IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This, |
| 37 | + IN CONST CM_OBJ_DESCRIPTOR *CmObjDesc, |
| 38 | + OUT CM_OBJECT_TOKEN *Token OPTIONAL |
| 39 | + ); |
| 40 | + |
| 41 | +/** Finalise the dynamic repository. |
| 42 | +
|
| 43 | + Finalising means: |
| 44 | + - Preventing any further objects from being added. |
| 45 | + - Allowing to get objects from the dynamic repository |
| 46 | + (not possible before a call to this function). |
| 47 | +
|
| 48 | + @param [in] This This dynamic platform repository. |
| 49 | +
|
| 50 | + @retval EFI_SUCCESS Success. |
| 51 | + @retval EFI_ALREADY_STARTED Instance already initialised. |
| 52 | + @retval EFI_INVALID_PARAMETER A parameter is invalid. |
| 53 | + @retval EFI_BUFFER_TOO_SMALL Buffer too small. |
| 54 | + @retval EFI_OUT_OF_RESOURCES An allocation has failed. |
| 55 | +**/ |
| 56 | +EFI_STATUS |
| 57 | +EFIAPI |
| 58 | +DynamicPlatRepoFinalise ( |
| 59 | + IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This |
| 60 | + ); |
| 61 | + |
| 62 | +/** Get a CmObj from the dynamic repository. |
| 63 | +
|
| 64 | + @param [in] This Pointer to the Dynamic Platform Repository. |
| 65 | + @param [in] CmObjectId The Configuration Manager Object ID. |
| 66 | + @param [in] Token An optional token identifying the object. If |
| 67 | + unused this must be CM_NULL_TOKEN. |
| 68 | + @param [in, out] CmObjDesc Pointer to the Configuration Manager Object |
| 69 | + descriptor describing the requested Object. |
| 70 | +
|
| 71 | + @retval EFI_SUCCESS Success. |
| 72 | + @retval EFI_INVALID_PARAMETER A parameter is invalid. |
| 73 | + @retval EFI_NOT_FOUND The required object information is not found. |
| 74 | +**/ |
| 75 | +EFI_STATUS |
| 76 | +EFIAPI |
| 77 | +DynamicPlatRepoGetObject ( |
| 78 | + IN DYNAMIC_PLATFORM_REPOSITORY_INFO *This, |
| 79 | + IN CM_OBJECT_ID CmObjectId, |
| 80 | + IN CM_OBJECT_TOKEN Token OPTIONAL, |
| 81 | + IN OUT CM_OBJ_DESCRIPTOR *CmObjDesc |
| 82 | + ); |
| 83 | + |
| 84 | +/** Initialize the dynamic platform repository. |
| 85 | +
|
| 86 | + @param [out] DynPlatRepo If success, contains the initialised dynamic |
| 87 | + platform repository. |
| 88 | +
|
| 89 | + @retval EFI_SUCCESS Success. |
| 90 | + @retval EFI_INVALID_PARAMETER A parameter is invalid. |
| 91 | + @retval EFI_OUT_OF_RESOURCES An allocation has failed. |
| 92 | +**/ |
| 93 | +EFI_STATUS |
| 94 | +EFIAPI |
| 95 | +DynamicPlatRepoInit ( |
| 96 | + OUT DYNAMIC_PLATFORM_REPOSITORY_INFO **DynPlatRepo |
| 97 | + ); |
| 98 | + |
| 99 | +/** Shutdown the dynamic platform repository. |
| 100 | +
|
| 101 | + Free all the memory allocated for the dynamic platform repository. |
| 102 | +
|
| 103 | + @param [in] DynPlatRepo The dynamic platform repository. |
| 104 | +
|
| 105 | + @retval EFI_INVALID_PARAMETER A parameter is invalid. |
| 106 | + @retval EFI_SUCCESS Success. |
| 107 | +**/ |
| 108 | +EFI_STATUS |
| 109 | +EFIAPI |
| 110 | +DynamicPlatRepoShutdown ( |
| 111 | + IN DYNAMIC_PLATFORM_REPOSITORY_INFO *DynPlatRepo |
| 112 | + ); |
| 113 | + |
| 114 | +#endif // DYNAMIC_PLAT_REPO_H_ |
0 commit comments