summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Include
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/Include
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/Include')
-rw-r--r--UefiPayloadPkg/Include/Library/DxeHobListLib.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Include/Library/DxeHobListLib.h b/UefiPayloadPkg/Include/Library/DxeHobListLib.h
new file mode 100644
index 0000000000..7e9b23f6d7
--- /dev/null
+++ b/UefiPayloadPkg/Include/Library/DxeHobListLib.h
@@ -0,0 +1,27 @@
+/** @file
+ Provides a service to retrieve a pointer to the start of HOB list.
+ Only available to DXE module types.
+
+ This library does not contain any functions or macros. It simply exports a global
+ pointer to the start of HOB list as defined in the Platform Initialization Driver
+ Execution Environment Core Interface Specification. The library constructor must
+ initialize this global pointer to the start of HOB list, so it is available at the
+ module's entry point. Since there is overhead in looking up the pointer to the start
+ of HOB list, only those modules that actually require access to the HOB list
+ should use this library.
+
+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __DXE_HOB_LIST_LIB_H__
+#define __DXE_HOB_LIST_LIB_H__
+
+///
+/// Cache copy of the start of HOB list
+///
+extern VOID *gHobList;
+
+#endif
+