VirtualBox

Ignore:
Timestamp:
Apr 14, 2023 3:17:44 PM (23 months 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/UefiCpuPkg/CpuIoPei/CpuIoPei.c

    r80721 r99404  
    4444// PPI Descriptor used to install the CPU I/O PPI
    4545//
    46 EFI_PEI_PPI_DESCRIPTOR gPpiList = {
     46EFI_PEI_PPI_DESCRIPTOR  gPpiList = {
    4747  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
    4848  &gEfiPeiCpuIoPpiInstalledGuid,
     
    5353// Lookup table for increment values based on transfer widths
    5454//
    55 UINT8 mInStride[] = {
     55UINT8  mInStride[] = {
    5656  1, // EfiPeiCpuIoWidthUint8
    5757  2, // EfiPeiCpuIoWidthUint16
     
    7171// Lookup table for increment values based on transfer widths
    7272//
    73 UINT8 mOutStride[] = {
     73UINT8  mOutStride[] = {
    7474  1, // EfiPeiCpuIoWidthUint8
    7575  2, // EfiPeiCpuIoWidthUint16
     
    132132  // so treat Count as 1
    133133  //
    134   if (Width >= EfiPeiCpuIoWidthFifoUint8 && Width <= EfiPeiCpuIoWidthFifoUint64) {
     134  if ((Width >= EfiPeiCpuIoWidthFifoUint8) && (Width <= EfiPeiCpuIoWidthFifoUint64)) {
    135135    Count = 1;
    136136  }
     
    139139  // Check to see if Width is in the valid range for I/O Port operations
    140140  //
    141   Width = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03);
     141  Width = (EFI_PEI_CPU_IO_PPI_WIDTH)(Width & 0x03);
    142142  if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) {
    143143    return EFI_INVALID_PARAMETER;
     
    169169      return EFI_UNSUPPORTED;
    170170    }
     171
    171172    if (Address > LShiftU64 (MaxCount - Count + 1, Width)) {
    172173      return EFI_UNSUPPORTED;
     
    221222  // Select loop based on the width of the transfer
    222223  //
    223   InStride = mInStride[Width];
    224   OutStride = mOutStride[Width];
    225   OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03);
    226   Aligned = (BOOLEAN)(((UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
     224  InStride       = mInStride[Width];
     225  OutStride      = mOutStride[Width];
     226  OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH)(Width & 0x03);
     227  Aligned        = (BOOLEAN)(((UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
    227228  for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
    228229    if (OperationWidth == EfiPeiCpuIoWidthUint8) {
     
    248249    }
    249250  }
     251
    250252  return EFI_SUCCESS;
    251253}
     
    295297  // Select loop based on the width of the transfer
    296298  //
    297   InStride = mInStride[Width];
    298   OutStride = mOutStride[Width];
    299   OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03);
    300   Aligned = (BOOLEAN)(((UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
     299  InStride       = mInStride[Width];
     300  OutStride      = mOutStride[Width];
     301  OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH)(Width & 0x03);
     302  Aligned        = (BOOLEAN)(((UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
    301303  for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
    302304    if (OperationWidth == EfiPeiCpuIoWidthUint8) {
     
    322324    }
    323325  }
     326
    324327  return EFI_SUCCESS;
    325328}
     
    369372  // Select loop based on the width of the transfer
    370373  //
    371   InStride = mInStride[Width];
    372   OutStride = mOutStride[Width];
    373   OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03);
     374  InStride       = mInStride[Width];
     375  OutStride      = mOutStride[Width];
     376  OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH)(Width & 0x03);
    374377
    375378  //
     
    378381  if (InStride == 0) {
    379382    switch (OperationWidth) {
    380     case EfiPeiCpuIoWidthUint8:
    381       IoReadFifo8 ((UINTN)Address, Count, Buffer);
    382       return EFI_SUCCESS;
    383     case EfiPeiCpuIoWidthUint16:
    384       IoReadFifo16 ((UINTN)Address, Count, Buffer);
    385       return EFI_SUCCESS;
    386     case EfiPeiCpuIoWidthUint32:
    387       IoReadFifo32 ((UINTN)Address, Count, Buffer);
    388       return EFI_SUCCESS;
    389     default:
    390       //
    391       // The CpuIoCheckParameter call above will ensure that this
    392       // path is not taken.
    393       //
    394       ASSERT (FALSE);
    395       break;
     383      case EfiPeiCpuIoWidthUint8:
     384        IoReadFifo8 ((UINTN)Address, Count, Buffer);
     385        return EFI_SUCCESS;
     386      case EfiPeiCpuIoWidthUint16:
     387        IoReadFifo16 ((UINTN)Address, Count, Buffer);
     388        return EFI_SUCCESS;
     389      case EfiPeiCpuIoWidthUint32:
     390        IoReadFifo32 ((UINTN)Address, Count, Buffer);
     391        return EFI_SUCCESS;
     392      default:
     393        //
     394        // The CpuIoCheckParameter call above will ensure that this
     395        // path is not taken.
     396        //
     397        ASSERT (FALSE);
     398        break;
    396399    }
    397400  }
     
    466469  // Select loop based on the width of the transfer
    467470  //
    468   InStride = mInStride[Width];
    469   OutStride = mOutStride[Width];
    470   OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH) (Width & 0x03);
     471  InStride       = mInStride[Width];
     472  OutStride      = mOutStride[Width];
     473  OperationWidth = (EFI_PEI_CPU_IO_PPI_WIDTH)(Width & 0x03);
    471474
    472475  //
     
    475478  if (InStride == 0) {
    476479    switch (OperationWidth) {
    477     case EfiPeiCpuIoWidthUint8:
    478       IoWriteFifo8 ((UINTN)Address, Count, Buffer);
    479       return EFI_SUCCESS;
    480     case EfiPeiCpuIoWidthUint16:
    481       IoWriteFifo16 ((UINTN)Address, Count, Buffer);
    482       return EFI_SUCCESS;
    483     case EfiPeiCpuIoWidthUint32:
    484       IoWriteFifo32 ((UINTN)Address, Count, Buffer);
    485       return EFI_SUCCESS;
    486     default:
    487       //
    488       // The CpuIoCheckParameter call above will ensure that this
    489       // path is not taken.
    490       //
    491       ASSERT (FALSE);
    492       break;
     480      case EfiPeiCpuIoWidthUint8:
     481        IoWriteFifo8 ((UINTN)Address, Count, Buffer);
     482        return EFI_SUCCESS;
     483      case EfiPeiCpuIoWidthUint16:
     484        IoWriteFifo16 ((UINTN)Address, Count, Buffer);
     485        return EFI_SUCCESS;
     486      case EfiPeiCpuIoWidthUint32:
     487        IoWriteFifo32 ((UINTN)Address, Count, Buffer);
     488        return EFI_SUCCESS;
     489      default:
     490        //
     491        // The CpuIoCheckParameter call above will ensure that this
     492        // path is not taken.
     493        //
     494        ASSERT (FALSE);
     495        break;
    493496    }
    494497  }
     
    573576EFIAPI
    574577CpuIoRead32 (
    575   IN CONST EFI_PEI_SERVICES     **PeiServices,
    576   IN CONST EFI_PEI_CPU_IO_PPI   *This,
    577   IN UINT64                     Address
     578  IN CONST EFI_PEI_SERVICES    **PeiServices,
     579  IN CONST EFI_PEI_CPU_IO_PPI  *This,
     580  IN UINT64                    Address
    578581  )
    579582{
     
    901904    // Shadow completed and running from memory
    902905    //
    903     DEBUG ((EFI_D_INFO, "CpuIO PPI has been loaded into memory.  Reinstalled PPI=0x%x\n", &gCpuIoPpi));
     906    DEBUG ((DEBUG_INFO, "CpuIO PPI has been loaded into memory.  Reinstalled PPI=0x%x\n", &gCpuIoPpi));
    904907  } else {
    905908    Status = PeiServicesInstallPpi (&gPpiList);
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