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