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 // Data hub worker definition
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')
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,
46 EFI_STATUS_CODE_TYPE CodeType
;
47 EFI_STATUS_CODE_VALUE Value
;
50 EFI_STATUS_CODE_DATA Data
;
51 UINT8 ExtendData
[EFI_STATUS_CODE_DATA_MAX_SIZE
];
52 } DATAHUB_STATUSCODE_RECORD
;
56 // Runtime memory status code worker definition
60 UINT32 NumberOfRecords
;
61 UINT32 MaxRecordsNumber
;
62 } RUNTIME_MEMORY_STATUSCODE_HEADER
;
67 // Report operation nest status.
68 // If it is set, then the report operation has nested.
70 UINT32 StatusCodeNestStatus
;
72 // Runtime status code management header, the records buffer is following it.
74 RUNTIME_MEMORY_STATUSCODE_HEADER
*RtMemoryStatusCodeTable
[2];
75 } DXE_STATUS_CODE_CONTROLLER
;
80 Dispatch initialization request to sub status code devices based on
81 customized feature flags.
85 InitializationDispatcherWorker (
91 Initialize serial status code worker.
93 @return The function always return EFI_SUCCESS
97 EfiSerialStatusCodeInitializeWorker (
103 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
105 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.
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.
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.
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.
125 @param Data This optional parameter may be used to pass additional data
127 @return The function always return EFI_SUCCESS.
131 SerialStatusCodeReportWorker (
132 IN EFI_STATUS_CODE_TYPE CodeType
,
133 IN EFI_STATUS_CODE_VALUE Value
,
135 IN EFI_GUID
*CallerId
,
136 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
140 Initialize runtime memory status code.
142 @return The function always return EFI_SUCCESS
146 RtMemoryStatusCodeInitializeWorker (
151 Report status code into runtime memory. If the runtime pool is full, roll back to the
152 first record and overwrite it.
154 @param RtMemoryStatusCodeTable
155 Point to Runtime memory table header.
157 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.
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.
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.
171 @return The function always return EFI_SUCCESS.
175 RtMemoryStatusCodeReportWorker (
176 RUNTIME_MEMORY_STATUSCODE_HEADER
*RtMemoryStatusCodeTable
,
177 IN EFI_STATUS_CODE_TYPE CodeType
,
178 IN EFI_STATUS_CODE_VALUE Value
,
183 Initialize data hubstatus code.
184 Create a data hub listener.
186 @return The function always return EFI_SUCCESS
190 DataHubStatusCodeInitializeWorker (
196 Report status code into DataHub.
198 @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.
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.
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.
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.
218 @param Data This optional parameter may be used to pass additional data
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.
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
;