示例#1
0
文件: Platform.c 项目: matsufan/edk2
/**
  Perform Platform PEI initialization.

  @param  FileHandle      Handle of the file being invoked.
  @param  PeiServices     Describes the list of possible PEI Services.

  @return EFI_SUCCESS     The PEIM initialized successfully.

**/
EFI_STATUS
EFIAPI
InitializePlatform (
  IN       EFI_PEI_FILE_HANDLE  FileHandle,
  IN CONST EFI_PEI_SERVICES     **PeiServices
  )
{
  EFI_STATUS            Status;
  EFI_PHYSICAL_ADDRESS  TopOfMemory;
  BOOLEAN               Xen;

  DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));

  DebugDumpCmos ();

  TopOfMemory = MemDetect ();

  Status = InitializeXen ();
  Xen = EFI_ERROR (Status) ? FALSE : TRUE;

  ReserveEmuVariableNvStore ();

  PeiFvInitialization ();

  MemMapInitialization (TopOfMemory);

  MiscInitialization (Xen);

  BootModeInitialization ();

  return EFI_SUCCESS;
}
示例#2
0
文件: Platform.c 项目: B-Rich/edk2
/**
  Perform Platform PEI initialization.

  @param  FileHandle      Handle of the file being invoked.
  @param  PeiServices     Describes the list of possible PEI Services.

  @return EFI_SUCCESS     The PEIM initialized successfully.

**/
EFI_STATUS
EFIAPI
InitializePlatform (
  IN       EFI_PEI_FILE_HANDLE  FileHandle,
  IN CONST EFI_PEI_SERVICES     **PeiServices
  )
{
  EFI_PHYSICAL_ADDRESS  TopOfMemory;
  UINT32 XenLeaf;

  TopOfMemory = 0;

  DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));

  DebugDumpCmos ();

  XenLeaf = XenDetect ();

  if (XenLeaf != 0) {
    PublishPeiMemory ();
    PcdSetBool (PcdPciDisableBusEnumeration, TRUE);
  } else {
    TopOfMemory = MemDetect ();
  }

  if (XenLeaf != 0) {
    DEBUG ((EFI_D_INFO, "Xen was detected\n"));
    InitializeXen (XenLeaf);
  }

  ReserveEmuVariableNvStore ();

  PeiFvInitialization ();

  if (XenLeaf != 0) {
    XenMemMapInitialization ();
  } else {
    MemMapInitialization (TopOfMemory);
  }

  MiscInitialization ();

  BootModeInitialization ();

  return EFI_SUCCESS;
}