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__
26 // Include common header file for this module.
28 #include "CommonHeader.h"
31 // Data hub worker definition
33 #define MAX_NUMBER_DATAHUB_RECORDS 1000
34 #define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE
35 #define EMPTY_RECORD_TAG 0xFF
36 #define DATAHUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')
39 // Address type of pointer.
40 // The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture
41 // Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture,
51 EFI_STATUS_CODE_TYPE CodeType
;
52 EFI_STATUS_CODE_VALUE Value
;
55 EFI_STATUS_CODE_DATA Data
;
56 UINT8 ExtendData
[EFI_STATUS_CODE_DATA_MAX_SIZE
];
57 } DATAHUB_STATUSCODE_RECORD
;
61 // Runtime memory status code worker definition
65 UINT32 NumberOfRecords
;
66 UINT32 MaxRecordsNumber
;
67 } RUNTIME_MEMORY_STATUSCODE_HEADER
;
72 // Report operation nest status.
73 // If it is set, then the report operation has nested.
75 UINT32 StatusCodeNestStatus
;
77 // Runtime status code management header, the records buffer is following it.
79 RUNTIME_MEMORY_STATUSCODE_HEADER
*RtMemoryStatusCodeTable
[2];
80 } DXE_STATUS_CODE_CONTROLLER
;
85 Dispatch initialization request to sub status code devices based on
86 customized feature flags.
90 InitializationDispatcherWorker (
96 Initialize serial status code worker.
98 @return The function always return EFI_SUCCESS
102 EfiSerialStatusCodeInitializeWorker (
108 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
110 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
112 @param Value Describes the current status of a hardware or software entity.
113 This included information about the class and subclass that is used to classify the entity
114 as well as an operation. For progress codes, the operation is the current activity.
115 For error codes, it is the exception. For debug codes, it is not defined at this time.
116 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
117 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
119 @param Instance The enumeration of a hardware or software entity within the system.
120 A system may contain multiple entities that match a class/subclass pairing.
121 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
122 not meaningful, or not relevant. Valid instance numbers start with 1.
125 @param CallerId This optional parameter may be used to identify the caller.
126 This parameter allows the status code driver to apply different rules to different callers.
127 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
130 @param Data This optional parameter may be used to pass additional data
132 @retval EFI_SUCCESS Success to report status code to serial I/O.
133 @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .
137 SerialStatusCodeReportWorker (
138 IN EFI_STATUS_CODE_TYPE CodeType
,
139 IN EFI_STATUS_CODE_VALUE Value
,
141 IN EFI_GUID
*CallerId
,
142 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
146 Initialize runtime memory status code.
148 @return The function always return EFI_SUCCESS
152 RtMemoryStatusCodeInitializeWorker (
157 Report status code into runtime memory. If the runtime pool is full, roll back to the
158 first record and overwrite it.
160 @param RtMemoryStatusCodeTable
161 Point to Runtime memory table header.
163 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
165 @param Value Describes the current status of a hardware or software entity.
166 This included information about the class and subclass that is used to classify the entity
167 as well as an operation. For progress codes, the operation is the current activity.
168 For error codes, it is the exception. For debug codes, it is not defined at this time.
169 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
170 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
172 @param Instance The enumeration of a hardware or software entity within the system.
173 A system may contain multiple entities that match a class/subclass pairing.
174 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
175 not meaningful, or not relevant. Valid instance numbers start with 1.
177 @return The function always return EFI_SUCCESS.
181 RtMemoryStatusCodeReportWorker (
182 RUNTIME_MEMORY_STATUSCODE_HEADER
*RtMemoryStatusCodeTable
,
183 IN EFI_STATUS_CODE_TYPE CodeType
,
184 IN EFI_STATUS_CODE_VALUE Value
,
189 Initialize data hubstatus code.
190 Create a data hub listener.
192 @return The function always return EFI_SUCCESS
196 DataHubStatusCodeInitializeWorker (
202 Report status code into DataHub.
204 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
206 @param Value Describes the current status of a hardware or software entity.
207 This included information about the class and subclass that is used to classify the entity
208 as well as an operation. For progress codes, the operation is the current activity.
209 For error codes, it is the exception. For debug codes, it is not defined at this time.
210 Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
211 Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
213 @param Instance The enumeration of a hardware or software entity within the system.
214 A system may contain multiple entities that match a class/subclass pairing.
215 The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
216 not meaningful, or not relevant. Valid instance numbers start with 1.
219 @param CallerId This optional parameter may be used to identify the caller.
220 This parameter allows the status code driver to apply different rules to different callers.
221 Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
224 @param Data This optional parameter may be used to pass additional data
226 @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.
227 @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .
228 @retval EFI_SUCCESS Success to cache status code and signal log data event.
232 DataHubStatusCodeReportWorker (
233 IN EFI_STATUS_CODE_TYPE CodeType
,
234 IN EFI_STATUS_CODE_VALUE Value
,
236 IN EFI_GUID
*CallerId
,
237 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
241 // declaration of DXE status code controller.
243 extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode
;