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