]>
Commit | Line | Data |
---|---|---|
3af9b388 | 1 | /** @file\r |
2 | Report Status Code Handler PEIM which produces general handlers and hook them\r | |
3 | onto the PEI status code router.\r | |
4 | \r | |
e5eed7d3 HT |
5 | Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r |
6 | This program and the accompanying materials\r | |
3af9b388 | 7 | are licensed and made available under the terms and conditions of the BSD License\r |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include "StatusCodeHandlerPei.h"\r | |
17 | \r | |
18 | /**\r | |
19 | Entry point of Status Code PEIM.\r | |
20 | \r | |
21 | This function is the entry point of this Status Code PEIM.\r | |
22 | It initializes supported status code devices according to PCD settings,\r | |
23 | and installs Status Code PPI.\r | |
24 | \r | |
25 | @param FileHandle Handle of the file being invoked.\r | |
26 | @param PeiServices Describes the list of possible PEI Services.\r | |
27 | \r | |
28 | @retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfully.\r | |
29 | \r | |
30 | **/\r | |
31 | EFI_STATUS\r | |
32 | EFIAPI\r | |
33 | StatusCodeHandlerPeiEntry (\r | |
34 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
35 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
36 | )\r | |
37 | {\r | |
38 | EFI_STATUS Status;\r | |
39 | EFI_PEI_RSC_HANDLER_PPI *RscHandlerPpi;\r | |
40 | \r | |
41 | Status = PeiServicesLocatePpi (\r | |
42 | &gEfiPeiRscHandlerPpiGuid,\r | |
43 | 0,\r | |
44 | NULL,\r | |
45 | (VOID **) &RscHandlerPpi\r | |
46 | );\r | |
47 | ASSERT_EFI_ERROR (Status);\r | |
48 | \r | |
49 | //\r | |
50 | // Dispatch initialization request to sub-statuscode-devices.\r | |
51 | // If enable UseSerial, then initialize serial port.\r | |
52 | // if enable UseMemory, then initialize memory status code worker.\r | |
53 | //\r | |
54 | if (FeaturePcdGet (PcdStatusCodeUseSerial)) {\r | |
55 | Status = SerialPortInitialize();\r | |
56 | ASSERT_EFI_ERROR (Status);\r | |
57 | Status = RscHandlerPpi->Register (SerialStatusCodeReportWorker); \r | |
58 | ASSERT_EFI_ERROR (Status);\r | |
59 | }\r | |
60 | if (FeaturePcdGet (PcdStatusCodeUseMemory)) {\r | |
61 | Status = MemoryStatusCodeInitializeWorker ();\r | |
62 | ASSERT_EFI_ERROR (Status);\r | |
63 | Status = RscHandlerPpi->Register (MemoryStatusCodeReportWorker); \r | |
64 | ASSERT_EFI_ERROR (Status);\r | |
65 | }\r | |
66 | \r | |
67 | return EFI_SUCCESS;\r | |
68 | }\r | |
69 | \r |