summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:02 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit1436aea4d5707e672672a11bda72be2c63c936c3 (patch)
tree370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Universal/MonotonicCounterRuntimeDxe
parent7c7184e201a90a1d2376e615e55e3f4074731468 (diff)
downloadedk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2
MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg/Universal/MonotonicCounterRuntimeDxe')
-rw-r--r--MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c b/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c
index f74b0b8..60b6e93 100644
--- a/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c
+++ b/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounter.c
@@ -27,12 +27,12 @@ EFI_HANDLE mMonotonicCounterHandle = NULL;
//
// The current monotonic counter value
//
-UINT64 mEfiMtc;
+UINT64 mEfiMtc;
//
// Event to update the monotonic Counter's high part when low part overflows.
//
-EFI_EVENT mEfiMtcEvent;
+EFI_EVENT mEfiMtcEvent;
/**
Returns a monotonically increasing count for the platform.
@@ -59,7 +59,7 @@ MonotonicCounterDriverGetNextMonotonicCount (
OUT UINT64 *Count
)
{
- EFI_TPL OldTpl;
+ EFI_TPL OldTpl;
//
// Cannot be called after ExitBootServices()
@@ -67,17 +67,19 @@ MonotonicCounterDriverGetNextMonotonicCount (
if (EfiAtRuntime ()) {
return EFI_UNSUPPORTED;
}
+
//
// Check input parameters
//
if (Count == NULL) {
return EFI_INVALID_PARAMETER;
}
+
//
// Update the monotonic counter with a lock
//
- OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
- *Count = mEfiMtc;
+ OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
+ *Count = mEfiMtc;
mEfiMtc++;
gBS->RestoreTPL (OldTpl);
@@ -85,14 +87,13 @@ MonotonicCounterDriverGetNextMonotonicCount (
// If the low 32-bit counter overflows (MSB bit toggled),
// then signal that the high part needs update now.
//
- if ((((UINT32) mEfiMtc) ^ ((UINT32) *Count)) & BIT31) {
+ if ((((UINT32)mEfiMtc) ^ ((UINT32)*Count)) & BIT31) {
gBS->SignalEvent (mEfiMtcEvent);
}
return EFI_SUCCESS;
}
-
/**
Returns the next high 32 bits of the platform's monotonic counter.
@@ -132,7 +133,7 @@ MonotonicCounterDriverGetNextHighMonotonicCount (
OUT UINT32 *HighCount
)
{
- EFI_TPL OldTpl;
+ EFI_TPL OldTpl;
//
// Check input parameters
@@ -145,14 +146,15 @@ MonotonicCounterDriverGetNextHighMonotonicCount (
//
// Use a lock if called before ExitBootServices()
//
- OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
- *HighCount = (UINT32) RShiftU64 (mEfiMtc, 32) + 1;
- mEfiMtc = LShiftU64 (*HighCount, 32);
+ OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
+ *HighCount = (UINT32)RShiftU64 (mEfiMtc, 32) + 1;
+ mEfiMtc = LShiftU64 (*HighCount, 32);
gBS->RestoreTPL (OldTpl);
} else {
- *HighCount = (UINT32) RShiftU64 (mEfiMtc, 32) + 1;
- mEfiMtc = LShiftU64 (*HighCount, 32);
+ *HighCount = (UINT32)RShiftU64 (mEfiMtc, 32) + 1;
+ mEfiMtc = LShiftU64 (*HighCount, 32);
}
+
//
// Update the NV variable to match the new high part
//
@@ -163,7 +165,6 @@ MonotonicCounterDriverGetNextHighMonotonicCount (
sizeof (UINT32),
HighCount
);
-
}
/**
@@ -176,8 +177,8 @@ MonotonicCounterDriverGetNextHighMonotonicCount (
VOID
EFIAPI
EfiMtcEventHandler (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
UINT32 HighCount;
@@ -226,16 +227,17 @@ MonotonicCounterDriverInitialize (
// Read the last high part
//
BufferSize = sizeof (UINT32);
- Status = EfiGetVariable (
- MTC_VARIABLE_NAME,
- &gMtcVendorGuid,
- NULL,
- &BufferSize,
- &HighCount
- );
+ Status = EfiGetVariable (
+ MTC_VARIABLE_NAME,
+ &gMtcVendorGuid,
+ NULL,
+ &BufferSize,
+ &HighCount
+ );
if (EFI_ERROR (Status)) {
HighCount = 0;
}
+
//
// Set the current value
//
@@ -251,8 +253,8 @@ MonotonicCounterDriverInitialize (
//
// Fill in the EFI Boot Services and EFI Runtime Services Monotonic Counter Fields
//
- gBS->GetNextMonotonicCount = MonotonicCounterDriverGetNextMonotonicCount;
- gRT->GetNextHighMonotonicCount = MonotonicCounterDriverGetNextHighMonotonicCount;
+ gBS->GetNextMonotonicCount = MonotonicCounterDriverGetNextMonotonicCount;
+ gRT->GetNextHighMonotonicCount = MonotonicCounterDriverGetNextHighMonotonicCount;
//
// Install the Monotonic Counter Architctural Protocol onto a new handle