2 Internal include file of Status Code Runtime DXE Driver.
4 Copyright (c) 2006 - 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __STATUS_CODE_RUNTIME_DXE_H__
16 #define __STATUS_CODE_RUNTIME_DXE_H__
19 #include <FrameworkDxe.h>
20 #include <FrameworkModuleDxe.h>
21 #include <Guid/DataHubStatusCodeRecord.h>
22 #include <Protocol/DataHub.h>
23 #include <Protocol/SerialIo.h>
24 #include <Guid/MemoryStatusCodeRecord.h>
25 #include <Protocol/StatusCode.h>
26 #include <Guid/StatusCodeDataTypeId.h>
27 #include <Guid/StatusCodeDataTypeDebug.h>
28 #include <Guid/EventGroup.h>
30 #include <Library/BaseLib.h>
31 #include <Library/SynchronizationLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/DebugLib.h>
34 #include <Library/ReportStatusCodeLib.h>
35 #include <Library/PrintLib.h>
36 #include <Library/PcdLib.h>
37 #include <Library/HobLib.h>
38 #include <Library/UefiDriverEntryPoint.h>
39 #include <Library/UefiBootServicesTableLib.h>
40 #include <Library/UefiLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/UefiRuntimeLib.h>
43 #include <Library/SerialPortLib.h>
44 #include <Library/OemHookStatusCodeLib.h>
47 // Data hub worker definition
49 #define DATAHUB_STATUS_CODE_SIGNATURE SIGNATURE_32 ('B', 'D', 'H', 'S')
54 UINT8 Data
[sizeof(DATA_HUB_STATUS_CODE_DATA_RECORD
) + EFI_STATUS_CODE_DATA_MAX_SIZE
];
55 } DATAHUB_STATUSCODE_RECORD
;
59 // Runtime memory status code worker definition
63 UINT32 NumberOfRecords
;
64 UINT32 MaxRecordsNumber
;
65 } RUNTIME_MEMORY_STATUSCODE_HEADER
;
67 extern RUNTIME_MEMORY_STATUSCODE_HEADER
*mRtMemoryStatusCodeTable
;
70 Report status code to all supported device.
72 This function implements EFI_STATUS_CODE_PROTOCOL.ReportStatusCode().
73 It calls into the workers which dispatches the platform specific listeners.
75 @param CodeType Indicates the type of status code being reported.
76 @param Value Describes the current status of a hardware or software entity.
77 This included information about the class and subclass that is used to
78 classify the entity as well as an operation.
79 @param Instance The enumeration of a hardware or software entity within
80 the system. Valid instance numbers start with 1.
81 @param CallerId This optional parameter may be used to identify the caller.
82 This parameter allows the status code driver to apply different rules to
84 @param Data This optional parameter may be used to pass additional data.
86 @retval EFI_SUCCESS The function completed successfully
87 @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
93 IN EFI_STATUS_CODE_TYPE CodeType
,
94 IN EFI_STATUS_CODE_VALUE Value
,
96 IN EFI_GUID
*CallerId OPTIONAL
,
97 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
101 Dispatch initialization request to sub status code devices based on
102 customized feature flags.
106 InitializationDispatcherWorker (
112 Locates Serial I/O Protocol as initialization for serial status code worker.
114 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
118 EfiSerialStatusCodeInitializeWorker (
124 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
126 @param CodeType Indicates the type of status code being reported.
127 @param Value Describes the current status of a hardware or software entity.
128 This included information about the class and subclass that is used to
129 classify the entity as well as an operation.
130 @param Instance The enumeration of a hardware or software entity within
131 the system. Valid instance numbers start with 1.
132 @param CallerId This optional parameter may be used to identify the caller.
133 This parameter allows the status code driver to apply different rules to
135 @param Data This optional parameter may be used to pass additional data.
137 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
138 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
139 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
143 SerialStatusCodeReportWorker (
144 IN EFI_STATUS_CODE_TYPE CodeType
,
145 IN EFI_STATUS_CODE_VALUE Value
,
147 IN EFI_GUID
*CallerId
,
148 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
152 Initialize runtime memory status code table as initialization for runtime memory status code worker
154 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
158 RtMemoryStatusCodeInitializeWorker (
163 Report status code into runtime memory. If the runtime pool is full, roll back to the
164 first record and overwrite it.
166 @param CodeType Indicates the type of status code being reported.
167 @param Value Describes the current status of a hardware or software entity.
168 This included information about the class and subclass that is used to
169 classify the entity as well as an operation.
170 @param Instance The enumeration of a hardware or software entity within
171 the system. Valid instance numbers start with 1.
173 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
177 RtMemoryStatusCodeReportWorker (
178 IN EFI_STATUS_CODE_TYPE CodeType
,
179 IN EFI_STATUS_CODE_VALUE Value
,
184 Locate Data Hub Protocol and create event for logging data
185 as initialization for data hub status code worker.
187 @retval EFI_SUCCESS Initialization is successful.
191 DataHubStatusCodeInitializeWorker (
197 Report status code into DataHub.
199 @param CodeType Indicates the type of status code being reported.
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
202 classify the entity as well as an operation.
203 @param Instance The enumeration of a hardware or software entity within
204 the system. Valid instance numbers start with 1.
205 @param CallerId This optional parameter may be used to identify the caller.
206 This parameter allows the status code driver to apply different rules to
208 @param Data This optional parameter may be used to pass additional data.
210 @retval EFI_SUCCESS The function completed successfully.
211 @retval EFI_DEVICE_ERROR Function is reentered.
212 @retval EFI_DEVICE_ERROR Function is called at runtime.
213 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for free record buffer.
217 DataHubStatusCodeReportWorker (
218 IN EFI_STATUS_CODE_TYPE CodeType
,
219 IN EFI_STATUS_CODE_VALUE Value
,
221 IN EFI_GUID
*CallerId
,
222 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
227 Virtual address change notification call back. It converts global pointer
230 @param Event Event whose notification function is being invoked.
231 @param Context Pointer to the notification function's context, which is
232 always zero in current implementation.
237 VirtualAddressChangeCallBack (