VirtualBox

Ignore:
Timestamp:
Oct 12, 2015 10:47:27 AM (9 years ago)
Author:
vboxsync
Message:

EFI: Remove VBoxPkg PlatformPei module and merge changes into OvmfPkg PlatformPei

Location:
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.dsc

    r58172 r58173  
    347347  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
    348348
    349 !ifndef $(VBOX)
    350349  OvmfPkg/PlatformPei/PlatformPei.inf {
    351350    <LibraryClasses>
    352351      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
    353352  }
    354 !else
    355   VBoxPkg/PlatformPei/PlatformPei.inf {
    356     <LibraryClasses>
    357       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
    358   }
    359 !endif
    360353
    361354  #
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.fdf

    r48674 r58173  
    112112INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf
    113113INF  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
    114 !ifndef $(VBOX)
    115114INF  OvmfPkg/PlatformPei/PlatformPei.inf
    116 !else
    117 INF  VBoxPkg/PlatformPei/PlatformPei.inf
    118 !endif
    119115INF  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
    120116
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.dsc

    r58172 r58173  
    347347  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
    348348
    349 !ifndef $(VBOX)
    350349  OvmfPkg/PlatformPei/PlatformPei.inf {
    351350    <LibraryClasses>
    352351      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
    353352  }
    354 !else
    355   VBoxPkg/PlatformPei/PlatformPei.inf {
    356     <LibraryClasses>
    357       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
    358   }
    359 !endif
    360353
    361354  #
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.fdf

    r48674 r58173  
    110110INF  MdeModulePkg/Universal/PCD/Pei/Pcd.inf
    111111INF  IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
    112 !ifndef $(VBOX)
    113112INF  OvmfPkg/PlatformPei/PlatformPei.inf
    114 !else
    115 INF  VBoxPkg/PlatformPei/PlatformPei.inf
    116 !endif
    117113INF  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
    118114
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/MemDetect.c

    r48674 r58173  
    118118    MemorySize = SIZE_64MB;
    119119  }
     120#ifdef VBOX
     121  MemorySize -= BASE_64KB; /* Reserves 64KB for ACPI tables. */
     122#endif
    120123
    121124  //
     
    130133  AddMemoryBaseSizeHob (MemoryBase, MemorySize);
    131134  AddMemoryRangeHob (BASE_1MB, MemoryBase);
     135#ifndef VBOX
    132136  AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
     137#endif
    133138
    134139  MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, CacheWriteBack);
    135140
     141#ifdef VBOX
     142  AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
     143#endif
    136144  MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
    137145
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.c

    r48674 r58173  
    9393}
    9494
     95#ifdef VBOX
     96VOID
     97AddRomMemoryBaseSizeHob (
     98  EFI_PHYSICAL_ADDRESS        MemoryBase,
     99  UINT64                      MemorySize
     100  )
     101{
     102  STATIC EFI_RESOURCE_ATTRIBUTE_TYPE Attributes =
     103    (
     104      EFI_RESOURCE_ATTRIBUTE_PRESENT     |
     105      EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED |
     106      EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE |
     107      EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
     108      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE
     109    );
     110
     111  BuildResourceDescriptorHob (
     112    EFI_RESOURCE_FIRMWARE_DEVICE,
     113    Attributes,
     114    MemoryBase,
     115    MemorySize
     116    );
     117
     118  DEBUG ((DEBUG_INFO, "ROM HOB: at 0x%llx size 0x%llx\n", MemoryBase, MemorySize));
     119}
     120
     121static VOID *
     122FindAcpiRsdPtr (
     123  VOID
     124  )
     125{
     126#define ACPI_RSD_PTR      SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
     127  UINTN                           Address;
     128
     129  //
     130  // First Search 0x0e0000 - 0x0fffff for RSD Ptr
     131  //
     132  for (Address = 0xe0000; Address < 0xfffff; Address += 0x10) {
     133    if (*(UINT64 *)(Address) == ACPI_RSD_PTR) {
     134      return (VOID *)Address;
     135    }
     136  }
     137  return NULL;
     138}
     139#undef ACPI_RSD_PTR
     140#endif
     141
    95142VOID
    96143AddIoMemoryRangeHob (
     
    169216  )
    170217{
     218#ifdef VBOX
     219  EFI_PHYSICAL_ADDRESS RsdPtr;
     220  EFI_PHYSICAL_ADDRESS AcpiTables;
     221#endif
    171222  //
    172223  // Create Memory Type Information HOB
     
    210261  //
    211262  // Video memory + Legacy BIOS region
     263#ifdef VBOX
     264  // This includes ACPI floating pointer region.
     265#endif
    212266  //
    213267  AddIoMemoryRangeHob (0x0A0000, BASE_1MB);
     268
     269#ifdef VBOX
     270  //
     271  // Add ACPI memory, provided by VBox
     272  //
     273  RsdPtr = (EFI_PHYSICAL_ADDRESS)(UINTN)FindAcpiRsdPtr();
     274  ASSERT(RsdPtr != 0);
     275  AcpiTables = (EFI_PHYSICAL_ADDRESS)*(UINT32*)((UINTN)RsdPtr + 16) & ~0xfff;
     276  ASSERT(AcpiTables != 0);
     277
     278  // ACPI tables 64 K
     279  AddRomMemoryBaseSizeHob(AcpiTables, 0x10000);
     280#endif
    214281}
    215282
     
    326393  TopOfMemory = MemDetect ();
    327394
     395#ifndef VBOX
    328396  Status = InitializeXen ();
    329397  Xen = EFI_ERROR (Status) ? FALSE : TRUE;
     398#else
     399  Xen = FALSE;
     400#endif
    330401
    331402  ReserveEmuVariableNvStore ();
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