]>
Commit | Line | Data |
---|---|---|
1 | /*++\r | |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | DxeStatusCode.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Header file of EFI DXE/RT Status Code.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef __DXE_STATUS_CODE_H__\r | |
23 | #define __DXE_STATUS_CODE_H__\r | |
24 | \r | |
25 | //\r | |
26 | // Data hub worker definition \r | |
27 | //\r | |
28 | #define MAX_NUMBER_DATAHUB_RECORDS 1000\r | |
29 | #define DATAHUB_BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE\r | |
30 | #define EMPTY_RECORD_TAG 0xFF\r | |
31 | #define DATAHUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S')\r | |
32 | \r | |
33 | //\r | |
34 | // Address type of pointer.\r | |
35 | // The point type always equal to PHYSICAL_MODE on IA32/X64/EBC architecture\r | |
36 | // Otherwise, VIRTUAL_MODE/PHYSICAL_MODE would be used on Ipf architecture, \r | |
37 | // \r | |
38 | typedef enum {\r | |
39 | PHYSICAL_MODE,\r | |
40 | VIRTUAL_MODE\r | |
41 | } PROCESSOR_MODE;\r | |
42 | \r | |
43 | typedef struct {\r | |
44 | UINTN Signature;\r | |
45 | LIST_ENTRY Node;\r | |
46 | EFI_STATUS_CODE_TYPE CodeType;\r | |
47 | EFI_STATUS_CODE_VALUE Value;\r | |
48 | UINT32 Instance;\r | |
49 | EFI_GUID CallerId;\r | |
50 | EFI_STATUS_CODE_DATA Data;\r | |
51 | UINT8 ExtendData[EFI_STATUS_CODE_DATA_MAX_SIZE];\r | |
52 | } DATAHUB_STATUSCODE_RECORD;\r | |
53 | \r | |
54 | \r | |
55 | //\r | |
56 | // Runtime memory status code worker definition \r | |
57 | // \r | |
58 | typedef struct {\r | |
59 | UINT32 RecordIndex;\r | |
60 | UINT32 NumberOfRecords;\r | |
61 | UINT32 MaxRecordsNumber;\r | |
62 | } RUNTIME_MEMORY_STATUSCODE_HEADER;\r | |
63 | \r | |
64 | \r | |
65 | typedef struct {\r | |
66 | //\r | |
67 | // Report operation nest status. \r | |
68 | // If it is set, then the report operation has nested.\r | |
69 | // \r | |
70 | UINT32 StatusCodeNestStatus;\r | |
71 | //\r | |
72 | // Runtime status code management header, the records buffer is following it.\r | |
73 | // \r | |
74 | RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable[2];\r | |
75 | } DXE_STATUS_CODE_CONTROLLER;\r | |
76 | \r | |
77 | \r | |
78 | /**\r | |
79 | \r | |
80 | Dispatch initialization request to sub status code devices based on \r | |
81 | customized feature flags.\r | |
82 | \r | |
83 | **/\r | |
84 | VOID\r | |
85 | InitializationDispatcherWorker (\r | |
86 | VOID\r | |
87 | );\r | |
88 | \r | |
89 | \r | |
90 | /**\r | |
91 | Initialize serial status code worker.\r | |
92 | \r | |
93 | @return The function always return EFI_SUCCESS\r | |
94 | \r | |
95 | **/\r | |
96 | EFI_STATUS\r | |
97 | EfiSerialStatusCodeInitializeWorker (\r | |
98 | VOID\r | |
99 | );\r | |
100 | \r | |
101 | \r | |
102 | /**\r | |
103 | Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r | |
104 | \r | |
105 | @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r | |
106 | \r | |
107 | @param Value Describes the current status of a hardware or software entity. \r | |
108 | This included information about the class and subclass that is used to classify the entity \r | |
109 | as well as an operation. For progress codes, the operation is the current activity. \r | |
110 | For error codes, it is the exception. For debug codes, it is not defined at this time. \r | |
111 | Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r | |
112 | Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r | |
113 | \r | |
114 | @param Instance The enumeration of a hardware or software entity within the system. \r | |
115 | A system may contain multiple entities that match a class/subclass pairing. \r | |
116 | The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r | |
117 | not meaningful, or not relevant. Valid instance numbers start with 1.\r | |
118 | \r | |
119 | \r | |
120 | @param CallerId This optional parameter may be used to identify the caller. \r | |
121 | This parameter allows the status code driver to apply different rules to different callers. \r | |
122 | Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r | |
123 | \r | |
124 | \r | |
125 | @param Data This optional parameter may be used to pass additional data\r | |
126 | \r | |
127 | @retval EFI_SUCCESS Success to report status code to serial I/O.\r | |
128 | @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r | |
129 | \r | |
130 | **/\r | |
131 | EFI_STATUS\r | |
132 | SerialStatusCodeReportWorker (\r | |
133 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
134 | IN EFI_STATUS_CODE_VALUE Value,\r | |
135 | IN UINT32 Instance,\r | |
136 | IN EFI_GUID *CallerId,\r | |
137 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
138 | );\r | |
139 | \r | |
140 | /**\r | |
141 | Initialize runtime memory status code.\r | |
142 | \r | |
143 | @return The function always return EFI_SUCCESS\r | |
144 | \r | |
145 | **/\r | |
146 | EFI_STATUS\r | |
147 | RtMemoryStatusCodeInitializeWorker (\r | |
148 | VOID\r | |
149 | );\r | |
150 | \r | |
151 | /**\r | |
152 | Report status code into runtime memory. If the runtime pool is full, roll back to the \r | |
153 | first record and overwrite it.\r | |
154 | \r | |
155 | @param RtMemoryStatusCodeTable \r | |
156 | Point to Runtime memory table header.\r | |
157 | \r | |
158 | @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r | |
159 | \r | |
160 | @param Value Describes the current status of a hardware or software entity. \r | |
161 | This included information about the class and subclass that is used to classify the entity \r | |
162 | as well as an operation. For progress codes, the operation is the current activity. \r | |
163 | For error codes, it is the exception. For debug codes, it is not defined at this time. \r | |
164 | Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r | |
165 | Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r | |
166 | \r | |
167 | @param Instance The enumeration of a hardware or software entity within the system. \r | |
168 | A system may contain multiple entities that match a class/subclass pairing. \r | |
169 | The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r | |
170 | not meaningful, or not relevant. Valid instance numbers start with 1.\r | |
171 | \r | |
172 | @return The function always return EFI_SUCCESS.\r | |
173 | \r | |
174 | **/\r | |
175 | EFI_STATUS\r | |
176 | RtMemoryStatusCodeReportWorker (\r | |
177 | RUNTIME_MEMORY_STATUSCODE_HEADER *RtMemoryStatusCodeTable,\r | |
178 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
179 | IN EFI_STATUS_CODE_VALUE Value,\r | |
180 | IN UINT32 Instance\r | |
181 | );\r | |
182 | \r | |
183 | /**\r | |
184 | Initialize data hubstatus code.\r | |
185 | Create a data hub listener.\r | |
186 | \r | |
187 | @return The function always return EFI_SUCCESS\r | |
188 | \r | |
189 | **/\r | |
190 | EFI_STATUS\r | |
191 | DataHubStatusCodeInitializeWorker (\r | |
192 | VOID\r | |
193 | );\r | |
194 | \r | |
195 | \r | |
196 | /**\r | |
197 | Report status code into DataHub.\r | |
198 | \r | |
199 | @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r | |
200 | \r | |
201 | @param Value Describes the current status of a hardware or software entity. \r | |
202 | This included information about the class and subclass that is used to classify the entity \r | |
203 | as well as an operation. For progress codes, the operation is the current activity. \r | |
204 | For error codes, it is the exception. For debug codes, it is not defined at this time. \r | |
205 | Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. \r | |
206 | Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r | |
207 | \r | |
208 | @param Instance The enumeration of a hardware or software entity within the system. \r | |
209 | A system may contain multiple entities that match a class/subclass pairing. \r | |
210 | The instance differentiates between them. An instance of 0 indicates that instance information is unavailable, \r | |
211 | not meaningful, or not relevant. Valid instance numbers start with 1.\r | |
212 | \r | |
213 | \r | |
214 | @param CallerId This optional parameter may be used to identify the caller. \r | |
215 | This parameter allows the status code driver to apply different rules to different callers. \r | |
216 | Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r | |
217 | \r | |
218 | \r | |
219 | @param Data This optional parameter may be used to pass additional data\r | |
220 | \r | |
221 | @retval EFI_OUT_OF_RESOURCES Can not acquire record buffer.\r | |
222 | @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .\r | |
223 | @retval EFI_SUCCESS Success to cache status code and signal log data event.\r | |
224 | \r | |
225 | **/\r | |
226 | EFI_STATUS\r | |
227 | DataHubStatusCodeReportWorker (\r | |
228 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
229 | IN EFI_STATUS_CODE_VALUE Value,\r | |
230 | IN UINT32 Instance,\r | |
231 | IN EFI_GUID *CallerId,\r | |
232 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
233 | );\r | |
234 | \r | |
235 | //\r | |
236 | // declaration of DXE status code controller.\r | |
237 | // \r | |
238 | extern DXE_STATUS_CODE_CONTROLLER gDxeStatusCode;\r | |
239 | \r | |
240 | #endif\r |