2 TCG MOR (Memory Overwrite Request) Control Driver.
4 This driver initilize MemoryOverwriteRequestControl variable. It
5 will clear MOR_CLEAR_MEMORY_BIT bit if it is set.
7 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 Entry Point for TCG MOR Control driver.
23 @param[in] ImageHandle Image handle of this driver.
24 @param[in] SystemTable A Pointer to the EFI System Table.
27 @return Others Some error occurs.
32 IN EFI_HANDLE ImageHandle
,
33 IN EFI_SYSTEM_TABLE
*SystemTable
41 /// The firmware is required to create the MemoryOverwriteRequestControl UEFI variable.
44 DataSize
= sizeof (MorControl
);
45 Status
= gRT
->GetVariable (
46 MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME
,
47 &gEfiMemoryOverwriteControlDataGuid
,
52 if (EFI_ERROR (Status
)) {
54 // Set default value to 0
58 if (MOR_CLEAR_MEMORY_VALUE (MorControl
) == 0x0) {
60 // MorControl is expected, directly return to avoid unnecessary variable operation
65 // Clear MOR_CLEAR_MEMORY_BIT
67 DEBUG ((EFI_D_INFO
, "TcgMor: Clear MorClearMemory bit\n"));
71 Status
= gRT
->SetVariable (
72 MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME
,
73 &gEfiMemoryOverwriteControlDataGuid
,
74 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
| EFI_VARIABLE_RUNTIME_ACCESS
,
78 ASSERT_EFI_ERROR (Status
);