From 8a09cdd7be72c7b7fb48d03f2597187d1595e949 Mon Sep 17 00:00:00 2001 From: Kun Qin Date: Thu, 31 Dec 2020 01:56:51 -0800 Subject: MdeModulePkg: StatusCodeHandler: StatusCodeHandler driver in StandaloneMm This change added support of StandaloneMm for StatusCodeHandler. It adds a new instance of StatusCodeHandler of MM_STANDALONE type, and abstracts the driver entrypoint into separate files, replaced gSmst with gMmst, and switched to MM version of RscHandlerProtocol. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Jiewen Yao Signed-off-by: Kun Qin Reviewed-by: Hao A Wu --- MdeModulePkg/MdeModulePkg.dsc | 1 + .../StatusCodeHandler/Smm/MemoryStatusCodeWorker.c | 36 +++--- .../StatusCodeHandler/Smm/SerialStatusCodeWorker.c | 2 +- .../StatusCodeHandler/Smm/StatusCodeHandlerMm.c | 79 +++++++++++++ .../StatusCodeHandler/Smm/StatusCodeHandlerMm.h | 130 +++++++++++++++++++++ .../StatusCodeHandler/Smm/StatusCodeHandlerSmm.c | 84 ------------- .../StatusCodeHandler/Smm/StatusCodeHandlerSmm.h | 117 ------------------- .../StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf | 15 +-- .../Smm/StatusCodeHandlerStandalone.c | 31 +++++ .../Smm/StatusCodeHandlerStandaloneMm.inf | 63 ++++++++++ .../Smm/StatusCodeHandlerTraditional.c | 31 +++++ 11 files changed, 362 insertions(+), 227 deletions(-) create mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.c create mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h delete mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c delete mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h create mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandalone.c create mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandaloneMm.inf create mode 100644 MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerTraditional.c (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 200fbcc18a..0989094900 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -476,6 +476,7 @@ MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf MdeModulePkg/Library/SmmReportStatusCodeLib/StandaloneMmReportStatusCodeLib.inf MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf + MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandaloneMm.inf MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf MdeModulePkg/Library/SmmMemoryAllocationProfileLib/SmmMemoryAllocationProfileLib.inf diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c index c9b43fd246..14bac8ec3c 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c @@ -7,15 +7,15 @@ **/ -#include "StatusCodeHandlerSmm.h" +#include "StatusCodeHandlerMm.h" -RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable; +RUNTIME_MEMORY_STATUSCODE_HEADER *mMmMemoryStatusCodeTable; /** - Initialize SMM memory status code table as initialization for memory status code worker + Initialize MM memory status code table as initialization for memory status code worker - @retval EFI_SUCCESS SMM memory status code table successfully initialized. - @retval others Errors from gSmst->SmmInstallConfigurationTable(). + @retval EFI_SUCCESS MM memory status code table successfully initialized. + @retval others Errors from gMmst->MmInstallConfigurationTable(). **/ EFI_STATUS MemoryStatusCodeInitializeWorker ( @@ -25,17 +25,17 @@ MemoryStatusCodeInitializeWorker ( EFI_STATUS Status; // - // Allocate SMM memory status code pool. + // Allocate MM memory status code pool. // - mSmmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024); - ASSERT (mSmmMemoryStatusCodeTable != NULL); + mMmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024); + ASSERT (mMmMemoryStatusCodeTable != NULL); - mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD); - Status = gSmst->SmmInstallConfigurationTable ( - gSmst, + mMmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD); + Status = gMmst->MmInstallConfigurationTable ( + gMmst, &gMemoryStatusCodeRecordGuid, - &mSmmMemoryStatusCodeTable, - sizeof (mSmmMemoryStatusCodeTable) + &mMmMemoryStatusCodeTable, + sizeof (mMmMemoryStatusCodeTable) ); return Status; } @@ -74,8 +74,8 @@ MemoryStatusCodeReportWorker ( // // Locate current record buffer. // - Record = (MEMORY_STATUSCODE_RECORD *) (mSmmMemoryStatusCodeTable + 1); - Record = &Record[mSmmMemoryStatusCodeTable->RecordIndex++]; + Record = (MEMORY_STATUSCODE_RECORD *) (mMmMemoryStatusCodeTable + 1); + Record = &Record[mMmMemoryStatusCodeTable->RecordIndex++]; // // Save status code. @@ -92,12 +92,12 @@ MemoryStatusCodeReportWorker ( // so the first record is pointed by record index. // If it is less then max number, index of the first record is zero. // - mSmmMemoryStatusCodeTable->NumberOfRecords++; - if (mSmmMemoryStatusCodeTable->RecordIndex == mSmmMemoryStatusCodeTable->MaxRecordsNumber) { + mMmMemoryStatusCodeTable->NumberOfRecords++; + if (mMmMemoryStatusCodeTable->RecordIndex == mMmMemoryStatusCodeTable->MaxRecordsNumber) { // // Wrap around record index. // - mSmmMemoryStatusCodeTable->RecordIndex = 0; + mMmMemoryStatusCodeTable->RecordIndex = 0; } return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c index 3df0a67126..bcb75bc7b1 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c @@ -6,7 +6,7 @@ **/ -#include "StatusCodeHandlerSmm.h" +#include "StatusCodeHandlerMm.h" /** Convert status code value and extended data to readable ASCII string, send string to serial I/O device. diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.c new file mode 100644 index 0000000000..4948d3d99a --- /dev/null +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.c @@ -0,0 +1,79 @@ +/** @file + Status Code Handler Driver which produces general handlers and hook them + onto the MM status code router. + + Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "StatusCodeHandlerMm.h" + +EFI_MM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL; + + +/** + Dispatch initialization request to sub status code devices based on + customized feature flags. + +**/ +VOID +InitializationDispatcherWorker ( + VOID + ) +{ + EFI_STATUS Status; + + // + // If enable UseSerial, then initialize serial port. + // if enable UseRuntimeMemory, then initialize runtime memory status code worker. + // + if (PcdGetBool (PcdStatusCodeUseSerial)) { + // + // Call Serial Port Lib API to initialize serial port. + // + Status = SerialPortInitialize (); + ASSERT_EFI_ERROR (Status); + } + if (PcdGetBool (PcdStatusCodeUseMemory)) { + Status = MemoryStatusCodeInitializeWorker (); + ASSERT_EFI_ERROR (Status); + } +} + +/** + Entry point of Common MM Status Code Driver. + + This function is the entry point of MM Status Code Driver. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +StatusCodeHandlerCommonEntry ( + VOID + ) +{ + EFI_STATUS Status; + + Status = gMmst->MmLocateProtocol ( + &gEfiMmRscHandlerProtocolGuid, + NULL, + (VOID **) &mRscHandlerProtocol + ); + ASSERT_EFI_ERROR (Status); + + // + // Dispatch initialization request to supported devices + // + InitializationDispatcherWorker (); + + if (PcdGetBool (PcdStatusCodeUseSerial)) { + mRscHandlerProtocol->Register (SerialStatusCodeReportWorker); + } + if (PcdGetBool (PcdStatusCodeUseMemory)) { + mRscHandlerProtocol->Register (MemoryStatusCodeReportWorker); + } + + return EFI_SUCCESS; +} diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h new file mode 100644 index 0000000000..7871ee4040 --- /dev/null +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h @@ -0,0 +1,130 @@ +/** @file + Internal include file for Status Code Handler Driver. + + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __STATUS_CODE_HANDLER_MM_H__ +#define __STATUS_CODE_HANDLER_MM_H__ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +// Define the maximum message length +// +#define MAX_DEBUG_MESSAGE_LENGTH 0x100 + +extern RUNTIME_MEMORY_STATUSCODE_HEADER *mMmMemoryStatusCodeTable; + +/** + Locates Serial I/O Protocol as initialization for serial status code worker. + + @retval EFI_SUCCESS Serial I/O Protocol is successfully located. + +**/ +EFI_STATUS +EfiSerialStatusCodeInitializeWorker ( + VOID + ); + + +/** + Convert status code value and extended data to readable ASCII string, send string to serial I/O device. + + @param CodeType Indicates the type of status code being reported. + @param Value Describes the current status of a hardware or software entity. + This included information about the class and subclass that is used to + classify the entity as well as an operation. + @param Instance The enumeration of a hardware or software entity within + the system. Valid instance numbers start with 1. + @param CallerId This optional parameter may be used to identify the caller. + This parameter allows the status code driver to apply different rules to + different callers. + @param Data This optional parameter may be used to pass additional data. + + @retval EFI_SUCCESS Status code reported to serial I/O successfully. + @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called. + @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK. + +**/ +EFI_STATUS +EFIAPI +SerialStatusCodeReportWorker ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID *CallerId, + IN EFI_STATUS_CODE_DATA *Data OPTIONAL + ); + +/** + Initialize runtime memory status code table as initialization for runtime memory status code worker + + @retval EFI_SUCCESS Runtime memory status code table successfully initialized. + +**/ +EFI_STATUS +MemoryStatusCodeInitializeWorker ( + VOID + ); + +/** + Report status code into runtime memory. If the runtime pool is full, roll back to the + first record and overwrite it. + + @param CodeType Indicates the type of status code being reported. + @param Value Describes the current status of a hardware or software entity. + This included information about the class and subclass that is used to + classify the entity as well as an operation. + @param Instance The enumeration of a hardware or software entity within + the system. Valid instance numbers start with 1. + @param CallerId This optional parameter may be used to identify the caller. + This parameter allows the status code driver to apply different rules to + different callers. + @param Data This optional parameter may be used to pass additional data. + + @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table. + +**/ +EFI_STATUS +EFIAPI +MemoryStatusCodeReportWorker ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID *CallerId, + IN EFI_STATUS_CODE_DATA *Data OPTIONAL + ); + +/** + Entry point of Common MM Status Code Driver. + + This function is the entry point of MM Status Code Driver. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +StatusCodeHandlerCommonEntry ( + VOID + ); + +#endif diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c deleted file mode 100644 index 20271571de..0000000000 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.c +++ /dev/null @@ -1,84 +0,0 @@ -/** @file - Status Code Handler Driver which produces general handlers and hook them - onto the SMM status code router. - - Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "StatusCodeHandlerSmm.h" - -EFI_SMM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL; - - -/** - Dispatch initialization request to sub status code devices based on - customized feature flags. - -**/ -VOID -InitializationDispatcherWorker ( - VOID - ) -{ - EFI_STATUS Status; - - // - // If enable UseSerial, then initialize serial port. - // if enable UseRuntimeMemory, then initialize runtime memory status code worker. - // - if (PcdGetBool (PcdStatusCodeUseSerial)) { - // - // Call Serial Port Lib API to initialize serial port. - // - Status = SerialPortInitialize (); - ASSERT_EFI_ERROR (Status); - } - if (PcdGetBool (PcdStatusCodeUseMemory)) { - Status = MemoryStatusCodeInitializeWorker (); - ASSERT_EFI_ERROR (Status); - } -} - -/** - Entry point of SMM Status Code Driver. - - This function is the entry point of SMM Status Code Driver. - - @param ImageHandle The firmware allocated handle for the EFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The entry point is executed successfully. - -**/ -EFI_STATUS -EFIAPI -StatusCodeHandlerSmmEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - Status = gSmst->SmmLocateProtocol ( - &gEfiSmmRscHandlerProtocolGuid, - NULL, - (VOID **) &mRscHandlerProtocol - ); - ASSERT_EFI_ERROR (Status); - - // - // Dispatch initialization request to supported devices - // - InitializationDispatcherWorker (); - - if (PcdGetBool (PcdStatusCodeUseSerial)) { - mRscHandlerProtocol->Register (SerialStatusCodeReportWorker); - } - if (PcdGetBool (PcdStatusCodeUseMemory)) { - mRscHandlerProtocol->Register (MemoryStatusCodeReportWorker); - } - - return EFI_SUCCESS; -} diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h deleted file mode 100644 index 6b5d53a4fe..0000000000 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h +++ /dev/null @@ -1,117 +0,0 @@ -/** @file - Internal include file for Status Code Handler Driver. - - Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
- (C) Copyright 2016 Hewlett Packard Enterprise Development LP
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __STATUS_CODE_HANDLER_SMM_H__ -#define __STATUS_CODE_HANDLER_SMM_H__ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// -// Define the maximum message length -// -#define MAX_DEBUG_MESSAGE_LENGTH 0x100 - -extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable; - -/** - Locates Serial I/O Protocol as initialization for serial status code worker. - - @retval EFI_SUCCESS Serial I/O Protocol is successfully located. - -**/ -EFI_STATUS -EfiSerialStatusCodeInitializeWorker ( - VOID - ); - - -/** - Convert status code value and extended data to readable ASCII string, send string to serial I/O device. - - @param CodeType Indicates the type of status code being reported. - @param Value Describes the current status of a hardware or software entity. - This included information about the class and subclass that is used to - classify the entity as well as an operation. - @param Instance The enumeration of a hardware or software entity within - the system. Valid instance numbers start with 1. - @param CallerId This optional parameter may be used to identify the caller. - This parameter allows the status code driver to apply different rules to - different callers. - @param Data This optional parameter may be used to pass additional data. - - @retval EFI_SUCCESS Status code reported to serial I/O successfully. - @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called. - @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK. - -**/ -EFI_STATUS -EFIAPI -SerialStatusCodeReportWorker ( - IN EFI_STATUS_CODE_TYPE CodeType, - IN EFI_STATUS_CODE_VALUE Value, - IN UINT32 Instance, - IN EFI_GUID *CallerId, - IN EFI_STATUS_CODE_DATA *Data OPTIONAL - ); - -/** - Initialize runtime memory status code table as initialization for runtime memory status code worker - - @retval EFI_SUCCESS Runtime memory status code table successfully initialized. - -**/ -EFI_STATUS -MemoryStatusCodeInitializeWorker ( - VOID - ); - -/** - Report status code into runtime memory. If the runtime pool is full, roll back to the - first record and overwrite it. - - @param CodeType Indicates the type of status code being reported. - @param Value Describes the current status of a hardware or software entity. - This included information about the class and subclass that is used to - classify the entity as well as an operation. - @param Instance The enumeration of a hardware or software entity within - the system. Valid instance numbers start with 1. - @param CallerId This optional parameter may be used to identify the caller. - This parameter allows the status code driver to apply different rules to - different callers. - @param Data This optional parameter may be used to pass additional data. - - @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table. - -**/ -EFI_STATUS -EFIAPI -MemoryStatusCodeReportWorker ( - IN EFI_STATUS_CODE_TYPE CodeType, - IN EFI_STATUS_CODE_VALUE Value, - IN UINT32 Instance, - IN EFI_GUID *CallerId, - IN EFI_STATUS_CODE_DATA *Data OPTIONAL - ); - -#endif diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf index 4e24d87e55..90abe662d2 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf @@ -1,5 +1,5 @@ ## @file -# Status Code Handler Driver which produces general handlers and hook them onto the SMM status code router. +# Status Code Handler Driver which produces general handlers and hook them onto the MM status code router. # # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
@@ -17,7 +17,7 @@ MODULE_TYPE = DXE_SMM_DRIVER PI_SPECIFICATION_VERSION = 0x0001000A VERSION_STRING = 1.0 - ENTRY_POINT = StatusCodeHandlerSmmEntry + ENTRY_POINT = StatusCodeHandlerTraditionalMmEntry # # The following information is for reference only and not required by the build tools. @@ -26,8 +26,9 @@ # [Sources] - StatusCodeHandlerSmm.c - StatusCodeHandlerSmm.h + StatusCodeHandlerMm.c + StatusCodeHandlerMm.h + StatusCodeHandlerTraditional.c SerialStatusCodeWorker.c MemoryStatusCodeWorker.c @@ -37,7 +38,7 @@ [LibraryClasses] SerialPortLib - SmmServicesTableLib + MmServicesTableLib UefiDriverEntryPoint PcdLib PrintLib @@ -51,7 +52,7 @@ gMemoryStatusCodeRecordGuid ## SOMETIMES_PRODUCES ## UNDEFINED # SmmSystemTable [Protocols] - gEfiSmmRscHandlerProtocolGuid ## CONSUMES + gEfiMmRscHandlerProtocolGuid ## CONSUMES [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES @@ -59,7 +60,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## SOMETIMES_CONSUMES [Depex] - gEfiSmmRscHandlerProtocolGuid + gEfiMmRscHandlerProtocolGuid [UserExtensions.TianoCore."ExtraFiles"] StatusCodeHandlerSmmExtra.uni diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandalone.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandalone.c new file mode 100644 index 0000000000..11a61705d6 --- /dev/null +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandalone.c @@ -0,0 +1,31 @@ +/** @file + Abstraction layer that contains Standalone MM specific implementation for + Status Code Handler Driver. + + Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "StatusCodeHandlerMm.h" + +/** + Entry point of Standalone MM Status Code Driver. + + This function is the entry point of Standalone MM Status Code Driver. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI MM System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +EFIAPI +StatusCodeHandlerStandaloneMmEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + return StatusCodeHandlerCommonEntry (); +} diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandaloneMm.inf b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandaloneMm.inf new file mode 100644 index 0000000000..d7c863bf06 --- /dev/null +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerStandaloneMm.inf @@ -0,0 +1,63 @@ +## @file +# Status Code Handler Driver which produces general handlers and hook them onto the MM status code router. +# +# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# Copyright (c) Microsoft Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = StatusCodeHandlerStandaloneMm + FILE_GUID = EBE7802F-5E11-4D4E-B463-22D2425D156B + MODULE_TYPE = MM_STANDALONE + PI_SPECIFICATION_VERSION = 0x00010032 + VERSION_STRING = 1.0 + ENTRY_POINT = StatusCodeHandlerStandaloneMmEntry + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 +# + +[Sources] + StatusCodeHandlerMm.c + StatusCodeHandlerMm.h + StatusCodeHandlerStandalone.c + SerialStatusCodeWorker.c + MemoryStatusCodeWorker.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + SerialPortLib + MmServicesTableLib + StandaloneMmDriverEntryPoint + PcdLib + PrintLib + ReportStatusCodeLib + DebugLib + MemoryAllocationLib + BaseMemoryLib + +[Guids] + gEfiStatusCodeDataTypeStringGuid ## SOMETIMES_CONSUMES ## UNDEFINED + gMemoryStatusCodeRecordGuid ## SOMETIMES_PRODUCES ## UNDEFINED # MmSystemTable + +[Protocols] + gEfiMmRscHandlerProtocolGuid ## CONSUMES + +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory ## SOMETIMES_CONSUMES + +[Depex] + gEfiMmRscHandlerProtocolGuid diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerTraditional.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerTraditional.c new file mode 100644 index 0000000000..1105f184b0 --- /dev/null +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerTraditional.c @@ -0,0 +1,31 @@ +/** @file + Abstraction layer that contains Standalone MM specific implementation for + Status Code Handler Driver. + + Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "StatusCodeHandlerMm.h" + +/** + Entry point of Traditional MM Status Code Driver. + + This function is the entry point of Traditional MM Status Code Driver. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + +**/ +EFI_STATUS +EFIAPI +StatusCodeHandlerTraditionalMmEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return StatusCodeHandlerCommonEntry (); +} -- cgit v1.2.3