]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Core: Remove PcdFrameworkCompatibilitySupport usage
authorDandan Bi <dandan.bi@intel.com>
Sun, 28 Apr 2019 13:31:31 +0000 (21:31 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 9 May 2019 01:42:55 +0000 (09:42 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1464

Currently Framework compatibility is not needed and
PcdFrameworkCompatibilitySupport will be removed from edk2.
So remove the usage of this PCD firstly.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdeModulePkg/Core/Dxe/DxeMain.inf
MdeModulePkg/Core/Dxe/Image/Image.c
MdeModulePkg/Core/Dxe/Image/Image.h
MdeModulePkg/Core/Pei/FwVol/FwVol.c
MdeModulePkg/Core/Pei/PeiMain.inf

index 8dee5bee0aa794cbdf951b2b2c6626cf59a71fe4..61161bee28e14dff335aa6162ef331d00a5605bb 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 #  It provides an implementation of DXE Core that is compliant with DXE CIS.\r
 #\r
-#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 ##\r
   ## PRODUCES\r
   ## SOMETIMES_CONSUMES\r
   gEfiDecompressProtocolGuid\r
-  gEfiLoadPeImageProtocolGuid                   ## SOMETIMES_PRODUCES   # Produces when PcdFrameworkCompatibilitySupport is set\r
   gEfiSimpleFileSystemProtocolGuid              ## SOMETIMES_CONSUMES\r
   gEfiLoadFileProtocolGuid                      ## SOMETIMES_CONSUMES\r
   gEfiLoadFile2ProtocolGuid                     ## SOMETIMES_CONSUMES\r
   gEfiCapsuleArchProtocolGuid                   ## CONSUMES\r
   gEfiWatchdogTimerArchProtocolGuid             ## CONSUMES\r
 \r
-[FeaturePcd]\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport     ## CONSUMES\r
-\r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber    ## SOMETIMES_CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber     ## SOMETIMES_CONSUMES\r
index de5b8bed27ad6c019dcf1925a52f30898c39a10c..22a87ecf6d7ce1b3ef8e682929af338f5a937547 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Core image handling services to load and unload PeImage.\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -14,15 +14,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //\r
 LOADED_IMAGE_PRIVATE_DATA  *mCurrentImage = NULL;\r
 \r
-LOAD_PE32_IMAGE_PRIVATE_DATA  mLoadPe32PrivateData = {\r
-  LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE,\r
-  NULL,\r
-  {\r
-    CoreLoadImageEx,\r
-    CoreUnloadImageEx\r
-  }\r
-};\r
-\r
 typedef struct {\r
   LIST_ENTRY                            Link;\r
   EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL  *Emulator;\r
@@ -276,18 +267,6 @@ CoreInitializeImageServices (
 \r
   InitializeListHead (&mAvailableEmulators);\r
 \r
-  if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {\r
-    //\r
-    // Export DXE Core PE Loader functionality for backward compatibility.\r
-    //\r
-    Status = CoreInstallProtocolInterface (\r
-               &mLoadPe32PrivateData.Handle,\r
-               &gEfiLoadPeImageProtocolGuid,\r
-               EFI_NATIVE_INTERFACE,\r
-               &mLoadPe32PrivateData.Pe32Image\r
-               );\r
-  }\r
-\r
   ProtectUefiImage (&Image->Info, Image->LoadedImageDevicePath);\r
 \r
   return Status;\r
@@ -1566,92 +1545,6 @@ CoreLoadImage (
   return Status;\r
 }\r
 \r
-\r
-\r
-/**\r
-  Loads an EFI image into memory and returns a handle to the image with extended parameters.\r
-\r
-  @param  This                    Calling context\r
-  @param  ParentImageHandle       The caller's image handle.\r
-  @param  FilePath                The specific file path from which the image is\r
-                                  loaded.\r
-  @param  SourceBuffer            If not NULL, a pointer to the memory location\r
-                                  containing a copy of the image to be loaded.\r
-  @param  SourceSize              The size in bytes of SourceBuffer.\r
-  @param  DstBuffer               The buffer to store the image.\r
-  @param  NumberOfPages           For input, specifies the space size of the\r
-                                  image by caller if not NULL. For output,\r
-                                  specifies the actual space size needed.\r
-  @param  ImageHandle             Image handle for output.\r
-  @param  EntryPoint              Image entry point for output.\r
-  @param  Attribute               The bit mask of attributes to set for the load\r
-                                  PE image.\r
-\r
-  @retval EFI_SUCCESS             The image was loaded into memory.\r
-  @retval EFI_NOT_FOUND           The FilePath was not found.\r
-  @retval EFI_INVALID_PARAMETER   One of the parameters has an invalid value.\r
-  @retval EFI_UNSUPPORTED         The image type is not supported, or the device\r
-                                  path cannot be parsed to locate the proper\r
-                                  protocol for loading the file.\r
-  @retval EFI_OUT_OF_RESOURCES    Image was not loaded due to insufficient\r
-                                  resources.\r
-  @retval EFI_LOAD_ERROR          Image was not loaded because the image format was corrupt or not\r
-                                  understood.\r
-  @retval EFI_DEVICE_ERROR        Image was not loaded because the device returned a read error.\r
-  @retval EFI_ACCESS_DENIED       Image was not loaded because the platform policy prohibits the\r
-                                  image from being loaded. NULL is returned in *ImageHandle.\r
-  @retval EFI_SECURITY_VIOLATION  Image was loaded and an ImageHandle was created with a\r
-                                  valid EFI_LOADED_IMAGE_PROTOCOL. However, the current\r
-                                  platform policy specifies that the image should not be started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CoreLoadImageEx (\r
-  IN  EFI_PE32_IMAGE_PROTOCOL          *This,\r
-  IN  EFI_HANDLE                       ParentImageHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL         *FilePath,\r
-  IN  VOID                             *SourceBuffer       OPTIONAL,\r
-  IN  UINTN                            SourceSize,\r
-  IN  EFI_PHYSICAL_ADDRESS             DstBuffer           OPTIONAL,\r
-  OUT UINTN                            *NumberOfPages      OPTIONAL,\r
-  OUT EFI_HANDLE                       *ImageHandle,\r
-  OUT EFI_PHYSICAL_ADDRESS             *EntryPoint         OPTIONAL,\r
-  IN  UINT32                           Attribute\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-  EFI_HANDLE    Handle;\r
-\r
-  PERF_LOAD_IMAGE_BEGIN (NULL);\r
-\r
-  Status = CoreLoadImageCommon (\r
-           TRUE,\r
-           ParentImageHandle,\r
-           FilePath,\r
-           SourceBuffer,\r
-           SourceSize,\r
-           DstBuffer,\r
-           NumberOfPages,\r
-           ImageHandle,\r
-           EntryPoint,\r
-           Attribute\r
-           );\r
-\r
-  Handle = NULL;\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // ImageHandle will be valid only Status is success.\r
-    //\r
-    Handle = *ImageHandle;\r
-  }\r
-\r
-  PERF_LOAD_IMAGE_END (Handle);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
 /**\r
   Transfer control to a loaded image's entry point.\r
 \r
@@ -2012,26 +1905,3 @@ CoreUnloadImage (
 Done:\r
   return Status;\r
 }\r
-\r
-\r
-\r
-/**\r
-  Unload the specified image.\r
-\r
-  @param  This                    Indicates the calling context.\r
-  @param  ImageHandle             The specified image handle.\r
-\r
-  @retval EFI_INVALID_PARAMETER   Image handle is NULL.\r
-  @retval EFI_UNSUPPORTED         Attempt to unload an unsupported image.\r
-  @retval EFI_SUCCESS             Image successfully unloaded.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CoreUnloadImageEx (\r
-  IN EFI_PE32_IMAGE_PROTOCOL  *This,\r
-  IN EFI_HANDLE                         ImageHandle\r
-  )\r
-{\r
-  return CoreUnloadImage (ImageHandle);\r
-}\r
index 6020a27371b7f759a8d55bda332bbcb85db4bd91..e9c44ab2a7f724780e36d60f744a9d9830032ad0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Data structure and functions to load and unload PeImage.\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -10,19 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #ifndef _IMAGE_H_\r
 #define _IMAGE_H_\r
 \r
-#define LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE  SIGNATURE_32('l','p','e','i')\r
-\r
-typedef struct {\r
-  UINTN                       Signature;\r
-  /// Image handle\r
-  EFI_HANDLE                  Handle;\r
-  EFI_PE32_IMAGE_PROTOCOL     Pe32Image;\r
-} LOAD_PE32_IMAGE_PRIVATE_DATA;\r
-\r
-#define LOAD_PE32_IMAGE_PRIVATE_DATA_FROM_THIS(a) \\r
-          CR(a, LOAD_PE32_IMAGE_PRIVATE_DATA, Pe32Image, LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE)\r
-\r
-\r
 //\r
 // Private Data Types\r
 //\r
@@ -34,74 +21,4 @@ typedef struct {
   UINTN               SourceSize;\r
 } IMAGE_FILE_HANDLE;\r
 \r
-/**\r
-  Loads an EFI image into memory and returns a handle to the image with extended parameters.\r
-\r
-  @param  This                    Calling context\r
-  @param  ParentImageHandle       The caller's image handle.\r
-  @param  FilePath                The specific file path from which the image is\r
-                                  loaded.\r
-  @param  SourceBuffer            If not NULL, a pointer to the memory location\r
-                                  containing a copy of the image to be loaded.\r
-  @param  SourceSize              The size in bytes of SourceBuffer.\r
-  @param  DstBuffer               The buffer to store the image.\r
-  @param  NumberOfPages           For input, specifies the space size of the\r
-                                  image by caller if not NULL. For output,\r
-                                  specifies the actual space size needed.\r
-  @param  ImageHandle             Image handle for output.\r
-  @param  EntryPoint              Image entry point for output.\r
-  @param  Attribute               The bit mask of attributes to set for the load\r
-                                  PE image.\r
-\r
-  @retval EFI_SUCCESS             The image was loaded into memory.\r
-  @retval EFI_NOT_FOUND           The FilePath was not found.\r
-  @retval EFI_INVALID_PARAMETER   One of the parameters has an invalid value.\r
-  @retval EFI_UNSUPPORTED         The image type is not supported, or the device\r
-                                  path cannot be parsed to locate the proper\r
-                                  protocol for loading the file.\r
-  @retval EFI_OUT_OF_RESOURCES    Image was not loaded due to insufficient\r
-                                  resources.\r
-  @retval EFI_LOAD_ERROR          Image was not loaded because the image format was corrupt or not\r
-                                  understood.\r
-  @retval EFI_DEVICE_ERROR        Image was not loaded because the device returned a read error.\r
-  @retval EFI_ACCESS_DENIED       Image was not loaded because the platform policy prohibits the\r
-                                  image from being loaded. NULL is returned in *ImageHandle.\r
-  @retval EFI_SECURITY_VIOLATION  Image was loaded and an ImageHandle was created with a\r
-                                  valid EFI_LOADED_IMAGE_PROTOCOL. However, the current\r
-                                  platform policy specifies that the image should not be started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CoreLoadImageEx (\r
-  IN  EFI_PE32_IMAGE_PROTOCOL          *This,\r
-  IN  EFI_HANDLE                       ParentImageHandle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL         *FilePath,\r
-  IN  VOID                             *SourceBuffer       OPTIONAL,\r
-  IN  UINTN                            SourceSize,\r
-  IN  EFI_PHYSICAL_ADDRESS             DstBuffer           OPTIONAL,\r
-  OUT UINTN                            *NumberOfPages      OPTIONAL,\r
-  OUT EFI_HANDLE                       *ImageHandle,\r
-  OUT EFI_PHYSICAL_ADDRESS             *EntryPoint         OPTIONAL,\r
-  IN  UINT32                           Attribute\r
-  );\r
-\r
-\r
-/**\r
-  Unload the specified image.\r
-\r
-  @param  This                    Indicates the calling context.\r
-  @param  ImageHandle             The specified image handle.\r
-\r
-  @retval EFI_INVALID_PARAMETER   Image handle is NULL.\r
-  @retval EFI_UNSUPPORTED         Attempt to unload an unsupported image.\r
-  @retval EFI_SUCCESS             Image successfully unloaded.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-CoreUnloadImageEx (\r
-  IN EFI_PE32_IMAGE_PROTOCOL  *This,\r
-  IN EFI_HANDLE                         ImageHandle\r
-  );\r
 #endif\r
index f817ba04e2792b38d0b404c626bfea68037b0595..709db00694c2d7013a2bc4e6c01928f40c3bb123 100644 (file)
@@ -1094,15 +1094,6 @@ PeiFfsFindNextFile (
 \r
   CoreFvHandle = FvHandleToCoreHandle (FvHandle);\r
 \r
-  //\r
-  // To make backward compatiblity, if can not find corresponding the handle of FV\r
-  // then treat FV as build-in FFS2/FFS3 format and memory mapped FV that FV handle is pointed\r
-  // to the address of first byte of FV.\r
-  //\r
-  if ((CoreFvHandle == NULL) && FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {\r
-    return FindFileEx (FvHandle, NULL, SearchType, FileHandle, NULL);\r
-  }\r
-\r
   if ((CoreFvHandle == NULL) || CoreFvHandle->FvPpi == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
@@ -2111,62 +2102,6 @@ FindNextCoreFvHandle (
   IN UINTN              Instance\r
   )\r
 {\r
-  UINTN                    Index;\r
-  BOOLEAN                  Match;\r
-  EFI_HOB_FIRMWARE_VOLUME  *FvHob;\r
-\r
-  //\r
-  // Handle Framework FvHob and Install FvInfo Ppi for it.\r
-  //\r
-  if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {\r
-    //\r
-    // Loop to search the wanted FirmwareVolume which supports FFS\r
-    //\r
-    FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetFirstHob (EFI_HOB_TYPE_FV);\r
-    while (FvHob != NULL) {\r
-      //\r
-      // Search whether FvHob has been installed into PeiCore's FV database.\r
-      // If found, no need install new FvInfoPpi for it.\r
-      //\r
-      for (Index = 0, Match = FALSE; Index < Private->FvCount; Index++) {\r
-        if ((EFI_PEI_FV_HANDLE)(UINTN)FvHob->BaseAddress == Private->Fv[Index].FvHeader) {\r
-          Match = TRUE;\r
-          break;\r
-        }\r
-      }\r
-\r
-      //\r
-      // Search whether FvHob has been cached into PeiCore's Unknown FV database.\r
-      // If found, no need install new FvInfoPpi for it.\r
-      //\r
-      if (!Match) {\r
-        for (Index = 0; Index < Private->UnknownFvInfoCount; Index ++) {\r
-          if ((UINTN)FvHob->BaseAddress == (UINTN)Private->UnknownFvInfo[Index].FvInfo) {\r
-            Match = TRUE;\r
-            break;\r
-          }\r
-        }\r
-      }\r
-\r
-      //\r
-      // If the Fv in FvHob has not been installed into PeiCore's FV database and has\r
-      // not been cached into PeiCore's Unknown FV database, install a new FvInfoPpi\r
-      // for it then PeiCore will dispatch it in callback of FvInfoPpi.\r
-      //\r
-      if (!Match) {\r
-        PeiServicesInstallFvInfoPpi (\r
-          &(((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHob->BaseAddress)->FileSystemGuid),\r
-          (VOID *)(UINTN)FvHob->BaseAddress,\r
-          (UINT32)FvHob->Length,\r
-          NULL,\r
-          NULL\r
-          );\r
-      }\r
-\r
-      FvHob = (EFI_HOB_FIRMWARE_VOLUME *)GetNextHob (EFI_HOB_TYPE_FV, (VOID *)((UINTN)FvHob + FvHob->Header.HobLength));\r
-    }\r
-  }\r
-\r
   if (Instance >= Private->FvCount) {\r
     return NULL;\r
   }\r
index c8a6d5b80b137ea0270db7950f34f2e0ccffbd4a..7c482dacfc34cd875af764b712dad33f63985e38 100644 (file)
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize                  ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst  ## CONSUMES\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport           ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressPeiCodePageNumber         ## SOMETIMES_CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber    ## SOMETIMES_CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber     ## SOMETIMES_CONSUMES\r