summaryrefslogtreecommitdiff
path: root/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2017-10-05 22:25:51 +0800
committerJiewen Yao <jiewen.yao@intel.com>2017-10-24 19:43:22 +0800
commit602ca88a55162bf84c369d6924131f128a0ed356 (patch)
tree13a196e6bb2ade628fe877a4c7ed0c71a92535d7 /Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c
parent5d307a4d238923cf79451899c7e6663ff210e48c (diff)
downloadedk2-platforms-602ca88a55162bf84c369d6924131f128a0ed356.tar.xz
Clean up Checkpoint.
1) CheckPointLib interface to be feature based, instead of phase based. 2) Rename file from Dump to Check. 3) Add TestPointStub to help convert PEI/SMM info to DXE protocol. 4) Implement all check points. Cc: Michael A Kubacki <michael.a.kubacki@intel.com> Cc: Amy Chan <amy.chan@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Brett Wang <brett.wang@intel.com> Cc: Daocheng Bu <daocheng.bu@intel.com> Cc: Isaac W Oram <isaac.w.oram@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Amy Chan <amy.chan@intel.com>
Diffstat (limited to 'Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c')
-rw-r--r--Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c
deleted file mode 100644
index 57a86963f2..0000000000
--- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeDumpMemAttribute.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @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/UefiBootServicesTableLib.h>
-#include <Library/TestPointCheckLib.h>
-#include <Library/TestPointLib.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiLib.h>
-#include <Library/PrintLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Guid/MemoryAttributesTable.h>
-
-CHAR8 *
-ShortNameOfMemoryType(
- IN UINT32 Type
- );
-
-VOID
-DumpMemoryAttributesTable (
- IN EFI_MEMORY_ATTRIBUTES_TABLE *MemoryAttributesTable
- )
-{
- UINTN Index;
- EFI_MEMORY_DESCRIPTOR *Entry;
- UINT64 Pages[EfiMaxMemoryType];
-
- ZeroMem (Pages, sizeof(Pages));
-
- DEBUG ((DEBUG_INFO, "MemoryAttributesTable:"));
- DEBUG ((DEBUG_INFO, " Version=0x%x", MemoryAttributesTable->Version));
- DEBUG ((DEBUG_INFO, " Count=0x%x", MemoryAttributesTable->NumberOfEntries));
- DEBUG ((DEBUG_INFO, " DescriptorSize=0x%x\n", MemoryAttributesTable->DescriptorSize));
- Entry = (EFI_MEMORY_DESCRIPTOR *)(MemoryAttributesTable + 1);
- DEBUG ((DEBUG_INFO, "Type Start End # Pages Attributes\n"));
- for (Index = 0; Index < MemoryAttributesTable->NumberOfEntries; Index++) {
- DEBUG ((DEBUG_INFO, ShortNameOfMemoryType(Entry->Type)));
- DEBUG ((DEBUG_INFO, " %016LX-%016LX %016LX %016LX\n",
- Entry->PhysicalStart,
- Entry->PhysicalStart+MultU64x64 (SIZE_4KB,Entry->NumberOfPages) - 1,
- Entry->NumberOfPages,
- Entry->Attribute
- ));
- if (Entry->Type < EfiMaxMemoryType) {
- Pages[Entry->Type] += Entry->NumberOfPages;
- }
- Entry = NEXT_MEMORY_DESCRIPTOR (Entry, MemoryAttributesTable->DescriptorSize);
- }
-
- DEBUG ((DEBUG_INFO, "\n"));
- DEBUG ((DEBUG_INFO, " RT_Code : %14ld Pages (%ld Bytes)\n", Pages[EfiRuntimeServicesCode], MultU64x64(SIZE_4KB, Pages[EfiRuntimeServicesCode])));
- DEBUG ((DEBUG_INFO, " RT_Data : %14ld Pages (%ld Bytes)\n", Pages[EfiRuntimeServicesData], MultU64x64(SIZE_4KB, Pages[EfiRuntimeServicesData])));
- DEBUG ((DEBUG_INFO, " -------------- \n"));
-}
-
-EFI_STATUS
-TestPointDumpMemAttribute (
- VOID
- )
-{
- EFI_STATUS Status;
- VOID *MemoryAttributesTable;
-
- DEBUG ((DEBUG_INFO, "==== TestPointDumpMemAttribute - Enter\n"));
- Status = EfiGetSystemConfigurationTable (&gEfiMemoryAttributesTableGuid, &MemoryAttributesTable);
- if (!EFI_ERROR (Status)) {
- DumpMemoryAttributesTable(MemoryAttributesTable);
- } else {
- TestPointLibAppendErrorString (
- PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV,
- NULL,
- TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_CODE_4 TEST_POINT_READY_TO_BOOT TEST_POINT_BYTE2_READY_TO_BOOT_ERROR_STRING_4
- );
- }
- DEBUG ((DEBUG_INFO, "==== TestPointDumpMemAttribute - Exit\n"));
-
- return Status;
-}