summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg/TimerDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:57 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commita550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97 (patch)
tree16ea0a059e01bb8af07f41dcea5996424c309a95 /EmulatorPkg/TimerDxe
parente7108d0e9655b1795c94ac372b0449f28dd907df (diff)
downloadedk2-a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97.tar.gz
edk2-a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97.tar.bz2
edk2-a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97.zip
EmulatorPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmulatorPkg 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 'EmulatorPkg/TimerDxe')
-rw-r--r--EmulatorPkg/TimerDxe/Timer.c42
-rw-r--r--EmulatorPkg/TimerDxe/Timer.h13
2 files changed, 28 insertions, 27 deletions
diff --git a/EmulatorPkg/TimerDxe/Timer.c b/EmulatorPkg/TimerDxe/Timer.c
index 8e2baaaa5b..4ec5c3ee28 100644
--- a/EmulatorPkg/TimerDxe/Timer.c
+++ b/EmulatorPkg/TimerDxe/Timer.c
@@ -27,12 +27,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// Pointer to the CPU Architectural Protocol instance
//
-EFI_CPU_ARCH_PROTOCOL *mCpu;
+EFI_CPU_ARCH_PROTOCOL *mCpu;
//
// The Timer Architectural Protocol that this driver produces
//
-EFI_TIMER_ARCH_PROTOCOL mTimer = {
+EFI_TIMER_ARCH_PROTOCOL mTimer = {
EmuTimerDriverRegisterHandler,
EmuTimerDriverSetTimerPeriod,
EmuTimerDriverGetTimerPeriod,
@@ -42,22 +42,22 @@ EFI_TIMER_ARCH_PROTOCOL mTimer = {
//
// The notification function to call on every timer interrupt
//
-EFI_TIMER_NOTIFY mTimerNotifyFunction = NULL;
+EFI_TIMER_NOTIFY mTimerNotifyFunction = NULL;
//
// The current period of the timer interrupt
//
-UINT64 mTimerPeriodMs;
-
+UINT64 mTimerPeriodMs;
VOID
EFIAPI
-TimerCallback (UINT64 DeltaMs)
+TimerCallback (
+ UINT64 DeltaMs
+ )
{
EFI_TPL OriginalTPL;
EFI_TIMER_NOTIFY CallbackFunction;
-
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
if (OriginalTPL < TPL_HIGH_LEVEL) {
@@ -73,15 +73,15 @@ TimerCallback (UINT64 DeltaMs)
}
gBS->RestoreTPL (OriginalTPL);
-
}
EFI_STATUS
EFIAPI
EmuTimerDriverRegisterHandler (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN EFI_TIMER_NOTIFY NotifyFunction
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ IN EFI_TIMER_NOTIFY NotifyFunction
)
+
/*++
Routine Description:
@@ -127,11 +127,11 @@ Returns:
//
// Check for invalid parameters
//
- if (NotifyFunction == NULL && mTimerNotifyFunction == NULL) {
+ if ((NotifyFunction == NULL) && (mTimerNotifyFunction == NULL)) {
return EFI_INVALID_PARAMETER;
}
- if (NotifyFunction != NULL && mTimerNotifyFunction != NULL) {
+ if ((NotifyFunction != NULL) && (mTimerNotifyFunction != NULL)) {
return EFI_ALREADY_STARTED;
}
@@ -142,6 +142,7 @@ Returns:
/* Enable Timer. */
gEmuThunk->SetTimer (mTimerPeriodMs, TimerCallback);
}
+
mTimerNotifyFunction = NotifyFunction;
return EFI_SUCCESS;
@@ -153,6 +154,7 @@ EmuTimerDriverSetTimerPeriod (
IN EFI_TIMER_ARCH_PROTOCOL *This,
IN UINT64 TimerPeriod
)
+
/*++
Routine Description:
@@ -190,14 +192,14 @@ Returns:
**/
{
-
//
// If TimerPeriod is 0, then the timer thread should be canceled
// If the TimerPeriod is valid, then create and/or adjust the period of the timer thread
//
- if (TimerPeriod == 0
- || ((TimerPeriod > TIMER_MINIMUM_VALUE)
- && (TimerPeriod < TIMER_MAXIMUM_VALUE))) {
+ if ( (TimerPeriod == 0)
+ || ( (TimerPeriod > TIMER_MINIMUM_VALUE)
+ && (TimerPeriod < TIMER_MAXIMUM_VALUE)))
+ {
mTimerPeriodMs = DivU64x32 (TimerPeriod + 5000, 10000);
gEmuThunk->SetTimer (mTimerPeriodMs, TimerCallback);
@@ -209,9 +211,10 @@ Returns:
EFI_STATUS
EFIAPI
EmuTimerDriverGetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- OUT UINT64 *TimerPeriod
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ OUT UINT64 *TimerPeriod
)
+
/*++
Routine Description:
@@ -250,6 +253,7 @@ EFIAPI
EmuTimerDriverGenerateSoftInterrupt (
IN EFI_TIMER_ARCH_PROTOCOL *This
)
+
/*++
Routine Description:
@@ -283,6 +287,7 @@ EmuTimerDriverInitialize (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
+
/*++
Routine Description:
@@ -341,6 +346,5 @@ Returns:
return Status;
}
-
return EFI_SUCCESS;
}
diff --git a/EmulatorPkg/TimerDxe/Timer.h b/EmulatorPkg/TimerDxe/Timer.h
index 861811f3a4..7a995e0d96 100644
--- a/EmulatorPkg/TimerDxe/Timer.h
+++ b/EmulatorPkg/TimerDxe/Timer.h
@@ -13,19 +13,16 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#ifndef _TIMER_H_
#define _TIMER_H_
-
-
-
//
// Legal timer value range in 100 ns units
//
-#define TIMER_MINIMUM_VALUE 0
-#define TIMER_MAXIMUM_VALUE (0x100000000ULL - 1)
+#define TIMER_MINIMUM_VALUE 0
+#define TIMER_MAXIMUM_VALUE (0x100000000ULL - 1)
//
// Default timer value in 100 ns units (50 ms)
//
-#define DEFAULT_TIMER_TICK_DURATION 500000
+#define DEFAULT_TIMER_TICK_DURATION 500000
//
// Function Prototypes
@@ -54,8 +51,8 @@ EmuTimerDriverSetTimerPeriod (
EFI_STATUS
EFIAPI
EmuTimerDriverGetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- OUT UINT64 *TimerPeriod
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ OUT UINT64 *TimerPeriod
);
EFI_STATUS