2 Internal include file for Status Code Handler PEIM.
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __STATUS_CODE_HANDLER_PEI_H__
10 #define __STATUS_CODE_HANDLER_PEI_H__
13 #include <Ppi/ReportStatusCodeHandler.h>
15 #include <Guid/MemoryStatusCodeRecord.h>
16 #include <Guid/StatusCodeDataTypeId.h>
17 #include <Guid/StatusCodeDataTypeDebug.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PrintLib.h>
21 #include <Library/ReportStatusCodeLib.h>
22 #include <Library/SerialPortLib.h>
23 #include <Library/HobLib.h>
24 #include <Library/PcdLib.h>
25 #include <Library/PeiServicesLib.h>
26 #include <Library/PeimEntryPoint.h>
27 #include <Library/BaseMemoryLib.h>
30 // Define the maximum message length
32 #define MAX_DEBUG_MESSAGE_LENGTH 0x100
35 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
37 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
38 @param CodeType Indicates the type of status code being reported.
39 @param Value Describes the current status of a hardware or
40 software entity. This includes information about the class and
41 subclass that is used to classify the entity as well as an operation.
42 For progress codes, the operation is the current activity.
43 For error codes, it is the exception.For debug codes,it is not defined at this time.
44 @param Instance The enumeration of a hardware or software entity within
45 the system. A system may contain multiple entities that match a class/subclass
46 pairing. The instance differentiates between them. An instance of 0 indicates
47 that instance information is unavailable, not meaningful, or not relevant.
48 Valid instance numbers start with 1.
49 @param CallerId This optional parameter may be used to identify the caller.
50 This parameter allows the status code driver to apply different rules to
52 @param Data This optional parameter may be used to pass additional data.
54 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
59 SerialStatusCodeReportWorker (
60 IN CONST EFI_PEI_SERVICES
**PeiServices
,
61 IN EFI_STATUS_CODE_TYPE CodeType
,
62 IN EFI_STATUS_CODE_VALUE Value
,
64 IN CONST EFI_GUID
*CallerId
,
65 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
70 Create the first memory status code GUID'ed HOB as initialization for memory status code worker.
72 @retval EFI_SUCCESS The GUID'ed HOB is created successfully.
76 MemoryStatusCodeInitializeWorker (
81 Report status code into GUID'ed HOB.
83 This function reports status code into GUID'ed HOB. If not all packets are full, then
84 write status code into available entry. Otherwise, create a new packet for it.
86 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
87 @param CodeType Indicates the type of status code being reported.
88 @param Value Describes the current status of a hardware or
89 software entity. This includes information about the class and
90 subclass that is used to classify the entity as well as an operation.
91 For progress codes, the operation is the current activity.
92 For error codes, it is the exception.For debug codes,it is not defined at this time.
93 @param Instance The enumeration of a hardware or software entity within
94 the system. A system may contain multiple entities that match a class/subclass
95 pairing. The instance differentiates between them. An instance of 0 indicates
96 that instance information is unavailable, not meaningful, or not relevant.
97 Valid instance numbers start with 1.
98 @param CallerId This optional parameter may be used to identify the caller.
99 This parameter allows the status code driver to apply different rules to
101 @param Data This optional parameter may be used to pass additional data.
103 @retval EFI_SUCCESS The function always return EFI_SUCCESS.
108 MemoryStatusCodeReportWorker (
109 IN CONST EFI_PEI_SERVICES
**PeiServices
,
110 IN EFI_STATUS_CODE_TYPE CodeType
,
111 IN EFI_STATUS_CODE_VALUE Value
,
113 IN CONST EFI_GUID
*CallerId
,
114 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL