summaryrefslogtreecommitdiffstats
path: root/PcAtChipsetPkg/Library
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:10 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit5220bd211df890f2672c23c050082862cd1e82d6 (patch)
treeef9ce787723fcb52a0e8812d7ce335f9f6614e86 /PcAtChipsetPkg/Library
parentac0a286f4d747a4c6c603a7b225917293cbe1e9f (diff)
downloadedk2-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')
-rw-r--r--PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c68
-rw-r--r--PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c8
-rw-r--r--PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.h1
-rw-r--r--PcAtChipsetPkg/Library/AcpiTimerLib/PeiAcpiTimerLib.c14
-rw-r--r--PcAtChipsetPkg/Library/BaseIoApicLib/IoApicLib.c6
-rw-r--r--PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.c45
-rw-r--r--PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c153
7 files changed, 149 insertions, 146 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;
}
diff --git a/PcAtChipsetPkg/Library/BaseIoApicLib/IoApicLib.c b/PcAtChipsetPkg/Library/BaseIoApicLib/IoApicLib.c
index 9e4a58049e..53ce15c4e0 100644
--- a/PcAtChipsetPkg/Library/BaseIoApicLib/IoApicLib.c
+++ b/PcAtChipsetPkg/Library/BaseIoApicLib/IoApicLib.c
@@ -86,7 +86,7 @@ IoApicEnableInterrupt (
ASSERT (Irq <= Version.Bits.MaximumRedirectionEntry);
Entry.Uint32.Low = IoApicRead (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2);
- Entry.Bits.Mask = Enable ? 0 : 1;
+ Entry.Bits.Mask = Enable ? 0 : 1;
IoApicWrite (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2, Entry.Uint32.Low);
}
@@ -137,7 +137,7 @@ IoApicConfigureInterrupt (
ASSERT (Vector <= 0xFF);
ASSERT (DeliveryMode < 8 && DeliveryMode != 6 && DeliveryMode != 3);
- Entry.Uint32.Low = IoApicRead (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2);
+ Entry.Uint32.Low = IoApicRead (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2);
Entry.Bits.Vector = (UINT8)Vector;
Entry.Bits.DeliveryMode = (UINT32)DeliveryMode;
Entry.Bits.DestinationMode = 0;
@@ -146,7 +146,7 @@ IoApicConfigureInterrupt (
Entry.Bits.Mask = 1;
IoApicWrite (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2, Entry.Uint32.Low);
- Entry.Uint32.High = IoApicRead (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2 + 1);
+ Entry.Uint32.High = IoApicRead (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2 + 1);
Entry.Bits.DestinationID = GetApicId ();
IoApicWrite (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2 + 1, Entry.Uint32.High);
}
diff --git a/PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.c b/PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.c
index e42c41c48e..4f3cb46d6e 100644
--- a/PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -29,7 +29,7 @@ ResetCold (
VOID
)
{
- IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
+ IoWrite8 ((UINTN)PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
}
/**
@@ -45,7 +45,7 @@ ResetWarm (
VOID
)
{
- IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
+ IoWrite8 ((UINTN)PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
}
/**
@@ -64,7 +64,6 @@ ResetShutdown (
ASSERT (FALSE);
}
-
/**
This function causes a systemwide reset. The exact type of the reset is
defined by the EFI_GUID that follows the Null-terminated Unicode string passed
@@ -79,8 +78,8 @@ ResetShutdown (
VOID
EFIAPI
ResetPlatformSpecific (
- IN UINTN DataSize,
- IN VOID *ResetData
+ IN UINTN DataSize,
+ IN VOID *ResetData
)
{
ResetCold ();
@@ -101,30 +100,30 @@ ResetPlatformSpecific (
VOID
EFIAPI
ResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN VOID *ResetData OPTIONAL
+ IN EFI_RESET_TYPE ResetType,
+ IN EFI_STATUS ResetStatus,
+ IN UINTN DataSize,
+ IN VOID *ResetData OPTIONAL
)
{
switch (ResetType) {
- case EfiResetWarm:
- ResetWarm ();
- break;
+ case EfiResetWarm:
+ ResetWarm ();
+ break;
- case EfiResetCold:
- ResetCold ();
- break;
+ case EfiResetCold:
+ ResetCold ();
+ break;
- case EfiResetShutdown:
- ResetShutdown ();
- return;
+ case EfiResetShutdown:
+ ResetShutdown ();
+ return;
- case EfiResetPlatformSpecific:
- ResetPlatformSpecific (DataSize, ResetData);
- return;
+ case EfiResetPlatformSpecific:
+ ResetPlatformSpecific (DataSize, ResetData);
+ return;
- default:
- return;
+ default:
+ return;
}
}
diff --git a/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c b/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
index aa5657a7fd..11537ec276 100644
--- a/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
+++ b/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
@@ -10,39 +10,39 @@
#include <Library/IoLib.h>
#include <Library/SerialPortLib.h>
-//---------------------------------------------
+// ---------------------------------------------
// UART Register Offsets
-//---------------------------------------------
-#define BAUD_LOW_OFFSET 0x00
-#define BAUD_HIGH_OFFSET 0x01
-#define IER_OFFSET 0x01
-#define LCR_SHADOW_OFFSET 0x01
-#define FCR_SHADOW_OFFSET 0x02
-#define IR_CONTROL_OFFSET 0x02
-#define FCR_OFFSET 0x02
-#define EIR_OFFSET 0x02
-#define BSR_OFFSET 0x03
-#define LCR_OFFSET 0x03
-#define MCR_OFFSET 0x04
-#define LSR_OFFSET 0x05
-#define MSR_OFFSET 0x06
-
-//---------------------------------------------
+// ---------------------------------------------
+#define BAUD_LOW_OFFSET 0x00
+#define BAUD_HIGH_OFFSET 0x01
+#define IER_OFFSET 0x01
+#define LCR_SHADOW_OFFSET 0x01
+#define FCR_SHADOW_OFFSET 0x02
+#define IR_CONTROL_OFFSET 0x02
+#define FCR_OFFSET 0x02
+#define EIR_OFFSET 0x02
+#define BSR_OFFSET 0x03
+#define LCR_OFFSET 0x03
+#define MCR_OFFSET 0x04
+#define LSR_OFFSET 0x05
+#define MSR_OFFSET 0x06
+
+// ---------------------------------------------
// UART Register Bit Defines
-//---------------------------------------------
-#define LSR_TXRDY 0x20
-#define LSR_RXDA 0x01
-#define DLAB 0x01
-#define MCR_DTRC 0x01
-#define MCR_RTS 0x02
-#define MSR_CTS 0x10
-#define MSR_DSR 0x20
-#define MSR_RI 0x40
-#define MSR_DCD 0x80
-
-//---------------------------------------------
+// ---------------------------------------------
+#define LSR_TXRDY 0x20
+#define LSR_RXDA 0x01
+#define DLAB 0x01
+#define MCR_DTRC 0x01
+#define MCR_RTS 0x02
+#define MSR_CTS 0x10
+#define MSR_DSR 0x20
+#define MSR_RI 0x40
+#define MSR_DCD 0x80
+
+// ---------------------------------------------
// UART Settings
-//---------------------------------------------
+// ---------------------------------------------
UINT16 gUartBase = 0x3F8;
UINTN gBps = 115200;
UINT8 gData = 8;
@@ -74,7 +74,7 @@ SerialPortInitialize (
//
// Map 5..8 to 0..3
//
- Data = (UINT8) (gData - (UINT8) 5);
+ Data = (UINT8)(gData - (UINT8)5);
//
// Calculate divisor for baud generator
@@ -84,19 +84,19 @@ SerialPortInitialize (
//
// Set communications format
//
- OutputData = (UINT8) ((DLAB << 7) | (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);
+ OutputData = (UINT8)((DLAB << 7) | (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);
IoWrite8 (gUartBase + LCR_OFFSET, OutputData);
//
// Configure baud rate
//
- IoWrite8 (gUartBase + BAUD_HIGH_OFFSET, (UINT8) (Divisor >> 8));
- IoWrite8 (gUartBase + BAUD_LOW_OFFSET, (UINT8) (Divisor & 0xff));
+ IoWrite8 (gUartBase + BAUD_HIGH_OFFSET, (UINT8)(Divisor >> 8));
+ IoWrite8 (gUartBase + BAUD_LOW_OFFSET, (UINT8)(Divisor & 0xff));
//
// Switch back to bank 0
//
- OutputData = (UINT8) ( (gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);
+ OutputData = (UINT8)((gBreakSet << 6) | (gParity << 3) | (gStop << 2) | Data);
IoWrite8 (gUartBase + LCR_OFFSET, OutputData);
return RETURN_SUCCESS;
@@ -124,9 +124,9 @@ SerialPortInitialize (
UINTN
EFIAPI
SerialPortWrite (
- IN UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
+ IN UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ )
{
UINTN Result;
UINT8 Data;
@@ -142,15 +142,15 @@ SerialPortWrite (
// Wait for the serial port to be ready.
//
do {
- Data = IoRead8 ((UINT16) gUartBase + LSR_OFFSET);
+ Data = IoRead8 ((UINT16)gUartBase + LSR_OFFSET);
} while ((Data & LSR_TXRDY) == 0);
- IoWrite8 ((UINT16) gUartBase, *Buffer++);
+
+ IoWrite8 ((UINT16)gUartBase, *Buffer++);
}
return Result;
}
-
/**
Reads data from a serial device into a buffer.
@@ -165,9 +165,9 @@ SerialPortWrite (
UINTN
EFIAPI
SerialPortRead (
- OUT UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
+ OUT UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ )
{
UINTN Result;
UINT8 Data;
@@ -183,10 +183,10 @@ SerialPortRead (
// Wait for the serial port to be ready.
//
do {
- Data = IoRead8 ((UINT16) gUartBase + LSR_OFFSET);
+ Data = IoRead8 ((UINT16)gUartBase + LSR_OFFSET);
} while ((Data & LSR_RXDA) == 0);
- *Buffer++ = IoRead8 ((UINT16) gUartBase);
+ *Buffer++ = IoRead8 ((UINT16)gUartBase);
}
return Result;
@@ -214,9 +214,9 @@ SerialPortPoll (
//
// Read the serial port status.
//
- Data = IoRead8 ((UINT16) gUartBase + LSR_OFFSET);
+ Data = IoRead8 ((UINT16)gUartBase + LSR_OFFSET);
- return (BOOLEAN) ((Data & LSR_RXDA) != 0);
+ return (BOOLEAN)((Data & LSR_RXDA) != 0);
}
/**
@@ -232,10 +232,10 @@ SerialPortPoll (
RETURN_STATUS
EFIAPI
SerialPortSetControl (
- IN UINT32 Control
+ IN UINT32 Control
)
{
- UINT8 Mcr;
+ UINT8 Mcr;
//
// First determine the parameter is invalid.
@@ -247,7 +247,7 @@ SerialPortSetControl (
//
// Read the Modem Control Register.
//
- Mcr = IoRead8 ((UINT16) gUartBase + MCR_OFFSET);
+ Mcr = IoRead8 ((UINT16)gUartBase + MCR_OFFSET);
Mcr &= (~(MCR_DTRC | MCR_RTS));
if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) == EFI_SERIAL_DATA_TERMINAL_READY) {
@@ -261,7 +261,7 @@ SerialPortSetControl (
//
// Write the Modem Control Register.
//
- IoWrite8 ((UINT16) gUartBase + MCR_OFFSET, Mcr);
+ IoWrite8 ((UINT16)gUartBase + MCR_OFFSET, Mcr);
return RETURN_SUCCESS;
}
@@ -279,19 +279,19 @@ SerialPortSetControl (
RETURN_STATUS
EFIAPI
SerialPortGetControl (
- OUT UINT32 *Control
+ OUT UINT32 *Control
)
{
- UINT8 Msr;
- UINT8 Mcr;
- UINT8 Lsr;
+ UINT8 Msr;
+ UINT8 Mcr;
+ UINT8 Lsr;
*Control = 0;
//
// Read the Modem Status Register.
//
- Msr = IoRead8 ((UINT16) gUartBase + MSR_OFFSET);
+ Msr = IoRead8 ((UINT16)gUartBase + MSR_OFFSET);
if ((Msr & MSR_CTS) == MSR_CTS) {
*Control |= EFI_SERIAL_CLEAR_TO_SEND;
@@ -312,7 +312,7 @@ SerialPortGetControl (
//
// Read the Modem Control Register.
//
- Mcr = IoRead8 ((UINT16) gUartBase + MCR_OFFSET);
+ Mcr = IoRead8 ((UINT16)gUartBase + MCR_OFFSET);
if ((Mcr & MCR_DTRC) == MCR_DTRC) {
*Control |= EFI_SERIAL_DATA_TERMINAL_READY;
@@ -325,7 +325,7 @@ SerialPortGetControl (
//
// Read the Line Status Register.
//
- Lsr = IoRead8 ((UINT16) gUartBase + LSR_OFFSET);
+ Lsr = IoRead8 ((UINT16)gUartBase + LSR_OFFSET);
if ((Lsr & LSR_TXRDY) == LSR_TXRDY) {
*Control |= EFI_SERIAL_OUTPUT_BUFFER_EMPTY;
@@ -374,19 +374,19 @@ SerialPortGetControl (
RETURN_STATUS
EFIAPI
SerialPortSetAttributes (
- IN OUT UINT64 *BaudRate,
- IN OUT UINT32 *ReceiveFifoDepth,
- IN OUT UINT32 *Timeout,
- IN OUT EFI_PARITY_TYPE *Parity,
- IN OUT UINT8 *DataBits,
- IN OUT EFI_STOP_BITS_TYPE *StopBits
+ IN OUT UINT64 *BaudRate,
+ IN OUT UINT32 *ReceiveFifoDepth,
+ IN OUT UINT32 *Timeout,
+ IN OUT EFI_PARITY_TYPE *Parity,
+ IN OUT UINT8 *DataBits,
+ IN OUT EFI_STOP_BITS_TYPE *StopBits
)
{
- UINTN Divisor;
- UINT8 OutputData;
- UINT8 LcrData;
- UINT8 LcrParity;
- UINT8 LcrStop;
+ UINTN Divisor;
+ UINT8 OutputData;
+ UINT8 LcrData;
+ UINT8 LcrParity;
+ UINT8 LcrStop;
//
// Check for default settings and fill in actual values.
@@ -414,7 +414,7 @@ SerialPortSetAttributes (
//
// Map 5..8 to 0..3
//
- LcrData = (UINT8) (*DataBits - (UINT8) 5);
+ LcrData = (UINT8)(*DataBits - (UINT8)5);
switch (*Parity) {
case NoParity:
@@ -458,26 +458,25 @@ SerialPortSetAttributes (
//
// Calculate divisor for baud generator
//
- Divisor = 115200 / (UINTN) *BaudRate;
+ Divisor = 115200 / (UINTN)*BaudRate;
//
// Set communications format
//
- OutputData = (UINT8) ((DLAB << 7) | (gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);
+ OutputData = (UINT8)((DLAB << 7) | (gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);
IoWrite8 (gUartBase + LCR_OFFSET, OutputData);
//
// Configure baud rate
//
- IoWrite8 (gUartBase + BAUD_HIGH_OFFSET, (UINT8) (Divisor >> 8));
- IoWrite8 (gUartBase + BAUD_LOW_OFFSET, (UINT8) (Divisor & 0xff));
+ IoWrite8 (gUartBase + BAUD_HIGH_OFFSET, (UINT8)(Divisor >> 8));
+ IoWrite8 (gUartBase + BAUD_LOW_OFFSET, (UINT8)(Divisor & 0xff));
//
// Switch back to bank 0
//
- OutputData = (UINT8) ((gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);
+ OutputData = (UINT8)((gBreakSet << 6) | (LcrParity << 3) | (LcrStop << 2) | LcrData);
IoWrite8 (gUartBase + LCR_OFFSET, OutputData);
return RETURN_SUCCESS;
}
-