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/UefiCpuPkg/Library/CpuTimerLib/CpuTimerLib.c

    r80721 r99404  
    1414#include <Register/Cpuid.h>
    1515
    16 GUID mCpuCrystalFrequencyHobGuid = { 0xe1ec5ad0, 0x8569, 0x46bd, { 0x8d, 0xcd, 0x3b, 0x9f, 0x6f, 0x45, 0x82, 0x7a } };
     16GUID  mCpuCrystalFrequencyHobGuid = {
     17  0xe1ec5ad0, 0x8569, 0x46bd, { 0x8d, 0xcd, 0x3b, 0x9f, 0x6f, 0x45, 0x82, 0x7a }
     18};
    1719
    1820/**
     
    4244  )
    4345{
    44   UINT64                 TscFrequency;
    45   UINT64                 CoreXtalFrequency;
    46   UINT32                 RegEax;
    47   UINT32                 RegEbx;
    48   UINT32                 RegEcx;
     46  UINT64  TscFrequency;
     47  UINT64  CoreXtalFrequency;
     48  UINT32  RegEax;
     49  UINT32  RegEbx;
     50  UINT32  RegEcx;
    4951
    5052  //
     
    5860  // If EAX or EBX returns 0, the XTAL ratio is not enumerated.
    5961  //
    60   if (RegEax == 0 || RegEbx ==0 ) {
     62  if ((RegEax == 0) || (RegEbx == 0)) {
    6163    ASSERT (RegEax != 0);
    6264    ASSERT (RegEbx != 0);
    6365    return 0;
    6466  }
     67
    6568  //
    6669  // If ECX returns 0, the XTAL frequency is not enumerated.
     
    7073    CoreXtalFrequency = PcdGet64 (PcdCpuCoreCrystalClockFrequency);
    7174  } else {
    72     CoreXtalFrequency = (UINT64) RegEcx;
     75    CoreXtalFrequency = (UINT64)RegEcx;
    7376  }
    7477
     
    100103  // The target timer count is calculated here
    101104  //
    102   Ticks = AsmReadTsc() + Delay;
     105  Ticks = AsmReadTsc () + Delay;
    103106
    104107  //
     
    108111  // Intel guarantees a minimum of 10 years before the TSC wraps.
    109112  //
    110   while (AsmReadTsc() <= Ticks) {
    111     CpuPause();
     113  while (AsmReadTsc () <= Ticks) {
     114    CpuPause ();
    112115  }
    113116}
     
    129132  )
    130133{
    131 
    132134  InternalCpuDelay (
    133135    DivU64x32 (
     
    137139        ),
    138140      1000000u
    139     )
    140   );
     141      )
     142    );
    141143
    142144  return MicroSeconds;
     
    159161  )
    160162{
    161 
    162163  InternalCpuDelay (
    163164    DivU64x32 (
     
    167168        ),
    168169      1000000000u
    169     )
    170   );
     170      )
     171    );
    171172
    172173  return NanoSeconds;
     
    220221EFIAPI
    221222GetPerformanceCounterProperties (
    222   OUT UINT64  *StartValue,  OPTIONAL
     223  OUT UINT64  *StartValue   OPTIONAL,
    223224  OUT UINT64  *EndValue     OPTIONAL
    224225  )
     
    231232    *EndValue = 0xffffffffffffffffULL;
    232233  }
     234
    233235  return InternalGetPerformanceCounterFrequency ();
    234236}
     
    270272  // i.e. highest bit set in Remainder should <= 33.
    271273  //
    272   Shift = MAX (0, HighBitSet64 (Remainder) - 33);
    273   Remainder = RShiftU64 (Remainder, (UINTN) Shift);
    274   Frequency = RShiftU64 (Frequency, (UINTN) Shift);
     274  Shift        = MAX (0, HighBitSet64 (Remainder) - 33);
     275  Remainder    = RShiftU64 (Remainder, (UINTN)Shift);
     276  Frequency    = RShiftU64 (Frequency, (UINTN)Shift);
    275277  NanoSeconds += DivU64x64Remainder (MultU64x32 (Remainder, 1000000000u), Frequency, NULL);
    276278
    277279  return NanoSeconds;
    278280}
    279 
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