From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.18083.1641954049814035968 for ; Tue, 11 Jan 2022 18:20:52 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=YXfndX1E; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641954052; x=1673490052; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RaM++8NfMqoA/iIbAYvvKKKmU8fBB45lhuuki2uSVMA=; b=YXfndX1ERxgxTmKAfv85GJkEOonuL2Zkjr66WVxjpF/5/Fz+vlDU3d87 e8gLgFQnTwwn6vJ8WHgc+sjTnTAafS2KtUAjCPhQicPEc3ZPXDJayE5el GarA81JNm9wMjIUNkfsHacVAs1OYXiiiMR9RJzXYo11p9HRZe1+NuM2yO jXhWDC9Ts6GOcGTbI5q8CWs/ZwmelUVwD+TWw+ecFnGxJu/qsj4SZMp4n h70eQY/3emQQnPzn5riRnxnWABk7VQgEHx6bMVP3YAswr905B6ooys6eN mnYpHTmP4GY+DAO5yH9eJ2M4NaFhJ69G3wAw4yZvPnzHUTFrq7cqqWPmA g==; X-IronPort-AV: E=McAfee;i="6200,9189,10224"; a="243439832" X-IronPort-AV: E=Sophos;i="5.88,281,1635231600"; d="scan'208";a="243439832" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 18:20:49 -0800 X-IronPort-AV: E=Sophos;i="5.88,281,1635231600"; d="scan'208";a="528990329" Received: from iworam-desk.amr.corp.intel.com ([10.7.150.79]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 18:20:49 -0800 From: "Oram, Isaac W" To: devel@edk2.groups.io Cc: Isaac Oram , Eric Dong , Liming Gao Subject: [edk2-devel][edk2-platforms][PATCH V1 17/27] PostCodeDebugFeaturePkg: Complete as an advanced feature Date: Tue, 11 Jan 2022 18:20:17 -0800 Message-Id: <919e3268a0358c3d751c6ae5ce1e134d8ef35abc.1641953242.git.isaac.w.oram@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add feature enable PCD. Use MinPlatformPkg build include files. Fix PEI_COR typo in PEI handler lib. Build StatusCodeHandler components with unique filename GUID. Add PreMemory.fdf and PostMemory.fdf include files. Improve Readme formatting and feature enabling checklist. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Isaac Oram --- Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc | 231 +++++--------------- Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf | 14 ++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf | 13 ++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf | 2 +- Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec | 11 + Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc | 30 +++ Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md | 31 ++- 7 files changed, 146 insertions(+), 186 deletions(-) diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc index 3d886fff38..31b0c02e79 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc @@ -12,192 +12,71 @@ # ## -################################################################################ -# -# Defines Section - statements that will be processed to create a Makefile. -# -################################################################################ [Defines] -!ifndef $(PEI_ARCH) - !error "PEI_ARCH must be specified to build this feature!" -!endif -!ifndef $(DXE_ARCH) - !error "DXE_ARCH must be specified to build this feature!" -!endif + !ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" + !endif + !ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" + !endif -################################################################################ -# -# PCD Section - list of PCD Entries modified by the feature. -# -################################################################################ + DEFINE POST_CODE_PEIM_FILENAME = 3ea07dd3-f837-40c0-ac56-f3e18a30d01b + DEFINE POST_CODE_DXE_FILENAME = e7d785f5-e2f3-45e3-b0e7-2291a6c6dea6 + DEFINE POST_CODE_SMM_FILENAME = 02a955c7-48c0-4178-989b-b3fea4b3c6a2 -# Unmark the following and StatusCodeHandler.efi to build the .dsc file directly -#[PcdsDynamicDefault] -# gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|TRUE +[PcdsDynamicExDefault] + # + # By default, make the functional control DynamicExDefault PCD so that it can be enabled when debugging. + # + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode -################################################################################ -# -# Library Class section - list of all Library Classes needed by this feature. -# -################################################################################ +[LibraryClasses.Common] + PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCodeMapLib.inf -!include MdePkg/MdeLibs.dsc.inc +[LibraryClasses.PEIM, LibraryClasses.PEI_CORE] + StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf +[LibraryClasses.DXE_RUNTIME_DRIVER] + StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf -[LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf +[LibraryClasses.DXE_SMM_DRIVER] + StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/SmmPostCodeStatusCodeHandlerLib.inf -[LibraryClasses.IA32.PEIM,LibraryClasses.IA32.PEI_CORE,LibraryClasses.IA32.SEC] - ####################################### - # Edk2 Packages - ####################################### - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf - -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf - -[LibraryClasses.common.UEFI_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - -[LibraryClasses.X64.DXE_SMM_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf - SmmIoLib|MdePkg/Library/SmmIoLib/SmmIoLib.inf - SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf - -################################################################################ -# -# Component section - list of all components that need built for this feature. -# -# Note: The EDK II DSC file is not used to specify how compiled binary images get placed -# into firmware volume images. This section is just a list of modules to compile from -# source into UEFI-compliant binaries. -# It is the FDF file that contains information on combining binary files into firmware -# volume images, whose concept is beyond UEFI and is described in PI specification. -# There may also be modules listed in this section that are not required in the FDF file, -# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be -# generated for it, but the binary will not be put into any firmware volume. -# -################################################################################ -# -# Feature PEI Components -# - -# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. [Components.IA32] - ##################################### - # PostCode Debug Feature Package - ##################################### - # Add library instances here that are not included in package components and should be tested - # in the package build. - PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + # + # Many boards already have StatusCodeHandler components built from the common core code + # Providing a unique name avoids collisions. Both status code handler components will + # install their listeners with the status code routers. + # + FILE_GUID = $(POST_CODE_PEIM_FILENAME) + + NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf + } - # The following is an example for used with StatusCodeHandler: -# MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { -# -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf -# PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf -# PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCodeMapLib.inf -# NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf -# } - - # Add components here that should be included in the package build. - -# -# Feature DXE Components -# - -# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. [Components.X64] - ##################################### - # PostCode Debug Feature Package - ##################################### + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { + + # + # Many boards already have StatusCodeHandler components built from the common core code + # Providing a unique name avoids collisions. Both status code handler components will + # install their listeners with the status code routers. + # + FILE_GUID = $(POST_CODE_DXE_FILENAME) + + NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf + } - # Add library instances here that are not included in package components and should be tested - # in the package build. - PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf - PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/SmmPostCodeStatusCodeHandlerLib.inf - - # The following is an example for used with StatusCodeHandler: -# MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { -# -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf -# PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf -# PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCodeMapLib.inf -# NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf -# } - -# MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { -# -# OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -# SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf -# PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf -# PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCodeMapLib.inf -# NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/SmmPostCodeStatusCodeHandlerLib.inf -# } - - # Add components here that should be included in the package build. - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] + MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { + + # + # Many boards already have StatusCodeHandler components built from the common core code + # Providing a unique name avoids collisions. Both status code handler components will + # install their listeners with the status code routers. + # + FILE_GUID = $(POST_CODE_SMM_FILENAME) + + NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/SmmPostCodeStatusCodeHandlerLib.inf + } diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf new file mode 100644 index 0000000000..1be9b369a8 --- /dev/null +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf @@ -0,0 +1,14 @@ +## @file +# FDF file for post-memory BeepDebugFeature advanced feature. +# +# This file is intended to be included into another package so advanced features +# can be conditionally included in the flash image by enabling the respective +# feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +INF FILE_GUID = $(POST_CODE_DXE_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf +INF FILE_GUID = $(POST_CODE_SMM_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf new file mode 100644 index 0000000000..168ceb1712 --- /dev/null +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,13 @@ +## @file +# FDF file for pre-memory BeepDebugFeature advanced feature. +# +# This file is intended to be included into another package so advanced features +# can be conditionally included in the flash image by enabling the respective +# feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +INF FILE_GUID = $(POST_CODE_PEIM_FILENAME) MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf index c27578fe90..72df81c77f 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf @@ -15,7 +15,7 @@ FILE_GUID = FA32350A-63DB-4AC6-88D1-BC5327EE7ECE MODULE_TYPE = PEIM CONSTRUCTOR = PeiPostCodeStatusCodeHandlerLibConstructor - LIBRARY_CLASS = StatusCodeHandlerLib|SEC PEIM PEI_COR + LIBRARY_CLASS = StatusCodeHandlerLib|SEC PEIM PEI_CORE # # The following information is for reference only and not required by the build tools. diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec index 5ba7b30ab6..42ac756a7c 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec @@ -28,5 +28,16 @@ [Guids] gPostCodeDebugFeaturePkgTokenSpaceGuid = {0x68886ac8, 0x7a29, 0x4845, {0xa7, 0x02, 0xe9, 0x83, 0xc8, 0x7f, 0xfb, 0xab}} +[PcdsFeatureFlag] + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable|FALSE|BOOLEAN|0x00000002 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] + ## This PCD allows for dynamic control of post code use if so desired. + # + # The PCD value can be modified at boot time to activate and deactivate the feature functionality. + # + # Note that this differs from PcdFeatureEnable which determines whether the feature is included + # as an advanced feature in the flash image. If enabled, the feature is then eligible to be activated/deactivated + # via this PCD. + # gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|FALSE|BOOLEAN|0x00000001 diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc index 4f0bec4a6f..349604098f 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc @@ -24,6 +24,36 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +[PcdsDynamicExDefault] + # + # PCD needed for this feature to build + # + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|TRUE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + +[LibraryClasses.Common] + # + # Required by common status code handler infrastructure + # + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf + # # This package always builds the feature. # diff --git a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md index c49db35999..3fc52f1c00 100644 --- a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md +++ b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md @@ -16,7 +16,7 @@ It also provide a library of PostCodeMap lib, it map the status code to post cod A library of PostCode lib is needed by platform. In the library contstructor function, PostCodeStatusCodeHandlerLib register the call back function for ReportStatusCode. -When called, it call GetPostCodeFromStatusCode() in PostCodeMapLib to get post code from status code, and call PostCode() in PostCodeLib to show the post code. +When called, it call GetPostCodeFromStatusCode () in PostCodeMapLib to get post code from status code, and call PostCode () in PostCodeLib to show the post code. PostCodeStatusCodeHandlerLib include 3 libraries for PEI, RuntimeDxe, SMM: * PeiPostCodeStatusCodeHandlerLib @@ -38,6 +38,7 @@ This library provide a function to get post code from status code. ## Key Functions * In PeiPostCodeStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI PostCodeStatusCodeReportWorker ( @@ -48,8 +49,10 @@ This library provide a function to get post code from status code. IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` * In RuntimeDxePostCodeStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI PostCodeStatusCodeReportWorker ( @@ -59,8 +62,10 @@ This library provide a function to get post code from status code. IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` * In SmmPostCodeStatusCodeHandlerLib: +``` EFI_STATUS EFIAPI PostCodeStatusCodeReportWorker ( @@ -70,23 +75,28 @@ This library provide a function to get post code from status code. IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) +``` * In PostCodeMapLib: +``` UINT32 EFIAPI GetPostCodeFromStatusCode ( IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value ) +``` ## Configuration -* Link the library to StatusCodeHandler.efi. +* Link the library to StatusCodeHandler.efi to add this status code handler. +``` Example: MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf } - Refer to PostCodeDebugFeature.dsc for other example. +``` + Refer to PostCodeDebugFeature.dsc for another example. * Config PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode. In platform .dsc file, need to config the type of gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode. Use PcdsFixedAtBuild to save binary size, and use PcdsDynamic if want to enable/disable in runtime. @@ -98,20 +108,23 @@ This library provide a function to get post code from status code. Status Code (ReportStatusCode) -> Post Code (GetPostCodeFromStatusCode). ## Control Flows -ReportStatusCode() -> PostCodeStatusCodeReportWorker() -> GetPostCodeFromStatusCode() -> PostCode() +ReportStatusCode () -> PostCodeStatusCodeReportWorker () -> GetPostCodeFromStatusCode () -> PostCode () ## Build Flows -There is not special build flows. +There are not special build flows. ## Test Point Results -Verify the post code shown is correct. +There are no test points defined. ## Functional Exit Criteria N/A ## Feature Enabling Checklist -* Set the PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode to TRUE. -* The post code can be shown. +* Set the PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable to TRUE. +* Select the PCD type desired and set the PCD gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode to TRUE. +* Implemented a platform specific PostCodeMapLib if needed. +* Verify the post code can be shown correctly. ## Common Optimizations -* Implemented platform's special PostCodeMapLib if needed. +* Set gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode based on a larger, board specific, size + optimization or performance optimization setting. -- 2.27.0.windows.1