summaryrefslogtreecommitdiffstats
path: root/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c
diff options
context:
space:
mode:
authorWei6 Xu <wei6.xu@intel.com>2020-05-12 13:27:34 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-05-15 06:11:44 +0000
commit6c4966423b1ee423cded5e5a59c3bdba16def32c (patch)
tree53f010ef130540e51b4ca6a578074cd111b36cb0 /FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c
parentff306cfd6ce43771d992e506aef9c4c8009cdb25 (diff)
downloadedk2-6c4966423b1ee423cded5e5a59c3bdba16def32c.tar.gz
edk2-6c4966423b1ee423cded5e5a59c3bdba16def32c.tar.bz2
edk2-6c4966423b1ee423cded5e5a59c3bdba16def32c.zip
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 <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c')
-rw-r--r--FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c b/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c
new file mode 100644
index 0000000000..55e9af2290
--- /dev/null
+++ b/FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.c
@@ -0,0 +1,34 @@
+/** @file
+ Null instance of FmpDependencyCheckLib.
+
+ Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include <PiDxe.h>
+#include <Library/FmpDependencyCheckLib.h>
+
+/**
+ 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
+ )
+{
+ return TRUE;
+}