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