2 Internal include file of Status Code Runtime DXE Driver.
4 Copyright (c) 2006 - 2009, 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
;
57 // Runtime memory status code worker definition
61 UINT32 NumberOfRecords
;
62 UINT32 MaxRecordsNumber
;
63 } RUNTIME_MEMORY_STATUSCODE_HEADER
;
65 extern RUNTIME_MEMORY_STATUSCODE_HEADER
*mRtMemoryStatusCodeTable
;
68 Report status code to all supported device.
70 This function implements EFI_STATUS_CODE_PROTOCOL.ReportStatusCode().
71 It calls into the workers which dispatches the platform specific listeners.
73 @param CodeType Indicates the type of status code being reported.
74 @param Value Describes the current status of a hardware or software entity.
75 This included information about the class and subclass that is used to
76 classify the entity as well as an operation.
77 @param Instance The enumeration of a hardware or software entity within
78 the system. Valid instance numbers start with 1.
79 @param CallerId This optional parameter may be used to identify the caller.
80 This parameter allows the status code driver to apply different rules to
82 @param Data This optional parameter may be used to pass additional data.
84 @retval EFI_SUCCESS The function completed successfully
85 @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
91 IN EFI_STATUS_CODE_TYPE CodeType
,
92 IN EFI_STATUS_CODE_VALUE Value
,
94 IN EFI_GUID
*CallerId OPTIONAL
,
95 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
99 Dispatch initialization request to sub status code devices based on
100 customized feature flags.
104 InitializationDispatcherWorker (
110 Locates Serial I/O Protocol as initialization for serial status code worker.
112 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
116 EfiSerialStatusCodeInitializeWorker (
122 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
124 @param CodeType Indicates the type of status code being reported.
125 @param Value Describes the current status of a hardware or software entity.
126 This included information about the class and subclass that is used to
127 classify the entity as well as an operation.
128 @param Instance The enumeration of a hardware or software entity within
129 the system. Valid instance numbers start with 1.
130 @param CallerId This optional parameter may be used to identify the caller.
131 This parameter allows the status code driver to apply different rules to
133 @param Data This optional parameter may be used to pass additional data.
135 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
136 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
137 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
141 SerialStatusCodeReportWorker (
142 IN EFI_STATUS_CODE_TYPE CodeType
,
143 IN EFI_STATUS_CODE_VALUE Value
,
145 IN EFI_GUID
*CallerId
,
146 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
150 Initialize runtime memory status code table as initialization for runtime memory status code worker
152 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
156 RtMemoryStatusCodeInitializeWorker (
161 Report status code into runtime memory. If the runtime pool is full, roll back to the
162 first record and overwrite it.
164 @param CodeType Indicates the type of status code being reported.
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
167 classify the entity as well as an operation.
168 @param Instance The enumeration of a hardware or software entity within
169 the system. Valid instance numbers start with 1.
171 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
175 RtMemoryStatusCodeReportWorker (
176 IN EFI_STATUS_CODE_TYPE CodeType
,
177 IN EFI_STATUS_CODE_VALUE Value
,
182 Locate Data Hub Protocol and create event for logging data
183 as initialization for data hub status code worker.
185 @retval EFI_SUCCESS Initialization is successful.
189 DataHubStatusCodeInitializeWorker (
195 Report status code into DataHub.
197 @param CodeType Indicates the type of status code being reported.
198 @param Value Describes the current status of a hardware or software entity.
199 This included information about the class and subclass that is used to
200 classify the entity as well as an operation.
201 @param Instance The enumeration of a hardware or software entity within
202 the system. Valid instance numbers start with 1.
203 @param CallerId This optional parameter may be used to identify the caller.
204 This parameter allows the status code driver to apply different rules to
206 @param Data This optional parameter may be used to pass additional data.
208 @retval EFI_SUCCESS The function completed successfully.
209 @retval EFI_DEVICE_ERROR Function is reentered.
210 @retval EFI_DEVICE_ERROR Function is called at runtime.
211 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for free record buffer.
215 DataHubStatusCodeReportWorker (
216 IN EFI_STATUS_CODE_TYPE CodeType
,
217 IN EFI_STATUS_CODE_VALUE Value
,
219 IN EFI_GUID
*CallerId
,
220 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
225 Virtual address change notification call back. It converts global pointer
228 @param Event Event whose notification function is being invoked.
229 @param Context Pointer to the notification function's context, which is
230 always zero in current implementation.
235 VirtualAddressChangeCallBack (