Hi Issac, Comments inline.
Thanks, Nate > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Oram, > Isaac W > Sent: Tuesday, January 11, 2022 6:20 PM > To: devel@edk2.groups.io > Cc: Oram, Isaac W <isaac.w.o...@intel.com>; Dong, Eric > <eric.d...@intel.com>; Gao, Liming <gaolim...@byosoft.com.cn> > Subject: [edk2-devel][edk2-platforms][PATCH V1 17/27] > PostCodeDebugFeaturePkg: Complete as an advanced feature > > 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 <eric.d...@intel.com> > Cc: Liming Gao <gaolim...@byosoft.com.cn> > > Signed-off-by: Isaac Oram <isaac.w.o...@intel.com> > --- > > Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDe > bugFeature.dsc | 231 > +++++--------------- > > Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemor > y.fdf | 14 ++ > > Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory. > fdf | 13 ++ > > Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStat > usCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf | 2 +- > > Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeat > urePkg.dec | 11 + > > Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeat > urePkg.dsc | 30 +++ > Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md > | 31 ++- > 7 files changed, 146 insertions(+), 186 deletions(-) > > diff --git > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCode > DebugFeature.dsc > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCode > DebugFeature.dsc > index 3d886fff38..31b0c02e79 100644 > --- > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCode > DebugFeature.dsc > +++ > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCode > D > +++ ebugFeature.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/Po > stCodeM > +apLib.inf > > -!include MdePkg/MdeLibs.dsc.inc > +[LibraryClasses.PEIM, LibraryClasses.PEI_CORE] > + > +StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatus > Code > +HandlerLib/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/BaseTimerLibNullTem > plate.inf > - > UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBo > otServicesTableLib.inf > - > UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry > Point.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/PostCodeStatus > Code > +HandlerLib/RuntimeDxePostCodeStatusCodeHandlerLib.inf > > -[LibraryClasses.common.PEIM] > - ####################################### > - # Edk2 Packages > - ####################################### > - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > - > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemory > AllocationLib.inf > - > PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/P > eiServicesTablePointerLibIdt.inf > +[LibraryClasses.DXE_SMM_DRIVER] > + > +StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatus > Code > +HandlerLib/SmmPostCodeStatusCodeHandlerLib.inf > > - > [LibraryClasses.IA32.PEIM,LibraryClasses.IA32.PEI_CORE,LibraryClasses.IA32. > SEC] > - ####################################### > - # Edk2 Packages > - ####################################### > - > ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiR > eportStatusCodeLib.inf > - > -[LibraryClasses.common.DXE_DRIVER] > - ####################################### > - # Edk2 Packages > - ####################################### > - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > - > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo > ryAllocationLib.inf > - > -[LibraryClasses.common.DXE_RUNTIME_DRIVER] > - ####################################### > - # Edk2 Packages > - ####################################### > - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > - > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo > ryAllocationLib.inf > - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf > - > ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCod > eLib/RuntimeDxeReportStatusCodeLib.inf > - > -[LibraryClasses.common.UEFI_DRIVER] > - ####################################### > - # Edk2 Packages > - ####################################### > - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > - > MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo > ryAllocationLib.inf > - > -[LibraryClasses.X64.DXE_SMM_DRIVER] > - ####################################### > - # Edk2 Packages > - ####################################### > - > SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesT > ableLib.inf > - > MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMe > moryAllocationLib.inf > - SmmIoLib|MdePkg/Library/SmmIoLib/SmmIoLib.inf > - SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf > - > ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/S > mmReportStatusCodeLib.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] This should be changed to [Components.$(PEI_ARCH)] > - ##################################### > - # 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/PeiPost > CodeStatusCodeHandlerLib.inf > + > MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.in > f { > + <Defines> > + # > + # 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) > + <LibraryClasses> > + > + > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/P > eiP > + ostCodeStatusCodeHandlerLib.inf > + } > > - # The following is an example for used with StatusCodeHandler: > -# > MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.in > f { > -# <LibraryClasses> > -# > OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN > ull/OemHookStatusCodeLibNull.inf > -# > SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.in > f > -# > PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDeb > ug.inf > -# > PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/Post > CodeMapLib.inf > -# > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/P > eiPostCodeStatusCodeHandlerLib.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] This should be changed to [Components.$(DXE_ARCH)] > - ##################################### > - # PostCode Debug Feature Package > - ##################################### > + > MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHan > dlerRuntimeDxe.inf { > + <Defines> > + # > + # 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) > + <LibraryClasses> > + > + > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/R > unt > + imeDxePostCodeStatusCodeHandlerLib.inf > + } > > - # Add library instances here that are not included in package components > and should be tested > - # in the package build. > - > PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/Runtim > eDxePostCodeStatusCodeHandlerLib.inf > - > PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/SmmPo > stCodeStatusCodeHandlerLib.inf > - > - # The following is an example for used with StatusCodeHandler: > -# > MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHan > dlerRuntimeDxe.inf { > -# <LibraryClasses> > -# > OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN > ull/OemHookStatusCodeLibNull.inf > -# > SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.in > f > -# > PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDeb > ug.inf > -# > PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/Post > CodeMapLib.inf > -# > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/R > untimeDxePostCodeStatusCodeHandlerLib.inf > -# } > - > -# > MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSm > m.inf { > -# <LibraryClasses> > -# > OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN > ull/OemHookStatusCodeLibNull.inf > -# > SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.in > f > -# > PostCodeLib|MdePkg/Library/BasePostCodeLibDebug/BasePostCodeLibDeb > ug.inf > -# > PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/Post > CodeMapLib.inf > -# > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/S > mmPostCodeStatusCodeHandlerLib.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/StatusCodeHandlerSm > m.inf { > + <Defines> > + # > + # 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) > + <LibraryClasses> > + > + > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/S > mmP > + ostCodeStatusCodeHandlerLib.inf > + } > diff --git > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMem > ory.fdf > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMem > ory.fdf > new file mode 100644 > index 0000000000..1be9b369a8 > --- /dev/null > +++ > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMem > or > +++ y.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/StatusCodeHa > ndlerRu > +ntimeDxe.inf INF FILE_GUID = $(POST_CODE_SMM_FILENAME) > +MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerS > mm.inf > diff --git > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemo > ry.fdf > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemo > ry.fdf > new file mode 100644 > index 0000000000..168ceb1712 > --- /dev/null > +++ > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemo > ry > +++ .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.i > nf > diff --git > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeS > tatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeS > tatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf > index c27578fe90..72df81c77f 100644 > --- > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeS > tatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf > +++ > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeS > +++ tatusCodeHandlerLib/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/PostCodeDebugFe > aturePkg.dec > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFe > aturePkg.dec > index 5ba7b30ab6..42ac756a7c 100644 > --- > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFe > aturePkg.dec > +++ > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFe > at > +++ urePkg.dec > @@ -28,5 +28,16 @@ > [Guids] > gPostCodeDebugFeaturePkgTokenSpaceGuid = {0x68886ac8, 0x7a29, > 0x4845, {0xa7, 0x02, 0xe9, 0x83, 0xc8, 0x7f, 0xfb, 0xab}} > > +[PcdsFeatureFlag] > + > +gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureE > nable|FA > +LSE|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 Pcd<FeatureName>FeatureEnable 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/PostCodeDebugFe > aturePkg.dsc > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFe > aturePkg.dsc > index 4f0bec4a6f..349604098f 100644 > --- > a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFe > aturePkg.dsc > +++ > b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFe > at > +++ urePkg.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/BasePl > atfo > +rmHookLibNull.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/StatusCodeHan > dlerRuntimeDxe.inf { > <LibraryClasses> > > NULL|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/R > untimeDxePostCodeStatusCodeHandlerLib.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.PcdPostCodeDebugFeatureEn > able 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 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85626): https://edk2.groups.io/g/devel/message/85626 Mute This Topic: https://groups.io/mt/88365346/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-