From 8472f1f59d63f3fc5df3c9ae52ffb26c7bb757a6 Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Thu, 8 Nov 2012 01:12:56 +0000 Subject: Build the registered guid HOB and SystemTable to record the GUID itself in PeiExtractGuidedSectionLib and DxeExtractGuidedSectionLib, and also state the restriction in BaseExtractGuidedSectionLib. Signed-off-by: Star Zeng Reviewed-by: Michael Kinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13930 6f19259b-4bc3-4df7-8a09-765794883524 --- .../BaseExtractGuidedSectionLib.inf | 7 +++++-- .../DxeExtractGuidedSectionLib.c | 16 ++++++++++++++-- .../DxeExtractGuidedSectionLib.inf | 3 ++- .../PeiExtractGuidedSectionLib.c | 12 +++++++++++- 4 files changed, 32 insertions(+), 6 deletions(-) (limited to 'MdePkg') diff --git a/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf b/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf index ffa2c5fddd..b0930e1027 100644 --- a/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf +++ b/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf @@ -7,8 +7,11 @@ # in their initialization without any issues. They only have to be careful in # the implementation of runtime services, because this BASE library instance doesn't # convert the address pointed by PcdGuidedExtractHandlerTableAddress to the virtual address. -# -# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+# And a driver should use this ExtractGuidedSectionLib to do implementation internally, also +# this ExtractGuidedSectionLib couldn't be used for guided section extraction that is required +# by PEI and DXE core for recovery or capsule image processing, etc. +# +# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License diff --git a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c index 609b329f62..567f09122d 100644 --- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c +++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c @@ -1,7 +1,7 @@ /** @file Provide generic extract guided section functions for Dxe phase. - Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -18,6 +18,7 @@ #include #include #include +#include #define EXTRACT_HANDLER_TABLE_SIZE 0x10 @@ -175,6 +176,8 @@ ExtractGuidedSectionRegisterHandlers ( ) { UINT32 Index; + VOID *GuidData; + // // Check input paramter. // @@ -211,7 +214,16 @@ ExtractGuidedSectionRegisterHandlers ( CopyGuid (&mExtractHandlerGuidTable [mNumberOfExtractHandler], SectionGuid); mExtractDecodeHandlerTable [mNumberOfExtractHandler] = DecodeHandler; mExtractGetInfoHandlerTable [mNumberOfExtractHandler++] = GetInfoHandler; - + + // + // Install the Guided Section GUID configuration table to record the GUID itself. + // Then the content of the configuration table buffer will be the same as the GUID value itself. + // + GuidData = AllocateCopyPool (sizeof (GUID), (VOID *) SectionGuid); + if (GuidData != NULL) { + gBS->InstallConfigurationTable ((EFI_GUID *) SectionGuid, GuidData); + } + return RETURN_SUCCESS; } diff --git a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf index 08e6f050ba..1b4acf1060 100644 --- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf +++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf @@ -3,7 +3,7 @@ # # This library provides generic extract guided section functions for DXE module. # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -42,4 +42,5 @@ MemoryAllocationLib BaseMemoryLib DebugLib + UefiBootServicesTableLib diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c index ffb11273bd..c471ae9ab3 100644 --- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c +++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c @@ -1,7 +1,7 @@ /** @file Provide generic extract guided section functions for PEI phase. - Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -243,6 +243,16 @@ ExtractGuidedSectionRegisterHandlers ( HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler; HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler; + // + // Build the Guided Section GUID HOB to record the GUID itself. + // Then the content of the GUIDed HOB will be the same as the GUID value itself. + // + BuildGuidDataHob ( + (EFI_GUID *) SectionGuid, + (VOID *) SectionGuid, + sizeof (GUID) + ); + return RETURN_SUCCESS; } -- cgit v1.2.3