TianoCore EDK2 master
Loading...
Searching...
No Matches
StatusCodeHandlerMm.c
Go to the documentation of this file.
1
10#include "StatusCodeHandlerMm.h"
11
12EFI_MM_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL;
13
19VOID
21 VOID
22 )
23{
24 EFI_STATUS Status;
25
26 //
27 // If enable UseSerial, then initialize serial port.
28 // if enable UseRuntimeMemory, then initialize runtime memory status code worker.
29 //
30 if (PcdGetBool (PcdStatusCodeUseSerial)) {
31 //
32 // Call Serial Port Lib API to initialize serial port.
33 //
34 Status = SerialPortInitialize ();
35 ASSERT_EFI_ERROR (Status);
36 }
37
38 if (PcdGetBool (PcdStatusCodeUseMemory)) {
40 ASSERT_EFI_ERROR (Status);
41 }
42}
43
54 VOID
55 )
56{
57 EFI_STATUS Status;
58
59 Status = gMmst->MmLocateProtocol (
60 &gEfiMmRscHandlerProtocolGuid,
61 NULL,
62 (VOID **)&mRscHandlerProtocol
63 );
64 ASSERT_EFI_ERROR (Status);
65
66 //
67 // Dispatch initialization request to supported devices
68 //
70
71 if (PcdGetBool (PcdStatusCodeUseSerial)) {
72 mRscHandlerProtocol->Register (SerialStatusCodeReportWorker);
73 }
74
75 if (PcdGetBool (PcdStatusCodeUseMemory)) {
76 mRscHandlerProtocol->Register (MemoryStatusCodeReportWorker);
77 }
78
79 return EFI_SUCCESS;
80}
RETURN_STATUS EFIAPI SerialPortInitialize(VOID)
Definition: SerialPortLib.c:25
#define NULL
Definition: Base.h:319
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
EFI_STATUS EFIAPI MemoryStatusCodeReportWorker(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL)
EFI_STATUS MemoryStatusCodeInitializeWorker(VOID)
#define PcdGetBool(TokenName)
Definition: PcdLib.h:401
EFI_STATUS EFIAPI SerialStatusCodeReportWorker(IN CONST EFI_PEI_SERVICES **PeiServices, IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN CONST EFI_GUID *CallerId, IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL)
VOID InitializationDispatcherWorker(VOID)
EFI_STATUS StatusCodeHandlerCommonEntry(VOID)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112