summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Library/DxeHobListLibNull
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2021-05-07 13:34:20 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-06-24 09:16:22 +0000
commit82f727c4af3289e7765b36e9c55c57cc61de4065 (patch)
tree2c89c48a1d49b933bb34a338ef55de8d4465763c /UefiPayloadPkg/Library/DxeHobListLibNull
parent12e34cd2f7900578ee83cb01b8f1696a7bb7511b (diff)
downloadedk2-82f727c4af3289e7765b36e9c55c57cc61de4065.tar.gz
edk2-82f727c4af3289e7765b36e9c55c57cc61de4065.tar.bz2
edk2-82f727c4af3289e7765b36e9c55c57cc61de4065.zip
UefiPayloadPkg: Add HobLib for UniversalPayload
For payload entry, use PayloadEntryHobLib as HobLib and payload entry should initialize hob base. For DxeCore, use new added DxeHobLib as HobLib, and DxeCore will initialize hob base. For Dxe Driver, use new added DxeHobLib as HobLib, and use DxeHobListLib to initialize hob base. Adding a new library DxeHobLib + DxeHobListLib instead of using the DxeHobLib.inf in MdePkg is because the constructor needed be separated from DxeHobLib. If not, when building UefiPayloadPkg, the dependency chain is as below: DebugLib -> SerialPortLib -> PlatformHookLib -> HobLib -> DebugLib Each library has a constructor, and this becomes a constructor circle. To break the circle, separate the constructor from the HobLib as a new DxeHobListLib, which won't depend on DebugLib. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Signed-off-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Diffstat (limited to 'UefiPayloadPkg/Library/DxeHobListLibNull')
-rw-r--r--UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c20
-rw-r--r--UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf28
2 files changed, 48 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
new file mode 100644
index 0000000000..92d3e17ef0
--- /dev/null
+++ b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.c
@@ -0,0 +1,20 @@
+/** @file
+ This library retrieve the EFI_BOOT_SERVICES pointer from EFI system table in
+ library's constructor.
+
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+
+#include <Uefi.h>
+
+EFI_STATUS
+EFIAPI
+DxeHobListLibNullConstructor (
+ VOID
+ )
+{
+ return EFI_SUCCESS;
+}
diff --git a/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf
new file mode 100644
index 0000000000..f17e5ebdbd
--- /dev/null
+++ b/UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf
@@ -0,0 +1,28 @@
+## @file
+# UEFI Boot Services Table Library implementation.
+#
+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeHobListLibNull
+ MODULE_TYPE = BASE
+ FILE_GUID = 060876c2-0e4e-4c63-8996-6af3710cfa64
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = DxeHobListLib
+ CONSTRUCTOR = DxeHobListLibNullConstructor
+
+#
+# VALID_ARCHITECTURES = IA32 X64 EBC
+#
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[Sources]
+ DxeHobListLibNull.c