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