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