VirtualBox

Ignore:
Timestamp:
Mar 31, 2025 11:31:09 AM (2 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168237
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable202502 from the vendor branch and make it build for the important platforms, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c

    r99404 r108794  
    1818#include <Library/MemoryAllocationLib.h>
    1919#include <Library/BaseMemoryLib.h>
    20 
     20#include <Guid/UniversalPayloadBase.h>
    2121#include "ElfLib.h"
     22
     23CONST EFI_PEI_PPI_DESCRIPTOR  gReadyToPayloadSignalPpi = {
     24  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
     25  &gUplReadyToPayloadPpiGuid,
     26  NULL
     27};
     28
     29/**
     30  Notify ReadyToPayLoad signal.
     31  @param[in] PeiServices       An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
     32  @param[in] NotifyDescriptor  Address of the notification descriptor data structure.
     33  @param[in] Ppi               Address of the PPI that was installed.
     34  @retval EFI_SUCCESS          Hobs data is discovered.
     35  @return Others               No Hobs data is discovered.
     36**/
     37EFI_STATUS
     38EFIAPI
     39EndOfPeiPpiNotifyCallback (
     40  IN EFI_PEI_SERVICES           **PeiServices,
     41  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
     42  IN VOID                       *Ppi
     43  )
     44{
     45  EFI_STATUS  Status;
     46
     47  //
     48  // Ready to Payload phase signal
     49  //
     50  Status = PeiServicesInstallPpi (&gReadyToPayloadSignalPpi);
     51
     52  return Status;
     53}
     54
     55EFI_PEI_NOTIFY_DESCRIPTOR  mEndOfPeiNotifyList[] = {
     56  {
     57    (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
     58    &gEfiEndOfPeiSignalPpiGuid,
     59    EndOfPeiPpiNotifyCallback
     60  }
     61};
    2262
    2363/**
     
    4888  VOID                          *Elf;
    4989  UNIVERSAL_PAYLOAD_EXTRA_DATA  *ExtraData;
     90  UNIVERSAL_PAYLOAD_BASE        *PayloadBase;
    5091  ELF_IMAGE_CONTEXT             Context;
    5192  UINT32                        Index;
     
    74115  } while (EFI_ERROR (Status));
    75116
    76   DEBUG ((
    77     DEBUG_INFO,
    78     "Payload File Size: 0x%08X, Mem Size: 0x%08x, Reload: %d\n",
    79     Context.FileSize,
    80     Context.ImageSize,
    81     Context.ReloadRequired
    82     ));
     117  Length      = sizeof (UNIVERSAL_PAYLOAD_BASE);
     118  PayloadBase = BuildGuidHob (
     119                  &gUniversalPayloadBaseGuid,
     120                  Length
     121                  );
     122  PayloadBase->Entry = (EFI_PHYSICAL_ADDRESS)Context.FileBase;
     123
     124  DEBUG (
     125    (
     126     DEBUG_INFO,
     127     "Payload File Size: 0x%08X, Mem Size: 0x%08x, Reload: %d\n",
     128     Context.FileSize,
     129     Context.ImageSize,
     130     Context.ReloadRequired
     131    )
     132    );
    83133
    84134  //
     
    154204  }
    155205
     206  DEBUG ((DEBUG_INFO, "LoadElfImage :%r, EntryPoint :%x\n", Status, (UINTN)Context.EntryPoint));
     207
     208  Status = PeiServicesNotifyPpi (&mEndOfPeiNotifyList[0]);
     209  ASSERT_EFI_ERROR (Status);
     210
    156211  return Status;
    157212}
     
    174229  @param  PeiServices Describes the list of possible PEI Services.
    175230
    176   @retval EFI_SUCESS The entry point executes successfully.
     231  @retval EFI_SUCCESS The entry point executes successfully.
    177232  @retval Others      Some error occurs during the execution of this function.
    178233
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette