Rename Protocol/FormCallback.h to Protocol/FormCallbackFramework.h to follow the...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / StatusCode / Dxe / DxeStatusCode.h
CommitLineData
ad1a1798 1/*++\r
2\r
3 Copyright (c) 2006, Intel Corporation \r
4 All rights reserved. This program and the accompanying materials \r
5 are licensed and made available under the terms and conditions of the BSD License \r
6 which accompanies this distribution. The full text of the license may be found at \r
7 http://opensource.org/licenses/bsd-license.php \r
8 \r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 DxeStatusCode.h\r
15\r
16Abstract:\r
17\r
18 Header file of EFI DXE/RT Status Code.\r
19\r
20--*/\r
21\r
22#ifndef __DXE_STATUS_CODE_H__\r
23#define __DXE_STATUS_CODE_H__\r
24\r
25//\r
26// Include common header file for this module.\r
27//\r
28#include "CommonHeader.h"\r
29\r
30//\r
31// Data hub worker definition \r
32//\r
33#define MAX_NUMBER_DATAHUB_RECORDS 1000\r
34#define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE\r
35#define EMPTY_RECORD_TAG 0xFF\r
36#define DATAHUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')\r
37\r
38//\r
39// Address type of pointer.\r
40// The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture\r
41// Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture, \r
42// \r
43typedef enum {\r
44 PHYSICAL_MODE,\r
45 VIRTUAL_MODE\r
46} PROCESSOR_MODE;\r
47\r
48typedef struct {\r
49 UINTN Signature;\r
50 LIST_ENTRY Node;\r
51 EFI_STATUS_CODE_TYPE CodeType;\r
52 EFI_STATUS_CODE_VALUE Value;\r
53 UINT32 Instance;\r
54 EFI_GUID CallerId;\r
55 EFI_STATUS_CODE_DATA Data;\r
56 UINT8 ExtendData[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
57} DATAHUB_STATUSCODE_RECORD;\r
58\r
59\r
60//\r
61// Runtime memory status code worker definition \r
62// \r
63typedef struct {\r
64 UINT32 RecordIndex;\r
65 UINT32 NumberOfRecords;\r
66 UINT32 MaxRecordsNumber;\r
67} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
68\r
69\r
70typedef struct {\r
71 //\r
72 // Report operation nest status. \r
73 // If it is set, then the report operation has nested.\r
74 // \r
75 UINT32 StatusCodeNestStatus;\r
76 //\r
77 // Runtime status code management header, the records buffer is following it.\r
78 // \r
79 RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable[2];\r
80} DXE_STATUS_CODE_CONTROLLER;\r
81\r
82\r
83/**\r
84 \r
85 Dispatch initialization request to sub status code devices based on \r
86 customized feature flags.\r
87 \r
88**/\r
89VOID\r
90InitializationDispatcherWorker (\r
91 VOID\r
92 );\r
93\r
94\r
95/**\r
96 Initialize serial status code worker.\r
97 \r
98 @return The function always return EFI_SUCCESS\r
99\r
100**/\r
101EFI_STATUS\r
102EfiSerialStatusCodeInitializeWorker (\r
103 VOID\r
104 );\r
105\r
106\r
107/**\r
108 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
109 \r
110 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
111 \r
112 @param Value Describes the current status of a hardware or software entity. \r
113 This included information about the class and subclass that is used to classify the entity \r
114 as well as an operation. For progress codes, the operation is the current activity. \r
115 For error codes, it is the exception. For debug codes, it is not defined at this time. \r
116 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r
117 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
118 \r
119 @param Instance The enumeration of a hardware or software entity within the system. \r
120 A system may contain multiple entities that match a class/subclass pairing. \r
121 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
122 not meaningful, or not relevant. Valid instance numbers start with 1.\r
123\r
124\r
125 @param CallerId This optional parameter may be used to identify the caller. \r
126 This parameter allows the status code driver to apply different rules to different callers. \r
127 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
128\r
129\r
130 @param Data This optional parameter may be used to pass additional data\r
131 \r
132 @retval EFI_SUCCESS Success to report status code to serial I/O.\r
133 @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r
134\r
135**/\r
136EFI_STATUS\r
137SerialStatusCodeReportWorker (\r
138 IN EFI_STATUS_CODE_TYPE CodeType,\r
139 IN EFI_STATUS_CODE_VALUE Value,\r
140 IN UINT32 Instance,\r
141 IN EFI_GUID *CallerId,\r
142 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
143 );\r
144\r
145/**\r
146 Initialize runtime memory status code.\r
147 \r
148 @return The function always return EFI_SUCCESS\r
149\r
150**/\r
151EFI_STATUS\r
152RtMemoryStatusCodeInitializeWorker (\r
153 VOID\r
154 );\r
155\r
156/**\r
157 Report status code into runtime memory. If the runtime pool is full, roll back to the \r
158 first record and overwrite it.\r
159 \r
160 @param RtMemoryStatusCodeTable \r
161 Point to Runtime memory table header.\r
162\r
163 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
164 \r
165 @param Value Describes the current status of a hardware or software entity. \r
166 This included information about the class and subclass that is used to classify the entity \r
167 as well as an operation. For progress codes, the operation is the current activity. \r
168 For error codes, it is the exception. For debug codes, it is not defined at this time. \r
169 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r
170 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
171 \r
172 @param Instance The enumeration of a hardware or software entity within the system. \r
173 A system may contain multiple entities that match a class/subclass pairing. \r
174 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
175 not meaningful, or not relevant. Valid instance numbers start with 1.\r
176 \r
177 @return The function always return EFI_SUCCESS.\r
178\r
179**/\r
180EFI_STATUS\r
181RtMemoryStatusCodeReportWorker (\r
182 RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable,\r
183 IN EFI_STATUS_CODE_TYPE CodeType,\r
184 IN EFI_STATUS_CODE_VALUE Value,\r
185 IN UINT32 Instance\r
186 );\r
187\r
188/**\r
189 Initialize data hubstatus code.\r
190 Create a data hub listener.\r
191 \r
192 @return The function always return EFI_SUCCESS\r
193\r
194**/\r
195EFI_STATUS\r
196DataHubStatusCodeInitializeWorker (\r
197 VOID\r
198 );\r
199\r
200\r
201/**\r
202 Report status code into DataHub.\r
203 \r
204 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
205 \r
206 @param Value Describes the current status of a hardware or software entity. \r
207 This included information about the class and subclass that is used to classify the entity \r
208 as well as an operation. For progress codes, the operation is the current activity. \r
209 For error codes, it is the exception. For debug codes, it is not defined at this time. \r
210 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r
211 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
212 \r
213 @param Instance The enumeration of a hardware or software entity within the system. \r
214 A system may contain multiple entities that match a class/subclass pairing. \r
215 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
216 not meaningful, or not relevant. Valid instance numbers start with 1.\r
217\r
218\r
219 @param CallerId This optional parameter may be used to identify the caller. \r
220 This parameter allows the status code driver to apply different rules to different callers. \r
221 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
222\r
223\r
224 @param Data This optional parameter may be used to pass additional data\r
225 \r
226 @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.\r
227 @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r
228 @retval EFI_SUCCESS Success to cache status code and signal log data event.\r
229\r
230**/\r
231EFI_STATUS\r
232DataHubStatusCodeReportWorker (\r
233 IN EFI_STATUS_CODE_TYPE CodeType,\r
234 IN EFI_STATUS_CODE_VALUE Value,\r
235 IN UINT32 Instance,\r
236 IN EFI_GUID *CallerId,\r
237 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
238 );\r
239\r
240//\r
241// declaration of DXE status code controller.\r
242// \r
243extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode;\r
244\r
245#endif\r