]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Image/Image.c
MdeModulePkg/DxeCore: remove explicit EBC handling
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Image / Image.c
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