ad1a1798 |
1 | /** @file\r |
d5aea10c |
2 | Internal include file for Status Code PEIM.\r |
ad1a1798 |
3 | \r |
d5aea10c |
4 | Copyright (c) 2006 - 2009, Intel Corporation\r |
ececc2eb |
5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
ad1a1798 |
12 | \r |
ad1a1798 |
13 | **/\r |
14 | \r |
15 | #ifndef __PEI_STATUS_CODE_H__\r |
16 | #define __PEI_STATUS_CODE_H__\r |
17 | \r |
18 | \r |
ed7748fe |
19 | \r |
ececc2eb |
20 | #include <FrameworkPei.h>\r |
ececc2eb |
21 | #include <Guid/MemoryStatusCodeRecord.h>\r |
22 | #include <Guid/StatusCodeDataTypeId.h>\r |
785e0c07 |
23 | #include <Guid/StatusCodeDataTypeDebug.h>\r |
ececc2eb |
24 | #include <Ppi/StatusCode.h>\r |
ed7748fe |
25 | \r |
ececc2eb |
26 | #include <Library/BaseLib.h>\r |
27 | #include <Library/BaseMemoryLib.h>\r |
28 | #include <Library/DebugLib.h>\r |
29 | #include <Library/PrintLib.h>\r |
30 | #include <Library/ReportStatusCodeLib.h>\r |
31 | #include <Library/SerialPortLib.h>\r |
32 | #include <Library/HobLib.h>\r |
33 | #include <Library/PcdLib.h>\r |
34 | #include <Library/PeiServicesLib.h>\r |
35 | #include <Library/OemHookStatusCodeLib.h>\r |
36 | #include <Library/PeimEntryPoint.h>\r |
ad1a1798 |
37 | \r |
38 | /**\r |
39 | Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r |
ececc2eb |
40 | \r |
d5aea10c |
41 | @param CodeType Indicates the type of status code being reported.\r |
42 | @param Value Describes the current status of a hardware or\r |
43 | software entity. This includes information about the class and\r |
44 | subclass that is used to classify the entity as well as an operation.\r |
45 | For progress codes, the operation is the current activity.\r |
46 | For error codes, it is the exception.For debug codes,it is not defined at this time.\r |
47 | @param Instance The enumeration of a hardware or software entity within\r |
48 | the system. A system may contain multiple entities that match a class/subclass\r |
49 | pairing. The instance differentiates between them. An instance of 0 indicates\r |
50 | that instance information is unavailable, not meaningful, or not relevant.\r |
51 | Valid instance numbers start with 1.\r |
52 | @param CallerId This optional parameter may be used to identify the caller.\r |
53 | This parameter allows the status code driver to apply different rules to\r |
54 | different callers.\r |
55 | @param Data This optional parameter may be used to pass additional data.\r |
56 | \r |
57 | @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r |
ad1a1798 |
58 | \r |
59 | **/\r |
60 | EFI_STATUS\r |
61 | SerialStatusCodeReportWorker (\r |
d5aea10c |
62 | IN EFI_STATUS_CODE_TYPE CodeType,\r |
63 | IN EFI_STATUS_CODE_VALUE Value,\r |
64 | IN UINT32 Instance,\r |
507b36ca |
65 | IN CONST EFI_GUID *CallerId,\r |
66 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r |
ad1a1798 |
67 | );\r |
68 | \r |
69 | \r |
70 | /**\r |
d5aea10c |
71 | Create the first memory status code GUID'ed HOB as initialization for memory status code worker.\r |
ececc2eb |
72 | \r |
d5aea10c |
73 | @retval EFI_SUCCESS The GUID'ed HOB is created successfully.\r |
ad1a1798 |
74 | \r |
75 | **/\r |
76 | EFI_STATUS\r |
77 | MemoryStatusCodeInitializeWorker (\r |
78 | VOID\r |
79 | );\r |
80 | \r |
81 | /**\r |
82 | Report status code into GUID'ed HOB.\r |
ececc2eb |
83 | \r |
d5aea10c |
84 | This function reports status code into GUID'ed HOB. If not all packets are full, then\r |
85 | write status code into available entry. Otherwise, create a new packet for it.\r |
ececc2eb |
86 | \r |
d5aea10c |
87 | @param CodeType Indicates the type of status code being reported.\r |
88 | @param Value Describes the current status of a hardware or\r |
89 | software entity. This includes information about the class and\r |
90 | subclass that is used to classify the entity as well as an operation.\r |
91 | For progress codes, the operation is the current activity.\r |
92 | For error codes, it is the exception.For debug codes,it is not defined at this time.\r |
93 | @param Instance The enumeration of a hardware or software entity within\r |
94 | the system. A system may contain multiple entities that match a class/subclass\r |
95 | pairing. The instance differentiates between them. An instance of 0 indicates\r |
96 | that instance information is unavailable, not meaningful, or not relevant.\r |
97 | Valid instance numbers start with 1.\r |
ececc2eb |
98 | \r |
d5aea10c |
99 | @retval EFI_SUCCESS The function always return EFI_SUCCESS.\r |
ad1a1798 |
100 | \r |
101 | **/\r |
102 | EFI_STATUS\r |
103 | MemoryStatusCodeReportWorker (\r |
104 | IN EFI_STATUS_CODE_TYPE CodeType,\r |
105 | IN EFI_STATUS_CODE_VALUE Value,\r |
106 | IN UINT32 Instance\r |
107 | );\r |
108 | \r |
109 | /**\r |
d5aea10c |
110 | Publishes an interface that allows PEIMs to report status codes.\r |
111 | \r |
112 | This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().\r |
113 | It publishes an interface that allows PEIMs to report status codes.\r |
114 | \r |
115 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r |
116 | @param CodeType Indicates the type of status code being reported.\r |
117 | @param Value Describes the current status of a hardware or\r |
118 | software entity. This includes information about the class and\r |
119 | subclass that is used to classify the entity as well as an operation.\r |
120 | For progress codes, the operation is the current activity.\r |
121 | For error codes, it is the exception.For debug codes,it is not defined at this time.\r |
122 | @param Instance The enumeration of a hardware or software entity within\r |
123 | the system. A system may contain multiple entities that match a class/subclass\r |
124 | pairing. The instance differentiates between them. An instance of 0 indicates\r |
125 | that instance information is unavailable, not meaningful, or not relevant.\r |
126 | Valid instance numbers start with 1.\r |
127 | @param CallerId This optional parameter may be used to identify the caller.\r |
128 | This parameter allows the status code driver to apply different rules to\r |
129 | different callers.\r |
130 | @param Data This optional parameter may be used to pass additional data.\r |
131 | \r |
132 | @retval EFI_SUCCESS The function completed successfully.\r |
ad1a1798 |
133 | \r |
134 | **/\r |
135 | EFI_STATUS\r |
136 | EFIAPI\r |
137 | ReportDispatcher (\r |
507b36ca |
138 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
d5aea10c |
139 | IN EFI_STATUS_CODE_TYPE CodeType,\r |
140 | IN EFI_STATUS_CODE_VALUE Value,\r |
141 | IN UINT32 Instance,\r |
507b36ca |
142 | IN CONST EFI_GUID *CallerId OPTIONAL,\r |
143 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r |
ad1a1798 |
144 | );\r |
145 | \r |
d5aea10c |
146 | #endif\r |
bcd70414 |
147 | \r |
148 | \r |