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