]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.h
Remove CommonHeader.h in StatusCodeDxe.
[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
6f2b45bb 26// The package level header files this module uses\r
ad1a1798 27//\r
6f2b45bb 28#include <FrameworkDxe.h>\r
29//\r
30// The protocols, PPI and GUID defintions for this module\r
31//\r
32#include <Guid/StatusCode.h>\r
33#include <Protocol/DataHub.h>\r
34#include <Protocol/SerialIo.h>\r
35#include <Guid/MemoryStatusCodeRecord.h>\r
36#include <Protocol/StatusCode.h>\r
37#include <Guid/StatusCodeDataTypeId.h>\r
38//\r
39// The Library classes this module consumes\r
40//\r
41#include <Library/BaseLib.h>\r
42#include <Library/BaseMemoryLib.h>\r
43#include <Library/DebugLib.h>\r
44#include <Library/ReportStatusCodeLib.h>\r
45#include <Library/PrintLib.h>\r
46#include <Library/PcdLib.h>\r
47#include <Library/HobLib.h>\r
48#include <Library/UefiDriverEntryPoint.h>\r
49#include <Library/UefiBootServicesTableLib.h>\r
50#include <Library/UefiLib.h>\r
51#include <Library/MemoryAllocationLib.h>\r
52#include <Library/UefiRuntimeLib.h>\r
53#include <Library/SerialPortLib.h>\r
54#include <Library/OemHookStatusCodeLib.h>\r
ad1a1798 55\r
56//\r
57// Data hub worker definition \r
58//\r
59#define MAX_NUMBER_DATAHUB_RECORDS 1000\r
60#define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE\r
61#define EMPTY_RECORD_TAG 0xFF\r
62#define DATAHUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')\r
63\r
64//\r
65// Address type of pointer.\r
66// The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture\r
67// Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture, \r
68// \r
69typedef enum {\r
70 PHYSICAL_MODE,\r
71 VIRTUAL_MODE\r
72} PROCESSOR_MODE;\r
73\r
74typedef struct {\r
6f2b45bb 75 UINTN Signature;\r
76 LIST_ENTRY Node;\r
77\r
78 UINT8 Data[sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + EFI_STATUS_CODE_DATA_MAX_SIZE];\r
ad1a1798 79} DATAHUB_STATUSCODE_RECORD;\r
80\r
81\r
82//\r
83// Runtime memory status code worker definition \r
84// \r
85typedef struct {\r
86 UINT32 RecordIndex;\r
87 UINT32 NumberOfRecords;\r
88 UINT32 MaxRecordsNumber;\r
89} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
90\r
91\r
92typedef struct {\r
93 //\r
94 // Report operation nest status. \r
95 // If it is set, then the report operation has nested.\r
96 // \r
97 UINT32 StatusCodeNestStatus;\r
98 //\r
99 // Runtime status code management header, the records buffer is following it.\r
100 // \r
101 RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable[2];\r
102} DXE_STATUS_CODE_CONTROLLER;\r
103\r
104\r
105/**\r
106 \r
107 Dispatch initialization request to sub status code devices based on \r
108 customized feature flags.\r
109 \r
110**/\r
111VOID\r
112InitializationDispatcherWorker (\r
113 VOID\r
114 );\r
115\r
116\r
117/**\r
118 Initialize serial status code worker.\r
119 \r
120 @return The function always return EFI_SUCCESS\r
121\r
122**/\r
123EFI_STATUS\r
124EfiSerialStatusCodeInitializeWorker (\r
125 VOID\r
126 );\r
127\r
128\r
129/**\r
130 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
131 \r
132 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
133 \r
134 @param Value Describes the current status of a hardware or software entity. \r
135 This included information about the class and subclass that is used to classify the entity \r
136 as well as an operation. For progress codes, the operation is the current activity. \r
137 For error codes, it is the exception. For debug codes, it is not defined at this time. \r
138 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r
139 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
140 \r
141 @param Instance The enumeration of a hardware or software entity within the system. \r
142 A system may contain multiple entities that match a class/subclass pairing. \r
143 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
144 not meaningful, or not relevant. Valid instance numbers start with 1.\r
145\r
146\r
147 @param CallerId This optional parameter may be used to identify the caller. \r
148 This parameter allows the status code driver to apply different rules to different callers. \r
149 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
150\r
151\r
152 @param Data This optional parameter may be used to pass additional data\r
153 \r
154 @retval EFI_SUCCESS Success to report status code to serial I/O.\r
155 @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r
156\r
157**/\r
158EFI_STATUS\r
159SerialStatusCodeReportWorker (\r
160 IN EFI_STATUS_CODE_TYPE CodeType,\r
161 IN EFI_STATUS_CODE_VALUE Value,\r
162 IN UINT32 Instance,\r
163 IN EFI_GUID *CallerId,\r
164 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
165 );\r
166\r
167/**\r
168 Initialize runtime memory status code.\r
169 \r
170 @return The function always return EFI_SUCCESS\r
171\r
172**/\r
173EFI_STATUS\r
174RtMemoryStatusCodeInitializeWorker (\r
175 VOID\r
176 );\r
177\r
178/**\r
179 Report status code into runtime memory. If the runtime pool is full, roll back to the \r
180 first record and overwrite it.\r
181 \r
182 @param RtMemoryStatusCodeTable \r
183 Point to Runtime memory table header.\r
184\r
185 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
186 \r
187 @param Value Describes the current status of a hardware or software entity. \r
188 This included information about the class and subclass that is used to classify the entity \r
189 as well as an operation. For progress codes, the operation is the current activity. \r
190 For error codes, it is the exception. For debug codes, it is not defined at this time. \r
191 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r
192 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
193 \r
194 @param Instance The enumeration of a hardware or software entity within the system. \r
195 A system may contain multiple entities that match a class/subclass pairing. \r
196 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
197 not meaningful, or not relevant. Valid instance numbers start with 1.\r
198 \r
199 @return The function always return EFI_SUCCESS.\r
200\r
201**/\r
202EFI_STATUS\r
203RtMemoryStatusCodeReportWorker (\r
204 RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable,\r
205 IN EFI_STATUS_CODE_TYPE CodeType,\r
206 IN EFI_STATUS_CODE_VALUE Value,\r
207 IN UINT32 Instance\r
208 );\r
209\r
210/**\r
211 Initialize data hubstatus code.\r
212 Create a data hub listener.\r
213 \r
214 @return The function always return EFI_SUCCESS\r
215\r
216**/\r
217EFI_STATUS\r
218DataHubStatusCodeInitializeWorker (\r
219 VOID\r
220 );\r
221\r
222\r
223/**\r
224 Report status code into DataHub.\r
225 \r
226 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
227 \r
228 @param Value Describes the current status of a hardware or software entity. \r
229 This included information about the class and subclass that is used to classify the entity \r
230 as well as an operation. For progress codes, the operation is the current activity. \r
231 For error codes, it is the exception. For debug codes, it is not defined at this time. \r
232 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r
233 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
234 \r
235 @param Instance The enumeration of a hardware or software entity within the system. \r
236 A system may contain multiple entities that match a class/subclass pairing. \r
237 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r
238 not meaningful, or not relevant. Valid instance numbers start with 1.\r
239\r
240\r
241 @param CallerId This optional parameter may be used to identify the caller. \r
242 This parameter allows the status code driver to apply different rules to different callers. \r
243 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
244\r
245\r
246 @param Data This optional parameter may be used to pass additional data\r
247 \r
248 @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.\r
249 @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r
250 @retval EFI_SUCCESS Success to cache status code and signal log data event.\r
251\r
252**/\r
253EFI_STATUS\r
254DataHubStatusCodeReportWorker (\r
255 IN EFI_STATUS_CODE_TYPE CodeType,\r
256 IN EFI_STATUS_CODE_VALUE Value,\r
257 IN UINT32 Instance,\r
258 IN EFI_GUID *CallerId,\r
259 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
260 );\r
261\r
6f2b45bb 262\r
263//\r
264// Declaration for callback Event.\r
265//\r
266VOID\r
267EFIAPI\r
268VirtualAddressChangeCallBack (\r
269 IN EFI_EVENT Event,\r
270 IN VOID *Context\r
271 );\r
272\r
273//\r
274// Declaration for original Entry Point.\r
275//\r
276EFI_STATUS\r
277EFIAPI\r
278DxeStatusCodeDriverEntry (\r
279 IN EFI_HANDLE ImageHandle,\r
280 IN EFI_SYSTEM_TABLE *SystemTable\r
281 );\r
282\r
ad1a1798 283//\r
284// declaration of DXE status code controller.\r
285// \r
286extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode;\r
287\r
288#endif\r