]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Pei/StatusCode/StatusCode.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Core / Pei / StatusCode / StatusCode.c
1 /** @file
2 Pei Core Status Code Support
3
4 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "PeiMain.h"
16
17 /**
18
19 Core version of the Status Code reporter
20
21
22 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
23 @param CodeType Type of Status Code.
24 @param Value Value to output for Status Code.
25 @param Instance Instance Number of this status code.
26 @param CallerId ID of the caller of this status code.
27 @param Data Optional data associated with this status code.
28
29 @retval EFI_SUCCESS if status code is successfully reported
30 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
31
32 **/
33 EFI_STATUS
34 EFIAPI
35 PeiReportStatusCode (
36 IN CONST EFI_PEI_SERVICES **PeiServices,
37 IN EFI_STATUS_CODE_TYPE CodeType,
38 IN EFI_STATUS_CODE_VALUE Value,
39 IN UINT32 Instance,
40 IN CONST EFI_GUID *CallerId,
41 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
42 )
43 {
44 EFI_STATUS Status;
45 EFI_PEI_PROGRESS_CODE_PPI *StatusCodePpi;
46
47 //
48 // Locate StatusCode Ppi.
49 //
50 Status = PeiServicesLocatePpi (
51 &gEfiPeiStatusCodePpiGuid,
52 0,
53 NULL,
54 (VOID **)&StatusCodePpi
55 );
56
57 if (!EFI_ERROR (Status)) {
58 Status = StatusCodePpi->ReportStatusCode (
59 PeiServices,
60 CodeType,
61 Value,
62 Instance,
63 CallerId,
64 Data
65 );
66
67 return Status;
68 }
69
70 return EFI_NOT_AVAILABLE_YET;
71 }
72
73
74