VirtualBox

Changeset 80934 in vbox for trunk


Ignore:
Timestamp:
Sep 22, 2019 3:37:49 PM (5 years ago)
Author:
vboxsync
Message:

EFI/Firmware: Some compi8les fixes when gcc is used (preparation to make the gcc build working again)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c

    r80901 r80934  
    10111011  *ppwszFileName = EFI_REMOVABLE_MEDIA_FILE_NAME;
    10121012
    1013   Status = gBS->HandleProtocol(hSFs, &gEfiSimpleFileSystemProtocolGuid, &pSFs);
     1013  Status = gBS->HandleProtocol(hSFs, &gEfiSimpleFileSystemProtocolGuid, (void **)&pSFs);
    10141014  if (!EFI_ERROR(Status))
    10151015  {
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/Disk/PartitionDxe/Apple.c

    r80721 r80934  
    103103  UINT32                    Partition;
    104104  UINT32                    PartitionEntries;
    105   UINT32                    VolSpaceSize;
    106105  UINT32                    SubBlockSize;
    107106  UINT32                    BlkPerSec;
     
    111110  Found         = EFI_NOT_FOUND;
    112111  Media         = BlockIo->Media;
    113   VolSpaceSize  = 0;
    114112
    115113  Block = AllocatePool ((UINTN) Media->BlockSize);
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/MemDetect.c

    r80721 r80934  
    765765  UINT64                      LowerMemorySize;
    766766  UINT64                      UpperMemorySize;
    767   EFI_PHYSICAL_ADDRESS        MemoryBase;
    768   UINT64                      MemorySize;
    769767
    770768  DEBUG ((EFI_D_INFO, "%a called\n", __FUNCTION__));
     
    798796    //
    799797    AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
    800     MemoryBase = 0;
    801     MemorySize = BASE_512KB + BASE_128KB;
    802798  } else {
    803799    LowerMemorySize = GetSystemMemorySizeBelow4gb ();
  • trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformPei/Platform.c

    r80721 r80934  
    254254  if (!mXen) {
    255255    UINT32  TopOfLowRam;
     256#ifndef VBOX
    256257    UINT64  PciExBarBase;
     258#endif
    257259    UINT32  PciBase;
    258260    UINT32  PciSize;
    259261
    260262    TopOfLowRam = GetSystemMemorySizeBelow4gb ();
     263#ifndef VBOX
    261264    PciExBarBase = 0;
    262 #ifndef VBOX
     265
    263266    if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
    264267      //
  • trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxAppleSim/VBoxAppleSim.c

    r80902 r80934  
    245245SetProperVariables(IN EFI_HANDLE ImageHandle, EFI_RUNTIME_SERVICES * rs)
    246246{
    247      EFI_STATUS          rc;
    248      UINT32              vBackgroundClear = 0x00000000;
    249      UINT32              vFwFeatures      = 0x80000015;
    250      UINT32              vFwFeaturesMask  = 0x800003ff;
    251 
    252      // -legacy acpi=0xffffffff acpi_debug=0xfffffff panic_io_port=0xef11 io=0xfffffffe trace=4096  io=0xffffffef -v serial=2 serialbaud=9600
    253      // 0x10 makes kdb default, thus 0x15e for kdb, 0x14e for gdb
    254      // usb=0x800 is required to work around default behavior of the Apple xHCI driver which rejects high-speed
    255      // USB devices and tries to force them to EHCI when running on the Intel Panther Point chipset.
    256 
    257      //static const CHAR8  vBootArgs[]      = "debug=0x15e keepsyms=1 acpi=0xffffffff acpi_debug=0xff acpi_level=7 -v -x32 -s"; // or just "debug=0x8 -legacy"
    258      // 0x14e for serial output
    259      //static const CHAR8  vDefBootArgs[]      = "debug=0x146 usb=0x800 keepsyms=1 -v -serial=0x1";
    260      static const CHAR8  vDefBootArgs[]      = "usb=0x800 keepsyms=1 -v -serial=0x1";
    261      CHAR8  vBootArgs[256];
    262      UINT32 BootArgsLen;
    263 
    264      BootArgsLen = GetVmVariable(EFI_INFO_INDEX_BOOT_ARGS, vBootArgs, sizeof vBootArgs);
    265      if (BootArgsLen <= 1)
    266      {
    267          BootArgsLen = sizeof vDefBootArgs;
    268          CopyMem(vBootArgs, vDefBootArgs, BootArgsLen);
    269      }
    270      rc = rs->SetVariable(L"BackgroundClear",
    271                           &gEfiAppleNvramGuid,
    272                           /* EFI_VARIABLE_NON_VOLATILE | */ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
    273                           sizeof(vBackgroundClear), &vBackgroundClear);
    274 
    275      rc = rs->SetVariable(L"FirmwareFeatures",
    276                           &gEfiAppleNvramGuid,
    277                           EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
    278                           sizeof(vFwFeatures), &vFwFeatures);
    279 
    280      rc = rs->SetVariable(L"FirmwareFeaturesMask",
    281                           &gEfiAppleNvramGuid,
    282                           EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
    283                           sizeof(vFwFeaturesMask), &vFwFeaturesMask);
    284 
    285      rc = rs->SetVariable(L"boot-args",
    286                           &gEfiAppleBootGuid,
    287                           EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
    288                           BootArgsLen, &vBootArgs);
     247    EFI_STATUS          rc;
     248    UINT32              vBackgroundClear = 0x00000000;
     249    UINT32              vFwFeatures      = 0x80000015;
     250    UINT32              vFwFeaturesMask  = 0x800003ff;
     251
     252    // -legacy acpi=0xffffffff acpi_debug=0xfffffff panic_io_port=0xef11 io=0xfffffffe trace=4096  io=0xffffffef -v serial=2 serialbaud=9600
     253    // 0x10 makes kdb default, thus 0x15e for kdb, 0x14e for gdb
     254    // usb=0x800 is required to work around default behavior of the Apple xHCI driver which rejects high-speed
     255    // USB devices and tries to force them to EHCI when running on the Intel Panther Point chipset.
     256
     257    //static const CHAR8  vBootArgs[]      = "debug=0x15e keepsyms=1 acpi=0xffffffff acpi_debug=0xff acpi_level=7 -v -x32 -s"; // or just "debug=0x8 -legacy"
     258    // 0x14e for serial output
     259    //static const CHAR8  vDefBootArgs[]      = "debug=0x146 usb=0x800 keepsyms=1 -v -serial=0x1";
     260    static const CHAR8  vDefBootArgs[]      = "usb=0x800 keepsyms=1 -v -serial=0x1";
     261    CHAR8  vBootArgs[256];
     262    UINT32 BootArgsLen;
     263
     264    BootArgsLen = GetVmVariable(EFI_INFO_INDEX_BOOT_ARGS, vBootArgs, sizeof vBootArgs);
     265    if (BootArgsLen <= 1)
     266    {
     267        BootArgsLen = sizeof vDefBootArgs;
     268        CopyMem(vBootArgs, vDefBootArgs, BootArgsLen);
     269    }
     270    rc = rs->SetVariable(L"BackgroundClear",
     271                         &gEfiAppleNvramGuid,
     272                         /* EFI_VARIABLE_NON_VOLATILE | */ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
     273                         sizeof(vBackgroundClear), &vBackgroundClear);
     274    ASSERT_EFI_ERROR (rc);
     275
     276    rc = rs->SetVariable(L"FirmwareFeatures",
     277                         &gEfiAppleNvramGuid,
     278                         EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
     279                         sizeof(vFwFeatures), &vFwFeatures);
     280    ASSERT_EFI_ERROR (rc);
     281
     282    rc = rs->SetVariable(L"FirmwareFeaturesMask",
     283                         &gEfiAppleNvramGuid,
     284                         EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
     285                         sizeof(vFwFeaturesMask), &vFwFeaturesMask);
     286    ASSERT_EFI_ERROR (rc);
     287
     288    rc = rs->SetVariable(L"boot-args",
     289                         &gEfiAppleBootGuid,
     290                         EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
     291                         BootArgsLen, &vBootArgs);
     292    ASSERT_EFI_ERROR (rc);
    289293
    290294     return EFI_SUCCESS;
  • trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxSysTables/VBoxSysTables.c

    r76553 r80934  
    148148    ASSERT(Ptr != NULL);
    149149    if (Ptr)
     150    {
    150151        rc = ConvertAndInstallTable(&gEfiSmbiosTableGuid, Ptr);
     152        ASSERT_EFI_ERROR (rc);
     153    }
    151154
    152155    Ptr = FindMPSPtr();
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