]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.h
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / StatusCode / Pei / StatusCodePei.h
1 /** @file
2 Internal include file for Status Code PEIM.
3
4 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __PEI_STATUS_CODE_H__
10 #define __PEI_STATUS_CODE_H__
11
12 #include <FrameworkPei.h>
13
14 #include <Guid/MemoryStatusCodeRecord.h>
15 #include <Guid/StatusCodeDataTypeId.h>
16 #include <Guid/StatusCodeDataTypeDebug.h>
17 #include <Ppi/StatusCode.h>
18
19 #include <Library/BaseLib.h>
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/PrintLib.h>
23 #include <Library/ReportStatusCodeLib.h>
24 #include <Library/SerialPortLib.h>
25 #include <Library/HobLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/PeiServicesLib.h>
28 #include <Library/OemHookStatusCodeLib.h>
29 #include <Library/PeimEntryPoint.h>
30
31 /**
32 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
33
34 @param CodeType Indicates the type of status code being reported.
35 @param Value Describes the current status of a hardware or
36 software entity. This includes information about the class and
37 subclass that is used to classify the entity as well as an operation.
38 For progress codes, the operation is the current activity.
39 For error codes, it is the exception.For debug codes,it is not defined at this time.
40 @param Instance The enumeration of a hardware or software entity within
41 the system. A system may contain multiple entities that match a class/subclass
42 pairing. The instance differentiates between them. An instance of 0 indicates
43 that instance information is unavailable, not meaningful, or not relevant.
44 Valid instance numbers start with 1.
45 @param CallerId This optional parameter may be used to identify the caller.
46 This parameter allows the status code driver to apply different rules to
47 different callers.
48 @param Data This optional parameter may be used to pass additional data.
49
50 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
51
52 **/
53 EFI_STATUS
54 SerialStatusCodeReportWorker (
55 IN EFI_STATUS_CODE_TYPE CodeType,
56 IN EFI_STATUS_CODE_VALUE Value,
57 IN UINT32 Instance,
58 IN CONST EFI_GUID *CallerId,
59 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
60 );
61
62
63 /**
64 Create the first memory status code GUID'ed HOB as initialization for memory status code worker.
65
66 @retval EFI_SUCCESS The GUID'ed HOB is created successfully.
67
68 **/
69 EFI_STATUS
70 MemoryStatusCodeInitializeWorker (
71 VOID
72 );
73
74 /**
75 Report status code into GUID'ed HOB.
76
77 This function reports status code into GUID'ed HOB. If not all packets are full, then
78 write status code into available entry. Otherwise, create a new packet for it.
79
80 @param CodeType Indicates the type of status code being reported.
81 @param Value Describes the current status of a hardware or
82 software entity. This includes information about the class and
83 subclass that is used to classify the entity as well as an operation.
84 For progress codes, the operation is the current activity.
85 For error codes, it is the exception.For debug codes,it is not defined at this time.
86 @param Instance The enumeration of a hardware or software entity within
87 the system. A system may contain multiple entities that match a class/subclass
88 pairing. The instance differentiates between them. An instance of 0 indicates
89 that instance information is unavailable, not meaningful, or not relevant.
90 Valid instance numbers start with 1.
91
92 @retval EFI_SUCCESS The function always return EFI_SUCCESS.
93
94 **/
95 EFI_STATUS
96 MemoryStatusCodeReportWorker (
97 IN EFI_STATUS_CODE_TYPE CodeType,
98 IN EFI_STATUS_CODE_VALUE Value,
99 IN UINT32 Instance
100 );
101
102 /**
103 Publishes an interface that allows PEIMs to report status codes.
104
105 This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().
106 It publishes an interface that allows PEIMs to report status codes.
107
108 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
109 @param CodeType Indicates the type of status code being reported.
110 @param Value Describes the current status of a hardware or
111 software entity. This includes information about the class and
112 subclass that is used to classify the entity as well as an operation.
113 For progress codes, the operation is the current activity.
114 For error codes, it is the exception.For debug codes,it is not defined at this time.
115 @param Instance The enumeration of a hardware or software entity within
116 the system. A system may contain multiple entities that match a class/subclass
117 pairing. The instance differentiates between them. An instance of 0 indicates
118 that instance information is unavailable, not meaningful, or not relevant.
119 Valid instance numbers start with 1.
120 @param CallerId This optional parameter may be used to identify the caller.
121 This parameter allows the status code driver to apply different rules to
122 different callers.
123 @param Data This optional parameter may be used to pass additional data.
124
125 @retval EFI_SUCCESS The function completed successfully.
126
127 **/
128 EFI_STATUS
129 EFIAPI
130 ReportDispatcher (
131 IN CONST EFI_PEI_SERVICES **PeiServices,
132 IN EFI_STATUS_CODE_TYPE CodeType,
133 IN EFI_STATUS_CODE_VALUE Value,
134 IN UINT32 Instance,
135 IN CONST EFI_GUID *CallerId OPTIONAL,
136 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
137 );
138
139 #endif
140
141