summaryrefslogtreecommitdiff
path: root/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgMor.c
diff options
context:
space:
mode:
Diffstat (limited to 'Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgMor.c')
-rw-r--r--Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgMor.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgMor.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgMor.c
new file mode 100644
index 0000000000..4570367d92
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgMor.c
@@ -0,0 +1,69 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Uefi.h>
+#include <PiDxe.h>
+#include <Library/TestPointCheckLib.h>
+#include <Library/TestPointLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiLib.h>
+#include <Library/PrintLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Guid/MemoryOverwriteControl.h>
+#include <IndustryStandard/MemoryOverwriteRequestControlLock.h>
+
+typedef struct {
+ CHAR16 *Name;
+ EFI_GUID *Guid;
+} VARIABLE_LIST;
+
+VARIABLE_LIST mMorVariable[] = {
+ {MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, &gEfiMemoryOverwriteControlDataGuid},
+ {MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, &gEfiMemoryOverwriteRequestControlLockGuid},
+};
+
+EFI_STATUS
+EFIAPI
+TestPointCheckTcgMor (
+ VOID
+ )
+{
+ VOID *Variable;
+ UINTN Size;
+ UINTN Index;
+ EFI_STATUS Status;
+ EFI_STATUS ReturnStatus;
+
+ DEBUG ((DEBUG_INFO, "==== TestPointCheckTcgMor - Enter\n"));
+
+ ReturnStatus = EFI_SUCCESS;
+ for (Index = 0; Index < sizeof(mMorVariable)/sizeof(mMorVariable[0]); Index++) {
+ Status = GetVariable2 (mMorVariable[Index].Name, mMorVariable[Index].Guid, &Variable, &Size);
+ if (EFI_ERROR(Status)) {
+ DEBUG ((DEBUG_ERROR, "Variable - %S not found\n", mMorVariable[Index].Name));
+ ReturnStatus = Status;
+ TestPointLibAppendErrorString (
+ PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV,
+ NULL,
+ TEST_POINT_BYTE4_READY_TO_BOOT_TCG_MOR_ENABLED_ERROR_CODE \
+ TEST_POINT_READY_TO_BOOT \
+ TEST_POINT_BYTE4_READY_TO_BOOT_TCG_MOR_ENABLED_ERROR_STRING
+ );
+ } else {
+ FreePool (Variable);
+ }
+ }
+
+ DEBUG ((DEBUG_INFO, "==== TestPointCheckTcgMor - Exit\n"));
+ return ReturnStatus;
+}