From 6c4966423b1ee423cded5e5a59c3bdba16def32c Mon Sep 17 00:00:00 2001 From: Wei6 Xu Date: Tue, 12 May 2020 13:27:34 +0800 Subject: FmpDevicePkg: Add FmpDependencyCheck library class and instances REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2696 * This library class provides platform specific services to support dependency check during updating firmware image. Platform can perform dependency check in platform specific manner by implementing its own FmpDependencyCheckLib. * Add FmpDependencyCheck instance to provide a sample of dependency check. The sample instance only checks the dependency from capsule image. The dependency from other FMP instances isn't checked here. * Add NULL instance as an option to skip the dependency check. Cc: Michael D Kinney Cc: Liming Gao Cc: Sean Brogan Signed-off-by: Wei6 Xu Reviewed-by: Sean Brogan Reviewed-by: Liming Gao --- .../Include/Library/FmpDependencyCheckLib.h | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 FmpDevicePkg/Include/Library/FmpDependencyCheckLib.h (limited to 'FmpDevicePkg/Include') diff --git a/FmpDevicePkg/Include/Library/FmpDependencyCheckLib.h b/FmpDevicePkg/Include/Library/FmpDependencyCheckLib.h new file mode 100644 index 0000000..ec380c4 --- /dev/null +++ b/FmpDevicePkg/Include/Library/FmpDependencyCheckLib.h @@ -0,0 +1,38 @@ +/** @file + Fmp Capsule Dependency check functions for Firmware Management Protocol based + firmware updates. + + Copyright (c) 2020, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __FMP_DEPENDENCY_CHECK_LIB__ +#define __FMP_DEPENDENCY_CHECK_LIB__ + +#include +#include + +/** + Check dependency for firmware update. + + @param[in] ImageTypeId Image Type Id. + @param[in] Version New version. + @param[in] Dependencies Fmp dependency. + @param[in] DependenciesSize Size, in bytes, of the Fmp dependency. + + @retval TRUE Dependencies are satisfied. + @retval FALSE Dependencies are unsatisfied or dependency check fails. + +**/ +BOOLEAN +EFIAPI +CheckFmpDependency ( + IN EFI_GUID ImageTypeId, + IN UINT32 Version, + IN EFI_FIRMWARE_IMAGE_DEP *Dependencies, OPTIONAL + IN UINT32 DependenciesSize + ); + +#endif -- cgit v1.1