2 Report Status Code Handler PEIM which produces general handlers and hook them
3 onto the PEI status code router.
5 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "StatusCodeHandlerPei.h"
13 Entry point of Status Code PEIM.
15 This function is the entry point of this Status Code PEIM.
16 It initializes supported status code devices according to PCD settings,
17 and installs Status Code PPI.
19 @param FileHandle Handle of the file being invoked.
20 @param PeiServices Describes the list of possible PEI Services.
22 @retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfully.
27 StatusCodeHandlerPeiEntry (
28 IN EFI_PEI_FILE_HANDLE FileHandle
,
29 IN CONST EFI_PEI_SERVICES
**PeiServices
33 EFI_PEI_RSC_HANDLER_PPI
*RscHandlerPpi
;
35 Status
= PeiServicesLocatePpi (
36 &gEfiPeiRscHandlerPpiGuid
,
39 (VOID
**) &RscHandlerPpi
41 ASSERT_EFI_ERROR (Status
);
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.
48 if (FeaturePcdGet (PcdStatusCodeUseSerial
)) {
49 Status
= SerialPortInitialize();
50 ASSERT_EFI_ERROR (Status
);
51 Status
= RscHandlerPpi
->Register (SerialStatusCodeReportWorker
);
52 ASSERT_EFI_ERROR (Status
);
54 if (FeaturePcdGet (PcdStatusCodeUseMemory
)) {
55 Status
= MemoryStatusCodeInitializeWorker ();
56 ASSERT_EFI_ERROR (Status
);
57 Status
= RscHandlerPpi
->Register (MemoryStatusCodeReportWorker
);
58 ASSERT_EFI_ERROR (Status
);