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