]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Main SAL API's defined in Intel Itanium Processor Family System Abstraction\r | |
3 | Layer Specification Revision 3.2 (December 2003)\r | |
4 | \r | |
5 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials are licensed and made available under \r | |
7 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
8 | The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php. \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __SAL_API_H__\r | |
17 | #define __SAL_API_H__\r | |
18 | \r | |
19 | ///\r | |
20 | /// SAL return status type \r | |
21 | ///\r | |
22 | typedef INTN EFI_SAL_STATUS;\r | |
23 | \r | |
24 | ///\r | |
25 | /// Call completed without error. \r | |
26 | ///\r | |
27 | #define EFI_SAL_SUCCESS ((EFI_SAL_STATUS) 0)\r | |
28 | ///\r | |
29 | /// Call completed without error, but some information was lost due to overflow. \r | |
30 | ///\r | |
31 | #define EFI_SAL_OVERFLOW ((EFI_SAL_STATUS) 1)\r | |
32 | ///\r | |
33 | /// Call completed without error; effect a warm boot of the system to complete the update.\r | |
34 | ///\r | |
35 | #define EFI_SAL_WARM_BOOT_NEEDED ((EFI_SAL_STATUS) 2)\r | |
36 | ///\r | |
37 | /// More information is available for retrieval. \r | |
38 | ///\r | |
39 | #define EFI_SAL_MORE_RECORDS ((EFI_SAL_STATUS) 3)\r | |
40 | ///\r | |
41 | /// Not implemented.\r | |
42 | ///\r | |
43 | #define EFI_SAL_NOT_IMPLEMENTED ((EFI_SAL_STATUS) - 1)\r | |
44 | ///\r | |
45 | /// Invalid Argument.\r | |
46 | ///\r | |
47 | #define EFI_SAL_INVALID_ARGUMENT ((EFI_SAL_STATUS) - 2)\r | |
48 | ///\r | |
49 | /// Call completed without error. \r | |
50 | ///\r | |
51 | #define EFI_SAL_ERROR ((EFI_SAL_STATUS) - 3)\r | |
52 | ///\r | |
53 | /// Virtual address not registered. \r | |
54 | ///\r | |
55 | #define EFI_SAL_VIRTUAL_ADDRESS_ERROR ((EFI_SAL_STATUS) - 4)\r | |
56 | ///\r | |
57 | /// No information available. \r | |
58 | ///\r | |
59 | #define EFI_SAL_NO_INFORMATION ((EFI_SAL_STATUS) - 5)\r | |
60 | ///\r | |
61 | /// Scratch buffer required.\r | |
62 | ///\r | |
63 | #define EFI_SAL_NOT_ENOUGH_SCRATCH ((EFI_SAL_STATUS) - 9)\r | |
64 | \r | |
65 | ///\r | |
66 | /// Return registers from SAL.\r | |
67 | ///\r | |
68 | typedef struct {\r | |
69 | ///\r | |
70 | /// SAL return status value in r8.\r | |
71 | ///\r | |
72 | EFI_SAL_STATUS Status;\r | |
73 | ///\r | |
74 | /// SAL returned value in r9.\r | |
75 | ///\r | |
76 | UINTN r9;\r | |
77 | ///\r | |
78 | /// SAL returned value in r10.\r | |
79 | ///\r | |
80 | UINTN r10;\r | |
81 | ///\r | |
82 | /// SAL returned value in r11.\r | |
83 | ///\r | |
84 | UINTN r11;\r | |
85 | } SAL_RETURN_REGS;\r | |
86 | \r | |
87 | /**\r | |
88 | Prototype of SAL procedures.\r | |
89 | \r | |
90 | @param FunctionId Functional identifier.\r | |
91 | The upper 32 bits are ignored and only the lower 32 bits\r | |
92 | are used. The following functional identifiers are defined:\r | |
93 | 0x01XXXXXX - Architected SAL functional group.\r | |
94 | 0x02XXXXXX to 0x03XXXXXX - OEM SAL functional group. Each OEM is\r | |
95 | allowed to use the entire range in the 0x02XXXXXX to 0x03XXXXXX range.\r | |
96 | 0x04XXXXXX to 0xFFFFFFFF - Reserved.\r | |
97 | @param Arg1 The first parameter of the architected/OEM specific SAL functions.\r | |
98 | @param Arg2 The second parameter of the architected/OEM specific SAL functions.\r | |
99 | @param Arg3 The third parameter passed to the ESAL function based.\r | |
100 | @param Arg4 The fourth parameter passed to the ESAL function based.\r | |
101 | @param Arg5 The fifth parameter passed to the ESAL function based.\r | |
102 | @param Arg6 The sixth parameter passed to the ESAL function.\r | |
103 | @param Arg7 The seventh parameter passed to the ESAL function based.\r | |
104 | \r | |
105 | @return r8 Return status: positive number indicates successful,\r | |
106 | negative number indicates failure.\r | |
107 | r9 Other return parameter in r9.\r | |
108 | r10 Other return parameter in r10.\r | |
109 | r11 Other return parameter in r11.\r | |
110 | \r | |
111 | **/\r | |
112 | typedef\r | |
113 | SAL_RETURN_REGS\r | |
114 | (EFIAPI *SAL_PROC)(\r | |
115 | IN UINT64 FunctionId,\r | |
116 | IN UINT64 Arg1,\r | |
117 | IN UINT64 Arg2,\r | |
118 | IN UINT64 Arg3,\r | |
119 | IN UINT64 Arg4,\r | |
120 | IN UINT64 Arg5,\r | |
121 | IN UINT64 Arg6,\r | |
122 | IN UINT64 Arg7\r | |
123 | );\r | |
124 | \r | |
125 | //\r | |
126 | // SAL Procedure FunctionId definition\r | |
127 | //\r | |
128 | \r | |
129 | ///\r | |
130 | /// Register software code locations with SAL.\r | |
131 | ///\r | |
132 | #define EFI_SAL_SET_VECTORS 0x01000000\r | |
133 | ///\r | |
134 | /// Return Machine State information obtained by SAL.\r | |
135 | ///\r | |
136 | #define EFI_SAL_GET_STATE_INFO 0x01000001\r | |
137 | ///\r | |
138 | /// Obtain size of Machine State information.\r | |
139 | ///\r | |
140 | #define EFI_SAL_GET_STATE_INFO_SIZE 0x01000002\r | |
141 | ///\r | |
142 | /// Clear Machine State information.\r | |
143 | ///\r | |
144 | #define EFI_SAL_CLEAR_STATE_INFO 0x01000003\r | |
145 | ///\r | |
146 | /// Cause the processor to go into a spin loop within SAL.\r | |
147 | ///\r | |
148 | #define EFI_SAL_MC_RENDEZ 0x01000004\r | |
149 | ///\r | |
150 | /// Register the machine check interface layer with SAL.\r | |
151 | ///\r | |
152 | #define EFI_SAL_MC_SET_PARAMS 0x01000005\r | |
153 | ///\r | |
154 | /// Register the physical addresses of locations needed by SAL.\r | |
155 | ///\r | |
156 | #define EFI_SAL_REGISTER_PHYSICAL_ADDR 0x01000006\r | |
157 | ///\r | |
158 | /// Flush the instruction or data caches.\r | |
159 | ///\r | |
160 | #define EFI_SAL_CACHE_FLUSH 0x01000008\r | |
161 | ///\r | |
162 | /// Initialize the instruction and data caches.\r | |
163 | ///\r | |
164 | #define EFI_SAL_CACHE_INIT 0x01000009\r | |
165 | ///\r | |
166 | /// Read from the PCI configuration space.\r | |
167 | ///\r | |
168 | #define EFI_SAL_PCI_CONFIG_READ 0x01000010\r | |
169 | ///\r | |
170 | /// Write to the PCI configuration space.\r | |
171 | ///\r | |
172 | #define EFI_SAL_PCI_CONFIG_WRITE 0x01000011\r | |
173 | ///\r | |
174 | /// Return the base frequency of the platform.\r | |
175 | ///\r | |
176 | #define EFI_SAL_FREQ_BASE 0x01000012\r | |
177 | ///\r | |
178 | /// Returns information on the physical processor mapping within the platform.\r | |
179 | ///\r | |
180 | #define EFI_SAL_PHYSICAL_ID_INFO 0x01000013\r | |
181 | ///\r | |
182 | /// Update the contents of firmware blocks.\r | |
183 | ///\r | |
184 | #define EFI_SAL_UPDATE_PAL 0x01000020\r | |
185 | \r | |
186 | #define EFI_SAL_FUNCTION_ID_MASK 0x0000ffff\r | |
187 | #define EFI_SAL_MAX_SAL_FUNCTION_ID 0x00000021\r | |
188 | \r | |
189 | //\r | |
190 | // SAL Procedure parameter definitions\r | |
191 | // Not much point in using typedefs or enums because all params\r | |
192 | // are UINT64 and the entry point is common\r | |
193 | //\r | |
194 | \r | |
195 | //\r | |
196 | // Parameter of EFI_SAL_SET_VECTORS\r | |
197 | //\r | |
198 | // Vector type\r | |
199 | //\r | |
200 | #define EFI_SAL_SET_MCA_VECTOR 0x0\r | |
201 | #define EFI_SAL_SET_INIT_VECTOR 0x1\r | |
202 | #define EFI_SAL_SET_BOOT_RENDEZ_VECTOR 0x2\r | |
203 | ///\r | |
204 | /// The format of a length_cs_n argument.\r | |
205 | ///\r | |
206 | typedef struct {\r | |
207 | UINT64 Length : 32;\r | |
208 | UINT64 ChecksumValid : 1;\r | |
209 | UINT64 Reserved1 : 7;\r | |
210 | UINT64 ByteChecksum : 8;\r | |
211 | UINT64 Reserved2 : 16;\r | |
212 | } SAL_SET_VECTORS_CS_N;\r | |
213 | \r | |
214 | //\r | |
215 | // Parameter of EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE, and EFI_SAL_CLEAR_STATE_INFO\r | |
216 | // \r | |
217 | // Type of information\r | |
218 | //\r | |
219 | #define EFI_SAL_MCA_STATE_INFO 0x0\r | |
220 | #define EFI_SAL_INIT_STATE_INFO 0x1\r | |
221 | #define EFI_SAL_CMC_STATE_INFO 0x2\r | |
222 | #define EFI_SAL_CP_STATE_INFO 0x3\r | |
223 | \r | |
224 | //\r | |
225 | // Parameter of EFI_SAL_MC_SET_PARAMS\r | |
226 | //\r | |
227 | // Unsigned 64-bit integer value for the parameter type of the machine check interface\r | |
228 | //\r | |
229 | #define EFI_SAL_MC_SET_RENDEZ_PARAM 0x1\r | |
230 | #define EFI_SAL_MC_SET_WAKEUP_PARAM 0x2\r | |
231 | #define EFI_SAL_MC_SET_CPE_PARAM 0x3\r | |
232 | //\r | |
233 | // Unsigned 64-bit integer value indicating whether interrupt vector or\r | |
234 | // memory address is specified\r | |
235 | //\r | |
236 | #define EFI_SAL_MC_SET_INTR_PARAM 0x1\r | |
237 | #define EFI_SAL_MC_SET_MEM_PARAM 0x2\r | |
238 | \r | |
239 | //\r | |
240 | // Parameter of EFI_SAL_REGISTER_PAL_PHYSICAL_ADDR\r | |
241 | //\r | |
242 | // The encoded value of the entity whose physical address is registered\r | |
243 | //\r | |
244 | #define EFI_SAL_REGISTER_PAL_ADDR 0x0\r | |
245 | \r | |
246 | //\r | |
247 | // Parameter of EFI_SAL_CACHE_FLUSH\r | |
248 | //\r | |
249 | // Unsigned 64-bit integer denoting type of cache flush operation\r | |
250 | //\r | |
251 | #define EFI_SAL_FLUSH_I_CACHE 0x01\r | |
252 | #define EFI_SAL_FLUSH_D_CACHE 0x02\r | |
253 | #define EFI_SAL_FLUSH_BOTH_CACHE 0x03\r | |
254 | #define EFI_SAL_FLUSH_MAKE_COHERENT 0x04\r | |
255 | \r | |
256 | //\r | |
257 | // Parameter of EFI_SAL_PCI_CONFIG_READ and EFI_SAL_PCI_CONFIG_WRITE\r | |
258 | //\r | |
259 | // PCI config size\r | |
260 | //\r | |
261 | #define EFI_SAL_PCI_CONFIG_ONE_BYTE 0x1\r | |
262 | #define EFI_SAL_PCI_CONFIG_TWO_BYTES 0x2\r | |
263 | #define EFI_SAL_PCI_CONFIG_FOUR_BYTES 0x4\r | |
264 | //\r | |
265 | // The type of PCI configuration address\r | |
266 | //\r | |
267 | #define EFI_SAL_PCI_COMPATIBLE_ADDRESS 0x0\r | |
268 | #define EFI_SAL_PCI_EXTENDED_REGISTER_ADDRESS 0x1\r | |
269 | ///\r | |
270 | /// The format of PCI Compatible Address.\r | |
271 | ///\r | |
272 | typedef struct {\r | |
273 | UINT64 Register : 8;\r | |
274 | UINT64 Function : 3;\r | |
275 | UINT64 Device : 5;\r | |
276 | UINT64 Bus : 8;\r | |
277 | UINT64 Segment : 8;\r | |
278 | UINT64 Reserved : 32;\r | |
279 | } SAL_PCI_ADDRESS;\r | |
280 | ///\r | |
281 | /// The format of Extended Register Address.\r | |
282 | ///\r | |
283 | typedef struct {\r | |
284 | UINT64 Register : 8;\r | |
285 | UINT64 ExtendedRegister : 4;\r | |
286 | UINT64 Function : 3;\r | |
287 | UINT64 Device : 5;\r | |
288 | UINT64 Bus : 8;\r | |
289 | UINT64 Segment : 16;\r | |
290 | UINT64 Reserved : 20;\r | |
291 | } SAL_PCI_EXTENDED_REGISTER_ADDRESS;\r | |
292 | \r | |
293 | //\r | |
294 | // Parameter of EFI_SAL_FREQ_BASE\r | |
295 | //\r | |
296 | // Unsigned 64-bit integer specifying the type of clock source\r | |
297 | //\r | |
298 | #define EFI_SAL_CPU_INPUT_FREQ_BASE 0x0\r | |
299 | #define EFI_SAL_PLATFORM_IT_FREQ_BASE 0x1\r | |
300 | #define EFI_SAL_PLATFORM_RTC_FREQ_BASE 0x2\r | |
301 | \r | |
302 | //\r | |
303 | // Parameter and return value of EFI_SAL_UPDATE_PAL\r | |
304 | //\r | |
305 | // Return parameter provides additional information on the\r | |
306 | // failure when the status field contains a value of -3,\r | |
307 | // returned in r9.\r | |
308 | //\r | |
309 | #define EFI_SAL_UPDATE_BAD_PAL_VERSION ((UINT64) -1)\r | |
310 | #define EFI_SAL_UPDATE_PAL_AUTH_FAIL ((UINT64) -2)\r | |
311 | #define EFI_SAL_UPDATE_PAL_BAD_TYPE ((UINT64) -3)\r | |
312 | #define EFI_SAL_UPDATE_PAL_READONLY ((UINT64) -4)\r | |
313 | #define EFI_SAL_UPDATE_PAL_WRITE_FAIL ((UINT64) -10)\r | |
314 | #define EFI_SAL_UPDATE_PAL_ERASE_FAIL ((UINT64) -11)\r | |
315 | #define EFI_SAL_UPDATE_PAL_READ_FAIL ((UINT64) -12)\r | |
316 | #define EFI_SAL_UPDATE_PAL_CANT_FIT ((UINT64) -13)\r | |
317 | ///\r | |
318 | /// 64-byte header of update data block.\r | |
319 | ///\r | |
320 | typedef struct {\r | |
321 | UINT32 Size;\r | |
322 | UINT32 MmddyyyyDate;\r | |
323 | UINT16 Version;\r | |
324 | UINT8 Type;\r | |
325 | UINT8 Reserved[5];\r | |
326 | UINT64 FwVendorId;\r | |
327 | UINT8 Reserved2[40];\r | |
328 | } SAL_UPDATE_PAL_DATA_BLOCK;\r | |
329 | ///\r | |
330 | /// Data structure pointed by the parameter param_buf.\r | |
331 | /// It is a 16-byte aligned data structure in memory with a length of 32 bytes\r | |
332 | /// that describes the new firmware. This information is organized in the form\r | |
333 | /// of a linked list with each element describing one firmware component.\r | |
334 | ///\r | |
335 | typedef struct _SAL_UPDATE_PAL_INFO_BLOCK {\r | |
336 | struct _SAL_UPDATE_PAL_INFO_BLOCK *Next;\r | |
337 | struct SAL_UPDATE_PAL_DATA_BLOCK *DataBlock;\r | |
338 | UINT8 StoreChecksum;\r | |
339 | UINT8 Reserved[15];\r | |
340 | } SAL_UPDATE_PAL_INFO_BLOCK;\r | |
341 | \r | |
342 | ///\r | |
343 | /// SAL System Table Definitions.\r | |
344 | ///\r | |
345 | #pragma pack(1)\r | |
346 | typedef struct {\r | |
347 | ///\r | |
348 | /// The ASCII string representation of "SST_" that confirms the presence of the table. \r | |
349 | /// \r | |
350 | UINT32 Signature;\r | |
351 | ///\r | |
352 | /// The length of the entire table in bytes, starting from offset zero and including the\r | |
353 | /// header and all entries indicated by the EntryCount field.\r | |
354 | ///\r | |
355 | UINT32 Length;\r | |
356 | ///\r | |
357 | /// The revision number of the Itanium Processor Family System Abstraction Layer\r | |
358 | /// Specification supported by the SAL implementation, in binary coded decimal (BCD) format.\r | |
359 | ///\r | |
360 | UINT16 SalRevision;\r | |
361 | ///\r | |
362 | /// The number of entries in the variable portion of the table.\r | |
363 | ///\r | |
364 | UINT16 EntryCount;\r | |
365 | ///\r | |
366 | /// A modulo checksum of the entire table and the entries following this table.\r | |
367 | ///\r | |
368 | UINT8 CheckSum;\r | |
369 | ///\r | |
370 | /// Unused, must be zero.\r | |
371 | ///\r | |
372 | UINT8 Reserved[7];\r | |
373 | ///\r | |
374 | /// Version Number of the SAL_A firmware implementation in BCD format.\r | |
375 | ///\r | |
376 | UINT16 SalAVersion;\r | |
377 | ///\r | |
378 | /// Version Number of the SAL_B firmware implementation in BCD format.\r | |
379 | ///\r | |
380 | UINT16 SalBVersion;\r | |
381 | ///\r | |
382 | /// An ASCII identification string which uniquely identifies the manufacturer\r | |
383 | /// of the system hardware.\r | |
384 | ///\r | |
385 | UINT8 OemId[32];\r | |
386 | ///\r | |
387 | /// An ASCII identification string which uniquely identifies a family of\r | |
388 | /// compatible products from the manufacturer.\r | |
389 | ///\r | |
390 | UINT8 ProductId[32];\r | |
391 | ///\r | |
392 | /// Unused, must be zero.\r | |
393 | ///\r | |
394 | UINT8 Reserved2[8];\r | |
395 | } SAL_SYSTEM_TABLE_HEADER;\r | |
396 | \r | |
397 | #define EFI_SAL_ST_HEADER_SIGNATURE "SST_"\r | |
398 | #define EFI_SAL_REVISION 0x0320\r | |
399 | //\r | |
400 | // SAL System Types\r | |
401 | //\r | |
402 | #define EFI_SAL_ST_ENTRY_POINT 0\r | |
403 | #define EFI_SAL_ST_MEMORY_DESCRIPTOR 1\r | |
404 | #define EFI_SAL_ST_PLATFORM_FEATURES 2\r | |
405 | #define EFI_SAL_ST_TR_USAGE 3\r | |
406 | #define EFI_SAL_ST_PTC 4\r | |
407 | #define EFI_SAL_ST_AP_WAKEUP 5\r | |
408 | \r | |
409 | //\r | |
410 | // SAL System Type Sizes\r | |
411 | //\r | |
412 | #define EFI_SAL_ST_ENTRY_POINT_SIZE 48\r | |
413 | #define EFI_SAL_ST_MEMORY_DESCRIPTOR_SIZE 32\r | |
414 | #define EFI_SAL_ST_PLATFORM_FEATURES_SIZE 16\r | |
415 | #define EFI_SAL_ST_TR_USAGE_SIZE 32\r | |
416 | #define EFI_SAL_ST_PTC_SIZE 16\r | |
417 | #define EFI_SAL_ST_AP_WAKEUP_SIZE 16\r | |
418 | \r | |
419 | ///\r | |
420 | /// Format of Entrypoint Descriptor Entry.\r | |
421 | ///\r | |
422 | typedef struct {\r | |
423 | UINT8 Type; ///< Type here should be 0.\r | |
424 | UINT8 Reserved[7];\r | |
425 | UINT64 PalProcEntry;\r | |
426 | UINT64 SalProcEntry;\r | |
427 | UINT64 SalGlobalDataPointer;\r | |
428 | UINT64 Reserved2[2];\r | |
429 | } SAL_ST_ENTRY_POINT_DESCRIPTOR;\r | |
430 | \r | |
431 | ///\r | |
432 | /// Format of Platform Features Descriptor Entry.\r | |
433 | ///\r | |
434 | typedef struct {\r | |
435 | UINT8 Type; ///< Type here should be 2.\r | |
436 | UINT8 PlatformFeatures;\r | |
437 | UINT8 Reserved[14];\r | |
438 | } SAL_ST_PLATFORM_FEATURES;\r | |
439 | \r | |
440 | //\r | |
441 | // Value of Platform Feature List\r | |
442 | //\r | |
443 | #define SAL_PLAT_FEAT_BUS_LOCK 0x01\r | |
444 | #define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02\r | |
445 | #define SAL_PLAT_FEAT_PROC_IPI_HINT 0x04\r | |
446 | \r | |
447 | ///\r | |
448 | /// Format of Translation Register Descriptor Entry.\r | |
449 | ///\r | |
450 | typedef struct {\r | |
451 | UINT8 Type; ///< Type here should be 3.\r | |
452 | UINT8 TRType;\r | |
453 | UINT8 TRNumber;\r | |
454 | UINT8 Reserved[5];\r | |
455 | UINT64 VirtualAddress;\r | |
456 | UINT64 EncodedPageSize;\r | |
457 | UINT64 Reserved1;\r | |
458 | } SAL_ST_TR_DECRIPTOR;\r | |
459 | \r | |
460 | //\r | |
461 | // Type of Translation Register\r | |
462 | //\r | |
463 | #define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00\r | |
464 | #define EFI_SAL_ST_TR_USAGE_DATA 01\r | |
465 | \r | |
466 | ///\r | |
467 | /// Definition of Coherence Domain Information.\r | |
468 | ///\r | |
469 | typedef struct {\r | |
470 | UINT64 NumberOfProcessors;\r | |
471 | UINT64 LocalIDRegister;\r | |
472 | } SAL_COHERENCE_DOMAIN_INFO;\r | |
473 | \r | |
474 | ///\r | |
475 | /// Format of Purge Translation Cache Coherence Domain Entry.\r | |
476 | ///\r | |
477 | typedef struct {\r | |
478 | UINT8 Type; ///< Type here should be 4.\r | |
479 | UINT8 Reserved[3];\r | |
480 | UINT32 NumberOfDomains;\r | |
481 | SAL_COHERENCE_DOMAIN_INFO *DomainInformation;\r | |
482 | } SAL_ST_CACHE_COHERENCE_DECRIPTOR;\r | |
483 | \r | |
484 | ///\r | |
485 | /// Format of Application Processor Wake-Up Descriptor Entry.\r | |
486 | ///\r | |
487 | typedef struct {\r | |
488 | UINT8 Type; ///< Type here should be 5.\r | |
489 | UINT8 WakeUpType;\r | |
490 | UINT8 Reserved[6];\r | |
491 | UINT64 ExternalInterruptVector;\r | |
492 | } SAL_ST_AP_WAKEUP_DECRIPTOR;\r | |
493 | \r | |
494 | ///\r | |
495 | /// Format of Firmware Interface Table (FIT) Entry.\r | |
496 | ///\r | |
497 | typedef struct {\r | |
498 | UINT64 Address;\r | |
499 | UINT8 Size[3];\r | |
500 | UINT8 Reserved;\r | |
501 | UINT16 Revision;\r | |
502 | UINT8 Type : 7;\r | |
503 | UINT8 CheckSumValid : 1;\r | |
504 | UINT8 CheckSum;\r | |
505 | } EFI_SAL_FIT_ENTRY;\r | |
506 | //\r | |
507 | // FIT Types \r | |
508 | //\r | |
509 | #define EFI_SAL_FIT_FIT_HEADER_TYPE 0x00\r | |
510 | #define EFI_SAL_FIT_PAL_B_TYPE 0x01\r | |
511 | //\r | |
512 | // Type from 0x02 to 0x0D is reserved.\r | |
513 | //\r | |
514 | #define EFI_SAL_FIT_PROCESSOR_SPECIFIC_PAL_A_TYPE 0x0E\r | |
515 | #define EFI_SAL_FIT_PAL_A_TYPE 0x0F\r | |
516 | //\r | |
517 | // OEM-defined type range is from 0x10 to 0x7E.\r | |
518 | // Here we defined the PEI_CORE type as 0x10\r | |
519 | //\r | |
520 | #define EFI_SAL_FIT_PEI_CORE_TYPE 0x10\r | |
521 | #define EFI_SAL_FIT_UNUSED_TYPE 0x7F\r | |
522 | \r | |
523 | //\r | |
524 | // FIT Entry\r | |
525 | //\r | |
526 | #define EFI_SAL_FIT_ENTRY_PTR (0x100000000 - 32) // 4GB - 24\r | |
527 | #define EFI_SAL_FIT_PALA_ENTRY (0x100000000 - 48) // 4GB - 32\r | |
528 | #define EFI_SAL_FIT_PALB_TYPE 01\r | |
529 | \r | |
530 | //\r | |
531 | // Following definitions are for Error Record Structure\r | |
532 | //\r | |
533 | \r | |
534 | ///\r | |
535 | /// Format of TimeStamp field in Record Header.\r | |
536 | ///\r | |
537 | typedef struct {\r | |
538 | UINT8 Seconds;\r | |
539 | UINT8 Minutes;\r | |
540 | UINT8 Hours;\r | |
541 | UINT8 Reserved;\r | |
542 | UINT8 Day;\r | |
543 | UINT8 Month;\r | |
544 | UINT8 Year;\r | |
545 | UINT8 Century;\r | |
546 | } SAL_TIME_STAMP;\r | |
547 | ///\r | |
548 | /// Definition of Record Header.\r | |
549 | ///\r | |
550 | typedef struct {\r | |
551 | UINT64 RecordId;\r | |
552 | UINT16 Revision;\r | |
553 | UINT8 ErrorSeverity;\r | |
554 | UINT8 ValidationBits;\r | |
555 | UINT32 RecordLength;\r | |
556 | SAL_TIME_STAMP TimeStamp;\r | |
557 | UINT8 OemPlatformId[16];\r | |
558 | } SAL_RECORD_HEADER;\r | |
559 | ///\r | |
560 | /// Definition of Section Header.\r | |
561 | ///\r | |
562 | typedef struct {\r | |
563 | GUID Guid;\r | |
564 | UINT16 Revision;\r | |
565 | UINT8 ErrorRecoveryInfo;\r | |
566 | UINT8 Reserved;\r | |
567 | UINT32 SectionLength;\r | |
568 | } SAL_SEC_HEADER;\r | |
569 | \r | |
570 | ///\r | |
571 | /// GUID of Processor Machine Check Errors.\r | |
572 | ///\r | |
573 | #define SAL_PROCESSOR_ERROR_RECORD_INFO \\r | |
574 | { \\r | |
575 | 0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
576 | }\r | |
577 | //\r | |
578 | // Bit masks for valid bits of MOD_ERROR_INFO\r | |
579 | //\r | |
580 | #define CHECK_INFO_VALID_BIT_MASK 0x1\r | |
581 | #define REQUESTOR_ID_VALID_BIT_MASK 0x2\r | |
582 | #define RESPONDER_ID_VALID_BIT_MASK 0x4\r | |
583 | #define TARGER_ID_VALID_BIT_MASK 0x8\r | |
584 | #define PRECISE_IP_VALID_BIT_MASK 0x10\r | |
585 | ///\r | |
586 | /// Definition of MOD_ERROR_INFO_STRUCT.\r | |
587 | ///\r | |
588 | typedef struct {\r | |
589 | UINT64 InfoValid : 1;\r | |
590 | UINT64 ReqValid : 1;\r | |
591 | UINT64 RespValid : 1;\r | |
592 | UINT64 TargetValid : 1;\r | |
593 | UINT64 IpValid : 1;\r | |
594 | UINT64 Reserved : 59;\r | |
595 | UINT64 Info;\r | |
596 | UINT64 Req;\r | |
597 | UINT64 Resp;\r | |
598 | UINT64 Target;\r | |
599 | UINT64 Ip;\r | |
600 | } MOD_ERROR_INFO;\r | |
601 | ///\r | |
602 | /// Definition of CPUID_INFO_STRUCT.\r | |
603 | ///\r | |
604 | typedef struct {\r | |
605 | UINT8 CpuidInfo[40];\r | |
606 | UINT8 Reserved;\r | |
607 | } CPUID_INFO;\r | |
608 | \r | |
609 | typedef struct {\r | |
610 | UINT64 FrLow;\r | |
611 | UINT64 FrHigh;\r | |
612 | } FR_STRUCT;\r | |
613 | //\r | |
614 | // Bit masks for PSI_STATIC_STRUCT.ValidFieldBits\r | |
615 | //\r | |
616 | #define MIN_STATE_VALID_BIT_MASK 0x1\r | |
617 | #define BR_VALID_BIT_MASK 0x2\r | |
618 | #define CR_VALID_BIT_MASK 0x4\r | |
619 | #define AR_VALID_BIT_MASK 0x8\r | |
620 | #define RR_VALID_BIT_MASK 0x10\r | |
621 | #define FR_VALID_BIT_MASK 0x20\r | |
622 | ///\r | |
623 | /// Definition of PSI_STATIC_STRUCT.\r | |
624 | ///\r | |
625 | typedef struct {\r | |
626 | UINT64 ValidFieldBits;\r | |
627 | UINT8 MinStateInfo[1024];\r | |
628 | UINT64 Br[8];\r | |
629 | UINT64 Cr[128];\r | |
630 | UINT64 Ar[128];\r | |
631 | UINT64 Rr[8];\r | |
632 | FR_STRUCT Fr[128];\r | |
633 | } PSI_STATIC_STRUCT;\r | |
634 | //\r | |
635 | // Bit masks for SAL_PROCESSOR_ERROR_RECORD.ValidationBits\r | |
636 | //\r | |
637 | #define PROC_ERROR_MAP_VALID_BIT_MASK 0x1\r | |
638 | #define PROC_STATE_PARAMETER_VALID_BIT_MASK 0x2\r | |
639 | #define PROC_CR_LID_VALID_BIT_MASK 0x4\r | |
640 | #define PROC_STATIC_STRUCT_VALID_BIT_MASK 0x8\r | |
641 | #define CPU_INFO_VALID_BIT_MASK 0x1000000\r | |
642 | ///\r | |
643 | /// Definition of Processor Machine Check Error Record.\r | |
644 | ///\r | |
645 | typedef struct {\r | |
646 | SAL_SEC_HEADER SectionHeader;\r | |
647 | UINT64 ValidationBits;\r | |
648 | UINT64 ProcErrorMap;\r | |
649 | UINT64 ProcStateParameter;\r | |
650 | UINT64 ProcCrLid;\r | |
651 | MOD_ERROR_INFO CacheError[15];\r | |
652 | MOD_ERROR_INFO TlbError[15];\r | |
653 | MOD_ERROR_INFO BusError[15];\r | |
654 | MOD_ERROR_INFO RegFileCheck[15];\r | |
655 | MOD_ERROR_INFO MsCheck[15];\r | |
656 | CPUID_INFO CpuInfo;\r | |
657 | PSI_STATIC_STRUCT PsiValidData;\r | |
658 | } SAL_PROCESSOR_ERROR_RECORD;\r | |
659 | \r | |
660 | ///\r | |
661 | /// GUID of Platform Memory Device Error Info.\r | |
662 | ///\r | |
663 | #define SAL_MEMORY_ERROR_RECORD_INFO \\r | |
664 | { \\r | |
665 | 0xe429faf2, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
666 | }\r | |
667 | //\r | |
668 | // Bit masks for SAL_MEMORY_ERROR_RECORD.ValidationBits\r | |
669 | //\r | |
670 | #define MEMORY_ERROR_STATUS_VALID_BIT_MASK 0x1\r | |
671 | #define MEMORY_PHYSICAL_ADDRESS_VALID_BIT_MASK 0x2\r | |
672 | #define MEMORY_ADDR_BIT_MASK 0x4\r | |
673 | #define MEMORY_NODE_VALID_BIT_MASK 0x8\r | |
674 | #define MEMORY_CARD_VALID_BIT_MASK 0x10\r | |
675 | #define MEMORY_MODULE_VALID_BIT_MASK 0x20\r | |
676 | #define MEMORY_BANK_VALID_BIT_MASK 0x40\r | |
677 | #define MEMORY_DEVICE_VALID_BIT_MASK 0x80\r | |
678 | #define MEMORY_ROW_VALID_BIT_MASK 0x100\r | |
679 | #define MEMORY_COLUMN_VALID_BIT_MASK 0x200\r | |
680 | #define MEMORY_BIT_POSITION_VALID_BIT_MASK 0x400\r | |
681 | #define MEMORY_PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x800\r | |
682 | #define MEMORY_PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x1000\r | |
683 | #define MEMORY_PLATFORM_TARGET_VALID_BIT_MASK 0x2000\r | |
684 | #define MEMORY_PLATFORM_BUS_SPECIFIC_DATA_VALID_BIT_MASK 0x4000\r | |
685 | #define MEMORY_PLATFORM_OEM_ID_VALID_BIT_MASK 0x8000\r | |
686 | #define MEMORY_PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x10000\r | |
687 | ///\r | |
688 | /// Definition of Platform Memory Device Error Info Record.\r | |
689 | ///\r | |
690 | typedef struct {\r | |
691 | SAL_SEC_HEADER SectionHeader;\r | |
692 | UINT64 ValidationBits;\r | |
693 | UINT64 MemErrorStatus;\r | |
694 | UINT64 MemPhysicalAddress;\r | |
695 | UINT64 MemPhysicalAddressMask;\r | |
696 | UINT16 MemNode;\r | |
697 | UINT16 MemCard;\r | |
698 | UINT16 MemModule;\r | |
699 | UINT16 MemBank;\r | |
700 | UINT16 MemDevice;\r | |
701 | UINT16 MemRow;\r | |
702 | UINT16 MemColumn;\r | |
703 | UINT16 MemBitPosition;\r | |
704 | UINT64 ModRequestorId;\r | |
705 | UINT64 ModResponderId;\r | |
706 | UINT64 ModTargetId;\r | |
707 | UINT64 BusSpecificData;\r | |
708 | UINT8 MemPlatformOemId[16];\r | |
709 | } SAL_MEMORY_ERROR_RECORD;\r | |
710 | \r | |
711 | ///\r | |
712 | /// GUID of Platform PCI Bus Error Info.\r | |
713 | ///\r | |
714 | #define SAL_PCI_BUS_ERROR_RECORD_INFO \\r | |
715 | { \\r | |
716 | 0xe429faf4, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
717 | }\r | |
718 | //\r | |
719 | // Bit masks for SAL_PCI_BUS_ERROR_RECORD.ValidationBits\r | |
720 | //\r | |
721 | #define PCI_BUS_ERROR_STATUS_VALID_BIT_MASK 0x1\r | |
722 | #define PCI_BUS_ERROR_TYPE_VALID_BIT_MASK 0x2\r | |
723 | #define PCI_BUS_ID_VALID_BIT_MASK 0x4\r | |
724 | #define PCI_BUS_ADDRESS_VALID_BIT_MASK 0x8\r | |
725 | #define PCI_BUS_DATA_VALID_BIT_MASK 0x10\r | |
726 | #define PCI_BUS_CMD_VALID_BIT_MASK 0x20\r | |
727 | #define PCI_BUS_REQUESTOR_ID_VALID_BIT_MASK 0x40\r | |
728 | #define PCI_BUS_RESPONDER_ID_VALID_BIT_MASK 0x80\r | |
729 | #define PCI_BUS_TARGET_VALID_BIT_MASK 0x100\r | |
730 | #define PCI_BUS_OEM_ID_VALID_BIT_MASK 0x200\r | |
731 | #define PCI_BUS_OEM_DATA_STRUCT_VALID_BIT_MASK 0x400\r | |
732 | \r | |
733 | ///\r | |
734 | /// Designated PCI Bus identifier.\r | |
735 | ///\r | |
736 | typedef struct {\r | |
737 | UINT8 BusNumber;\r | |
738 | UINT8 SegmentNumber;\r | |
739 | } PCI_BUS_ID;\r | |
740 | \r | |
741 | ///\r | |
742 | /// Definition of Platform PCI Bus Error Info Record.\r | |
743 | ///\r | |
744 | typedef struct {\r | |
745 | SAL_SEC_HEADER SectionHeader;\r | |
746 | UINT64 ValidationBits;\r | |
747 | UINT64 PciBusErrorStatus;\r | |
748 | UINT16 PciBusErrorType;\r | |
749 | PCI_BUS_ID PciBusId;\r | |
750 | UINT32 Reserved;\r | |
751 | UINT64 PciBusAddress;\r | |
752 | UINT64 PciBusData;\r | |
753 | UINT64 PciBusCommand;\r | |
754 | UINT64 PciBusRequestorId;\r | |
755 | UINT64 PciBusResponderId;\r | |
756 | UINT64 PciBusTargetId;\r | |
757 | UINT8 PciBusOemId[16];\r | |
758 | } SAL_PCI_BUS_ERROR_RECORD;\r | |
759 | \r | |
760 | ///\r | |
761 | /// GUID of Platform PCI Component Error Info.\r | |
762 | ///\r | |
763 | #define SAL_PCI_COMP_ERROR_RECORD_INFO \\r | |
764 | { \\r | |
765 | 0xe429faf6, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
766 | }\r | |
767 | //\r | |
768 | // Bit masks for SAL_PCI_COMPONENT_ERROR_RECORD.ValidationBits\r | |
769 | //\r | |
770 | #define PCI_COMP_ERROR_STATUS_VALID_BIT_MASK 0x1\r | |
771 | #define PCI_COMP_INFO_VALID_BIT_MASK 0x2\r | |
772 | #define PCI_COMP_MEM_NUM_VALID_BIT_MASK 0x4\r | |
773 | #define PCI_COMP_IO_NUM_VALID_BIT_MASK 0x8\r | |
774 | #define PCI_COMP_REG_DATA_PAIR_VALID_BIT_MASK 0x10\r | |
775 | #define PCI_COMP_OEM_DATA_STRUCT_VALID_BIT_MASK 0x20\r | |
776 | ///\r | |
777 | /// Format of PCI Component Information to identify the device.\r | |
778 | ///\r | |
779 | typedef struct {\r | |
780 | UINT16 VendorId;\r | |
781 | UINT16 DeviceId;\r | |
782 | UINT8 ClassCode[3];\r | |
783 | UINT8 FunctionNumber;\r | |
784 | UINT8 DeviceNumber;\r | |
785 | UINT8 BusNumber;\r | |
786 | UINT8 SegmentNumber;\r | |
787 | UINT8 Reserved[5];\r | |
788 | } PCI_COMP_INFO;\r | |
789 | ///\r | |
790 | /// Definition of Platform PCI Component Error Info.\r | |
791 | ///\r | |
792 | typedef struct {\r | |
793 | SAL_SEC_HEADER SectionHeader;\r | |
794 | UINT64 ValidationBits;\r | |
795 | UINT64 PciComponentErrorStatus;\r | |
796 | PCI_COMP_INFO PciComponentInfo;\r | |
797 | UINT32 PciComponentMemNum;\r | |
798 | UINT32 PciComponentIoNum;\r | |
799 | UINT8 PciBusOemId[16];\r | |
800 | } SAL_PCI_COMPONENT_ERROR_RECORD;\r | |
801 | \r | |
802 | ///\r | |
803 | /// Platform SEL Device Error Info.\r | |
804 | ///\r | |
805 | #define SAL_SEL_DEVICE_ERROR_RECORD_INFO \\r | |
806 | { \\r | |
807 | 0xe429faf3, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
808 | }\r | |
809 | //\r | |
810 | // Bit masks for SAL_SEL_DEVICE_ERROR_RECORD.ValidationBits\r | |
811 | //\r | |
812 | #define SEL_RECORD_ID_VALID_BIT_MASK 0x1;\r | |
813 | #define SEL_RECORD_TYPE_VALID_BIT_MASK 0x2;\r | |
814 | #define SEL_GENERATOR_ID_VALID_BIT_MASK 0x4;\r | |
815 | #define SEL_EVM_REV_VALID_BIT_MASK 0x8;\r | |
816 | #define SEL_SENSOR_TYPE_VALID_BIT_MASK 0x10;\r | |
817 | #define SEL_SENSOR_NUM_VALID_BIT_MASK 0x20;\r | |
818 | #define SEL_EVENT_DIR_TYPE_VALID_BIT_MASK 0x40;\r | |
819 | #define SEL_EVENT_DATA1_VALID_BIT_MASK 0x80;\r | |
820 | #define SEL_EVENT_DATA2_VALID_BIT_MASK 0x100;\r | |
821 | #define SEL_EVENT_DATA3_VALID_BIT_MASK 0x200;\r | |
822 | ///\r | |
823 | /// Definition of Platform SEL Device Error Info Record.\r | |
824 | ///\r | |
825 | typedef struct {\r | |
826 | SAL_SEC_HEADER SectionHeader;\r | |
827 | UINT64 ValidationBits;\r | |
828 | UINT16 SelRecordId;\r | |
829 | UINT8 SelRecordType;\r | |
830 | UINT32 TimeStamp;\r | |
831 | UINT16 GeneratorId;\r | |
832 | UINT8 EvmRevision;\r | |
833 | UINT8 SensorType;\r | |
834 | UINT8 SensorNum;\r | |
835 | UINT8 EventDirType;\r | |
836 | UINT8 Data1;\r | |
837 | UINT8 Data2;\r | |
838 | UINT8 Data3;\r | |
839 | } SAL_SEL_DEVICE_ERROR_RECORD;\r | |
840 | \r | |
841 | ///\r | |
842 | /// GUID of Platform SMBIOS Device Error Info.\r | |
843 | ///\r | |
844 | #define SAL_SMBIOS_ERROR_RECORD_INFO \\r | |
845 | { \\r | |
846 | 0xe429faf5, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
847 | }\r | |
848 | //\r | |
849 | // Bit masks for SAL_SMBIOS_DEVICE_ERROR_RECORD.ValidationBits\r | |
850 | //\r | |
851 | #define SMBIOS_EVENT_TYPE_VALID_BIT_MASK 0x1\r | |
852 | #define SMBIOS_LENGTH_VALID_BIT_MASK 0x2\r | |
853 | #define SMBIOS_TIME_STAMP_VALID_BIT_MASK 0x4\r | |
854 | #define SMBIOS_DATA_VALID_BIT_MASK 0x8\r | |
855 | ///\r | |
856 | /// Definition of Platform SMBIOS Device Error Info Record.\r | |
857 | ///\r | |
858 | typedef struct {\r | |
859 | SAL_SEC_HEADER SectionHeader;\r | |
860 | UINT64 ValidationBits;\r | |
861 | UINT8 SmbiosEventType;\r | |
862 | UINT8 SmbiosLength;\r | |
863 | UINT8 SmbiosBcdTimeStamp[6];\r | |
864 | } SAL_SMBIOS_DEVICE_ERROR_RECORD;\r | |
865 | \r | |
866 | ///\r | |
867 | /// GUID of Platform Specific Error Info.\r | |
868 | ///\r | |
869 | #define SAL_PLATFORM_ERROR_RECORD_INFO \\r | |
870 | { \\r | |
871 | 0xe429faf7, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r | |
872 | }\r | |
873 | //\r | |
874 | // Bit masks for SAL_PLATFORM_SPECIFIC_ERROR_RECORD.ValidationBits\r | |
875 | //\r | |
876 | #define PLATFORM_ERROR_STATUS_VALID_BIT_MASK 0x1\r | |
877 | #define PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x2\r | |
878 | #define PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x4\r | |
879 | #define PLATFORM_TARGET_VALID_BIT_MASK 0x8\r | |
880 | #define PLATFORM_SPECIFIC_DATA_VALID_BIT_MASK 0x10\r | |
881 | #define PLATFORM_OEM_ID_VALID_BIT_MASK 0x20\r | |
882 | #define PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x40\r | |
883 | #define PLATFORM_OEM_DEVICE_PATH_VALID_BIT_MASK 0x80\r | |
884 | ///\r | |
885 | /// Definition of Platform Specific Error Info Record.\r | |
886 | ///\r | |
887 | typedef struct {\r | |
888 | SAL_SEC_HEADER SectionHeader;\r | |
889 | UINT64 ValidationBits;\r | |
890 | UINT64 PlatformErrorStatus;\r | |
891 | UINT64 PlatformRequestorId;\r | |
892 | UINT64 PlatformResponderId;\r | |
893 | UINT64 PlatformTargetId;\r | |
894 | UINT64 PlatformBusSpecificData;\r | |
895 | UINT8 OemComponentId[16];\r | |
896 | } SAL_PLATFORM_SPECIFIC_ERROR_RECORD;\r | |
897 | \r | |
898 | ///\r | |
899 | /// Union of all the possible SAL Error Record Types.\r | |
900 | ///\r | |
901 | typedef union {\r | |
902 | SAL_RECORD_HEADER *RecordHeader;\r | |
903 | SAL_PROCESSOR_ERROR_RECORD *SalProcessorRecord;\r | |
904 | SAL_PCI_BUS_ERROR_RECORD *SalPciBusRecord;\r | |
905 | SAL_PCI_COMPONENT_ERROR_RECORD *SalPciComponentRecord;\r | |
906 | SAL_SEL_DEVICE_ERROR_RECORD *ImpiRecord;\r | |
907 | SAL_SMBIOS_DEVICE_ERROR_RECORD *SmbiosRecord;\r | |
908 | SAL_PLATFORM_SPECIFIC_ERROR_RECORD *PlatformRecord;\r | |
909 | SAL_MEMORY_ERROR_RECORD *MemoryRecord;\r | |
910 | UINT8 *Raw;\r | |
911 | } SAL_ERROR_RECORDS_POINTERS;\r | |
912 | \r | |
913 | #pragma pack()\r | |
914 | \r | |
915 | #endif\r |