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