2 Internal include file of Status Code Runtime DXE Driver.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __STATUS_CODE_RUNTIME_DXE_H__
10 #define __STATUS_CODE_RUNTIME_DXE_H__
13 #include <FrameworkDxe.h>
14 #include <Guid/DataHubStatusCodeRecord.h>
15 #include <Protocol/DataHub.h>
16 #include <Guid/MemoryStatusCodeRecord.h>
17 #include <Protocol/StatusCode.h>
18 #include <Guid/StatusCodeDataTypeId.h>
19 #include <Guid/StatusCodeDataTypeDebug.h>
20 #include <Guid/EventGroup.h>
22 #include <Library/BaseLib.h>
23 #include <Library/SynchronizationLib.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/ReportStatusCodeLib.h>
27 #include <Library/PrintLib.h>
28 #include <Library/PcdLib.h>
29 #include <Library/HobLib.h>
30 #include <Library/UefiDriverEntryPoint.h>
31 #include <Library/UefiBootServicesTableLib.h>
32 #include <Library/UefiLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/UefiRuntimeLib.h>
35 #include <Library/SerialPortLib.h>
36 #include <Library/OemHookStatusCodeLib.h>
39 // Data hub worker definition
41 #define DATAHUB_STATUS_CODE_SIGNATURE SIGNATURE_32 ('B', 'D', 'H', 'S')
46 UINT8 Data
[sizeof(DATA_HUB_STATUS_CODE_DATA_RECORD
) + EFI_STATUS_CODE_DATA_MAX_SIZE
];
47 } DATAHUB_STATUSCODE_RECORD
;
50 extern RUNTIME_MEMORY_STATUSCODE_HEADER
*mRtMemoryStatusCodeTable
;
53 Report status code to all supported device.
55 This function implements EFI_STATUS_CODE_PROTOCOL.ReportStatusCode().
56 It calls into the workers which dispatches the platform specific listeners.
58 @param CodeType Indicates the type of status code being reported.
59 @param Value Describes the current status of a hardware or software entity.
60 This included information about the class and subclass that is used to
61 classify the entity as well as an operation.
62 @param Instance The enumeration of a hardware or software entity within
63 the system. Valid instance numbers start with 1.
64 @param CallerId This optional parameter may be used to identify the caller.
65 This parameter allows the status code driver to apply different rules to
67 @param Data This optional parameter may be used to pass additional data.
69 @retval EFI_SUCCESS The function completed successfully
70 @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
76 IN EFI_STATUS_CODE_TYPE CodeType
,
77 IN EFI_STATUS_CODE_VALUE Value
,
79 IN EFI_GUID
*CallerId OPTIONAL
,
80 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
84 Dispatch initialization request to sub status code devices based on
85 customized feature flags.
89 InitializationDispatcherWorker (
95 Locates Serial I/O Protocol as initialization for serial status code worker.
97 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
101 EfiSerialStatusCodeInitializeWorker (
107 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
109 @param CodeType Indicates the type of status code being reported.
110 @param Value Describes the current status of a hardware or software entity.
111 This included information about the class and subclass that is used to
112 classify the entity as well as an operation.
113 @param Instance The enumeration of a hardware or software entity within
114 the system. Valid instance numbers start with 1.
115 @param CallerId This optional parameter may be used to identify the caller.
116 This parameter allows the status code driver to apply different rules to
118 @param Data This optional parameter may be used to pass additional data.
120 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
121 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
122 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
126 SerialStatusCodeReportWorker (
127 IN EFI_STATUS_CODE_TYPE CodeType
,
128 IN EFI_STATUS_CODE_VALUE Value
,
130 IN EFI_GUID
*CallerId
,
131 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
135 Initialize runtime memory status code table as initialization for runtime memory status code worker
137 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
141 RtMemoryStatusCodeInitializeWorker (
146 Report status code into runtime memory. If the runtime pool is full, roll back to the
147 first record and overwrite it.
149 @param CodeType Indicates the type of status code being reported.
150 @param Value Describes the current status of a hardware or software entity.
151 This included information about the class and subclass that is used to
152 classify the entity as well as an operation.
153 @param Instance The enumeration of a hardware or software entity within
154 the system. Valid instance numbers start with 1.
156 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
160 RtMemoryStatusCodeReportWorker (
161 IN EFI_STATUS_CODE_TYPE CodeType
,
162 IN EFI_STATUS_CODE_VALUE Value
,
167 Locate Data Hub Protocol and create event for logging data
168 as initialization for data hub status code worker.
170 @retval EFI_SUCCESS Initialization is successful.
174 DataHubStatusCodeInitializeWorker (
180 Report status code into DataHub.
182 @param CodeType Indicates the type of status code being reported.
183 @param Value Describes the current status of a hardware or software entity.
184 This included information about the class and subclass that is used to
185 classify the entity as well as an operation.
186 @param Instance The enumeration of a hardware or software entity within
187 the system. Valid instance numbers start with 1.
188 @param CallerId This optional parameter may be used to identify the caller.
189 This parameter allows the status code driver to apply different rules to
191 @param Data This optional parameter may be used to pass additional data.
193 @retval EFI_SUCCESS The function completed successfully.
194 @retval EFI_DEVICE_ERROR Function is reentered.
195 @retval EFI_DEVICE_ERROR Function is called at runtime.
196 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for free record buffer.
200 DataHubStatusCodeReportWorker (
201 IN EFI_STATUS_CODE_TYPE CodeType
,
202 IN EFI_STATUS_CODE_VALUE Value
,
204 IN EFI_GUID
*CallerId
,
205 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
210 Virtual address change notification call back. It converts global pointer
213 @param Event Event whose notification function is being invoked.
214 @param Context Pointer to the notification function's context, which is
215 always zero in current implementation.
220 VirtualAddressChangeCallBack (