VirtualBox

Ignore:
Timestamp:
Mar 12, 2019 12:40:12 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
129295
Message:

EFI: First step in UDK2018 merge. Does not build yet.

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
1 deleted
16 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspInitPei/FindPeiCore.c

    r58464 r77662  
    147147  Find and return Pei Core entry point.
    148148
    149   It also find SEC and PEI Core file debug inforamtion. It will report them if
     149  It also find SEC and PEI Core file debug information. It will report them if
    150150  remote debug is enabled.
    151151
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspInitPei/SecMain.c

    r58464 r77662  
    6262
    6363  @param[in] SizeOfRam           Size of the temporary memory available for use.
    64   @param[in] TempRamBase         Base address of tempory ram
     64  @param[in] TempRamBase         Base address of temporary ram
    6565  @param[in] BootFirmwareVolume  Base address of the Boot Firmware Volume.
    6666**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspInitPei/SecMain.h

    r58464 r77662  
    5555
    5656  @param[in] SizeOfRam           Size of the temporary memory available for use.
    57   @param[in] TempRamBase         Base address of tempory ram
     57  @param[in] TempRamBase         Base address of temporary ram
    5858  @param[in] BootFirmwareVolume  Base address of the Boot Firmware Volume.
    5959**/
     
    6969  Find and return Pei Core entry point.
    7070
    71   It also find SEC and PEI Core file debug inforamtion. It will report them if
     71  It also find SEC and PEI Core file debug information. It will report them if
    7272  remote debug is enabled.
    7373
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspNotifyDxe/LoadBelow4G.c

    r58464 r77662  
    11/** @file
    22
    3 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
     3Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
    44
    55This program and the accompanying materials
     
    113113  ImageContext.ImageAddress = (PHYSICAL_ADDRESS)(UINTN)FfsBuffer;
    114114  //
    115   // Align buffer on section boundry
     115  // Align buffer on section boundary
    116116  //
    117117  ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;
    118   ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));
     118  ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)ImageContext.SectionAlignment - 1);
    119119  //
    120120  // Load the image to our new buffer
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspWrapperSecCore/FindPeiCore.c

    r58464 r77662  
    147147  Find and return Pei Core entry point.
    148148
    149   It also find SEC and PEI Core file debug inforamtion. It will report them if
     149  It also find SEC and PEI Core file debug information. It will report them if
    150150  remote debug is enabled.
    151151
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspWrapperSecCore/SecMain.c

    r58464 r77662  
    5353
    5454  @param[in] SizeOfRam           Size of the temporary memory available for use.
    55   @param[in] TempRamBase         Base address of tempory ram
     55  @param[in] TempRamBase         Base address of temporary ram
    5656  @param[in] BootFirmwareVolume  Base address of the Boot Firmware Volume.
    5757**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/FspWrapperSecCore/SecMain.h

    r58464 r77662  
    5454
    5555  @param[in] SizeOfRam           Size of the temporary memory available for use.
    56   @param[in] TempRamBase         Base address of tempory ram
     56  @param[in] TempRamBase         Base address of temporary ram
    5757  @param[in] BootFirmwareVolume  Base address of the Boot Firmware Volume.
    5858**/
     
    6868  Find and return Pei Core entry point.
    6969
    70   It also find SEC and PEI Core file debug inforamtion. It will report them if
     70  It also find SEC and PEI Core file debug information. It will report them if
    7171  remote debug is enabled.
    7272
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/IntelFspWrapperPkg.dsc

    r58466 r77662  
    22# Provides drivers and definitions to support fsp in EDKII bios.
    33#
    4 # Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
     4# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
    55# This program and the accompanying materials are licensed and made available under
    66# the terms and conditions of the BSD License that accompanies this distribution.
     
    2020  OUTPUT_DIRECTORY               = Build/IntelFspWrapperPkg
    2121  SUPPORTED_ARCHITECTURES        = IA32|X64
    22   BUILD_TARGETS                  = DEBUG|RELEASE
     22  BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
    2323  SKUID_IDENTIFIER               = DEFAULT
    2424
     
    8484  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80080046
    8585  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
     86
     87[BuildOptions]
     88  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/BaseFspApiLib/FspApiLib.c

    r58464 r77662  
    22  Provide FSP API related function.
    33
    4   Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
    55  This program and the accompanying materials
    66  are licensed and made available under the terms and conditions of the BSD License
     
    9999  BOOLEAN             InterruptState;
    100100
    101   FspInitApi = (FSP_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspInitEntryOffset);
     101  FspInitApi = (FSP_INIT)((UINTN)FspHeader->ImageBase + FspHeader->FspInitEntryOffset);
    102102  InterruptState = SaveAndDisableInterrupts ();
    103103  Status = Execute32BitCode ((UINTN)FspInitApi, (UINTN)FspInitParams);
     
    126126  BOOLEAN             InterruptState;
    127127
    128   NotifyPhaseApi = (FSP_NOTIFY_PHASE)(UINTN)(FspHeader->ImageBase + FspHeader->NotifyPhaseEntryOffset);
     128  NotifyPhaseApi = (FSP_NOTIFY_PHASE)((UINTN)FspHeader->ImageBase + FspHeader->NotifyPhaseEntryOffset);
    129129  InterruptState = SaveAndDisableInterrupts ();
    130130  Status = Execute32BitCode ((UINTN)NotifyPhaseApi, (UINTN)NotifyPhaseParams);
     
    153153  BOOLEAN             InterruptState;
    154154
    155   FspMemoryInitApi = (FSP_MEMORY_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspMemoryInitEntryOffset);
     155  FspMemoryInitApi = (FSP_MEMORY_INIT)((UINTN)FspHeader->ImageBase + FspHeader->FspMemoryInitEntryOffset);
    156156  InterruptState = SaveAndDisableInterrupts ();
    157157  Status = Execute32BitCode ((UINTN)FspMemoryInitApi, (UINTN)FspMemoryInitParams);
     
    180180  BOOLEAN             InterruptState;
    181181
    182   TempRamExitApi = (FSP_TEMP_RAM_EXIT)(UINTN)(FspHeader->ImageBase + FspHeader->TempRamExitEntryOffset);
     182  TempRamExitApi = (FSP_TEMP_RAM_EXIT)((UINTN)FspHeader->ImageBase + FspHeader->TempRamExitEntryOffset);
    183183  InterruptState = SaveAndDisableInterrupts ();
    184184  Status = Execute32BitCode ((UINTN)TempRamExitApi, (UINTN)TempRamExitParam);
     
    207207  BOOLEAN             InterruptState;
    208208
    209   FspSiliconInitApi = (FSP_SILICON_INIT)(UINTN)(FspHeader->ImageBase + FspHeader->FspSiliconInitEntryOffset);
     209  FspSiliconInitApi = (FSP_SILICON_INIT)((UINTN)FspHeader->ImageBase + FspHeader->FspSiliconInitEntryOffset);
    210210  InterruptState = SaveAndDisableInterrupts ();
    211211  Status = Execute32BitCode ((UINTN)FspSiliconInitApi, (UINTN)FspSiliconInitParam);
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/BaseFspApiLib/X64/DispatchExecute.c

    r58464 r77662  
    9090  )
    9191{
    92   return AsmExecute32BitCode (Function, Param1, 0, &mGdt);
     92  EFI_STATUS       Status;
     93  IA32_DESCRIPTOR  Idtr;
     94
     95  //
     96  // Idtr might be changed inside of FSP. 32bit FSP only knows the <4G address.
     97  // If IDTR.Base is >4G, FSP can not handle. So we need save/restore IDTR here for X64 only.
     98  // Interrupt is already disabled here, so it is safety to update IDTR.
     99  //
     100  AsmReadIdtr (&Idtr);
     101  Status = AsmExecute32BitCode (Function, Param1, 0, &mGdt);
     102  AsmWriteIdtr (&Idtr);
     103
     104  return Status;
    93105}
    94106
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/FspHobProcessLibSample.c

    r58464 r77662  
    2626#include <Guid/GuidHobFspEas.h>
    2727#include <Guid/MemoryTypeInformation.h>
     28#include <Guid/PcdDataBaseHobGuid.h>
    2829#include <Ppi/Capsule.h>
    2930
     
    4647  )
    4748{
    48   EFI_STATUS                  Status;
    4949  EFI_PEI_HOB_POINTERS        Hob;
    5050  EFI_MEMORY_TYPE_INFORMATION *MemoryData;
     
    5353
    5454  MemoryData = NULL;
    55   Status     = (*PeiServices)->GetHobList ((CONST EFI_PEI_SERVICES**)PeiServices, (VOID **) &Hob.Raw);
     55  (*PeiServices)->GetHobList ((CONST EFI_PEI_SERVICES**)PeiServices, (VOID **) &Hob.Raw);
    5656  while (!END_OF_HOB_LIST (Hob)) {
    5757    if (Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION &&
     
    156156  EFI_STATUS           Status;
    157157  EFI_BOOT_MODE        BootMode;
    158   PEI_CAPSULE_PPI      *Capsule;
     158  EFI_PEI_CAPSULE_PPI  *Capsule;
    159159  VOID                 *CapsuleBuffer;
    160160  UINTN                CapsuleBufferLength;
     
    247247    S3PeiMemBase = 0;
    248248    S3PeiMemSize = 0;
    249     Status = GetS3MemoryInfo (&S3PeiMemBase, &S3PeiMemSize);
     249    Status = GetS3MemoryInfo (&S3PeiMemSize, &S3PeiMemBase);
    250250    ASSERT_EFI_ERROR (Status);
    251251    DEBUG((DEBUG_INFO, "S3 memory %Xh - %Xh bytes\n", S3PeiMemBase, S3PeiMemSize));
     
    272272    if (BootMode == BOOT_ON_FLASH_UPDATE) {
    273273      Status = PeiServicesLocatePpi (
    274                  &gPeiCapsulePpiGuid,
     274                 &gEfiPeiCapsulePpiGuid,
    275275                 0,
    276276                 NULL,
     
    336336
    337337/**
     338  Process FSP HOB list
     339
     340  @param[in] FspHobList  Pointer to the HOB data structure produced by FSP.
     341
     342**/
     343VOID
     344ProcessFspHobList (
     345  IN VOID                 *FspHobList
     346  )
     347{
     348  EFI_PEI_HOB_POINTERS  FspHob;
     349
     350  FspHob.Raw = FspHobList;
     351
     352  //
     353  // Add all the HOBs from FSP binary to FSP wrapper
     354  //
     355  while (!END_OF_HOB_LIST (FspHob)) {
     356    if (FspHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) {
     357      //
     358      // Skip FSP binary creates PcdDataBaseHobGuid
     359      //
     360      if (!CompareGuid(&FspHob.Guid->Name, &gPcdDataBaseHobGuid)) {
     361        BuildGuidDataHob (
     362          &FspHob.Guid->Name,
     363          GET_GUID_HOB_DATA(FspHob),
     364          GET_GUID_HOB_DATA_SIZE(FspHob)
     365        );
     366      }
     367    }
     368    FspHob.Raw = GET_NEXT_HOB (FspHob);
     369  }
     370}
     371
     372/**
    338373  BIOS process FspBobList for other data (not Memory Resource Descriptor).
    339374
     
    348383  )
    349384{
     385  ProcessFspHobList (FspHobList);
     386
    350387  return EFI_SUCCESS;
    351388}
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/PeiFspHobProcessLibSample/PeiFspHobProcessLibSample.inf

    r58464 r77662  
    7171  gFspReservedMemoryResourceHobGuid                       ## CONSUMES ## HOB
    7272  gEfiMemoryTypeInformationGuid                           ## CONSUMES ## GUID
     73  gPcdDataBaseHobGuid                                     ## CONSUMES ## HOB
    7374
    7475[Ppis]
    75   gPeiCapsulePpiGuid                                      ## CONSUMES
     76  gEfiPeiCapsulePpiGuid                                   ## CONSUMES
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.S

    r58464 r77662  
    211211
    212212TempRamInitDone:
     213  cmp  $0x8000000E, %eax   #Check if EFI_NOT_FOUND returned. Error code for Microcode Update not found.
     214  je   CallSecFspInit      #If microcode not found, don't hang, but continue.
     215
    213216  cmp  $0x0, %eax
    214217  jnz  FspApiFailed
     
    216219  #   ECX: start of range
    217220  #   EDX: end of range
     221CallSecFspInit:
     222  xorl    %eax, %eax
    218223  movl    %edx, %esp
     224
     225  # Align the stack at DWORD
     226  addl  $3, %esp
     227  andl  $0xFFFFFFFC, %esp
     228
    219229  pushl   %edx
    220230  pushl   %ecx
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/Ia32/SecEntry.asm

    r58464 r77662  
    221221
    222222TempRamInitDone:
    223   cmp eax, 0
     223  cmp eax, 8000000Eh      ;Check if EFI_NOT_FOUND returned. Error code for Microcode Update not found.
     224  je  CallSecFspInit      ;If microcode not found, don't hang, but continue.
     225
     226  cmp eax, 0              ;Check if EFI_SUCCESS retuned.
    224227  jnz FspApiFailed
    225228
    226229  ;   ECX: start of range
    227230  ;   EDX: end of range
     231CallSecFspInit:
     232  xor     eax, eax
    228233  mov     esp, edx
     234
     235  ; Align the stack at DWORD
     236  add  esp,  3
     237  and  esp, 0FFFFFFFCh
     238
    229239  push    edx
    230240  push    ecx
  • trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFspWrapperPkg/Library/SecPeiFspPlatformSecLibSample/SecTempRamSupport.c

    r58464 r77662  
    140140  //
    141141  // SecSwitchStack function must be invoked after the memory migration
    142   // immediatly, also we need fixup the stack change caused by new call into
    143   // permenent memory.
     142  // immediately, also we need fixup the stack change caused by new call into
     143  // permanent memory.
    144144  //
    145145  SecSwitchStack (
Note: See TracChangeset for help on using the changeset viewer.

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