2 Fmp Capsule Dependency support functions for Firmware Management Protocol based
5 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef __FMP_DEPENDENCY_LIB__
12 #define __FMP_DEPENDENCY_LIB__
15 #include <Protocol/FirmwareManagement.h>
18 // Data struct to store FMP ImageType and version for dependency check.
23 } FMP_DEPEX_CHECK_VERSION_DATA
;
26 Validate the dependency expression and output its size.
28 @param[in] Dependencies Pointer to the EFI_FIRMWARE_IMAGE_DEP.
29 @param[in] MaxDepexSize Max size of the dependency.
30 @param[out] DepexSize Size of dependency.
32 @retval TRUE The capsule is valid.
33 @retval FALSE The capsule is invalid.
39 IN EFI_FIRMWARE_IMAGE_DEP
*Dependencies
,
40 IN UINTN MaxDepexSize
,
45 Get dependency from firmware image.
47 @param[in] Image Points to the firmware image.
48 @param[in] ImageSize Size, in bytes, of the firmware image.
49 @param[out] DepexSize Size, in bytes, of the dependency.
51 @retval The pointer to dependency.
55 EFI_FIRMWARE_IMAGE_DEP
*
58 IN EFI_FIRMWARE_IMAGE_AUTHENTICATION
*Image
,
64 Evaluate the dependencies. The caller must search all the Fmp instances and
65 gather their versions into FmpVersions parameter. If there is PUSH_GUID opcode
66 in dependency expression with no FmpVersions provided, the dependency will
69 @param[in] Dependencies Dependency expressions.
70 @param[in] DependenciesSize Size of Dependency expressions.
71 @param[in] FmpVersions Array of Fmp ImageTypeId and version. This
72 parameter is optional and can be set to NULL.
73 @param[in] FmpVersionsCount Element count of the array. When FmpVersions
74 is NULL, FmpVersionsCount must be 0.
76 @retval TRUE Dependency expressions evaluate to TRUE.
77 @retval FALSE Dependency expressions evaluate to FALSE.
83 IN EFI_FIRMWARE_IMAGE_DEP
*Dependencies
,
84 IN UINTN DependenciesSize
,
85 IN FMP_DEPEX_CHECK_VERSION_DATA
*FmpVersions OPTIONAL
,
86 IN UINTN FmpVersionsCount