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
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.
18 Header file of EFI DXE/RT Status Code.
22 #ifndef __DXE_STATUS_CODE_H__
23 #define __DXE_STATUS_CODE_H__
25 #include <Common/StatusCode.h>
28 // Data hub worker definition
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')
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,
49 UINT8 Data
[sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD
) + EFI_STATUS_CODE_DATA_MAX_SIZE
];
50 } DATAHUB_STATUSCODE_RECORD
;
54 // Runtime memory status code worker definition
58 UINT32 NumberOfRecords
;
59 UINT32 MaxRecordsNumber
;
60 } RUNTIME_MEMORY_STATUSCODE_HEADER
;
65 // Report operation nest status.
66 // If it is set, then the report operation has nested.
68 UINT32 StatusCodeNestStatus
;
70 // Runtime status code management header, the records buffer is following it.
72 RUNTIME_MEMORY_STATUSCODE_HEADER
*RtMemoryStatusCodeTable
[2];
73 } DXE_STATUS_CODE_CONTROLLER
;
78 Dispatch initialization request to sub status code devices based on
79 customized feature flags.
83 InitializationDispatcherWorker (
89 Initialize serial status code worker.
91 @return The function always return EFI_SUCCESS
95 EfiSerialStatusCodeInitializeWorker (
101 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
103 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
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.
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.
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.
123 @param Data This optional parameter may be used to pass additional data
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 .
130 SerialStatusCodeReportWorker (
131 IN EFI_STATUS_CODE_TYPE CodeType
,
132 IN EFI_STATUS_CODE_VALUE Value
,
134 IN EFI_GUID
*CallerId
,
135 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
139 Initialize runtime memory status code.
141 @return The function always return EFI_SUCCESS
145 RtMemoryStatusCodeInitializeWorker (
150 Report status code into runtime memory. If the runtime pool is full, roll back to the
151 first record and overwrite it.
153 @param RtMemoryStatusCodeTable
154 Point to Runtime memory table header.
156 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
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.
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.
170 @return The function always return EFI_SUCCESS.
174 RtMemoryStatusCodeReportWorker (
175 RUNTIME_MEMORY_STATUSCODE_HEADER
*RtMemoryStatusCodeTable
,
176 IN EFI_STATUS_CODE_TYPE CodeType
,
177 IN EFI_STATUS_CODE_VALUE Value
,
182 Initialize data hubstatus code.
183 Create a data hub listener.
185 @return The function always return EFI_SUCCESS
189 DataHubStatusCodeInitializeWorker (
195 Report status code into DataHub.
197 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
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.
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.
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.
217 @param Data This optional parameter may be used to pass additional data
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.
225 DataHubStatusCodeReportWorker (
226 IN EFI_STATUS_CODE_TYPE CodeType
,
227 IN EFI_STATUS_CODE_VALUE Value
,
229 IN EFI_GUID
*CallerId
,
230 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
234 // declaration of DXE status code controller.
236 extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode
;