2 Status Code Handler Driver which produces general handlers and hook them
3 onto the MM status code router.
5 Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "StatusCodeHandlerMm.h"
12 EFI_MM_RSC_HANDLER_PROTOCOL
*mRscHandlerProtocol
= NULL
;
16 Dispatch initialization request to sub status code devices based on
17 customized feature flags.
21 InitializationDispatcherWorker (
28 // If enable UseSerial, then initialize serial port.
29 // if enable UseRuntimeMemory, then initialize runtime memory status code worker.
31 if (PcdGetBool (PcdStatusCodeUseSerial
)) {
33 // Call Serial Port Lib API to initialize serial port.
35 Status
= SerialPortInitialize ();
36 ASSERT_EFI_ERROR (Status
);
38 if (PcdGetBool (PcdStatusCodeUseMemory
)) {
39 Status
= MemoryStatusCodeInitializeWorker ();
40 ASSERT_EFI_ERROR (Status
);
45 Entry point of Common MM Status Code Driver.
47 This function is the entry point of MM Status Code Driver.
49 @retval EFI_SUCCESS The entry point is executed successfully.
53 StatusCodeHandlerCommonEntry (
59 Status
= gMmst
->MmLocateProtocol (
60 &gEfiMmRscHandlerProtocolGuid
,
62 (VOID
**) &mRscHandlerProtocol
64 ASSERT_EFI_ERROR (Status
);
67 // Dispatch initialization request to supported devices
69 InitializationDispatcherWorker ();
71 if (PcdGetBool (PcdStatusCodeUseSerial
)) {
72 mRscHandlerProtocol
->Register (SerialStatusCodeReportWorker
);
74 if (PcdGetBool (PcdStatusCodeUseMemory
)) {
75 mRscHandlerProtocol
->Register (MemoryStatusCodeReportWorker
);