diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:10 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 5220bd211df890f2672c23c050082862cd1e82d6 (patch) | |
tree | ef9ce787723fcb52a0e8812d7ce335f9f6614e86 /PcAtChipsetPkg/Library/AcpiTimerLib | |
parent | ac0a286f4d747a4c6c603a7b225917293cbe1e9f (diff) | |
download | edk2-5220bd211df890f2672c23c050082862cd1e82d6.tar.gz edk2-5220bd211df890f2672c23c050082862cd1e82d6.tar.bz2 edk2-5220bd211df890f2672c23c050082862cd1e82d6.zip |
PcAtChipsetPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the PcAtChipsetPkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'PcAtChipsetPkg/Library/AcpiTimerLib')
4 files changed, 48 insertions, 43 deletions
diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c b/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c index bcb32545f3..d68eaccf1f 100644 --- a/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c @@ -15,7 +15,9 @@ #include <Library/DebugLib.h>
#include <IndustryStandard/Acpi.h>
-GUID mFrequencyHobGuid = { 0x3fca54f6, 0xe1a2, 0x4b20, { 0xbe, 0x76, 0x92, 0x6b, 0x4b, 0x48, 0xbf, 0xaa }};
+GUID mFrequencyHobGuid = {
+ 0x3fca54f6, 0xe1a2, 0x4b20, { 0xbe, 0x76, 0x92, 0x6b, 0x4b, 0x48, 0xbf, 0xaa }
+};
/**
Internal function to retrieves the 64-bit frequency in Hz.
@@ -45,11 +47,11 @@ AcpiTimerLibConstructor ( VOID
)
{
- UINTN Bus;
- UINTN Device;
- UINTN Function;
- UINTN EnableRegister;
- UINT8 EnableMask;
+ UINTN Bus;
+ UINTN Device;
+ UINTN Function;
+ UINTN EnableRegister;
+ UINT8 EnableMask;
//
// ASSERT for the invalid PCD values. They must be configured to the real value.
@@ -69,18 +71,18 @@ AcpiTimerLibConstructor ( //
// ASSERT for the invalid PCD values. They must be configured to the real value.
//
- ASSERT (PcdGet8 (PcdAcpiIoPciDeviceNumber) != 0xFF);
- ASSERT (PcdGet8 (PcdAcpiIoPciFunctionNumber) != 0xFF);
+ ASSERT (PcdGet8 (PcdAcpiIoPciDeviceNumber) != 0xFF);
+ ASSERT (PcdGet8 (PcdAcpiIoPciFunctionNumber) != 0xFF);
ASSERT (PcdGet16 (PcdAcpiIoPciEnableRegisterOffset) != 0xFFFF);
//
// Retrieve the PCD values for the PCI configuration space required to program the ACPI I/O Port Base Address
//
- Bus = PcdGet8 (PcdAcpiIoPciBusNumber);
- Device = PcdGet8 (PcdAcpiIoPciDeviceNumber);
- Function = PcdGet8 (PcdAcpiIoPciFunctionNumber);
+ Bus = PcdGet8 (PcdAcpiIoPciBusNumber);
+ Device = PcdGet8 (PcdAcpiIoPciDeviceNumber);
+ Function = PcdGet8 (PcdAcpiIoPciFunctionNumber);
EnableRegister = PcdGet16 (PcdAcpiIoPciEnableRegisterOffset);
- EnableMask = PcdGet8 (PcdAcpiIoBarEnableMask);
+ EnableMask = PcdGet8 (PcdAcpiIoBarEnableMask);
//
// If ACPI I/O space is not enabled yet, program ACPI I/O base address and enable it.
@@ -122,12 +124,14 @@ InternalAcpiGetAcpiTimerIoPort ( // value other than PcdAcpiIoPortBaseAddress
//
if (PcdGet16 (PcdAcpiIoPciBarRegisterOffset) != 0x0000) {
- Port = PciRead16 (PCI_LIB_ADDRESS (
- PcdGet8 (PcdAcpiIoPciBusNumber),
- PcdGet8 (PcdAcpiIoPciDeviceNumber),
- PcdGet8 (PcdAcpiIoPciFunctionNumber),
- PcdGet16 (PcdAcpiIoPciBarRegisterOffset)
- ));
+ Port = PciRead16 (
+ PCI_LIB_ADDRESS (
+ PcdGet8 (PcdAcpiIoPciBusNumber),
+ PcdGet8 (PcdAcpiIoPciDeviceNumber),
+ PcdGet8 (PcdAcpiIoPciFunctionNumber),
+ PcdGet16 (PcdAcpiIoPciBarRegisterOffset)
+ )
+ );
}
return (Port & PcdGet16 (PcdAcpiIoPortBaseAddressMask)) + PcdGet16 (PcdAcpiPm1TmrOffset);
@@ -147,9 +151,9 @@ InternalAcpiDelay ( IN UINT32 Delay
)
{
- UINT16 Port;
- UINT32 Ticks;
- UINT32 Times;
+ UINT16 Port;
+ UINT32 Ticks;
+ UINT32 Times;
Port = InternalAcpiGetAcpiTimerIoPort ();
Times = Delay >> 22;
@@ -285,6 +289,7 @@ GetPerformanceCounterProperties ( if (EndValue != NULL) {
*EndValue = 0xffffffffffffffffULL;
}
+
return InternalGetPerformanceCounterFrequency ();
}
@@ -324,9 +329,9 @@ GetTimeInNanoSecond ( // Since 2^29 < 1,000,000,000 = 0x3B9ACA00 < 2^30, Remainder should < 2^(64-30) = 2^34,
// i.e. highest bit set in Remainder should <= 33.
//
- Shift = MAX (0, HighBitSet64 (Remainder) - 33);
- Remainder = RShiftU64 (Remainder, (UINTN) Shift);
- Frequency = RShiftU64 (Frequency, (UINTN) Shift);
+ Shift = MAX (0, HighBitSet64 (Remainder) - 33);
+ Remainder = RShiftU64 (Remainder, (UINTN)Shift);
+ Frequency = RShiftU64 (Frequency, (UINTN)Shift);
NanoSeconds += DivU64x64Remainder (MultU64x32 (Remainder, 1000000000u), Frequency, NULL);
return NanoSeconds;
@@ -352,12 +357,12 @@ InternalCalculateTscFrequency ( VOID
)
{
- UINT64 StartTSC;
- UINT64 EndTSC;
- UINT16 TimerAddr;
- UINT32 Ticks;
- UINT64 TscFrequency;
- BOOLEAN InterruptState;
+ UINT64 StartTSC;
+ UINT64 EndTSC;
+ UINT16 TimerAddr;
+ UINT32 Ticks;
+ UINT64 TscFrequency;
+ BOOLEAN InterruptState;
InterruptState = SaveAndDisableInterrupts ();
@@ -377,8 +382,9 @@ InternalCalculateTscFrequency ( // the while loop will exit.
//
while (((Ticks - IoBitFieldRead32 (TimerAddr, 0, 23)) & BIT23) == 0) {
- CpuPause();
+ CpuPause ();
}
+
EndTSC = AsmReadTsc (); // TSC value 101.4 us later
TscFrequency = MultU64x32 (
diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c index 0e401194d0..16ac48938f 100644 --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c @@ -11,7 +11,7 @@ #include <Library/BaseLib.h>
#include <Library/HobLib.h>
-extern GUID mFrequencyHobGuid;
+extern GUID mFrequencyHobGuid;
/**
The constructor function enables ACPI IO space.
@@ -66,7 +66,7 @@ InternalGetPerformanceCounterFrequency ( VOID
)
{
- return mPerformanceCounterFrequency;
+ return mPerformanceCounterFrequency;
}
/**
@@ -80,7 +80,7 @@ CommonAcpiTimerLibConstructor ( VOID
)
{
- EFI_HOB_GUID_TYPE *GuidHob;
+ EFI_HOB_GUID_TYPE *GuidHob;
//
// Enable ACPI IO space.
@@ -92,7 +92,7 @@ CommonAcpiTimerLibConstructor ( //
GuidHob = GetFirstGuidHob (&mFrequencyHobGuid);
if (GuidHob != NULL) {
- mPerformanceCounterFrequency = *(UINT64*)GET_GUID_HOB_DATA (GuidHob);
+ mPerformanceCounterFrequency = *(UINT64 *)GET_GUID_HOB_DATA (GuidHob);
} else {
mPerformanceCounterFrequency = InternalCalculateTscFrequency ();
}
diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.h b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.h index 6015d684e5..455d82a840 100644 --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.h +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.h @@ -6,7 +6,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/
-
#ifndef _DXE_STANDALONE_MM_ACPI_TIMER_LIB_H_
#define _DXE_STANDALONE_MM_ACPI_TIMER_LIB_H_
diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/PeiAcpiTimerLib.c b/PcAtChipsetPkg/Library/AcpiTimerLib/PeiAcpiTimerLib.c index a669794c3b..c2f629486d 100644 --- a/PcAtChipsetPkg/Library/AcpiTimerLib/PeiAcpiTimerLib.c +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/PeiAcpiTimerLib.c @@ -12,7 +12,7 @@ #include <Library/HobLib.h>
#include <Library/DebugLib.h>
-extern GUID mFrequencyHobGuid;
+extern GUID mFrequencyHobGuid;
/**
Calculate TSC frequency.
@@ -47,18 +47,18 @@ InternalGetPerformanceCounterFrequency ( VOID
)
{
- UINT64 *PerformanceCounterFrequency;
- EFI_HOB_GUID_TYPE *GuidHob;
+ UINT64 *PerformanceCounterFrequency;
+ EFI_HOB_GUID_TYPE *GuidHob;
PerformanceCounterFrequency = NULL;
- GuidHob = GetFirstGuidHob (&mFrequencyHobGuid);
+ GuidHob = GetFirstGuidHob (&mFrequencyHobGuid);
if (GuidHob == NULL) {
- PerformanceCounterFrequency = (UINT64*)BuildGuidHob(&mFrequencyHobGuid, sizeof (*PerformanceCounterFrequency));
+ PerformanceCounterFrequency = (UINT64 *)BuildGuidHob (&mFrequencyHobGuid, sizeof (*PerformanceCounterFrequency));
ASSERT (PerformanceCounterFrequency != NULL);
*PerformanceCounterFrequency = InternalCalculateTscFrequency ();
} else {
- PerformanceCounterFrequency = (UINT64*)GET_GUID_HOB_DATA (GuidHob);
+ PerformanceCounterFrequency = (UINT64 *)GET_GUID_HOB_DATA (GuidHob);
}
- return *PerformanceCounterFrequency;
+ return *PerformanceCounterFrequency;
}
|