]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DxeCore: remove explicit EBC handling
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 14 Sep 2018 19:11:47 +0000 (21:11 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 15 Apr 2019 01:37:39 +0000 (18:37 -0700)
Now that the EBC machine type is no longer classified as a
natively supported machine type on the architectures that can
support it via the EBC interpreter, the EBC specific handling
in DXE core is no longer used and can be removed.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
MdeModulePkg/Core/Dxe/DxeMain.h
MdeModulePkg/Core/Dxe/DxeMain.inf
MdeModulePkg/Core/Dxe/Image/Image.c

index bbb424bdb00ac59c095fb5cb3ff11361fb936219..6a64852730fb08015b4b861913e7562ce5013851 100644 (file)
@@ -36,7 +36,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Protocol/LoadPe32Image.h>\r
 #include <Protocol/Security.h>\r
 #include <Protocol/Security2.h>\r
-#include <Protocol/Ebc.h>\r
 #include <Protocol/Reset.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/Metronome.h>\r
@@ -221,8 +220,6 @@ typedef struct {
   BASE_LIBRARY_JUMP_BUFFER    *JumpContext;\r
   /// Machine type from PE image\r
   UINT16                      Machine;\r
-  /// EBC Protocol pointer\r
-  EFI_EBC_PROTOCOL            *Ebc;\r
   /// PE/COFF Image Emulator Protocol pointer\r
   EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL  *PeCoffEmu;\r
   /// Runtime image list\r
index d4b3912b5e6ebf1dd82211abb7b56426a7208446..8dee5bee0aa794cbdf951b2b2c6626cf59a71fe4 100644 (file)
   gEfiLoadedImageProtocolGuid                   ## PRODUCES\r
   gEfiLoadedImageDevicePathProtocolGuid         ## PRODUCES\r
   gEfiHiiPackageListProtocolGuid                ## SOMETIMES_PRODUCES\r
-  gEfiEbcProtocolGuid                           ## SOMETIMES_CONSUMES\r
   gEfiSmmBase2ProtocolGuid                      ## SOMETIMES_CONSUMES\r
   gEdkiiPeCoffImageEmulatorProtocolGuid         ## SOMETIMES_CONSUMES\r
 \r
index 7ff1dfec5173ff5128895ccbdbbc2952d8a5491d..08306a73fdbfd5ecdb1252b52ecdb7b5e20f5db9 100644 (file)
@@ -69,7 +69,6 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage  = {
   NULL,                       // JumpBuffer\r
   NULL,                       // JumpContext\r
   0,                          // Machine\r
-  NULL,                       // Ebc\r
   NULL,                       // PeCoffEmu\r
   NULL,                       // RuntimeData\r
   NULL                        // LoadedImageDevicePath\r
@@ -86,9 +85,6 @@ typedef struct {
   CHAR16  *MachineTypeName;\r
 } MACHINE_TYPE_INFO;\r
 \r
-//\r
-// EBC machine is not listed in this table, because EBC is in the default supported scopes of other machine type.\r
-//\r
 GLOBAL_REMOVE_IF_UNREFERENCED MACHINE_TYPE_INFO  mMachineTypeInfo[] = {\r
   {EFI_IMAGE_MACHINE_IA32,           L"IA32"},\r
   {EFI_IMAGE_MACHINE_IA64,           L"IA64"},\r
@@ -768,51 +764,15 @@ CoreLoadPeImage (
   InvalidateInstructionCacheRange ((VOID *)(UINTN)Image->ImageContext.ImageAddress, (UINTN)Image->ImageContext.ImageSize);\r
 \r
   //\r
-  // Copy the machine type from the context to the image private data. This\r
-  // is needed during image unload to know if we should call an EBC protocol\r
-  // to unload the image.\r
+  // Copy the machine type from the context to the image private data.\r
   //\r
   Image->Machine = Image->ImageContext.Machine;\r
 \r
   //\r
-  // Get the image entry point. If it's an EBC image, then call into the\r
-  // interpreter to create a thunk for the entry point and use the returned\r
-  // value for the entry point.\r
+  // Get the image entry point.\r
   //\r
   Image->EntryPoint   = (EFI_IMAGE_ENTRY_POINT)(UINTN)Image->ImageContext.EntryPoint;\r
-  if (Image->ImageContext.Machine == EFI_IMAGE_MACHINE_EBC) {\r
-    //\r
-    // Locate the EBC interpreter protocol\r
-    //\r
-    Status = CoreLocateProtocol (&gEfiEbcProtocolGuid, NULL, (VOID **)&Image->Ebc);\r
-    if (EFI_ERROR(Status) || Image->Ebc == NULL) {\r
-      DEBUG ((DEBUG_LOAD | DEBUG_ERROR, "CoreLoadPeImage: There is no EBC interpreter for an EBC image.\n"));\r
-      goto Done;\r
-    }\r
-\r
-    //\r
-    // Register a callback for flushing the instruction cache so that created\r
-    // thunks can be flushed.\r
-    //\r
-    Status = Image->Ebc->RegisterICacheFlush (Image->Ebc, (EBC_ICACHE_FLUSH)InvalidateInstructionCacheRange);\r
-    if (EFI_ERROR(Status)) {\r
-      goto Done;\r
-    }\r
-\r
-    //\r
-    // Create a thunk for the image's entry point. This will be the new\r
-    // entry point for the image.\r
-    //\r
-    Status = Image->Ebc->CreateThunk (\r
-                           Image->Ebc,\r
-                           Image->Handle,\r
-                           (VOID *)(UINTN) Image->ImageContext.EntryPoint,\r
-                           (VOID **) &Image->EntryPoint\r
-                           );\r
-    if (EFI_ERROR(Status)) {\r
-      goto Done;\r
-    }\r
-  } else if (Image->PeCoffEmu != NULL) {\r
+  if (Image->PeCoffEmu != NULL) {\r
     Status = Image->PeCoffEmu->RegisterImage (Image->PeCoffEmu,\r
                                  Image->ImageBasePage,\r
                                  EFI_PAGES_TO_SIZE (Image->NumberOfPages),\r
@@ -1002,13 +962,6 @@ CoreUnloadAndCloseImage (
 \r
   UnprotectUefiImage (&Image->Info, Image->LoadedImageDevicePath);\r
 \r
-  if (Image->Ebc != NULL) {\r
-    //\r
-    // If EBC protocol exists we must perform cleanups for this image.\r
-    //\r
-    Image->Ebc->UnloadImage (Image->Ebc, Image->Handle);\r
-  }\r
-\r
   if (Image->PeCoffEmu != NULL) {\r
     //\r
     // If the PE/COFF Emulator protocol exists we must unregister the image.\r