2 Internal include file of Status Code Runtime DXE Driver.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 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 <Guid/DataHubStatusCodeRecord.h>
21 #include <Protocol/DataHub.h>
22 #include <Guid/MemoryStatusCodeRecord.h>
23 #include <Protocol/StatusCode.h>
24 #include <Guid/StatusCodeDataTypeId.h>
25 #include <Guid/StatusCodeDataTypeDebug.h>
26 #include <Guid/EventGroup.h>
28 #include <Library/BaseLib.h>
29 #include <Library/SynchronizationLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/DebugLib.h>
32 #include <Library/ReportStatusCodeLib.h>
33 #include <Library/PrintLib.h>
34 #include <Library/PcdLib.h>
35 #include <Library/HobLib.h>
36 #include <Library/UefiDriverEntryPoint.h>
37 #include <Library/UefiBootServicesTableLib.h>
38 #include <Library/UefiLib.h>
39 #include <Library/MemoryAllocationLib.h>
40 #include <Library/UefiRuntimeLib.h>
41 #include <Library/SerialPortLib.h>
42 #include <Library/OemHookStatusCodeLib.h>
45 // Data hub worker definition
47 #define DATAHUB_STATUS_CODE_SIGNATURE SIGNATURE_32 ('B', 'D', 'H', 'S')
52 UINT8 Data
[sizeof(DATA_HUB_STATUS_CODE_DATA_RECORD
) + EFI_STATUS_CODE_DATA_MAX_SIZE
];
53 } DATAHUB_STATUSCODE_RECORD
;
56 extern RUNTIME_MEMORY_STATUSCODE_HEADER
*mRtMemoryStatusCodeTable
;
59 Report status code to all supported device.
61 This function implements EFI_STATUS_CODE_PROTOCOL.ReportStatusCode().
62 It calls into the workers which dispatches the platform specific listeners.
64 @param CodeType Indicates the type of status code being reported.
65 @param Value Describes the current status of a hardware or software entity.
66 This included information about the class and subclass that is used to
67 classify the entity as well as an operation.
68 @param Instance The enumeration of a hardware or software entity within
69 the system. Valid instance numbers start with 1.
70 @param CallerId This optional parameter may be used to identify the caller.
71 This parameter allows the status code driver to apply different rules to
73 @param Data This optional parameter may be used to pass additional data.
75 @retval EFI_SUCCESS The function completed successfully
76 @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
82 IN EFI_STATUS_CODE_TYPE CodeType
,
83 IN EFI_STATUS_CODE_VALUE Value
,
85 IN EFI_GUID
*CallerId OPTIONAL
,
86 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
90 Dispatch initialization request to sub status code devices based on
91 customized feature flags.
95 InitializationDispatcherWorker (
101 Locates Serial I/O Protocol as initialization for serial status code worker.
103 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
107 EfiSerialStatusCodeInitializeWorker (
113 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
115 @param CodeType Indicates the type of status code being reported.
116 @param Value Describes the current status of a hardware or software entity.
117 This included information about the class and subclass that is used to
118 classify the entity as well as an operation.
119 @param Instance The enumeration of a hardware or software entity within
120 the system. Valid instance numbers start with 1.
121 @param CallerId This optional parameter may be used to identify the caller.
122 This parameter allows the status code driver to apply different rules to
124 @param Data This optional parameter may be used to pass additional data.
126 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
127 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
128 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
132 SerialStatusCodeReportWorker (
133 IN EFI_STATUS_CODE_TYPE CodeType
,
134 IN EFI_STATUS_CODE_VALUE Value
,
136 IN EFI_GUID
*CallerId
,
137 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
141 Initialize runtime memory status code table as initialization for runtime memory status code worker
143 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
147 RtMemoryStatusCodeInitializeWorker (
152 Report status code into runtime memory. If the runtime pool is full, roll back to the
153 first record and overwrite it.
155 @param CodeType Indicates the type of status code being reported.
156 @param Value Describes the current status of a hardware or software entity.
157 This included information about the class and subclass that is used to
158 classify the entity as well as an operation.
159 @param Instance The enumeration of a hardware or software entity within
160 the system. Valid instance numbers start with 1.
162 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
166 RtMemoryStatusCodeReportWorker (
167 IN EFI_STATUS_CODE_TYPE CodeType
,
168 IN EFI_STATUS_CODE_VALUE Value
,
173 Locate Data Hub Protocol and create event for logging data
174 as initialization for data hub status code worker.
176 @retval EFI_SUCCESS Initialization is successful.
180 DataHubStatusCodeInitializeWorker (
186 Report status code into DataHub.
188 @param CodeType Indicates the type of status code being reported.
189 @param Value Describes the current status of a hardware or software entity.
190 This included information about the class and subclass that is used to
191 classify the entity as well as an operation.
192 @param Instance The enumeration of a hardware or software entity within
193 the system. Valid instance numbers start with 1.
194 @param CallerId This optional parameter may be used to identify the caller.
195 This parameter allows the status code driver to apply different rules to
197 @param Data This optional parameter may be used to pass additional data.
199 @retval EFI_SUCCESS The function completed successfully.
200 @retval EFI_DEVICE_ERROR Function is reentered.
201 @retval EFI_DEVICE_ERROR Function is called at runtime.
202 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for free record buffer.
206 DataHubStatusCodeReportWorker (
207 IN EFI_STATUS_CODE_TYPE CodeType
,
208 IN EFI_STATUS_CODE_VALUE Value
,
210 IN EFI_GUID
*CallerId
,
211 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
216 Virtual address change notification call back. It converts global pointer
219 @param Event Event whose notification function is being invoked.
220 @param Context Pointer to the notification function's context, which is
221 always zero in current implementation.
226 VirtualAddressChangeCallBack (