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>
This commit is contained in:
committed by
mergify[bot]
parent
e7108d0e96
commit
a550d468a6
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user