]> git.proxmox.com Git - mirror_edk2.git/commit - MdePkg/Library/DxeHobLib/HobLib.c
MdePkg DxeHobLib: Make GetHobList working before Constructor is called
authorStar Zeng <star.zeng@intel.com>
Mon, 16 Jan 2017 08:07:53 +0000 (16:07 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 20 Jan 2017 07:39:23 +0000 (15:39 +0800)
commit6d11b822a3a68b810f0ceb26ea107ad0e984052a
tree1711075ab1c96b055671fe8dd996886c7ca63a70
parentcd5b2ae437553df0e491f926b8748bf88809e76a
MdePkg DxeHobLib: Make GetHobList working before Constructor is called

The latest PiSmmCore driver added several debug messages in the
function SmmAddMemoryRegion in Page.c. The function SmmAddMemoryRegion
is called by the library constructor
PiSmmCoreMemoryAllocationLibConstructor.

When PiSmmCoreMemoryAllocationLibConstructor is executed, the
constructor of DxeHobLib (HobLibConstructor in HobLib.c) is not
executed yet. But platform instance of DebugLib may need get hob
before printing any message. As a result, an ASSERT happens in the
function GetHobList.

The patch is to update GetHobList to get HOB list from system
configuration table when the HOB list is not retrieved and not cached
yet, and HobLibConstructor is also to be updated to just call
GetHobList.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/DxeHobLib/HobLib.c