From 1f003fafade69043b4fd587dd30fc63997df0d3e Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Sat, 20 May 2017 15:42:12 +0800 Subject: Add MinPlatform. reviewed-by: Jiewen Yao reviewed-by: Michael A Kubacki reviewed-by: Amy Chan reviewed-by: Rangasai V Chaganty reviewed-by: Chasel Chiu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- .../Test/Library/TestPointCheckLib/PeiDumpFvInfo.c | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiDumpFvInfo.c (limited to 'Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiDumpFvInfo.c') diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiDumpFvInfo.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiDumpFvInfo.c new file mode 100644 index 0000000000..c32c03b2c7 --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/PeiDumpFvInfo.c @@ -0,0 +1,118 @@ +/** @file + +Copyright (c) 2017, 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 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 +#include +#include +#include +#include +#include +#include +#include + +EFI_STATUS +TestPointDumpFvInfo ( + VOID + ) +{ + EFI_STATUS Status; + EFI_PEI_PPI_DESCRIPTOR *Descriptor; + EFI_PEI_FIRMWARE_VOLUME_INFO_PPI *FvInfo; + EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI *FvInfo2; + UINTN Index; + UINTN Index2; + + DEBUG ((DEBUG_INFO, "==== TestPointDumpFvInfo - Enter\n")); + DEBUG ((DEBUG_INFO, "FV Info PPI\n")); + for (Index = 0; ; Index++) { + Status = PeiServicesLocatePpi ( + &gEfiPeiFirmwareVolumeInfoPpiGuid, + Index, + &Descriptor, + (VOID **)&FvInfo + ); + if (EFI_ERROR (Status)) { + break; + } + DEBUG ((DEBUG_INFO, + " BA=%08x L=%08x Format={%g}", + (UINT32)(UINTN)FvInfo->FvInfo, + FvInfo->FvInfoSize, + &FvInfo->FvFormat, + FvInfo->ParentFvName, + FvInfo->ParentFileName + )); + if (FvInfo->ParentFvName != NULL) { + DEBUG ((DEBUG_INFO, + " ParentFv={%g}", + FvInfo->ParentFvName + )); + } + if (FvInfo->ParentFileName != NULL) { + DEBUG ((DEBUG_INFO, + " ParentFileName={%g}", + FvInfo->ParentFileName + )); + } + DEBUG ((DEBUG_INFO, "\n")); + } + + DEBUG ((DEBUG_INFO, "FV Info2 PPI\n")); + for (Index2 = 0; ; Index2++) { + Status = PeiServicesLocatePpi ( + &gEfiPeiFirmwareVolumeInfo2PpiGuid, + Index2, + &Descriptor, + (VOID **)&FvInfo2 + ); + if (EFI_ERROR (Status)) { + break; + } + DEBUG ((DEBUG_INFO, + " BA=%08x L=%08x Format={%g}", + (UINT32)(UINTN)FvInfo2->FvInfo, + FvInfo2->FvInfoSize, + &FvInfo2->FvFormat, + FvInfo2->ParentFvName, + FvInfo2->ParentFileName, + FvInfo2->AuthenticationStatus + )); + if (FvInfo2->ParentFvName != NULL) { + DEBUG ((DEBUG_INFO, + " ParentFv={%g}", + FvInfo2->ParentFvName + )); + } + if (FvInfo2->ParentFileName != NULL) { + DEBUG ((DEBUG_INFO, + " ParentFileName={%g}", + FvInfo2->ParentFileName + )); + } + DEBUG ((DEBUG_INFO, + " Auth=%08x\n", + FvInfo2->AuthenticationStatus + )); + } + DEBUG ((DEBUG_INFO, "==== TestPointDumpFvInfo - Exit\n")); + + if ((Index == 0) && (Index2 == 0)) { + TestPointLibAppendErrorString ( + PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, + NULL, + TEST_POINT_BYTE1_END_OF_PEI_ERROR_CODE_3 TEST_POINT_END_OF_PEI TEST_POINT_BYTE1_END_OF_PEI_ERROR_STRING_3 + ); + return EFI_INVALID_PARAMETER; + } + return EFI_SUCCESS; +} -- cgit v1.2.3