]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Pei/StatusCode/StatusCode.c
Enable Nt32 platform boot to DXE phase.
[mirror_edk2.git] / MdeModulePkg / 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 //
25 // Include common header file for this module.
26 //
27 #include "CommonHeader.h"
28
29 #include <PeiMain.h>
30
31 EFI_STATUS
32 EFIAPI
33 PeiReportStatusCode (
34 IN EFI_PEI_SERVICES **PeiServices,
35 IN EFI_STATUS_CODE_TYPE CodeType,
36 IN EFI_STATUS_CODE_VALUE Value,
37 IN UINT32 Instance,
38 IN EFI_GUID *CallerId,
39 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
40 )
41 /*++
42
43 Routine Description:
44
45 Core version of the Status Code reporter
46
47 Arguments:
48
49 PeiServices - The PEI core services table.
50
51 CodeType - Type of Status Code.
52
53 Value - Value to output for Status Code.
54
55 Instance - Instance Number of this status code.
56
57 CallerId - ID of the caller of this status code.
58
59 Data - Optional data associated with this status code.
60
61 Returns:
62
63 Status - EFI_SUCCESS if status code is successfully reported
64 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
65
66 --*/
67 {
68 EFI_STATUS Status;
69 EFI_PEI_PROGRESS_CODE_PPI *StatusCodePpi;
70
71
72 //
73 //Locate StatusCode Ppi.
74 //
75 Status = PeiServicesLocatePpi (
76 &gEfiPeiStatusCodePpiGuid,
77 0,
78 NULL,
79 (VOID **)&StatusCodePpi
80 );
81
82 if (!EFI_ERROR (Status)) {
83 Status = StatusCodePpi->ReportStatusCode (
84 PeiServices,
85 CodeType,
86 Value,
87 Instance,
88 CallerId,
89 Data
90 );
91
92 return Status;
93 }
94
95
96 return EFI_NOT_AVAILABLE_YET;
97 }
98
99
100