TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/FmpDependencyLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Guid/SystemResourceTable.h>
#include <LastAttemptStatus.h>
#include <FmpLastAttemptStatus.h>
Go to the source code of this file.
Data Structures | |
union | ELEMENT_VALUE |
struct | DEPEX_ELEMENT |
Macros | |
#define | DEPEX_STACK_SIZE_INCREMENT 0x1000 |
Enumerations | |
enum | ELEMENT_TYPE { BooleanType , VersionType } |
Functions | |
EFI_STATUS | GrowDepexStack (VOID) |
EFI_STATUS | Push (IN UINT32 Value, IN UINTN Type) |
EFI_STATUS | Pop (OUT DEPEX_ELEMENT *Element, IN ELEMENT_TYPE Type) |
BOOLEAN EFIAPI | EvaluateDependency (IN EFI_FIRMWARE_IMAGE_DEP *Dependencies, IN UINTN DependenciesSize, IN FMP_DEPEX_CHECK_VERSION_DATA *FmpVersions OPTIONAL, IN UINTN FmpVersionsCount, OUT UINT32 *LastAttemptStatus OPTIONAL) |
BOOLEAN EFIAPI | ValidateDependency (IN EFI_FIRMWARE_IMAGE_DEP *Dependencies, IN UINTN MaxDepexSize, OUT UINT32 *DepexSize, OUT UINT32 *LastAttemptStatus OPTIONAL) |
EFI_FIRMWARE_IMAGE_DEP *EFIAPI | GetImageDependency (IN EFI_FIRMWARE_IMAGE_AUTHENTICATION *Image, IN UINTN ImageSize, OUT UINT32 *DepexSize, OUT UINT32 *LastAttemptStatus OPTIONAL) |
Variables | |
DEPEX_ELEMENT * | mDepexEvaluationStack = NULL |
DEPEX_ELEMENT * | mDepexEvaluationStackEnd = NULL |
DEPEX_ELEMENT * | mDepexEvaluationStackPointer = NULL |
Supports Fmp Capsule Dependency Expression.
Copyright (c) Microsoft Corporation.
Copyright (c) 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FmpDependencyLib.c.
#define DEPEX_STACK_SIZE_INCREMENT 0x1000 |
Definition at line 23 of file FmpDependencyLib.c.
enum ELEMENT_TYPE |
Definition at line 28 of file FmpDependencyLib.c.
BOOLEAN EFIAPI EvaluateDependency | ( | IN EFI_FIRMWARE_IMAGE_DEP * | Dependencies, |
IN UINTN | DependenciesSize, | ||
IN FMP_DEPEX_CHECK_VERSION_DATA *FmpVersions | OPTIONAL, | ||
IN UINTN | FmpVersionsCount, | ||
OUT UINT32 *LastAttemptStatus | OPTIONAL | ||
) |
Evaluate the dependencies. The caller must search all the Fmp instances and gather their versions into FmpVersions parameter. If there is PUSH_GUID opcode in dependency expression with no FmpVersions provided, the dependency will evaluate to FALSE.
[in] | Dependencies | Dependency expressions. |
[in] | DependenciesSize | Size of Dependency expressions. |
[in] | FmpVersions | Array of Fmp ImageTypeId and version. This parameter is optional and can be set to NULL. |
[in] | FmpVersionsCount | Element count of the array. When FmpVersions is NULL, FmpVersionsCount must be 0. |
[out] | LastAttemptStatus | An optional pointer to a UINT32 that holds the last attempt status to report back to the caller. This function will set the value to LAST_ATTEMPT_STATUS_SUCCESS if an error code is not set. |
TRUE | Dependency expressions evaluate to TRUE. |
FALSE | Dependency expressions evaluate to FALSE. |
Definition at line 221 of file FmpDependencyLib.c.
EFI_FIRMWARE_IMAGE_DEP *EFIAPI GetImageDependency | ( | IN EFI_FIRMWARE_IMAGE_AUTHENTICATION * | Image, |
IN UINTN | ImageSize, | ||
OUT UINT32 * | DepexSize, | ||
OUT UINT32 *LastAttemptStatus | OPTIONAL | ||
) |
Get dependency from firmware image.
[in] | Image | Points to the firmware image. |
[in] | ImageSize | Size, in bytes, of the firmware image. |
[out] | DepexSize | Size, in bytes, of the dependency. |
[out] | LastAttemptStatus | An optional pointer to a UINT32 that holds the last attempt status to report back to the caller. If a last attempt status error code is not returned, this function will not modify the LastAttemptStatus value. |
The | pointer to dependency. |
Null |
Definition at line 640 of file FmpDependencyLib.c.
EFI_STATUS GrowDepexStack | ( | VOID | ) |
Grow size of the Depex stack
EFI_SUCCESS | Stack successfully growed. |
EFI_OUT_OF_RESOURCES | There is not enough system memory to grow the stack. |
Definition at line 64 of file FmpDependencyLib.c.
EFI_STATUS Pop | ( | OUT DEPEX_ELEMENT * | Element, |
IN ELEMENT_TYPE | Type | ||
) |
Pop an element from the stack.
[out] | Element | Element to pop. |
[in] | Type | Type of element. |
EFI_SUCCESS | The value was popped onto the stack. |
EFI_ACCESS_DENIED | The pop operation underflowed the stack. |
EFI_INVALID_PARAMETER | Type is mismatched. |
Definition at line 172 of file FmpDependencyLib.c.
EFI_STATUS Push | ( | IN UINT32 | Value, |
IN UINTN | Type | ||
) |
Push an element onto the Stack.
[in] | Value | Value to push. |
[in] | Type | Element Type |
EFI_SUCCESS | The value was pushed onto the stack. |
EFI_OUT_OF_RESOURCES | There is not enough system memory to grow the stack. |
EFI_INVALID_PARAMETER | Wrong stack element type. |
Definition at line 120 of file FmpDependencyLib.c.
BOOLEAN EFIAPI ValidateDependency | ( | IN EFI_FIRMWARE_IMAGE_DEP * | Dependencies, |
IN UINTN | MaxDepexSize, | ||
OUT UINT32 * | DepexSize, | ||
OUT UINT32 *LastAttemptStatus | OPTIONAL | ||
) |
Validate the dependency expression and output its size.
[in] | Dependencies | Pointer to the EFI_FIRMWARE_IMAGE_DEP. |
[in] | MaxDepexSize | Max size of the dependency. |
[out] | DepexSize | Size of dependency. |
[out] | LastAttemptStatus | An optional pointer to a UINT32 that holds the last attempt status to report back to the caller. If a last attempt status error code is not returned, this function will not modify the LastAttemptStatus value. |
TRUE | The dependency expression is valid. |
FALSE | The dependency expression is invalid. |
Definition at line 561 of file FmpDependencyLib.c.
DEPEX_ELEMENT* mDepexEvaluationStack = NULL |
Definition at line 52 of file FmpDependencyLib.c.
DEPEX_ELEMENT* mDepexEvaluationStackEnd = NULL |
Definition at line 53 of file FmpDependencyLib.c.
DEPEX_ELEMENT* mDepexEvaluationStackPointer = NULL |
Definition at line 54 of file FmpDependencyLib.c.