X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FTcg%2FMemoryOverwriteControl%2FTcgMor.c;fp=SecurityPkg%2FTcg%2FMemoryOverwriteControl%2FTcgMor.c;h=a4acc14e9a883f669d322237283a287984e2af84;hp=def965f13853cf1acdc84998307f5ab1294c5899;hb=8a8c6c962a4abc75224799bfd03f2f68bb2a89e3;hpb=9c12f2d77fe8ac958e6da4ceb92378227dd6c676 diff --git a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c index def965f138..a4acc14e9a 100644 --- a/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c +++ b/SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.c @@ -4,7 +4,7 @@ This driver initilize MemoryOverwriteRequestControl variable. It will clear MOR_CLEAR_MEMORY_BIT bit if it is set. -Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -35,6 +35,7 @@ OnReadyToBoot ( IN VOID *Context ) { + EFI_STATUS Status; UINTN DataSize; if (MOR_CLEAR_MEMORY_VALUE (mMorControl) == 0x0) { @@ -50,14 +51,16 @@ OnReadyToBoot ( mMorControl &= 0xFE; DataSize = sizeof (mMorControl); - 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 + ); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "TcgMor: Clear MOR_CLEAR_MEMORY_BIT failure, Status = %r\n")); + } } @@ -98,7 +101,6 @@ MorDriverEntryPoint ( // Set default value to 0 // mMorControl = 0; - DEBUG ((EFI_D_INFO, "TcgMor: Create gEfiMemoryOverwriteControlDataGuid!\n")); Status = gRT->SetVariable ( MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, &gEfiMemoryOverwriteControlDataGuid, @@ -106,8 +108,7 @@ MorDriverEntryPoint ( DataSize, &mMorControl ); - ASSERT_EFI_ERROR (Status); - + DEBUG ((EFI_D_INFO, "TcgMor: Create MOR variable! Status = %r\n", Status)); } else { // // Create a Ready To Boot Event and Clear the MorControl bit in the call back function.