]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Core/Pei/StatusCode/StatusCode.c
Fix some cleanall issues
[mirror_edk2.git] / EdkModulePkg / Core / Pei / StatusCode / StatusCode.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 StatusCode.c
15
16 Abstract:
17
18 Pei Core Status Code Support
19
20 Revision History
21
22 --*/
23
24 #include <PeiMain.h>
25
26 EFI_STATUS
27 EFIAPI
28 PeiReportStatusCode (
29 IN EFI_PEI_SERVICES **PeiServices,
30 IN EFI_STATUS_CODE_TYPE CodeType,
31 IN EFI_STATUS_CODE_VALUE Value,
32 IN UINT32 Instance,
33 IN EFI_GUID *CallerId,
34 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
35 )
36 /*++
37
38 Routine Description:
39
40 Core version of the Status Code reporter
41
42 Arguments:
43
44 PeiServices - The PEI core services table.
45
46 CodeType - Type of Status Code.
47
48 Value - Value to output for Status Code.
49
50 Instance - Instance Number of this status code.
51
52 CallerId - ID of the caller of this status code.
53
54 Data - Optional data associated with this status code.
55
56 Returns:
57
58 Status - EFI_SUCCESS if status code is successfully reported
59 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
60
61 --*/
62 {
63 EFI_STATUS Status;
64 EFI_PEI_PROGRESS_CODE_PPI *StatusCodePpi;
65
66
67 //
68 //Locate StatusCode Ppi.
69 //
70 Status = PeiCoreLocatePpi (
71 &gEfiPeiStatusCodePpiGuid,
72 0,
73 NULL,
74 (VOID **)&StatusCodePpi
75 );
76
77 if (!EFI_ERROR (Status)) {
78 Status = StatusCodePpi->ReportStatusCode (
79 PeiServices,
80 CodeType,
81 Value,
82 Instance,
83 CallerId,
84 Data
85 );
86
87 return Status;
88 }
89
90
91 return EFI_NOT_AVAILABLE_YET;
92 }
93
94
95