]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.h
eeb6dcb720595426505eddd9f085b1928dbd9710
[mirror_edk2.git] / EdkModulePkg / Universal / StatusCode / Dxe / DxeStatusCode.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation. All rights reserved.
4 This software and associated documentation (if any) is furnished
5 under a license and may only be used or copied in accordance
6 with the terms of the license. Except as permitted by such
7 license, no part of this software or documentation may be
8 reproduced, stored in a retrieval system, or transmitted in any
9 form or by any means without the express written consent of
10 Intel Corporation.
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 enum {
39 PHYSICAL_MODE,
40 VIRTUAL_MODE
41 };
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 @return The function always return EFI_SUCCESS.
128
129 **/
130 EFI_STATUS
131 SerialStatusCodeReportWorker (
132 IN EFI_STATUS_CODE_TYPE CodeType,
133 IN EFI_STATUS_CODE_VALUE Value,
134 IN UINT32 Instance,
135 IN EFI_GUID *CallerId,
136 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
137 );
138
139 /**
140 Initialize runtime memory status code.
141
142 @return The function always return EFI_SUCCESS
143
144 **/
145 EFI_STATUS
146 RtMemoryStatusCodeInitializeWorker (
147 VOID
148 );
149
150 /**
151 Report status code into runtime memory. If the runtime pool is full, roll back to the
152 first record and overwrite it.
153
154 @param RtMemoryStatusCodeTable
155 Point to Runtime memory table header.
156
157 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.
158
159 @param Value Describes the current status of a hardware or software entity.
160 This included information about the class and subclass that is used to classify the entity
161 as well as an operation. For progress codes, the operation is the current activity.
162 For error codes, it is the exception. For debug codes, it is not defined at this time.
163 Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below.
164 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
165
166 @param Instance The enumeration of a hardware or software entity within the system.
167 A system may contain multiple entities that match a class/subclass pairing.
168 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
169 not meaningful, or not relevant. Valid instance numbers start with 1.
170
171 @return The function always return EFI_SUCCESS.
172
173 **/
174 EFI_STATUS
175 RtMemoryStatusCodeReportWorker (
176 RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable,
177 IN EFI_STATUS_CODE_TYPE CodeType,
178 IN EFI_STATUS_CODE_VALUE Value,
179 IN UINT32 Instance
180 );
181
182 /**
183 Initialize data hubstatus code.
184 Create a data hub listener.
185
186 @return The function always return EFI_SUCCESS
187
188 **/
189 EFI_STATUS
190 DataHubStatusCodeInitializeWorker (
191 VOID
192 );
193
194
195 /**
196 Report status code into DataHub.
197
198 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.
199
200 @param Value Describes the current status of a hardware or software entity.
201 This included information about the class and subclass that is used to classify the entity
202 as well as an operation. For progress codes, the operation is the current activity.
203 For error codes, it is the exception. For debug codes, it is not defined at this time.
204 Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below.
205 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
206
207 @param Instance The enumeration of a hardware or software entity within the system.
208 A system may contain multiple entities that match a class/subclass pairing.
209 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
210 not meaningful, or not relevant. Valid instance numbers start with 1.
211
212
213 @param CallerId This optional parameter may be used to identify the caller.
214 This parameter allows the status code driver to apply different rules to different callers.
215 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
216
217
218 @param Data This optional parameter may be used to pass additional data
219
220 @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.
221 @retval EFI_SUCCESS Success to cache status code and signal log data event.
222
223 **/
224 EFI_STATUS
225 DataHubStatusCodeReportWorker (
226 IN EFI_STATUS_CODE_TYPE CodeType,
227 IN EFI_STATUS_CODE_VALUE Value,
228 IN UINT32 Instance,
229 IN EFI_GUID *CallerId,
230 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
231 );
232
233 //
234 // declaration of DXE status code controller.
235 //
236 extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode;
237
238 #endif