]>
Commit | Line | Data |
---|---|---|
25126a05 | 1 | /** @file\r |
2 | OEM hook status code handler PEIM which produces general handler and hook it\r | |
3 | onto the PEI status code router.\r | |
4 | \r | |
8f2a5f80 | 5 | Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r |
9d2eedba | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
25126a05 | 7 | \r |
8 | **/\r | |
9 | \r | |
10 | //\r | |
11 | // The package level header files this module uses\r | |
12 | //\r | |
13 | #include <WinNtPeim.h>\r | |
14 | \r | |
15 | //\r | |
16 | // The protocols, PPI and GUID defintions for this module\r | |
17 | //\r | |
18 | #include <Ppi/ReportStatusCodeHandler.h>\r | |
19 | //\r | |
20 | // The Library classes this module consumes\r | |
21 | //\r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/PeiServicesLib.h>\r | |
24 | #include <Library/PeimEntryPoint.h>\r | |
25 | #include <Library/OemHookStatusCodeLib.h>\r | |
26 | \r | |
27 | EFI_STATUS\r | |
28 | EFIAPI\r | |
29 | OemHookStatusCodeReportWrapper (\r | |
30 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
31 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
32 | IN EFI_STATUS_CODE_VALUE Value,\r | |
33 | IN UINT32 Instance,\r | |
34 | IN CONST EFI_GUID *CallerId, OPTIONAL\r | |
35 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
36 | )\r | |
37 | {\r | |
38 | return OemHookStatusCodeReport (\r | |
39 | CodeType,\r | |
40 | Value,\r | |
41 | Instance,\r | |
42 | (EFI_GUID *) CallerId,\r | |
43 | (EFI_STATUS_CODE_DATA *) Data\r | |
44 | );\r | |
45 | }\r | |
46 | \r | |
47 | /**\r | |
48 | Entry point of OEM hook status code handler PEIM.\r | |
49 | \r | |
50 | This function is the entry point of this OEM hook status code handler PEIM.\r | |
51 | It initializes and registers OEM status code handler.\r | |
52 | \r | |
53 | @param FileHandle Handle of the file being invoked.\r | |
54 | @param PeiServices Describes the list of possible PEI Services.\r | |
55 | \r | |
56 | @retval EFI_SUCESS The entry point executes successfully.\r | |
57 | \r | |
58 | **/\r | |
59 | EFI_STATUS\r | |
60 | EFIAPI\r | |
61 | WinNtOemHookStatusCodeHandlerPeiEntry (\r | |
62 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
63 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
64 | )\r | |
65 | {\r | |
66 | EFI_STATUS Status;\r | |
67 | EFI_PEI_RSC_HANDLER_PPI *RscHandlerPpi;\r | |
68 | \r | |
69 | Status = PeiServicesLocatePpi (\r | |
70 | &gEfiPeiRscHandlerPpiGuid,\r | |
71 | 0,\r | |
72 | NULL,\r | |
73 | (VOID **) &RscHandlerPpi\r | |
74 | );\r | |
75 | ASSERT_EFI_ERROR (Status);\r | |
76 | \r | |
77 | OemHookStatusCodeInitialize ();\r | |
78 | \r | |
79 | Status = RscHandlerPpi->Register (OemHookStatusCodeReportWrapper); \r | |
80 | ASSERT_EFI_ERROR (Status);\r | |
81 | \r | |
82 | return EFI_SUCCESS;\r | |
83 | }\r |