]> git.proxmox.com Git - mirror_edk2.git/blob - FmpDevicePkg/FmpDxe/Dependency.h
FmpDevicePkg: Add FmpDependencyDevice library class and NULL instance
[mirror_edk2.git] / FmpDevicePkg / FmpDxe / Dependency.h
1 /** @file
2 Fmp Capsule Dependency support functions for Firmware Management Protocol based
3 firmware updates.
4
5 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef __DEPENDENCY_H__
12 #define __DEPENDENCY_H__
13
14 #include <Library/UefiLib.h>
15 #include <Protocol/FirmwareManagement.h>
16
17 #define DEPENDENCIES_SATISFIED 0
18 #define DEPENDENCIES_UNSATISFIED 1
19 #define DEPENDENCIES_INVALID 2
20
21 extern UINT8 mDependenciesCheckStatus;
22
23 /**
24 Validate the dependency expression and output its size.
25
26 @param[in] ImageDepex Pointer to the EFI_FIRMWARE_IMAGE_DEP.
27 @param[in] MaxDepexSize Max size of the dependency.
28 @param[out] DepexSize Size of dependency.
29
30 @retval TRUE The capsule is valid.
31 @retval FALSE The capsule is invalid.
32
33 **/
34 BOOLEAN
35 ValidateImageDepex (
36 IN EFI_FIRMWARE_IMAGE_DEP *ImageDepex,
37 IN CONST UINTN MaxDepexSize,
38 OUT UINT32 *DepexSize
39 );
40
41 /**
42 Check dependency for firmware update.
43
44 @param[in] ImageTypeId Image Type Id.
45 @param[in] Version New version.
46 @param[in] Dependencies The dependencies.
47 @param[in] DepexSize Size of the dependencies
48 @param[out] IsSatisfied Indicate the dependencies is satisfied or not.
49
50 @retval EFI_SUCCESS Dependency Evaluation is successful.
51 @retval Others Dependency Evaluation fails with unexpected error.
52
53 **/
54 EFI_STATUS
55 EvaluateImageDependencies (
56 IN CONST EFI_GUID ImageTypeId,
57 IN CONST UINT32 Version,
58 IN CONST EFI_FIRMWARE_IMAGE_DEP *Dependencies,
59 IN CONST UINT32 DepexSize,
60 OUT BOOLEAN *IsSatisfied
61 );
62
63 #endif