summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:12 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitc411b485b63a671a1e276700cff025c73997233c (patch)
treee7a57ca51b659161ab4bc9da95e988760ec57e7a /SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c
parent39de741e2dcb8f11e9b4438e37224797643d8451 (diff)
downloadedk2-c411b485b63a671a1e276700cff025c73997233c.tar.gz
edk2-c411b485b63a671a1e276700cff025c73997233c.tar.bz2
edk2-c411b485b63a671a1e276700cff025c73997233c.zip
SecurityPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the SecurityPkg 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: Jian J Wang <jian.j.wang@intel.com>
Diffstat (limited to 'SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c')
-rw-r--r--SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c105
1 files changed, 53 insertions, 52 deletions
diff --git a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c
index e5dd06ebcf..0addf575a0 100644
--- a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c
+++ b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c
@@ -12,7 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "TcgMor.h"
-UINT8 mMorControl;
+UINT8 mMorControl;
/**
Ready to Boot Event notification handler.
@@ -24,8 +24,8 @@ UINT8 mMorControl;
VOID
EFIAPI
OnReadyToBoot (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
EFI_STATUS Status;
@@ -35,8 +35,9 @@ OnReadyToBoot (
//
// MorControl is expected, directly return to avoid unnecessary variable operation
//
- return ;
+ return;
}
+
//
// Clear MOR_CLEAR_MEMORY_BIT
//
@@ -45,12 +46,12 @@ OnReadyToBoot (
DataSize = sizeof (mMorControl);
Status = gRT->SetVariable (
- MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
- &gEfiMemoryOverwriteControlDataGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- DataSize,
- &mMorControl
- );
+ MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
+ &gEfiMemoryOverwriteControlDataGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ DataSize,
+ &mMorControl
+ );
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "TcgMor: Clear MOR_CLEAR_MEMORY_BIT failure, Status = %r\n", Status));
}
@@ -70,11 +71,10 @@ OnReadyToBoot (
**/
VOID
InitiateTPerReset (
- IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Ssp,
- IN UINT32 MediaId
+ IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Ssp,
+ IN UINT32 MediaId
)
{
-
EFI_STATUS Status;
UINT8 *Buffer;
UINTN XferSize;
@@ -84,17 +84,17 @@ InitiateTPerReset (
BOOLEAN IeeeFlag;
SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA *Data;
- Buffer = NULL;
- TcgFlag = FALSE;
- IeeeFlag = FALSE;
+ Buffer = NULL;
+ TcgFlag = FALSE;
+ IeeeFlag = FALSE;
//
// ATA8-ACS 7.57.6.1 indicates the Transfer Length field requirements a multiple of 512.
// If the length of the TRUSTED RECEIVE parameter data is greater than the Transfer Length,
// then the device shall return the TRUSTED RECEIVE parameter data truncated to the requested Transfer Length.
//
- Len = ROUNDUP512(sizeof(SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA));
- Buffer = AllocateZeroPool(Len);
+ Len = ROUNDUP512 (sizeof (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA));
+ Buffer = AllocateZeroPool (Len);
if (Buffer == NULL) {
return;
@@ -122,17 +122,18 @@ InitiateTPerReset (
// In returned data, the ListLength field indicates the total length, in bytes,
// of the supported security protocol list.
//
- Data = (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA*)Buffer;
- Len = ROUNDUP512(sizeof (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA) +
- (Data->SupportedSecurityListLength[0] << 8) +
- (Data->SupportedSecurityListLength[1])
- );
+ Data = (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA *)Buffer;
+ Len = ROUNDUP512 (
+ sizeof (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA) +
+ (Data->SupportedSecurityListLength[0] << 8) +
+ (Data->SupportedSecurityListLength[1])
+ );
//
// Free original buffer and allocate new buffer.
//
- FreePool(Buffer);
- Buffer = AllocateZeroPool(Len);
+ FreePool (Buffer);
+ Buffer = AllocateZeroPool (Len);
if (Buffer == NULL) {
return;
}
@@ -155,7 +156,7 @@ InitiateTPerReset (
goto Exit;
}
- Data = (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA*)Buffer;
+ Data = (SUPPORTED_SECURITY_PROTOCOLS_PARAMETER_DATA *)Buffer;
Len = (Data->SupportedSecurityListLength[0] << 8) + Data->SupportedSecurityListLength[1];
//
@@ -219,7 +220,7 @@ InitiateTPerReset (
Exit:
if (Buffer != NULL) {
- FreePool(Buffer);
+ FreePool (Buffer);
}
}
@@ -237,12 +238,12 @@ TPerResetAtEndOfDxe (
IN VOID *Context
)
{
- EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Ssp;
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_STATUS Status;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- UINTN Index;
+ EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Ssp;
+ EFI_BLOCK_IO_PROTOCOL *BlockIo;
+ EFI_STATUS Status;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
+ UINTN Index;
//
// Locate all SSP protocol instances.
@@ -262,24 +263,24 @@ TPerResetAtEndOfDxe (
return;
}
- for (Index = 0; Index < HandleCount; Index ++) {
+ for (Index = 0; Index < HandleCount; Index++) {
//
// Get the SSP interface.
//
- Status = gBS->HandleProtocol(
+ Status = gBS->HandleProtocol (
HandleBuffer[Index],
&gEfiStorageSecurityCommandProtocolGuid,
- (VOID **) &Ssp
+ (VOID **)&Ssp
);
if (EFI_ERROR (Status)) {
continue;
}
- Status = gBS->HandleProtocol(
+ Status = gBS->HandleProtocol (
HandleBuffer[Index],
&gEfiBlockIoProtocolGuid,
- (VOID **) &BlockIo
+ (VOID **)&BlockIo
);
if (EFI_ERROR (Status)) {
@@ -317,25 +318,25 @@ MorDriverEntryPoint (
///
DataSize = sizeof (mMorControl);
- Status = gRT->GetVariable (
- MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
- &gEfiMemoryOverwriteControlDataGuid,
- NULL,
- &DataSize,
- &mMorControl
- );
+ Status = gRT->GetVariable (
+ MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
+ &gEfiMemoryOverwriteControlDataGuid,
+ NULL,
+ &DataSize,
+ &mMorControl
+ );
if (EFI_ERROR (Status)) {
//
// Set default value to 0
//
mMorControl = 0;
- Status = gRT->SetVariable (
- MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
- &gEfiMemoryOverwriteControlDataGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- DataSize,
- &mMorControl
- );
+ Status = gRT->SetVariable (
+ MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
+ &gEfiMemoryOverwriteControlDataGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ DataSize,
+ &mMorControl
+ );
DEBUG ((DEBUG_INFO, "TcgMor: Create MOR variable! Status = %r\n", Status));
} else {
//