summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Library/PL031RealTimeClockLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:52 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit40b0b23ed34f48c26d711d3e4613a4bb35eeadff (patch)
treeaba2ec9c8c50e4deb9486a16297ba496c4a302d2 /ArmPlatformPkg/Library/PL031RealTimeClockLib
parent429309e0c6b74792d679681a8edd0d5ae0ff850c (diff)
downloadedk2-40b0b23ed34f48c26d711d3e4613a4bb35eeadff.tar.gz
edk2-40b0b23ed34f48c26d711d3e4613a4bb35eeadff.tar.bz2
edk2-40b0b23ed34f48c26d711d3e4613a4bb35eeadff.zip
ArmPlatformPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmPlatformPkg 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: Andrew Fish <afish@apple.com>
Diffstat (limited to 'ArmPlatformPkg/Library/PL031RealTimeClockLib')
-rw-r--r--ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClock.h43
-rw-r--r--ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c77
2 files changed, 60 insertions, 60 deletions
diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClock.h b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClock.h
index 6112a42638..00b3fc99ac 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClock.h
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClock.h
@@ -6,34 +6,33 @@
**/
-
#ifndef __PL031_REAL_TIME_CLOCK_H__
#define __PL031_REAL_TIME_CLOCK_H__
// PL031 Registers
-#define PL031_RTC_DR_DATA_REGISTER 0x000
-#define PL031_RTC_MR_MATCH_REGISTER 0x004
-#define PL031_RTC_LR_LOAD_REGISTER 0x008
-#define PL031_RTC_CR_CONTROL_REGISTER 0x00C
-#define PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGISTER 0x010
-#define PL031_RTC_RIS_RAW_IRQ_STATUS_REGISTER 0x014
-#define PL031_RTC_MIS_MASKED_IRQ_STATUS_REGISTER 0x018
-#define PL031_RTC_ICR_IRQ_CLEAR_REGISTER 0x01C
-#define PL031_RTC_PERIPH_ID0 0xFE0
-#define PL031_RTC_PERIPH_ID1 0xFE4
-#define PL031_RTC_PERIPH_ID2 0xFE8
-#define PL031_RTC_PERIPH_ID3 0xFEC
-#define PL031_RTC_PCELL_ID0 0xFF0
-#define PL031_RTC_PCELL_ID1 0xFF4
-#define PL031_RTC_PCELL_ID2 0xFF8
-#define PL031_RTC_PCELL_ID3 0xFFC
+#define PL031_RTC_DR_DATA_REGISTER 0x000
+#define PL031_RTC_MR_MATCH_REGISTER 0x004
+#define PL031_RTC_LR_LOAD_REGISTER 0x008
+#define PL031_RTC_CR_CONTROL_REGISTER 0x00C
+#define PL031_RTC_IMSC_IRQ_MASK_SET_CLEAR_REGISTER 0x010
+#define PL031_RTC_RIS_RAW_IRQ_STATUS_REGISTER 0x014
+#define PL031_RTC_MIS_MASKED_IRQ_STATUS_REGISTER 0x018
+#define PL031_RTC_ICR_IRQ_CLEAR_REGISTER 0x01C
+#define PL031_RTC_PERIPH_ID0 0xFE0
+#define PL031_RTC_PERIPH_ID1 0xFE4
+#define PL031_RTC_PERIPH_ID2 0xFE8
+#define PL031_RTC_PERIPH_ID3 0xFEC
+#define PL031_RTC_PCELL_ID0 0xFF0
+#define PL031_RTC_PCELL_ID1 0xFF4
+#define PL031_RTC_PCELL_ID2 0xFF8
+#define PL031_RTC_PCELL_ID3 0xFFC
// PL031 Values
-#define PL031_RTC_ENABLED 0x00000001
-#define PL031_SET_IRQ_MASK 0x00000001
-#define PL031_IRQ_TRIGGERED 0x00000001
-#define PL031_CLEAR_IRQ 0x00000001
+#define PL031_RTC_ENABLED 0x00000001
+#define PL031_SET_IRQ_MASK 0x00000001
+#define PL031_IRQ_TRIGGERED 0x00000001
+#define PL031_CLEAR_IRQ 0x00000001
-#define PL031_COUNTS_PER_SECOND 1
+#define PL031_COUNTS_PER_SECOND 1
#endif
diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index 3afef4bf9a..a203299c06 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -31,38 +31,40 @@
#include "PL031RealTimeClock.h"
-STATIC BOOLEAN mPL031Initialized = FALSE;
-STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;
-STATIC UINTN mPL031RtcBase;
+STATIC BOOLEAN mPL031Initialized = FALSE;
+STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;
+STATIC UINTN mPL031RtcBase;
EFI_STATUS
IdentifyPL031 (
VOID
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
// Check if this is a PrimeCell Peripheral
if ( (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID0) != 0x0D)
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID1) != 0xF0)
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID2) != 0x05)
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID3) != 0xB1)) {
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID1) != 0xF0)
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID2) != 0x05)
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID3) != 0xB1))
+ {
Status = EFI_NOT_FOUND;
goto EXIT;
}
// Check if this PrimeCell Peripheral is the PL031 Real Time Clock
if ( (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID0) != 0x31)
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID1) != 0x10)
- || ((MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID2) & 0xF) != 0x04)
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID3) != 0x00)) {
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID1) != 0x10)
+ || ((MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID2) & 0xF) != 0x04)
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID3) != 0x00))
+ {
Status = EFI_NOT_FOUND;
goto EXIT;
}
Status = EFI_SUCCESS;
- EXIT:
+EXIT:
return Status;
}
@@ -71,10 +73,10 @@ InitializePL031 (
VOID
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
// Prepare the hardware
- Status = IdentifyPL031();
+ Status = IdentifyPL031 ();
if (EFI_ERROR (Status)) {
goto EXIT;
}
@@ -96,7 +98,7 @@ InitializePL031 (
mPL031Initialized = TRUE;
- EXIT:
+EXIT:
return Status;
}
@@ -117,8 +119,8 @@ InitializePL031 (
EFI_STATUS
EFIAPI
LibGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
+ OUT EFI_TIME *Time,
+ OUT EFI_TIME_CAPABILITIES *Capabilities
)
{
EFI_STATUS Status;
@@ -154,17 +156,16 @@ LibGetTime (
// Update the Capabilities info
if (Capabilities != NULL) {
// PL031 runs at frequency 1Hz
- Capabilities->Resolution = PL031_COUNTS_PER_SECOND;
+ Capabilities->Resolution = PL031_COUNTS_PER_SECOND;
// Accuracy in ppm multiplied by 1,000,000, e.g. for 50ppm set 50,000,000
- Capabilities->Accuracy = (UINT32)PcdGet32 (PcdPL031RtcPpmAccuracy);
+ Capabilities->Accuracy = (UINT32)PcdGet32 (PcdPL031RtcPpmAccuracy);
// FALSE: Setting the time does not clear the values below the resolution level
- Capabilities->SetsToZero = FALSE;
+ Capabilities->SetsToZero = FALSE;
}
return EFI_SUCCESS;
}
-
/**
Sets the current local time and date information.
@@ -178,7 +179,7 @@ LibGetTime (
EFI_STATUS
EFIAPI
LibSetTime (
- IN EFI_TIME *Time
+ IN EFI_TIME *Time
)
{
EFI_STATUS Status;
@@ -217,7 +218,6 @@ LibSetTime (
return EFI_SUCCESS;
}
-
/**
Returns the current wakeup alarm clock setting.
@@ -233,16 +233,15 @@ LibSetTime (
EFI_STATUS
EFIAPI
LibGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
+ OUT BOOLEAN *Enabled,
+ OUT BOOLEAN *Pending,
+ OUT EFI_TIME *Time
)
{
// Not a required feature
return EFI_UNSUPPORTED;
}
-
/**
Sets the system wakeup alarm clock time.
@@ -259,8 +258,8 @@ LibGetWakeupTime (
EFI_STATUS
EFIAPI
LibSetWakeupTime (
- IN BOOLEAN Enabled,
- OUT EFI_TIME *Time
+ IN BOOLEAN Enabled,
+ OUT EFI_TIME *Time
)
{
// Not a required feature
@@ -278,8 +277,8 @@ LibSetWakeupTime (
VOID
EFIAPI
LibRtcVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
//
@@ -288,7 +287,7 @@ LibRtcVirtualNotifyEvent (
// to virtual address. After the OS transitions to calling in virtual mode, all future
// runtime calls will be made in virtual mode.
//
- EfiConvertPointer (0x0, (VOID**)&mPL031RtcBase);
+ EfiConvertPointer (0x0, (VOID **)&mPL031RtcBase);
return;
}
@@ -305,12 +304,12 @@ LibRtcVirtualNotifyEvent (
EFI_STATUS
EFIAPI
LibRtcInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
+ EFI_STATUS Status;
+ EFI_HANDLE Handle;
// Initialize RTC Base Address
mPL031RtcBase = PcdGet32 (PcdPL031RtcBase);
@@ -318,7 +317,8 @@ LibRtcInitialize (
// Declare the controller as EFI_MEMORY_RUNTIME
Status = gDS->AddMemorySpace (
EfiGcdMemoryTypeMemoryMappedIo,
- mPL031RtcBase, SIZE_4KB,
+ mPL031RtcBase,
+ SIZE_4KB,
EFI_MEMORY_UC | EFI_MEMORY_RUNTIME
);
if (EFI_ERROR (Status)) {
@@ -334,9 +334,10 @@ LibRtcInitialize (
Handle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
&Handle,
- &gEfiRealTimeClockArchProtocolGuid, NULL,
+ &gEfiRealTimeClockArchProtocolGuid,
+ NULL,
NULL
- );
+ );
ASSERT_EFI_ERROR (Status);
//