Re: [edk2] [PATCH] MdeModulePkg DxeCore: Call PeCoffExtraActionLib member after Constructor

2016-04-21 Thread Yao, Jiewen
Reviewed by: jiewen@intel.com



> -Original Message-
> From: Zeng, Star
> Sent: Thursday, April 21, 2016 9:55 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen ; Gao, Liming
> ; Tian, Feng 
> Subject: [PATCH] MdeModulePkg DxeCore: Call PeCoffExtraActionLib
> member after Constructor
> 
> Originally, the code block for "Report DXE Core image information to the
> PE/COFF
> Extra Action Library" was after ProcessLibraryConstructorList(). To fix an
> issue,
> ProcessLibraryConstructorList() was moved to be right after
> CoreInitializeGcdServices()
> at c5d5379937629f3061d08b8d9a3386a40152ca2c, but the code block was
> left.
> 
> As there maybe PeCoffExtraActionLib implementation need Constructor
> executed first,
> the patch is to move the code block for "Report DXE Core image information
> to the PE/COFF
> Extra Action Library" to be after ProcessLibraryConstructorList.
> 
> Cc: Jiewen Yao 
> Cc: Liming Gao 
> Cc: Feng Tian 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Star Zeng 
> ---
>  MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 26
> +-
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
> b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
> index 20ff02f663b2..a458d6b64fee 100644
> --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
> +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
> @@ -291,19 +291,6 @@ DxeMain (
>ASSERT_EFI_ERROR (Status);
> 
>//
> -  // Report DXE Core image information to the PE/COFF Extra Action
> Library
> -  //
> -  ZeroMem (&ImageContext, sizeof (ImageContext));
> -  ImageContext.ImageAddress   =
> (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
> -  ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer
> ((VOID*)(UINTN)ImageContext.ImageAddress);
> -  ImageContext.SizeOfHeaders  = PeCoffGetSizeOfHeaders
> ((VOID*)(UINTN)ImageContext.ImageAddress);
> -  Status = PeCoffLoaderGetEntryPoint
> ((VOID*)(UINTN)ImageContext.ImageAddress, &EntryPoint);
> -  if (Status == EFI_SUCCESS) {
> -ImageContext.EntryPoint =
> (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
> -  }
> -  PeCoffLoaderRelocateImageExtraAction (&ImageContext);
> -
> -  //
>// Initialize the Global Coherency Domain Services
>//
>Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress,
> MemoryLength);
> @@ -317,6 +304,19 @@ DxeMain (
>PERF_START (NULL,"DXE", NULL, 0) ;
> 
>//
> +  // Report DXE Core image information to the PE/COFF Extra Action
> Library
> +  //
> +  ZeroMem (&ImageContext, sizeof (ImageContext));
> +  ImageContext.ImageAddress   =
> (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
> +  ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer
> ((VOID*)(UINTN)ImageContext.ImageAddress);
> +  ImageContext.SizeOfHeaders  = PeCoffGetSizeOfHeaders
> ((VOID*)(UINTN)ImageContext.ImageAddress);
> +  Status = PeCoffLoaderGetEntryPoint
> ((VOID*)(UINTN)ImageContext.ImageAddress, &EntryPoint);
> +  if (Status == EFI_SUCCESS) {
> +ImageContext.EntryPoint =
> (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
> +  }
> +  PeCoffLoaderRelocateImageExtraAction (&ImageContext);
> +
> +  //
>// Install the DXE Services Table into the EFI System Tables's
> Configuration Table
>//
>Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid,
> gDxeCoreDS);
> --
> 2.7.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] MdeModulePkg DxeCore: Call PeCoffExtraActionLib member after Constructor

2016-04-20 Thread Star Zeng
Originally, the code block for "Report DXE Core image information to the PE/COFF
Extra Action Library" was after ProcessLibraryConstructorList(). To fix an 
issue,
ProcessLibraryConstructorList() was moved to be right after 
CoreInitializeGcdServices()
at c5d5379937629f3061d08b8d9a3386a40152ca2c, but the code block was left.

As there maybe PeCoffExtraActionLib implementation need Constructor executed 
first,
the patch is to move the code block for "Report DXE Core image information to 
the PE/COFF
Extra Action Library" to be after ProcessLibraryConstructorList.

Cc: Jiewen Yao 
Cc: Liming Gao 
Cc: Feng Tian 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng 
---
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c 
b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 20ff02f663b2..a458d6b64fee 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -291,19 +291,6 @@ DxeMain (
   ASSERT_EFI_ERROR (Status);
 
   //
-  // Report DXE Core image information to the PE/COFF Extra Action Library
-  //
-  ZeroMem (&ImageContext, sizeof (ImageContext));
-  ImageContext.ImageAddress   = 
(EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
-  ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer 
((VOID*)(UINTN)ImageContext.ImageAddress);
-  ImageContext.SizeOfHeaders  = PeCoffGetSizeOfHeaders 
((VOID*)(UINTN)ImageContext.ImageAddress);
-  Status = PeCoffLoaderGetEntryPoint ((VOID*)(UINTN)ImageContext.ImageAddress, 
&EntryPoint);
-  if (Status == EFI_SUCCESS) {
-ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
-  }
-  PeCoffLoaderRelocateImageExtraAction (&ImageContext);
-
-  //
   // Initialize the Global Coherency Domain Services
   //
   Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, 
MemoryLength);
@@ -317,6 +304,19 @@ DxeMain (
   PERF_START (NULL,"DXE", NULL, 0) ;
 
   //
+  // Report DXE Core image information to the PE/COFF Extra Action Library
+  //
+  ZeroMem (&ImageContext, sizeof (ImageContext));
+  ImageContext.ImageAddress   = 
(EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
+  ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer 
((VOID*)(UINTN)ImageContext.ImageAddress);
+  ImageContext.SizeOfHeaders  = PeCoffGetSizeOfHeaders 
((VOID*)(UINTN)ImageContext.ImageAddress);
+  Status = PeCoffLoaderGetEntryPoint ((VOID*)(UINTN)ImageContext.ImageAddress, 
&EntryPoint);
+  if (Status == EFI_SUCCESS) {
+ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
+  }
+  PeCoffLoaderRelocateImageExtraAction (&ImageContext);
+
+  //
   // Install the DXE Services Table into the EFI System Tables's Configuration 
Table
   //
   Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, 
gDxeCoreDS);
-- 
2.7.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel