2 Internal include file for Status Code Handler Driver.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __STATUS_CODE_HANDLER_SMM_H__
11 #define __STATUS_CODE_HANDLER_SMM_H__
13 #include <Protocol/SmmReportStatusCodeHandler.h>
15 #include <Guid/MemoryStatusCodeRecord.h>
16 #include <Guid/StatusCodeDataTypeId.h>
17 #include <Guid/StatusCodeDataTypeDebug.h>
19 #include <Library/SynchronizationLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/ReportStatusCodeLib.h>
22 #include <Library/PrintLib.h>
23 #include <Library/PcdLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/SmmServicesTableLib.h>
26 #include <Library/SerialPortLib.h>
27 #include <Library/MemoryAllocationLib.h>
28 #include <Library/BaseMemoryLib.h>
31 // Define the maximum message length
33 #define MAX_DEBUG_MESSAGE_LENGTH 0x100
35 extern RUNTIME_MEMORY_STATUSCODE_HEADER
*mSmmMemoryStatusCodeTable
;
38 Locates Serial I/O Protocol as initialization for serial status code worker.
40 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
44 EfiSerialStatusCodeInitializeWorker (
50 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
52 @param CodeType Indicates the type of status code being reported.
53 @param Value Describes the current status of a hardware or software entity.
54 This included information about the class and subclass that is used to
55 classify the entity as well as an operation.
56 @param Instance The enumeration of a hardware or software entity within
57 the system. Valid instance numbers start with 1.
58 @param CallerId This optional parameter may be used to identify the caller.
59 This parameter allows the status code driver to apply different rules to
61 @param Data This optional parameter may be used to pass additional data.
63 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
64 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
65 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
70 SerialStatusCodeReportWorker (
71 IN EFI_STATUS_CODE_TYPE CodeType
,
72 IN EFI_STATUS_CODE_VALUE Value
,
74 IN EFI_GUID
*CallerId
,
75 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
79 Initialize runtime memory status code table as initialization for runtime memory status code worker
81 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
85 MemoryStatusCodeInitializeWorker (
90 Report status code into runtime memory. If the runtime pool is full, roll back to the
91 first record and overwrite it.
93 @param CodeType Indicates the type of status code being reported.
94 @param Value Describes the current status of a hardware or software entity.
95 This included information about the class and subclass that is used to
96 classify the entity as well as an operation.
97 @param Instance The enumeration of a hardware or software entity within
98 the system. Valid instance numbers start with 1.
99 @param CallerId This optional parameter may be used to identify the caller.
100 This parameter allows the status code driver to apply different rules to
102 @param Data This optional parameter may be used to pass additional data.
104 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
109 MemoryStatusCodeReportWorker (
110 IN EFI_STATUS_CODE_TYPE CodeType
,
111 IN EFI_STATUS_CODE_VALUE Value
,
113 IN EFI_GUID
*CallerId
,
114 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL