VirtualBox

Ignore:
Timestamp:
Apr 14, 2023 3:17:44 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156854
Message:

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, 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/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c

    r89983 r99404  
    88
    99**/
    10 #include <PiDxe.h>
     10#include <IndustryStandard/Pci.h>                     // PCI_MAX_BUS
     11#include <IndustryStandard/Q35MchIch9.h>              // INTEL_Q35_MCH_DEVIC...
     12#include <Library/BaseMemoryLib.h>                    // ZeroMem()
     13#include <Library/PcdLib.h>                           // PcdGet64()
     14#include <Library/PciHostBridgeLib.h>                 // PCI_ROOT_BRIDGE_APE...
     15#include <Library/PciHostBridgeUtilityLib.h>          // PciHostBridgeUtilit...
     16#include <Protocol/PciHostBridgeResourceAllocation.h> // EFI_PCI_HOST_BRIDGE...
     17#include <Protocol/PciRootBridgeIo.h>                 // EFI_PCI_ATTRIBUTE_I...
    1118
    12 #include <IndustryStandard/Pci.h>
    13 #include <IndustryStandard/Q35MchIch9.h>
    14 
    15 #include <Protocol/PciHostBridgeResourceAllocation.h>
    16 #include <Protocol/PciRootBridgeIo.h>
    17 
    18 #include <Library/BaseMemoryLib.h>
    19 #include <Library/DebugLib.h>
    20 #include <Library/MemoryAllocationLib.h>
    21 #include <Library/PcdLib.h>
    22 #include <Library/PciHostBridgeLib.h>
    23 #include <Library/PciHostBridgeUtilityLib.h>
    24 #include "PciHostBridge.h"
    25 
    26 
    27 STATIC PCI_ROOT_BRIDGE_APERTURE mNonExistAperture = { MAX_UINT64, 0 };
    28 
     19STATIC PCI_ROOT_BRIDGE_APERTURE  mNonExistAperture = { MAX_UINT64, 0 };
    2920
    3021/**
     
    4031EFIAPI
    4132PciHostBridgeGetRootBridges (
    42   UINTN *Count
     33  UINTN  *Count
    4334  )
    4435{
    45   UINT64               Attributes;
    46   UINT64               AllocationAttributes;
    47   PCI_ROOT_BRIDGE_APERTURE Io;
    48   PCI_ROOT_BRIDGE_APERTURE Mem;
    49   PCI_ROOT_BRIDGE_APERTURE MemAbove4G;
    50 
    51   if (PcdGetBool (PcdPciDisableBusEnumeration)) {
    52     return ScanForRootBridges (Count);
    53   }
     36  UINT64                    Attributes;
     37  UINT64                    AllocationAttributes;
     38  PCI_ROOT_BRIDGE_APERTURE  Io;
     39  PCI_ROOT_BRIDGE_APERTURE  Mem;
     40  PCI_ROOT_BRIDGE_APERTURE  MemAbove4G;
    5441
    5542  ZeroMem (&Io, sizeof (Io));
     
    5845
    5946  Attributes = EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO |
    60     EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO |
    61     EFI_PCI_ATTRIBUTE_ISA_IO_16 |
    62     EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO |
    63     EFI_PCI_ATTRIBUTE_VGA_MEMORY |
    64     EFI_PCI_ATTRIBUTE_VGA_IO_16 |
    65     EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16;
     47               EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO |
     48               EFI_PCI_ATTRIBUTE_ISA_IO_16 |
     49               EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO |
     50               EFI_PCI_ATTRIBUTE_VGA_MEMORY |
     51               EFI_PCI_ATTRIBUTE_VGA_IO_16 |
     52               EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16;
    6653
    6754  AllocationAttributes = EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM;
    6855  if (PcdGet64 (PcdPciMmio64Size) > 0) {
    6956    AllocationAttributes |= EFI_PCI_HOST_BRIDGE_MEM64_DECODE;
    70     MemAbove4G.Base = PcdGet64 (PcdPciMmio64Base);
    71     MemAbove4G.Limit = PcdGet64 (PcdPciMmio64Base) +
    72                        PcdGet64 (PcdPciMmio64Size) - 1;
     57    MemAbove4G.Base       = PcdGet64 (PcdPciMmio64Base);
     58    MemAbove4G.Limit      = PcdGet64 (PcdPciMmio64Base) +
     59                            PcdGet64 (PcdPciMmio64Size) - 1;
    7360  } else {
    7461    CopyMem (&MemAbove4G, &mNonExistAperture, sizeof (mNonExistAperture));
    7562  }
    7663
    77   Io.Base = PcdGet64 (PcdPciIoBase);
    78   Io.Limit = PcdGet64 (PcdPciIoBase) + (PcdGet64 (PcdPciIoSize) - 1);
    79   Mem.Base = PcdGet64 (PcdPciMmio32Base);
     64  Io.Base   = PcdGet64 (PcdPciIoBase);
     65  Io.Limit  = PcdGet64 (PcdPciIoBase) + (PcdGet64 (PcdPciIoSize) - 1);
     66  Mem.Base  = PcdGet64 (PcdPciMmio32Base);
    8067  Mem.Limit = PcdGet64 (PcdPciMmio32Base) + (PcdGet64 (PcdPciMmio32Size) - 1);
    8168
    8269  return PciHostBridgeUtilityGetRootBridges (
    83     Count,
    84     Attributes,
    85     AllocationAttributes,
    86     FALSE,
    87     PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID,
    88     0,
    89     PCI_MAX_BUS,
    90     &Io,
    91     &Mem,
    92     &MemAbove4G,
    93     &mNonExistAperture,
    94     &mNonExistAperture
    95     );
     70           Count,
     71           Attributes,
     72           AllocationAttributes,
     73           FALSE,
     74           PcdGet16 (PcdOvmfHostBridgePciDevId) != INTEL_Q35_MCH_DEVICE_ID,
     75           0,
     76           PCI_MAX_BUS,
     77           &Io,
     78           &Mem,
     79           &MemAbove4G,
     80           &mNonExistAperture,
     81           &mNonExistAperture
     82           );
    9683}
    97 
    9884
    9985/**
     
    10793EFIAPI
    10894PciHostBridgeFreeRootBridges (
    109   PCI_ROOT_BRIDGE *Bridges,
    110   UINTN           Count
     95  PCI_ROOT_BRIDGE  *Bridges,
     96  UINTN            Count
    11197  )
    11298{
    11399  PciHostBridgeUtilityFreeRootBridges (Bridges, Count);
    114100}
    115 
    116101
    117102/**
     
    132117EFIAPI
    133118PciHostBridgeResourceConflict (
    134   EFI_HANDLE                        HostBridgeHandle,
    135   VOID                              *Configuration
     119  EFI_HANDLE  HostBridgeHandle,
     120  VOID        *Configuration
    136121  )
    137122{
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