TianoCore EDK2 master
Loading...
Searching...
No Matches
StatusCodeHandlerPei.c
Go to the documentation of this file.
1
11
26EFIAPI
28 IN EFI_PEI_FILE_HANDLE FileHandle,
29 IN CONST EFI_PEI_SERVICES **PeiServices
30 )
31{
32 EFI_STATUS Status;
33 EFI_PEI_RSC_HANDLER_PPI *RscHandlerPpi;
34
35 Status = PeiServicesLocatePpi (
36 &gEfiPeiRscHandlerPpiGuid,
37 0,
38 NULL,
39 (VOID **)&RscHandlerPpi
40 );
41 ASSERT_EFI_ERROR (Status);
42
43 //
44 // Dispatch initialization request to sub-statuscode-devices.
45 // If enable UseSerial, then initialize serial port.
46 // if enable UseMemory, then initialize memory status code worker.
47 //
48 if (PcdGetBool (PcdStatusCodeUseSerial)) {
49 Status = SerialPortInitialize ();
50 ASSERT_EFI_ERROR (Status);
51 Status = RscHandlerPpi->Register (SerialStatusCodeReportWorker);
52 ASSERT_EFI_ERROR (Status);
53 }
54
55 if (PcdGetBool (PcdStatusCodeUseMemory)) {
57 ASSERT_EFI_ERROR (Status);
58 Status = RscHandlerPpi->Register (MemoryStatusCodeReportWorker);
59 ASSERT_EFI_ERROR (Status);
60 }
61
62 return EFI_SUCCESS;
63}
RETURN_STATUS EFIAPI SerialPortInitialize(VOID)
Definition: SerialPortLib.c:25
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#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 * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
EFI_STATUS EFIAPI StatusCodeHandlerPeiEntry(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112