]>
Commit | Line | Data |
---|---|---|
9f7f5161 | 1 | /**\r |
2 | @file\r | |
3 | Display the ACPI tables\r | |
4 | \r | |
bcb96695 MK |
5 | Copyright (c) 2011-2012, Intel Corporation. All rights reserved.\r |
6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
7dc13291 | 7 | \r |
8 | **/\r | |
9 | \r | |
10 | #include <WebServer.h>\r | |
11 | #include <Guid/Acpi.h>\r | |
12 | #include <IndustryStandard/Acpi10.h>\r | |
13 | #include <IndustryStandard/Acpi30.h>\r | |
14 | \r | |
d3a595ce | 15 | #if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.\r |
7dc13291 | 16 | #pragma warning ( disable : 4305 )\r |
d3a595ce | 17 | #endif // defined(_MSC_VER)\r |
7dc13291 | 18 | \r |
19 | //\r | |
20 | // Ensure proper structure formats\r | |
21 | //\r | |
22 | #pragma pack(1)\r | |
23 | \r | |
24 | typedef struct {\r | |
25 | UINT8 AddressSpaceId;\r | |
26 | UINT8 RegisterBitWidth;\r | |
27 | UINT8 RegisterBitOffset;\r | |
28 | UINT8 AccessSize;\r | |
29 | UINT64 Address;\r | |
30 | } GENERIC_ADDRESS;\r | |
31 | \r | |
32 | \r | |
33 | typedef struct {\r | |
34 | UINT32 Signature; // 0\r | |
35 | UINT32 Length; // 4\r | |
36 | UINT8 Revision; // 8\r | |
37 | UINT8 Checksum; // 9\r | |
38 | UINT8 OemId[6]; // 10\r | |
39 | UINT8 OemTableId[8]; // 16\r | |
40 | UINT32 OemRevision; // 24\r | |
41 | UINT32 CreatorId; // 28\r | |
42 | UINT32 CreatorRevision; // 32\r | |
43 | UINT8 DefinitionBlock[1]; // 36\r | |
44 | } ACPI_DSDT;\r | |
45 | \r | |
46 | \r | |
47 | typedef struct {\r | |
48 | UINT32 Signature; // 0\r | |
49 | UINT32 Length; // 4\r | |
50 | UINT8 Revision; // 8\r | |
51 | UINT8 Checksum; // 9\r | |
52 | UINT8 OemId[6]; // 10\r | |
53 | UINT8 OemTableId[8]; // 16\r | |
54 | UINT32 OemRevision; // 24\r | |
55 | UINT32 CreatorId; // 28\r | |
56 | UINT32 CreatorRevision; // 32\r | |
57 | UINT32 FirmwareCtrl; // 36\r | |
58 | UINT32 DSDT; // 40\r | |
59 | UINT8 Reserved; // 44\r | |
60 | UINT8 PreferredPmProfile; // 45\r | |
61 | UINT16 SciInt; // 46\r | |
62 | UINT32 SmiCmd; // 48\r | |
63 | UINT8 AcpiEnable; // 52\r | |
64 | UINT8 AcpiDisable; // 53\r | |
65 | UINT8 S4BiosReq; // 54\r | |
66 | UINT8 PStateCnt; // 55\r | |
67 | UINT32 Pm1aEvtBlk; // 56\r | |
68 | UINT32 Pm1bEvtBlk; // 60\r | |
69 | UINT32 Pm1aCntBlk; // 64\r | |
70 | UINT32 Pm1bCntBlk; // 68\r | |
71 | UINT32 Pm2CntBlk; // 72\r | |
72 | UINT32 PmTmrBlk; // 76\r | |
73 | UINT32 Gpe0Blk; // 80\r | |
74 | UINT32 Gpe1Blk; // 84\r | |
75 | UINT8 Pm1EvtLen; // 88\r | |
76 | UINT8 Pm1CntLen; // 89\r | |
77 | UINT8 PM2CntLen; // 90\r | |
78 | UINT8 PmTmrLen; // 91\r | |
79 | UINT8 Gpe0BlkLen; // 92\r | |
80 | UINT8 Gpe1BlkLen; // 93\r | |
81 | UINT8 Gpe1Base; // 94\r | |
82 | UINT8 CstCnt; // 95\r | |
83 | UINT16 PLvl2Lat; // 96\r | |
84 | UINT16 PLvl3Lat; // 98\r | |
85 | UINT16 FlushSize; // 100\r | |
86 | UINT16 FlushStride; // 102\r | |
87 | UINT8 DutyOffset; // 104\r | |
88 | UINT8 DutyWidth; // 105\r | |
89 | UINT8 DayAlrm; // 106\r | |
90 | UINT8 MonAlrm; // 107\r | |
91 | UINT8 Century; // 108\r | |
92 | UINT16 IapcBootArch; // 109\r | |
93 | UINT8 Reserved2; // 111\r | |
94 | UINT32 Flags; // 112\r | |
59bc0593 | 95 | UINT32 ResetReg[3]; // 116\r |
7dc13291 | 96 | UINT8 ResetValue; // 128\r |
59bc0593 | 97 | UINT8 Reserved3[3]; // 129\r |
7dc13291 | 98 | UINT64 XFirmwareCtrl; // 132\r |
99 | UINT64 XDsdt; // 140\r | |
59bc0593 | 100 | UINT32 XPm1aEvtBlk[3]; // 148\r |
101 | UINT32 XPm1bEvtBlk[3]; // 160\r | |
102 | UINT32 XPm1aCntBlk[3]; // 172\r | |
103 | UINT32 XPm1bCntBlk[3]; // 184\r | |
104 | UINT32 XPm2CntBlk[3]; // 196\r | |
105 | UINT32 XPmTmrBlk[3]; // 208\r | |
106 | UINT32 XGpe0Blk[3]; // 220\r | |
107 | UINT32 XGpe1Blk[3]; // 232\r | |
7dc13291 | 108 | } ACPI_FADT;\r |
109 | \r | |
110 | \r | |
111 | typedef struct {\r | |
112 | UINT32 Signature;\r | |
113 | UINT32 Length;\r | |
114 | UINT8 Revision;\r | |
115 | UINT8 Checksum;\r | |
116 | UINT8 OemId[6];\r | |
117 | UINT8 OemTableId[8];\r | |
118 | UINT32 OemRevision;\r | |
119 | UINT32 CreatorId;\r | |
120 | UINT32 CreatorRevision;\r | |
121 | UINT32 Entry[1];\r | |
122 | } ACPI_RSDT;\r | |
123 | \r | |
124 | \r | |
9f7f5161 | 125 | typedef struct {\r |
126 | UINT32 Signature; // 0\r | |
127 | UINT32 Length; // 4\r | |
128 | } ACPI_UNKNOWN;\r | |
129 | \r | |
7dc13291 | 130 | #pragma pack()\r |
131 | \r | |
132 | \r | |
133 | typedef struct {\r | |
134 | UINT32 Signature;\r | |
135 | CONST CHAR8 * pTableName;\r | |
136 | CONST CHAR16 * pWebPage;\r | |
137 | } TABLE_SIGNATURE;\r | |
138 | \r | |
139 | \r | |
59bc0593 | 140 | CONST TABLE_SIGNATURE mTableId[] = {\r |
9f7f5161 | 141 | { APIC_SIGNATURE, "APIC", PAGE_ACPI_APIC },\r |
142 | { BGRT_SIGNATURE, "BGRT", PAGE_ACPI_BGRT },\r | |
7dc13291 | 143 | { DSDT_SIGNATURE, "DSDT", PAGE_ACPI_DSDT },\r |
9f7f5161 | 144 | { FADT_SIGNATURE, "FADT", PAGE_ACPI_FADT },\r |
145 | { HPET_SIGNATURE, "HPET", PAGE_ACPI_HPET },\r | |
146 | { MCFG_SIGNATURE, "MCFG", PAGE_ACPI_MCFG },\r | |
147 | { SSDT_SIGNATURE, "SSDT", PAGE_ACPI_SSDT },\r | |
148 | { TCPA_SIGNATURE, "TCPA", PAGE_ACPI_TCPA },\r | |
149 | { UEFI_SIGNATURE, "UEFI", PAGE_ACPI_UEFI }\r | |
7dc13291 | 150 | };\r |
151 | \r | |
152 | \r | |
153 | /**\r | |
154 | Locate the RSDT table\r | |
155 | \r | |
156 | @return Table address or NULL if not found\r | |
157 | \r | |
158 | **/\r | |
159 | CONST ACPI_RSDT *\r | |
160 | LocateRsdt (\r | |
161 | VOID\r | |
162 | )\r | |
163 | {\r | |
164 | CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER * pRsdp10b;\r | |
165 | CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER * pRsdp30;\r | |
166 | CONST ACPI_RSDT * pRsdt;\r | |
167 | EFI_STATUS Status;\r | |
168 | \r | |
169 | //\r | |
170 | // Use for/break instead of goto\r | |
171 | //\r | |
172 | pRsdt = NULL;\r | |
173 | for ( ; ; ) {\r | |
174 | //\r | |
175 | // Locate the RSDT\r | |
176 | //\r | |
177 | Status = EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid, (VOID **)&pRsdp30 );\r | |
178 | if ( !EFI_ERROR ( Status )) {\r | |
53c31c51 | 179 | pRsdt = (ACPI_RSDT *)(UINTN)pRsdp30->RsdtAddress;\r |
7dc13291 | 180 | }\r |
181 | else {\r | |
182 | Status = EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (VOID **)&pRsdp10b );\r | |
183 | if ( EFI_ERROR ( Status )) {\r | |
184 | break;\r | |
185 | }\r | |
53c31c51 | 186 | pRsdt = (ACPI_RSDT *)(UINTN)pRsdp10b->RsdtAddress;\r |
7dc13291 | 187 | }\r |
188 | break;\r | |
189 | }\r | |
190 | \r | |
191 | //\r | |
192 | // The entry was not found\r | |
193 | //\r | |
194 | return pRsdt;\r | |
195 | }\r | |
196 | \r | |
197 | \r | |
198 | /**\r | |
199 | Locate the specified table\r | |
200 | \r | |
201 | @param [in] Signature Table signature\r | |
202 | \r | |
203 | @return Table address or NULL if not found\r | |
204 | \r | |
205 | **/\r | |
206 | CONST VOID *\r | |
207 | LocateTable (\r | |
208 | IN UINT32 Signature\r | |
209 | )\r | |
210 | {\r | |
211 | CONST UINT32 * pEnd;\r | |
212 | CONST UINT32 * pEntry;\r | |
213 | CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER * pRsdp10b;\r | |
214 | CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER * pRsdp30;\r | |
215 | CONST ACPI_RSDT * pRsdt;\r | |
216 | CONST UINT32 * pSignature;\r | |
217 | EFI_STATUS Status;\r | |
218 | \r | |
219 | //\r | |
220 | // Use for/break instead of goto\r | |
221 | //\r | |
222 | for ( ; ; ) {\r | |
223 | //\r | |
224 | // Locate the RSDT\r | |
225 | //\r | |
226 | Status = EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid, (VOID **)&pRsdp30 );\r | |
227 | if ( !EFI_ERROR ( Status )) {\r | |
53c31c51 | 228 | pRsdt = (ACPI_RSDT *)(UINTN)pRsdp30->RsdtAddress;\r |
7dc13291 | 229 | }\r |
230 | else {\r | |
231 | Status = EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (VOID **)&pRsdp10b );\r | |
232 | if ( EFI_ERROR ( Status )) {\r | |
233 | break;\r | |
234 | }\r | |
53c31c51 | 235 | pRsdt = (ACPI_RSDT *)(UINTN)pRsdp10b->RsdtAddress;\r |
7dc13291 | 236 | }\r |
237 | \r | |
238 | //\r | |
239 | // Walk the list of entries\r | |
240 | //\r | |
59bc0593 | 241 | pEntry = &pRsdt->Entry[ 0 ];\r |
242 | pEnd = &pEntry[(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];\r | |
7dc13291 | 243 | while ( pEnd > pEntry ) {\r |
244 | //\r | |
245 | // The entry is actually a 32-bit physical table address\r | |
246 | // The first entry in the table is the 32-bit table signature\r | |
247 | //\r | |
53c31c51 | 248 | pSignature = (UINT32 *)(UINTN)*pEntry;\r |
7dc13291 | 249 | if ( *pSignature == Signature ) {\r |
53c31c51 | 250 | return (CONST VOID *)(UINTN)*pEntry;\r |
7dc13291 | 251 | }\r |
252 | \r | |
253 | //\r | |
254 | // Set the next entry\r | |
255 | //\r | |
256 | pEntry++;\r | |
257 | }\r | |
258 | break;\r | |
259 | }\r | |
260 | \r | |
261 | //\r | |
262 | // The entry was not found\r | |
263 | //\r | |
264 | return NULL;\r | |
265 | }\r | |
266 | \r | |
267 | \r | |
268 | /**\r | |
269 | Display a row containing a hex value\r | |
270 | \r | |
271 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
272 | @param [in] pPort The WSDT_PORT structure address\r | |
273 | @param [in] pName Address of a zero terminated name string\r | |
274 | @param [in] Length Length in bytes\r | |
275 | @param [in] pChar Address of the first character\r | |
276 | \r | |
277 | @retval EFI_SUCCESS The request was successfully processed\r | |
278 | \r | |
279 | **/\r | |
280 | EFI_STATUS\r | |
281 | RowAnsiArray (\r | |
282 | IN int SocketFD,\r | |
283 | IN WSDT_PORT * pPort,\r | |
284 | IN CONST CHAR8 * pName,\r | |
285 | IN UINTN Length,\r | |
286 | IN CONST CHAR8 * pChar\r | |
287 | )\r | |
288 | {\r | |
289 | CONST CHAR8 * pData;\r | |
290 | CONST CHAR8 * pEnd;\r | |
291 | EFI_STATUS Status;\r | |
292 | \r | |
293 | DBG_ENTER ( );\r | |
294 | \r | |
295 | //\r | |
296 | // Use for/break instead of goto\r | |
297 | //\r | |
298 | for ( ; ; ) {\r | |
299 | //\r | |
300 | // Start the row\r | |
301 | //\r | |
302 | Status = HttpSendAnsiString ( SocketFD,\r | |
303 | pPort,\r | |
304 | "<tr><td>" );\r | |
305 | if ( EFI_ERROR ( Status )) {\r | |
306 | break;\r | |
307 | }\r | |
308 | Status = HttpSendAnsiString ( SocketFD,\r | |
309 | pPort,\r | |
310 | pName );\r | |
311 | if ( EFI_ERROR ( Status )) {\r | |
312 | break;\r | |
313 | }\r | |
314 | Status = HttpSendAnsiString ( SocketFD,\r | |
315 | pPort,\r | |
316 | "</td><td><code>" );\r | |
317 | if ( EFI_ERROR ( Status )) {\r | |
318 | break;\r | |
319 | }\r | |
320 | \r | |
321 | //\r | |
322 | // Display the characters\r | |
323 | //\r | |
324 | pData = pChar;\r | |
59bc0593 | 325 | pEnd = &pChar[ Length ];\r |
7dc13291 | 326 | while ( pEnd > pData ) {\r |
327 | Status = HttpSendCharacter ( SocketFD,\r | |
328 | pPort,\r | |
329 | *pData++,\r | |
330 | " " );\r | |
331 | if ( EFI_ERROR ( Status )) {\r | |
332 | break;\r | |
333 | }\r | |
334 | }\r | |
335 | if ( EFI_ERROR ( Status )) {\r | |
336 | break;\r | |
337 | }\r | |
338 | \r | |
339 | //\r | |
340 | // Display the byte values\r | |
341 | //\r | |
342 | Status = HttpSendAnsiString ( SocketFD,\r | |
343 | pPort,\r | |
344 | "<br/>0x" );\r | |
345 | if ( EFI_ERROR ( Status )) {\r | |
346 | break;\r | |
347 | }\r | |
348 | pData = pChar;\r | |
349 | while ( pEnd > pData ) {\r | |
350 | Status = HttpSendHexBits ( SocketFD,\r | |
351 | pPort,\r | |
352 | 8,\r | |
353 | *pData++ );\r | |
354 | if ( EFI_ERROR ( Status )) {\r | |
355 | break;\r | |
356 | }\r | |
357 | if ( pEnd > pData ) {\r | |
358 | Status = HttpSendAnsiString ( SocketFD,\r | |
359 | pPort,\r | |
360 | " 0x" );\r | |
361 | if ( EFI_ERROR ( Status )) {\r | |
362 | break;\r | |
363 | }\r | |
364 | }\r | |
365 | }\r | |
366 | \r | |
367 | //\r | |
368 | // Terminate the row\r | |
369 | //\r | |
370 | Status = HttpSendAnsiString ( SocketFD,\r | |
371 | pPort,\r | |
372 | "</code></td></tr>\r\n" );\r | |
373 | break;\r | |
374 | }\r | |
375 | \r | |
376 | //\r | |
377 | // Return the operation status\r | |
378 | //\r | |
379 | DBG_EXIT_STATUS ( Status );\r | |
380 | return Status;\r | |
381 | }\r | |
382 | \r | |
383 | \r | |
384 | /**\r | |
385 | Format a row with a list of bytes\r | |
386 | \r | |
387 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
388 | @param [in] pPort The WSDT_PORT structure address\r | |
389 | @param [in] pName Zero terminated name string\r | |
390 | @param [in] ByteCount The number of bytes to display\r | |
391 | @param [in] pData Address of the byte array\r | |
392 | \r | |
393 | @retval EFI_SUCCESS The request was successfully processed\r | |
394 | \r | |
395 | **/\r | |
396 | EFI_STATUS\r | |
397 | RowBytes (\r | |
398 | IN int SocketFD,\r | |
399 | IN WSDT_PORT * pPort,\r | |
400 | IN CHAR8 * pName,\r | |
401 | IN UINTN ByteCount,\r | |
402 | IN CONST UINT8 * pData\r | |
403 | )\r | |
404 | {\r | |
405 | CONST UINT8 * pEnd;\r | |
406 | EFI_STATUS Status;\r | |
407 | \r | |
408 | //\r | |
409 | // Use for/break instead of goto\r | |
410 | //\r | |
411 | for ( ; ; ) {\r | |
412 | //\r | |
413 | // Start the row\r | |
414 | //\r | |
415 | Status = HttpSendAnsiString ( SocketFD,\r | |
416 | pPort,\r | |
417 | "<tr><td>" );\r | |
418 | if ( EFI_ERROR ( Status )) {\r | |
419 | break;\r | |
420 | }\r | |
421 | \r | |
422 | //\r | |
423 | // Display the field name\r | |
424 | //\r | |
425 | Status = HttpSendAnsiString ( SocketFD,\r | |
426 | pPort,\r | |
427 | pName );\r | |
428 | if ( EFI_ERROR ( Status )) {\r | |
429 | break;\r | |
430 | }\r | |
431 | \r | |
432 | //\r | |
433 | // Display the field value\r | |
434 | //\r | |
435 | Status = HttpSendAnsiString ( SocketFD,\r | |
436 | pPort,\r | |
437 | "</td><td><code>0x" );\r | |
438 | if ( EFI_ERROR ( Status )) {\r | |
439 | break;\r | |
440 | }\r | |
59bc0593 | 441 | pEnd = &pData[ ByteCount ];\r |
7dc13291 | 442 | while ( pEnd > pData ) {\r |
443 | Status = HttpSendHexBits ( SocketFD,\r | |
444 | pPort,\r | |
445 | 8,\r | |
446 | *pData++ );\r | |
447 | if ( EFI_ERROR ( Status )) {\r | |
448 | break;\r | |
449 | }\r | |
450 | if ( pEnd > pData ) {\r | |
451 | Status = HttpSendAnsiString ( SocketFD,\r | |
452 | pPort,\r | |
453 | " 0x" );\r | |
454 | if ( EFI_ERROR ( Status )) {\r | |
455 | break;\r | |
456 | }\r | |
457 | }\r | |
458 | }\r | |
459 | if ( EFI_ERROR ( Status )) {\r | |
460 | break;\r | |
461 | }\r | |
462 | \r | |
463 | //\r | |
464 | // Terminate the row\r | |
465 | //\r | |
466 | Status = HttpSendAnsiString ( SocketFD,\r | |
467 | pPort,\r | |
468 | "</code></td></tr>\r\n" );\r | |
469 | break;\r | |
470 | }\r | |
471 | \r | |
472 | //\r | |
473 | // Return the operation status\r | |
474 | //\r | |
475 | return Status;\r | |
476 | }\r | |
477 | \r | |
478 | \r | |
479 | /**\r | |
480 | Format a row with a list of bytes\r | |
481 | \r | |
482 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
483 | @param [in] pPort The WSDT_PORT structure address\r | |
484 | @param [in] pName Zero terminated name string\r | |
485 | @param [in] ByteCount The number of bytes to display\r | |
486 | @param [in] pData Address of the byte array\r | |
487 | \r | |
488 | @retval EFI_SUCCESS The request was successfully processed\r | |
489 | \r | |
490 | **/\r | |
491 | EFI_STATUS\r | |
492 | RowDump (\r | |
493 | IN int SocketFD,\r | |
494 | IN WSDT_PORT * pPort,\r | |
495 | IN CHAR8 * pName,\r | |
496 | IN UINTN ByteCount,\r | |
497 | IN CONST UINT8 * pData\r | |
498 | )\r | |
499 | {\r | |
500 | EFI_STATUS Status;\r | |
501 | \r | |
502 | //\r | |
503 | // Use for/break instead of goto\r | |
504 | //\r | |
505 | for ( ; ; ) {\r | |
506 | //\r | |
507 | // Start the row\r | |
508 | //\r | |
509 | Status = HttpSendAnsiString ( SocketFD,\r | |
510 | pPort,\r | |
511 | "<tr><td>" );\r | |
512 | if ( EFI_ERROR ( Status )) {\r | |
513 | break;\r | |
514 | }\r | |
515 | \r | |
516 | //\r | |
517 | // Display the field name\r | |
518 | //\r | |
519 | Status = HttpSendAnsiString ( SocketFD,\r | |
520 | pPort,\r | |
521 | pName );\r | |
522 | if ( EFI_ERROR ( Status )) {\r | |
523 | break;\r | |
524 | }\r | |
525 | \r | |
526 | //\r | |
527 | // Start the field value\r | |
528 | //\r | |
529 | Status = HttpSendAnsiString ( SocketFD,\r | |
530 | pPort,\r | |
531 | "</td><td>" );\r | |
532 | if ( EFI_ERROR ( Status )) {\r | |
533 | break;\r | |
534 | }\r | |
535 | \r | |
536 | //\r | |
537 | // Dump the buffer\r | |
538 | //\r | |
539 | Status = HttpSendDump ( SocketFD,\r | |
540 | pPort,\r | |
541 | ByteCount,\r | |
542 | pData );\r | |
543 | \r | |
544 | //\r | |
545 | // Terminate the field value and row\r | |
546 | //\r | |
547 | Status = HttpSendAnsiString ( SocketFD,\r | |
548 | pPort,\r | |
549 | "</td></tr>\r\n" );\r | |
550 | break;\r | |
551 | }\r | |
552 | \r | |
553 | //\r | |
554 | // Return the operation status\r | |
555 | //\r | |
556 | return Status;\r | |
557 | }\r | |
558 | \r | |
559 | \r | |
560 | /**\r | |
561 | Format a row with a general address\r | |
562 | \r | |
563 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
564 | @param [in] pPort The WSDT_PORT structure address\r | |
565 | @param [in] pName Zero terminated name string\r | |
566 | @param [in] pAddr Address of the general address buffer\r | |
567 | @param [in] pWebPage Zero terminated web page address\r | |
568 | \r | |
569 | @retval EFI_SUCCESS The request was successfully processed\r | |
570 | \r | |
571 | **/\r | |
572 | EFI_STATUS\r | |
573 | RowGenericAddress (\r | |
574 | IN int SocketFD,\r | |
575 | IN WSDT_PORT * pPort,\r | |
576 | IN CHAR8 * pName,\r | |
577 | IN CONST UINT32 * pAddr,\r | |
578 | IN CONST CHAR16 * pWebPage\r | |
579 | )\r | |
580 | {\r | |
581 | CONST GENERIC_ADDRESS * pGenericAddress;\r | |
582 | EFI_STATUS Status;\r | |
583 | \r | |
584 | //\r | |
585 | // Use for/break instead of goto\r | |
586 | //\r | |
587 | for ( ; ; ) {\r | |
588 | //\r | |
589 | // Start the row\r | |
590 | //\r | |
591 | Status = HttpSendAnsiString ( SocketFD,\r | |
592 | pPort,\r | |
593 | "<tr><td>" );\r | |
594 | if ( EFI_ERROR ( Status )) {\r | |
595 | break;\r | |
596 | }\r | |
597 | \r | |
598 | //\r | |
599 | // Display the field name\r | |
600 | //\r | |
601 | Status = HttpSendAnsiString ( SocketFD,\r | |
602 | pPort,\r | |
603 | pName );\r | |
604 | if ( EFI_ERROR ( Status )) {\r | |
605 | break;\r | |
606 | }\r | |
607 | \r | |
608 | //\r | |
609 | // Display the field value\r | |
610 | //\r | |
611 | Status = HttpSendAnsiString ( SocketFD,\r | |
612 | pPort,\r | |
613 | "</td><td><code>" );\r | |
614 | if ( EFI_ERROR ( Status )) {\r | |
615 | break;\r | |
616 | }\r | |
617 | \r | |
618 | //\r | |
619 | // Determine the type of address\r | |
620 | //\r | |
621 | pGenericAddress = (CONST GENERIC_ADDRESS *)pAddr;\r | |
622 | if ( 0 == pGenericAddress->AddressSpaceId ) {\r | |
623 | Status = HttpSendAnsiString ( SocketFD, pPort, "System Memory" );\r | |
624 | }\r | |
625 | else if ( 1 == pGenericAddress->AddressSpaceId ) {\r | |
626 | Status = HttpSendAnsiString ( SocketFD, pPort, "I/O Space" );\r | |
627 | }\r | |
628 | else if ( 2 == pGenericAddress->AddressSpaceId ) {\r | |
629 | Status = HttpSendAnsiString ( SocketFD, pPort, "PCI Configuration Space" );\r | |
630 | }\r | |
631 | else if ( 3 == pGenericAddress->AddressSpaceId ) {\r | |
632 | Status = HttpSendAnsiString ( SocketFD, pPort, "Embedded Controller" );\r | |
633 | }\r | |
634 | else if ( 4 == pGenericAddress->AddressSpaceId ) {\r | |
635 | Status = HttpSendAnsiString ( SocketFD, pPort, "SMBus" );\r | |
636 | }\r | |
637 | else if ( 0x7f == pGenericAddress->AddressSpaceId ) {\r | |
638 | Status = HttpSendAnsiString ( SocketFD, pPort, "Functional Fixed Hardware" );\r | |
639 | }\r | |
640 | else if (( 0xc0 <= pGenericAddress->AddressSpaceId )\r | |
641 | && ( 0xff >= pGenericAddress->AddressSpaceId )) {\r | |
642 | Status = HttpSendAnsiString ( SocketFD, pPort, "OEM Defined" );\r | |
643 | }\r | |
644 | else {\r | |
645 | Status = HttpSendAnsiString ( SocketFD, pPort, "Reserved" );\r | |
646 | }\r | |
647 | if ( EFI_ERROR ( Status )) {\r | |
648 | break;\r | |
649 | }\r | |
650 | Status = HttpSendAnsiString ( SocketFD,\r | |
651 | pPort,\r | |
652 | "<br/>Register Bit Width: " );\r | |
653 | if ( EFI_ERROR ( Status )) {\r | |
654 | break;\r | |
655 | }\r | |
656 | Status = HttpSendValue ( SocketFD,\r | |
657 | pPort,\r | |
658 | pGenericAddress->RegisterBitWidth );\r | |
659 | if ( EFI_ERROR ( Status )) {\r | |
660 | break;\r | |
661 | }\r | |
662 | Status = HttpSendAnsiString ( SocketFD,\r | |
663 | pPort,\r | |
664 | "<br/>Register Bit Offset: " );\r | |
665 | if ( EFI_ERROR ( Status )) {\r | |
666 | break;\r | |
667 | }\r | |
668 | Status = HttpSendHexValue ( SocketFD,\r | |
669 | pPort,\r | |
670 | pGenericAddress->RegisterBitOffset );\r | |
671 | if ( EFI_ERROR ( Status )) {\r | |
672 | break;\r | |
673 | }\r | |
674 | Status = HttpSendAnsiString ( SocketFD,\r | |
675 | pPort,\r | |
676 | "<br/>Access Size: " );\r | |
677 | if ( EFI_ERROR ( Status )) {\r | |
678 | break;\r | |
679 | }\r | |
680 | Status = HttpSendValue ( SocketFD,\r | |
681 | pPort,\r | |
682 | pGenericAddress->AccessSize );\r | |
683 | if ( EFI_ERROR ( Status )) {\r | |
684 | break;\r | |
685 | }\r | |
686 | Status = HttpSendAnsiString ( SocketFD,\r | |
687 | pPort,\r | |
688 | "<br/>Address: " );\r | |
689 | if ( EFI_ERROR ( Status )) {\r | |
690 | break;\r | |
691 | }\r | |
692 | \r | |
693 | //\r | |
694 | // Add the web-page link if necessary\r | |
695 | //\r | |
696 | if ( NULL != pWebPage ) {\r | |
697 | Status = HttpSendAnsiString ( SocketFD,\r | |
698 | pPort,\r | |
699 | "<a target=\"_blank\" href=\"" );\r | |
700 | if ( EFI_ERROR ( Status )) {\r | |
701 | break;\r | |
702 | }\r | |
703 | Status = HttpSendUnicodeString ( SocketFD,\r | |
704 | pPort,\r | |
705 | pWebPage );\r | |
706 | if ( EFI_ERROR ( Status )) {\r | |
707 | break;\r | |
708 | }\r | |
709 | Status = HttpSendAnsiString ( SocketFD,\r | |
710 | pPort,\r | |
711 | "\">" );\r | |
712 | if ( EFI_ERROR ( Status )) {\r | |
713 | break;\r | |
714 | }\r | |
715 | }\r | |
716 | \r | |
717 | //\r | |
718 | // Display the address\r | |
719 | //\r | |
720 | Status = HttpSendAnsiString ( SocketFD,\r | |
721 | pPort,\r | |
722 | "0x" );\r | |
723 | if ( EFI_ERROR ( Status )) {\r | |
724 | break;\r | |
725 | }\r | |
726 | Status = HttpSendHexBits ( SocketFD,\r | |
727 | pPort,\r | |
728 | 64,\r | |
729 | pGenericAddress->Address );\r | |
730 | if ( EFI_ERROR ( Status )) {\r | |
731 | break;\r | |
732 | }\r | |
733 | \r | |
734 | //\r | |
735 | // Finish the web-page link if necessary\r | |
736 | //\r | |
737 | if ( NULL != pWebPage ) {\r | |
738 | Status = HttpSendAnsiString ( SocketFD,\r | |
739 | pPort,\r | |
740 | "</a>" );\r | |
741 | if ( EFI_ERROR ( Status )) {\r | |
742 | break;\r | |
743 | }\r | |
744 | }\r | |
745 | \r | |
746 | //\r | |
747 | // Terminate the row\r | |
748 | //\r | |
749 | Status = HttpSendAnsiString ( SocketFD,\r | |
750 | pPort,\r | |
751 | "</code></td></tr>\r\n" );\r | |
752 | break;\r | |
753 | }\r | |
754 | \r | |
755 | //\r | |
756 | // Return the operation status\r | |
757 | //\r | |
758 | return Status;\r | |
759 | }\r | |
760 | \r | |
761 | \r | |
762 | /**\r | |
763 | Translate a table address into a web page\r | |
764 | \r | |
765 | @param [in] pSignature Address of the table signature\r | |
766 | @param [out] ppTableName Address to receive the table name address\r | |
767 | \r | |
768 | @return Zero terminated web page address or NULL if not found\r | |
769 | \r | |
770 | **/\r | |
771 | CONST CHAR16 *\r | |
772 | SignatureLookup (\r | |
773 | IN UINT32 * pSignature,\r | |
774 | OUT CONST CHAR8 ** ppTableName\r | |
775 | )\r | |
776 | {\r | |
777 | CONST TABLE_SIGNATURE * pTableId;\r | |
778 | CONST TABLE_SIGNATURE * pEnd;\r | |
779 | UINT32 Signature;\r | |
780 | \r | |
781 | //\r | |
782 | // Walk the list of tables\r | |
783 | //\r | |
784 | Signature = *pSignature;\r | |
59bc0593 | 785 | pTableId = &mTableId[ 0 ];\r |
786 | pEnd = &pTableId[ sizeof ( mTableId ) / sizeof ( mTableId[ 0 ])];\r | |
7dc13291 | 787 | while ( pEnd > pTableId ) {\r |
788 | //\r | |
789 | // Attempt to locate the table signature\r | |
790 | //\r | |
791 | if ( pTableId->Signature == Signature ) {\r | |
792 | //\r | |
793 | // The signature was found\r | |
794 | // Return the web page\r | |
795 | //\r | |
796 | *ppTableName = pTableId->pTableName;\r | |
797 | return pTableId->pWebPage;\r | |
798 | }\r | |
799 | \r | |
800 | //\r | |
801 | // Set the next table\r | |
802 | //\r | |
803 | pTableId += 1;\r | |
804 | }\r | |
805 | \r | |
806 | //\r | |
807 | // The table was not found\r | |
808 | //\r | |
809 | *ppTableName = (CONST CHAR8 *)pSignature;\r | |
810 | return NULL;\r | |
811 | }\r | |
812 | \r | |
813 | \r | |
9f7f5161 | 814 | /**\r |
815 | Respond with the APIC table\r | |
816 | \r | |
817 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
818 | @param [in] pPort The WSDT_PORT structure address\r | |
819 | @param [out] pbDone Address to receive the request completion status\r | |
820 | \r | |
821 | @retval EFI_SUCCESS The request was successfully processed\r | |
822 | \r | |
823 | **/\r | |
824 | EFI_STATUS\r | |
825 | AcpiApicPage (\r | |
826 | IN int SocketFD,\r | |
827 | IN WSDT_PORT * pPort,\r | |
828 | OUT BOOLEAN * pbDone\r | |
829 | )\r | |
830 | {\r | |
831 | CONST ACPI_UNKNOWN * pApic;\r | |
832 | EFI_STATUS Status;\r | |
833 | \r | |
834 | DBG_ENTER ( );\r | |
835 | \r | |
836 | //\r | |
837 | // Send the APIC page\r | |
838 | //\r | |
839 | for ( ; ; ) {\r | |
840 | //\r | |
841 | // Locate the APIC\r | |
842 | //\r | |
843 | pApic = (ACPI_UNKNOWN *)LocateTable ( APIC_SIGNATURE );\r | |
844 | if ( NULL == pApic ) {\r | |
845 | Status = EFI_NOT_FOUND;\r | |
846 | break;\r | |
847 | }\r | |
848 | \r | |
849 | //\r | |
850 | // Send the page and table header\r | |
851 | //\r | |
852 | Status = TableHeader ( SocketFD, pPort, L"APIC Table", pApic );\r | |
853 | if ( EFI_ERROR ( Status )) {\r | |
854 | break;\r | |
855 | }\r | |
856 | \r | |
857 | //\r | |
858 | // Display the header\r | |
859 | //\r | |
860 | Status = RowAnsiArray ( SocketFD,\r | |
861 | pPort,\r | |
862 | "Signature",\r | |
863 | sizeof ( pApic->Signature ),\r | |
864 | (CHAR8 *)&pApic->Signature );\r | |
865 | if ( EFI_ERROR ( Status )) {\r | |
866 | break;\r | |
867 | }\r | |
868 | Status = RowDecimalValue ( SocketFD,\r | |
869 | pPort,\r | |
870 | "Length",\r | |
871 | pApic->Length );\r | |
872 | if ( EFI_ERROR ( Status )) {\r | |
873 | break;\r | |
874 | }\r | |
875 | \r | |
876 | //\r | |
877 | // Display the data from the table\r | |
878 | //\r | |
879 | Status = RowDump ( SocketFD,\r | |
880 | pPort,\r | |
881 | "Data",\r | |
882 | pApic->Length - sizeof ( *pApic ) + 1,\r | |
883 | (UINT8 *)( pApic + 1 ));\r | |
884 | if ( EFI_ERROR ( Status )) {\r | |
885 | break;\r | |
886 | }\r | |
887 | \r | |
888 | //\r | |
889 | // Build the table trailer\r | |
890 | //\r | |
891 | Status = TableTrailer ( SocketFD,\r | |
892 | pPort,\r | |
893 | pbDone );\r | |
894 | break;\r | |
895 | }\r | |
896 | \r | |
897 | //\r | |
898 | // Return the operation status\r | |
899 | //\r | |
900 | DBG_EXIT_STATUS ( Status );\r | |
901 | return Status;\r | |
902 | }\r | |
903 | \r | |
904 | \r | |
905 | /**\r | |
906 | Respond with the BGRT table\r | |
907 | \r | |
908 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
909 | @param [in] pPort The WSDT_PORT structure address\r | |
910 | @param [out] pbDone Address to receive the request completion status\r | |
911 | \r | |
912 | @retval EFI_SUCCESS The request was successfully processed\r | |
913 | \r | |
914 | **/\r | |
915 | EFI_STATUS\r | |
916 | AcpiBgrtPage (\r | |
917 | IN int SocketFD,\r | |
918 | IN WSDT_PORT * pPort,\r | |
919 | OUT BOOLEAN * pbDone\r | |
920 | )\r | |
921 | {\r | |
922 | CONST ACPI_UNKNOWN * pBgrt;\r | |
923 | EFI_STATUS Status;\r | |
924 | \r | |
925 | DBG_ENTER ( );\r | |
926 | \r | |
927 | //\r | |
928 | // Send the BGRT page\r | |
929 | //\r | |
930 | for ( ; ; ) {\r | |
931 | //\r | |
932 | // Locate the BGRT\r | |
933 | //\r | |
934 | pBgrt = (ACPI_UNKNOWN *)LocateTable ( BGRT_SIGNATURE );\r | |
935 | if ( NULL == pBgrt ) {\r | |
936 | Status = EFI_NOT_FOUND;\r | |
937 | break;\r | |
938 | }\r | |
939 | \r | |
940 | //\r | |
941 | // Send the page and table header\r | |
942 | //\r | |
943 | Status = TableHeader ( SocketFD, pPort, L"BGRT Table", pBgrt );\r | |
944 | if ( EFI_ERROR ( Status )) {\r | |
945 | break;\r | |
946 | }\r | |
947 | \r | |
948 | //\r | |
949 | // Display the header\r | |
950 | //\r | |
951 | Status = RowAnsiArray ( SocketFD,\r | |
952 | pPort,\r | |
953 | "Signature",\r | |
954 | sizeof ( pBgrt->Signature ),\r | |
955 | (CHAR8 *)&pBgrt->Signature );\r | |
956 | if ( EFI_ERROR ( Status )) {\r | |
957 | break;\r | |
958 | }\r | |
959 | Status = RowDecimalValue ( SocketFD,\r | |
960 | pPort,\r | |
961 | "Length",\r | |
962 | pBgrt->Length );\r | |
963 | if ( EFI_ERROR ( Status )) {\r | |
964 | break;\r | |
965 | }\r | |
966 | \r | |
967 | //\r | |
968 | // Display the data from the table\r | |
969 | //\r | |
970 | Status = RowDump ( SocketFD,\r | |
971 | pPort,\r | |
972 | "Data",\r | |
973 | pBgrt->Length - sizeof ( *pBgrt ) + 1,\r | |
974 | (UINT8 *)( pBgrt + 1 ));\r | |
975 | if ( EFI_ERROR ( Status )) {\r | |
976 | break;\r | |
977 | }\r | |
978 | \r | |
979 | //\r | |
980 | // Build the table trailer\r | |
981 | //\r | |
982 | Status = TableTrailer ( SocketFD,\r | |
983 | pPort,\r | |
984 | pbDone );\r | |
985 | break;\r | |
986 | }\r | |
987 | \r | |
988 | //\r | |
989 | // Return the operation status\r | |
990 | //\r | |
991 | DBG_EXIT_STATUS ( Status );\r | |
992 | return Status;\r | |
993 | }\r | |
994 | \r | |
995 | \r | |
7dc13291 | 996 | /**\r |
997 | Respond with the ACPI DSDT table\r | |
998 | \r | |
999 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1000 | @param [in] pPort The WSDT_PORT structure address\r | |
1001 | @param [out] pbDone Address to receive the request completion status\r | |
1002 | \r | |
1003 | @retval EFI_SUCCESS The request was successfully processed\r | |
1004 | \r | |
1005 | **/\r | |
1006 | EFI_STATUS\r | |
1007 | AcpiDsdtPage (\r | |
1008 | IN int SocketFD,\r | |
1009 | IN WSDT_PORT * pPort,\r | |
1010 | OUT BOOLEAN * pbDone\r | |
1011 | )\r | |
1012 | {\r | |
1013 | CONST ACPI_DSDT * pDsdt;\r | |
1014 | CONST ACPI_FADT * pFadt;\r | |
1015 | EFI_STATUS Status;\r | |
1016 | \r | |
1017 | DBG_ENTER ( );\r | |
1018 | \r | |
1019 | //\r | |
1020 | // Send the DADT page\r | |
1021 | //\r | |
1022 | for ( ; ; ) {\r | |
1023 | //\r | |
1024 | // Locate the DADT\r | |
1025 | //\r | |
1026 | pFadt = (ACPI_FADT *)LocateTable ( FADT_SIGNATURE );\r | |
1027 | if ( NULL == pFadt ) {\r | |
1028 | Status = EFI_NOT_FOUND;\r | |
1029 | break;\r | |
1030 | }\r | |
d3a595ce | 1031 | pDsdt = (VOID *)(UINTN)pFadt->XDsdt;\r |
7dc13291 | 1032 | \r |
1033 | //\r | |
1034 | // Send the page and table header\r | |
1035 | //\r | |
1036 | Status = TableHeader ( SocketFD, pPort, L"DSDT - Differentiated System Description Table", pDsdt );\r | |
1037 | if ( EFI_ERROR ( Status )) {\r | |
1038 | break;\r | |
1039 | }\r | |
1040 | \r | |
1041 | //\r | |
1042 | // Display the DSDT header\r | |
1043 | //\r | |
1044 | Status = RowAnsiArray ( SocketFD,\r | |
1045 | pPort,\r | |
1046 | "Signature",\r | |
1047 | sizeof ( pDsdt->Signature ),\r | |
1048 | (CHAR8 *)&pDsdt->Signature );\r | |
1049 | if ( EFI_ERROR ( Status )) {\r | |
1050 | break;\r | |
1051 | }\r | |
1052 | Status = RowDecimalValue ( SocketFD,\r | |
1053 | pPort,\r | |
1054 | "Length",\r | |
1055 | pDsdt->Length );\r | |
1056 | if ( EFI_ERROR ( Status )) {\r | |
1057 | break;\r | |
1058 | }\r | |
1059 | Status = RowDecimalValue ( SocketFD,\r | |
1060 | pPort,\r | |
1061 | "Revision",\r | |
1062 | pDsdt->Revision );\r | |
1063 | if ( EFI_ERROR ( Status )) {\r | |
1064 | break;\r | |
1065 | }\r | |
1066 | Status = RowHexValue ( SocketFD,\r | |
1067 | pPort,\r | |
1068 | "Checksum",\r | |
1069 | pDsdt->Checksum,\r | |
1070 | NULL );\r | |
1071 | if ( EFI_ERROR ( Status )) {\r | |
1072 | break;\r | |
1073 | }\r | |
1074 | Status = RowAnsiArray ( SocketFD,\r | |
1075 | pPort,\r | |
1076 | "OEMID",\r | |
1077 | sizeof ( pDsdt->OemId ),\r | |
d3a595ce | 1078 | (CONST CHAR8 *)&pDsdt->OemId[ 0 ]);\r |
7dc13291 | 1079 | if ( EFI_ERROR ( Status )) {\r |
1080 | break;\r | |
1081 | }\r | |
1082 | Status = RowAnsiArray ( SocketFD,\r | |
1083 | pPort,\r | |
1084 | "OEM Table ID",\r | |
1085 | sizeof ( pDsdt->OemTableId ),\r | |
d3a595ce | 1086 | (CONST CHAR8 *)&pDsdt->OemTableId[ 0 ]);\r |
7dc13291 | 1087 | if ( EFI_ERROR ( Status )) {\r |
1088 | break;\r | |
1089 | }\r | |
1090 | Status = RowRevision ( SocketFD,\r | |
1091 | pPort,\r | |
1092 | "OEM Revision",\r | |
1093 | pDsdt->OemRevision );\r | |
1094 | if ( EFI_ERROR ( Status )) {\r | |
1095 | break;\r | |
1096 | }\r | |
1097 | Status = RowAnsiArray ( SocketFD,\r | |
1098 | pPort,\r | |
1099 | "Creator ID",\r | |
1100 | sizeof ( pDsdt->CreatorId ),\r | |
1101 | (CHAR8 *)&pDsdt->CreatorId );\r | |
1102 | if ( EFI_ERROR ( Status )) {\r | |
1103 | break;\r | |
1104 | }\r | |
1105 | Status = RowRevision ( SocketFD,\r | |
1106 | pPort,\r | |
1107 | "Creator Revision",\r | |
1108 | pDsdt->CreatorRevision );\r | |
1109 | if ( EFI_ERROR ( Status )) {\r | |
1110 | break;\r | |
1111 | }\r | |
1112 | \r | |
1113 | //\r | |
1114 | // Display the data from the DSDT\r | |
1115 | //\r | |
1116 | Status = RowDump ( SocketFD,\r | |
1117 | pPort,\r | |
1118 | "Definition Block",\r | |
1119 | pDsdt->Length - sizeof ( *pDsdt ) + 1,\r | |
1120 | &pDsdt->DefinitionBlock[0]);\r | |
1121 | if ( EFI_ERROR ( Status )) {\r | |
1122 | break;\r | |
1123 | }\r | |
1124 | \r | |
1125 | //\r | |
1126 | // Build the table trailer\r | |
1127 | //\r | |
1128 | Status = TableTrailer ( SocketFD,\r | |
1129 | pPort,\r | |
1130 | pbDone );\r | |
1131 | break;\r | |
1132 | }\r | |
1133 | \r | |
1134 | //\r | |
1135 | // Return the operation status\r | |
1136 | //\r | |
1137 | DBG_EXIT_STATUS ( Status );\r | |
1138 | return Status;\r | |
1139 | }\r | |
1140 | \r | |
1141 | \r | |
1142 | /**\r | |
1143 | Respond with the ACPI FADT table\r | |
1144 | \r | |
1145 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1146 | @param [in] pPort The WSDT_PORT structure address\r | |
1147 | @param [out] pbDone Address to receive the request completion status\r | |
1148 | \r | |
1149 | @retval EFI_SUCCESS The request was successfully processed\r | |
1150 | \r | |
1151 | **/\r | |
1152 | EFI_STATUS\r | |
1153 | AcpiFadtPage (\r | |
1154 | IN int SocketFD,\r | |
1155 | IN WSDT_PORT * pPort,\r | |
1156 | OUT BOOLEAN * pbDone\r | |
1157 | )\r | |
1158 | {\r | |
1159 | CONST ACPI_FADT * pFadt;\r | |
1160 | EFI_STATUS Status;\r | |
1161 | \r | |
1162 | DBG_ENTER ( );\r | |
1163 | \r | |
1164 | //\r | |
1165 | // Send the FADT page\r | |
1166 | //\r | |
1167 | for ( ; ; ) {\r | |
1168 | //\r | |
1169 | // Locate the FADT\r | |
1170 | //\r | |
1171 | pFadt = (ACPI_FADT *)LocateTable ( FADT_SIGNATURE );\r | |
1172 | if ( NULL == pFadt ) {\r | |
1173 | Status = EFI_NOT_FOUND;\r | |
1174 | break;\r | |
1175 | }\r | |
1176 | \r | |
1177 | //\r | |
1178 | // Send the page and table header\r | |
1179 | //\r | |
1180 | Status = TableHeader ( SocketFD, pPort, L"FADT - Fixed ACPI Description Table", pFadt );\r | |
1181 | if ( EFI_ERROR ( Status )) {\r | |
1182 | break;\r | |
1183 | }\r | |
1184 | \r | |
1185 | //\r | |
1186 | // Display the FSDT header\r | |
1187 | //\r | |
1188 | Status = RowAnsiArray ( SocketFD,\r | |
1189 | pPort,\r | |
1190 | "Signature",\r | |
1191 | sizeof ( pFadt->Signature ),\r | |
1192 | (CHAR8 *)&pFadt->Signature );\r | |
1193 | if ( EFI_ERROR ( Status )) {\r | |
1194 | break;\r | |
1195 | }\r | |
1196 | Status = RowDecimalValue ( SocketFD,\r | |
1197 | pPort,\r | |
1198 | "Length",\r | |
1199 | pFadt->Length );\r | |
1200 | if ( EFI_ERROR ( Status )) {\r | |
1201 | break;\r | |
1202 | }\r | |
1203 | Status = RowDecimalValue ( SocketFD,\r | |
1204 | pPort,\r | |
1205 | "Revision",\r | |
1206 | pFadt->Revision );\r | |
1207 | if ( EFI_ERROR ( Status )) {\r | |
1208 | break;\r | |
1209 | }\r | |
1210 | Status = RowHexValue ( SocketFD,\r | |
1211 | pPort,\r | |
1212 | "Checksum",\r | |
1213 | pFadt->Checksum,\r | |
1214 | NULL );\r | |
1215 | if ( EFI_ERROR ( Status )) {\r | |
1216 | break;\r | |
1217 | }\r | |
1218 | Status = RowAnsiArray ( SocketFD,\r | |
1219 | pPort,\r | |
1220 | "OEMID",\r | |
1221 | sizeof ( pFadt->OemId ),\r | |
d3a595ce | 1222 | (CONST CHAR8 *)&pFadt->OemId[ 0 ]);\r |
7dc13291 | 1223 | if ( EFI_ERROR ( Status )) {\r |
1224 | break;\r | |
1225 | }\r | |
1226 | Status = RowAnsiArray ( SocketFD,\r | |
1227 | pPort,\r | |
1228 | "OEM Table ID",\r | |
1229 | sizeof ( pFadt->OemTableId ),\r | |
d3a595ce | 1230 | (CONST CHAR8 *)&pFadt->OemTableId[ 0 ]);\r |
7dc13291 | 1231 | if ( EFI_ERROR ( Status )) {\r |
1232 | break;\r | |
1233 | }\r | |
1234 | Status = RowRevision ( SocketFD,\r | |
1235 | pPort,\r | |
1236 | "OEM Revision",\r | |
1237 | pFadt->OemRevision );\r | |
1238 | if ( EFI_ERROR ( Status )) {\r | |
1239 | break;\r | |
1240 | }\r | |
1241 | Status = RowAnsiArray ( SocketFD,\r | |
1242 | pPort,\r | |
1243 | "Creator ID",\r | |
1244 | sizeof ( pFadt->CreatorId ),\r | |
1245 | (CHAR8 *)&pFadt->CreatorId );\r | |
1246 | if ( EFI_ERROR ( Status )) {\r | |
1247 | break;\r | |
1248 | }\r | |
1249 | Status = RowRevision ( SocketFD,\r | |
1250 | pPort,\r | |
1251 | "Creator Revision",\r | |
1252 | pFadt->CreatorRevision );\r | |
1253 | if ( EFI_ERROR ( Status )) {\r | |
1254 | break;\r | |
1255 | }\r | |
1256 | \r | |
1257 | //\r | |
1258 | // Display the data from the FADT\r | |
1259 | //\r | |
1260 | Status = RowPointer ( SocketFD,\r | |
1261 | pPort,\r | |
1262 | "FIRMWARE_CTRL",\r | |
53c31c51 | 1263 | (CONST VOID *)(UINTN)pFadt->FirmwareCtrl,\r |
7dc13291 | 1264 | NULL );\r |
1265 | if ( EFI_ERROR ( Status )) {\r | |
1266 | break;\r | |
1267 | }\r | |
1268 | Status = RowPointer ( SocketFD,\r | |
1269 | pPort,\r | |
1270 | "DSDT",\r | |
53c31c51 | 1271 | (CONST VOID *)(UINTN)pFadt->DSDT,\r |
7dc13291 | 1272 | ( pFadt->DSDT == pFadt->XDsdt ) ? PAGE_ACPI_DSDT : NULL );\r |
1273 | if ( EFI_ERROR ( Status )) {\r | |
1274 | break;\r | |
1275 | }\r | |
1276 | Status = RowHexValue ( SocketFD,\r | |
1277 | pPort,\r | |
1278 | "Reserved",\r | |
1279 | pFadt->Reserved,\r | |
1280 | NULL );\r | |
1281 | if ( EFI_ERROR ( Status )) {\r | |
1282 | break;\r | |
1283 | }\r | |
1284 | Status = RowHexValue ( SocketFD,\r | |
1285 | pPort,\r | |
1286 | "Preferred_PM_Profile",\r | |
1287 | pFadt->PreferredPmProfile,\r | |
1288 | NULL );\r | |
1289 | if ( EFI_ERROR ( Status )) {\r | |
1290 | break;\r | |
1291 | }\r | |
1292 | Status = RowHexValue ( SocketFD,\r | |
1293 | pPort,\r | |
1294 | "SCI_INT",\r | |
1295 | pFadt->SciInt,\r | |
1296 | NULL );\r | |
1297 | if ( EFI_ERROR ( Status )) {\r | |
1298 | break;\r | |
1299 | }\r | |
1300 | Status = RowHexValue ( SocketFD,\r | |
1301 | pPort,\r | |
1302 | "SMI_CMD",\r | |
1303 | pFadt->SmiCmd,\r | |
1304 | NULL );\r | |
1305 | if ( EFI_ERROR ( Status )) {\r | |
1306 | break;\r | |
1307 | }\r | |
1308 | Status = RowHexValue ( SocketFD,\r | |
1309 | pPort,\r | |
1310 | "ACPI_ENABLE",\r | |
1311 | pFadt->AcpiEnable,\r | |
1312 | NULL );\r | |
1313 | if ( EFI_ERROR ( Status )) {\r | |
1314 | break;\r | |
1315 | }\r | |
1316 | Status = RowHexValue ( SocketFD,\r | |
1317 | pPort,\r | |
1318 | "ACPI_DISABLE",\r | |
1319 | pFadt->AcpiDisable,\r | |
1320 | NULL );\r | |
1321 | if ( EFI_ERROR ( Status )) {\r | |
1322 | break;\r | |
1323 | }\r | |
1324 | Status = RowHexValue ( SocketFD,\r | |
1325 | pPort,\r | |
1326 | "S4BIOS_REQ",\r | |
1327 | pFadt->S4BiosReq,\r | |
1328 | NULL );\r | |
1329 | if ( EFI_ERROR ( Status )) {\r | |
1330 | break;\r | |
1331 | }\r | |
1332 | Status = RowHexValue ( SocketFD,\r | |
1333 | pPort,\r | |
1334 | "PSTATE_CNT",\r | |
1335 | pFadt->PStateCnt,\r | |
1336 | NULL );\r | |
1337 | if ( EFI_ERROR ( Status )) {\r | |
1338 | break;\r | |
1339 | }\r | |
1340 | Status = RowHexValue ( SocketFD,\r | |
1341 | pPort,\r | |
1342 | "PM1a_EVT_BLK",\r | |
1343 | pFadt->Pm1aEvtBlk,\r | |
1344 | NULL );\r | |
1345 | if ( EFI_ERROR ( Status )) {\r | |
1346 | break;\r | |
1347 | }\r | |
1348 | Status = RowHexValue ( SocketFD,\r | |
1349 | pPort,\r | |
1350 | "PM1b_EVT_BLK",\r | |
1351 | pFadt->Pm1bEvtBlk,\r | |
1352 | NULL );\r | |
1353 | if ( EFI_ERROR ( Status )) {\r | |
1354 | break;\r | |
1355 | }\r | |
1356 | Status = RowHexValue ( SocketFD,\r | |
1357 | pPort,\r | |
1358 | "PM1a_CNT_BLK",\r | |
1359 | pFadt->Pm1aCntBlk,\r | |
1360 | NULL );\r | |
1361 | if ( EFI_ERROR ( Status )) {\r | |
1362 | break;\r | |
1363 | }\r | |
1364 | Status = RowHexValue ( SocketFD,\r | |
1365 | pPort,\r | |
1366 | "PM1b_CNT_BLK",\r | |
1367 | pFadt->Pm1bCntBlk,\r | |
1368 | NULL );\r | |
1369 | if ( EFI_ERROR ( Status )) {\r | |
1370 | break;\r | |
1371 | }\r | |
1372 | Status = RowHexValue ( SocketFD,\r | |
1373 | pPort,\r | |
1374 | "PM2_CNT_BLK",\r | |
1375 | pFadt->Pm2CntBlk,\r | |
1376 | NULL );\r | |
1377 | if ( EFI_ERROR ( Status )) {\r | |
1378 | break;\r | |
1379 | }\r | |
1380 | Status = RowHexValue ( SocketFD,\r | |
1381 | pPort,\r | |
1382 | "PM_TMR_BLK",\r | |
1383 | pFadt->PmTmrBlk,\r | |
1384 | NULL );\r | |
1385 | if ( EFI_ERROR ( Status )) {\r | |
1386 | break;\r | |
1387 | }\r | |
1388 | \r | |
1389 | Status = RowHexValue ( SocketFD,\r | |
1390 | pPort,\r | |
1391 | "GPE0_BLK",\r | |
1392 | pFadt->Gpe0Blk,\r | |
1393 | NULL );\r | |
1394 | if ( EFI_ERROR ( Status )) {\r | |
1395 | break;\r | |
1396 | }\r | |
1397 | Status = RowHexValue ( SocketFD,\r | |
1398 | pPort,\r | |
1399 | "GPE1_BLK",\r | |
1400 | pFadt->Gpe1Blk,\r | |
1401 | NULL );\r | |
1402 | if ( EFI_ERROR ( Status )) {\r | |
1403 | break;\r | |
1404 | }\r | |
1405 | Status = RowDecimalValue ( SocketFD,\r | |
1406 | pPort,\r | |
1407 | "PM1_EVT_LEN",\r | |
1408 | pFadt->Pm1EvtLen );\r | |
1409 | if ( EFI_ERROR ( Status )) {\r | |
1410 | break;\r | |
1411 | }\r | |
1412 | Status = RowDecimalValue ( SocketFD,\r | |
1413 | pPort,\r | |
1414 | "PM1_CNT_LEN",\r | |
1415 | pFadt->Pm1CntLen );\r | |
1416 | if ( EFI_ERROR ( Status )) {\r | |
1417 | break;\r | |
1418 | }\r | |
1419 | Status = RowDecimalValue ( SocketFD,\r | |
1420 | pPort,\r | |
1421 | "PM2_CNT_LEN",\r | |
1422 | pFadt->PM2CntLen );\r | |
1423 | if ( EFI_ERROR ( Status )) {\r | |
1424 | break;\r | |
1425 | }\r | |
1426 | Status = RowDecimalValue ( SocketFD,\r | |
1427 | pPort,\r | |
1428 | "PM_TMR_LEN",\r | |
1429 | pFadt->PmTmrLen );\r | |
1430 | if ( EFI_ERROR ( Status )) {\r | |
1431 | break;\r | |
1432 | }\r | |
1433 | Status = RowDecimalValue ( SocketFD,\r | |
1434 | pPort,\r | |
1435 | "GPE0_BLK_LEN",\r | |
1436 | pFadt->Gpe0BlkLen );\r | |
1437 | if ( EFI_ERROR ( Status )) {\r | |
1438 | break;\r | |
1439 | }\r | |
1440 | Status = RowDecimalValue ( SocketFD,\r | |
1441 | pPort,\r | |
1442 | "GPE1_BLK_LEN",\r | |
1443 | pFadt->Gpe1BlkLen );\r | |
1444 | if ( EFI_ERROR ( Status )) {\r | |
1445 | break;\r | |
1446 | }\r | |
1447 | Status = RowHexValue ( SocketFD,\r | |
1448 | pPort,\r | |
1449 | "GPE1_BASE",\r | |
1450 | pFadt->Gpe1Base,\r | |
1451 | NULL );\r | |
1452 | if ( EFI_ERROR ( Status )) {\r | |
1453 | break;\r | |
1454 | }\r | |
1455 | Status = RowDecimalValue ( SocketFD,\r | |
1456 | pPort,\r | |
1457 | "CST_CNT",\r | |
1458 | pFadt->CstCnt );\r | |
1459 | if ( EFI_ERROR ( Status )) {\r | |
1460 | break;\r | |
1461 | }\r | |
1462 | Status = RowHexValue ( SocketFD,\r | |
1463 | pPort,\r | |
1464 | "P_LVL2_LAT",\r | |
1465 | pFadt->PLvl2Lat,\r | |
1466 | NULL );\r | |
1467 | if ( EFI_ERROR ( Status )) {\r | |
1468 | break;\r | |
1469 | }\r | |
1470 | Status = RowHexValue ( SocketFD,\r | |
1471 | pPort,\r | |
1472 | "P_LVL3_LAT",\r | |
1473 | pFadt->PLvl3Lat,\r | |
1474 | NULL );\r | |
1475 | if ( EFI_ERROR ( Status )) {\r | |
1476 | break;\r | |
1477 | }\r | |
1478 | Status = RowDecimalValue ( SocketFD,\r | |
1479 | pPort,\r | |
1480 | "FLUSH_SIZE",\r | |
1481 | pFadt->FlushSize );\r | |
1482 | if ( EFI_ERROR ( Status )) {\r | |
1483 | break;\r | |
1484 | }\r | |
1485 | Status = RowDecimalValue ( SocketFD,\r | |
1486 | pPort,\r | |
1487 | "FLUSH_Stride",\r | |
1488 | pFadt->FlushStride );\r | |
1489 | if ( EFI_ERROR ( Status )) {\r | |
1490 | break;\r | |
1491 | }\r | |
1492 | Status = RowHexValue ( SocketFD,\r | |
1493 | pPort,\r | |
1494 | "DUTY_OFFSET",\r | |
1495 | pFadt->DutyOffset,\r | |
1496 | NULL );\r | |
1497 | if ( EFI_ERROR ( Status )) {\r | |
1498 | break;\r | |
1499 | }\r | |
1500 | Status = RowHexValue ( SocketFD,\r | |
1501 | pPort,\r | |
1502 | "DUTY_WIDTH",\r | |
1503 | pFadt->DutyWidth,\r | |
1504 | NULL );\r | |
1505 | if ( EFI_ERROR ( Status )) {\r | |
1506 | break;\r | |
1507 | }\r | |
1508 | Status = RowHexValue ( SocketFD,\r | |
1509 | pPort,\r | |
1510 | "DAY_ALRM",\r | |
1511 | pFadt->DayAlrm,\r | |
1512 | NULL );\r | |
1513 | if ( EFI_ERROR ( Status )) {\r | |
1514 | break;\r | |
1515 | }\r | |
1516 | Status = RowHexValue ( SocketFD,\r | |
1517 | pPort,\r | |
1518 | "MON_ALRM",\r | |
1519 | pFadt->MonAlrm,\r | |
1520 | NULL );\r | |
1521 | if ( EFI_ERROR ( Status )) {\r | |
1522 | break;\r | |
1523 | }\r | |
1524 | Status = RowHexValue ( SocketFD,\r | |
1525 | pPort,\r | |
1526 | "CENTURY",\r | |
1527 | pFadt->Century,\r | |
1528 | NULL );\r | |
1529 | if ( EFI_ERROR ( Status )) {\r | |
1530 | break;\r | |
1531 | }\r | |
1532 | Status = RowHexValue ( SocketFD,\r | |
1533 | pPort,\r | |
1534 | "IAPC_BOOT_ARCH",\r | |
1535 | pFadt->IapcBootArch,\r | |
1536 | NULL );\r | |
1537 | if ( EFI_ERROR ( Status )) {\r | |
1538 | break;\r | |
1539 | }\r | |
1540 | Status = RowHexValue ( SocketFD,\r | |
1541 | pPort,\r | |
1542 | "Reserved",\r | |
1543 | pFadt->Reserved2,\r | |
1544 | NULL );\r | |
1545 | if ( EFI_ERROR ( Status )) {\r | |
1546 | break;\r | |
1547 | }\r | |
1548 | Status = RowHexValue ( SocketFD,\r | |
1549 | pPort,\r | |
1550 | "Flags",\r | |
1551 | pFadt->Flags,\r | |
1552 | NULL );\r | |
1553 | if ( EFI_ERROR ( Status )) {\r | |
1554 | break;\r | |
1555 | }\r | |
1556 | Status = RowGenericAddress ( SocketFD,\r | |
1557 | pPort,\r | |
1558 | "RESET_REG",\r | |
1559 | &pFadt->ResetReg[0],\r | |
1560 | NULL );\r | |
1561 | if ( EFI_ERROR ( Status )) {\r | |
1562 | break;\r | |
1563 | }\r | |
1564 | Status = RowHexValue ( SocketFD,\r | |
1565 | pPort,\r | |
1566 | "RESET_VALUE",\r | |
1567 | pFadt->ResetValue,\r | |
1568 | NULL );\r | |
1569 | if ( EFI_ERROR ( Status )) {\r | |
1570 | break;\r | |
1571 | }\r | |
1572 | Status = RowHexValue ( SocketFD,\r | |
1573 | pPort,\r | |
1574 | "Reserved",\r | |
1575 | pFadt->Reserved3[0],\r | |
1576 | NULL );\r | |
1577 | if ( EFI_ERROR ( Status )) {\r | |
1578 | break;\r | |
1579 | }\r | |
1580 | Status = RowHexValue ( SocketFD,\r | |
1581 | pPort,\r | |
1582 | "Reserved",\r | |
1583 | pFadt->Reserved3[1],\r | |
1584 | NULL );\r | |
1585 | if ( EFI_ERROR ( Status )) {\r | |
1586 | break;\r | |
1587 | }\r | |
1588 | Status = RowHexValue ( SocketFD,\r | |
1589 | pPort,\r | |
1590 | "Reserved",\r | |
1591 | pFadt->Reserved3[2],\r | |
1592 | NULL );\r | |
1593 | if ( EFI_ERROR ( Status )) {\r | |
1594 | break;\r | |
1595 | }\r | |
1596 | Status = RowHexValue ( SocketFD,\r | |
1597 | pPort,\r | |
1598 | "X_FIRMWARE_CTRL",\r | |
1599 | pFadt->XFirmwareCtrl,\r | |
1600 | NULL );\r | |
1601 | if ( EFI_ERROR ( Status )) {\r | |
1602 | break;\r | |
1603 | }\r | |
1604 | Status = RowHexValue ( SocketFD,\r | |
1605 | pPort,\r | |
1606 | "X_DSDT",\r | |
1607 | pFadt->XDsdt,\r | |
1608 | PAGE_ACPI_DSDT );\r | |
1609 | if ( EFI_ERROR ( Status )) {\r | |
1610 | break;\r | |
1611 | }\r | |
1612 | Status = RowGenericAddress ( SocketFD,\r | |
1613 | pPort,\r | |
1614 | "X_PM1a_EVT_BLK",\r | |
1615 | &pFadt->XPm1aEvtBlk[0],\r | |
1616 | NULL );\r | |
1617 | if ( EFI_ERROR ( Status )) {\r | |
1618 | break;\r | |
1619 | }\r | |
1620 | Status = RowGenericAddress ( SocketFD,\r | |
1621 | pPort,\r | |
1622 | "X_PM1b_EVT_BLK",\r | |
1623 | &pFadt->XPm1bEvtBlk[0],\r | |
1624 | NULL );\r | |
1625 | if ( EFI_ERROR ( Status )) {\r | |
1626 | break;\r | |
1627 | }\r | |
1628 | Status = RowGenericAddress ( SocketFD,\r | |
1629 | pPort,\r | |
1630 | "X_PM1a_CNT_BLK",\r | |
1631 | &pFadt->XPm1aCntBlk[0],\r | |
1632 | NULL );\r | |
1633 | if ( EFI_ERROR ( Status )) {\r | |
1634 | break;\r | |
1635 | }\r | |
1636 | Status = RowGenericAddress ( SocketFD,\r | |
1637 | pPort,\r | |
1638 | "X_PM1b_CNT_BLK",\r | |
1639 | &pFadt->XPm1bCntBlk[0],\r | |
1640 | NULL );\r | |
1641 | if ( EFI_ERROR ( Status )) {\r | |
1642 | break;\r | |
1643 | }\r | |
1644 | Status = RowGenericAddress ( SocketFD,\r | |
1645 | pPort,\r | |
1646 | "X_PM2_CNT_BLK",\r | |
1647 | &pFadt->XPm2CntBlk[0],\r | |
1648 | NULL );\r | |
1649 | if ( EFI_ERROR ( Status )) {\r | |
1650 | break;\r | |
1651 | }\r | |
1652 | Status = RowGenericAddress ( SocketFD,\r | |
1653 | pPort,\r | |
1654 | "X_PM_TMR_BLK",\r | |
1655 | &pFadt->XPmTmrBlk[0],\r | |
1656 | NULL );\r | |
1657 | if ( EFI_ERROR ( Status )) {\r | |
1658 | break;\r | |
1659 | }\r | |
1660 | Status = RowGenericAddress ( SocketFD,\r | |
1661 | pPort,\r | |
1662 | "X_GPE0_BLK",\r | |
1663 | &pFadt->XGpe0Blk[0],\r | |
1664 | NULL );\r | |
1665 | if ( EFI_ERROR ( Status )) {\r | |
1666 | break;\r | |
1667 | }\r | |
1668 | Status = RowGenericAddress ( SocketFD,\r | |
1669 | pPort,\r | |
1670 | "X_GPE1_BLK",\r | |
1671 | &pFadt->XGpe1Blk[0],\r | |
1672 | NULL );\r | |
1673 | if ( EFI_ERROR ( Status )) {\r | |
1674 | break;\r | |
1675 | }\r | |
1676 | \r | |
1677 | //\r | |
1678 | // Build the table trailer\r | |
1679 | //\r | |
1680 | Status = TableTrailer ( SocketFD,\r | |
1681 | pPort,\r | |
1682 | pbDone );\r | |
1683 | break;\r | |
1684 | }\r | |
1685 | \r | |
1686 | //\r | |
1687 | // Return the operation status\r | |
1688 | //\r | |
1689 | DBG_EXIT_STATUS ( Status );\r | |
1690 | return Status;\r | |
1691 | }\r | |
1692 | \r | |
1693 | \r | |
1694 | /**\r | |
9f7f5161 | 1695 | Respond with the HPET table\r |
7dc13291 | 1696 | \r |
1697 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1698 | @param [in] pPort The WSDT_PORT structure address\r | |
1699 | @param [out] pbDone Address to receive the request completion status\r | |
1700 | \r | |
1701 | @retval EFI_SUCCESS The request was successfully processed\r | |
1702 | \r | |
1703 | **/\r | |
1704 | EFI_STATUS\r | |
9f7f5161 | 1705 | AcpiHpetPage (\r |
7dc13291 | 1706 | IN int SocketFD,\r |
1707 | IN WSDT_PORT * pPort,\r | |
1708 | OUT BOOLEAN * pbDone\r | |
1709 | )\r | |
1710 | {\r | |
9f7f5161 | 1711 | CONST ACPI_UNKNOWN * pHpet;\r |
7dc13291 | 1712 | EFI_STATUS Status;\r |
1713 | \r | |
1714 | DBG_ENTER ( );\r | |
1715 | \r | |
1716 | //\r | |
9f7f5161 | 1717 | // Send the HPET page\r |
7dc13291 | 1718 | //\r |
1719 | for ( ; ; ) {\r | |
1720 | //\r | |
9f7f5161 | 1721 | // Locate the HPET\r |
7dc13291 | 1722 | //\r |
9f7f5161 | 1723 | pHpet = (ACPI_UNKNOWN *)LocateTable ( HPET_SIGNATURE );\r |
1724 | if ( NULL == pHpet ) {\r | |
1725 | Status = EFI_NOT_FOUND;\r | |
7dc13291 | 1726 | break;\r |
1727 | }\r | |
1728 | \r | |
1729 | //\r | |
1730 | // Send the page and table header\r | |
1731 | //\r | |
9f7f5161 | 1732 | Status = TableHeader ( SocketFD, pPort, L"HPET Table", pHpet );\r |
7dc13291 | 1733 | if ( EFI_ERROR ( Status )) {\r |
1734 | break;\r | |
1735 | }\r | |
1736 | \r | |
1737 | //\r | |
9f7f5161 | 1738 | // Display the header\r |
7dc13291 | 1739 | //\r |
1740 | Status = RowAnsiArray ( SocketFD,\r | |
1741 | pPort,\r | |
1742 | "Signature",\r | |
9f7f5161 | 1743 | sizeof ( pHpet->Signature ),\r |
1744 | (CHAR8 *)&pHpet->Signature );\r | |
7dc13291 | 1745 | if ( EFI_ERROR ( Status )) {\r |
1746 | break;\r | |
1747 | }\r | |
9f7f5161 | 1748 | Status = RowDecimalValue ( SocketFD,\r |
1749 | pPort,\r | |
1750 | "Length",\r | |
1751 | pHpet->Length );\r | |
7dc13291 | 1752 | if ( EFI_ERROR ( Status )) {\r |
1753 | break;\r | |
1754 | }\r | |
9f7f5161 | 1755 | \r |
1756 | //\r | |
1757 | // Display the data from the table\r | |
1758 | //\r | |
1759 | Status = RowDump ( SocketFD,\r | |
1760 | pPort,\r | |
1761 | "Data",\r | |
1762 | pHpet->Length - sizeof ( *pHpet ) + 1,\r | |
1763 | (UINT8 *)( pHpet + 1 ));\r | |
7dc13291 | 1764 | if ( EFI_ERROR ( Status )) {\r |
1765 | break;\r | |
1766 | }\r | |
1767 | \r | |
1768 | //\r | |
1769 | // Build the table trailer\r | |
1770 | //\r | |
1771 | Status = TableTrailer ( SocketFD,\r | |
1772 | pPort,\r | |
1773 | pbDone );\r | |
1774 | break;\r | |
1775 | }\r | |
1776 | \r | |
1777 | //\r | |
1778 | // Return the operation status\r | |
1779 | //\r | |
1780 | DBG_EXIT_STATUS ( Status );\r | |
1781 | return Status;\r | |
1782 | }\r | |
1783 | \r | |
1784 | \r | |
1785 | /**\r | |
9f7f5161 | 1786 | Respond with the MCFG table\r |
7dc13291 | 1787 | \r |
1788 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1789 | @param [in] pPort The WSDT_PORT structure address\r | |
1790 | @param [out] pbDone Address to receive the request completion status\r | |
1791 | \r | |
1792 | @retval EFI_SUCCESS The request was successfully processed\r | |
1793 | \r | |
1794 | **/\r | |
1795 | EFI_STATUS\r | |
9f7f5161 | 1796 | AcpiMcfgPage (\r |
7dc13291 | 1797 | IN int SocketFD,\r |
1798 | IN WSDT_PORT * pPort,\r | |
1799 | OUT BOOLEAN * pbDone\r | |
1800 | )\r | |
1801 | {\r | |
9f7f5161 | 1802 | CONST ACPI_UNKNOWN * pMcfg;\r |
7dc13291 | 1803 | EFI_STATUS Status;\r |
1804 | \r | |
1805 | DBG_ENTER ( );\r | |
1806 | \r | |
1807 | //\r | |
9f7f5161 | 1808 | // Send the MCFG page\r |
7dc13291 | 1809 | //\r |
1810 | for ( ; ; ) {\r | |
1811 | //\r | |
9f7f5161 | 1812 | // Locate the MCFG\r |
7dc13291 | 1813 | //\r |
9f7f5161 | 1814 | pMcfg = (ACPI_UNKNOWN *)LocateTable ( MCFG_SIGNATURE );\r |
1815 | if ( NULL == pMcfg ) {\r | |
1816 | Status = EFI_NOT_FOUND;\r | |
7dc13291 | 1817 | break;\r |
1818 | }\r | |
1819 | \r | |
1820 | //\r | |
1821 | // Send the page and table header\r | |
1822 | //\r | |
9f7f5161 | 1823 | Status = TableHeader ( SocketFD, pPort, L"MCFG Table", pMcfg );\r |
7dc13291 | 1824 | if ( EFI_ERROR ( Status )) {\r |
1825 | break;\r | |
1826 | }\r | |
1827 | \r | |
1828 | //\r | |
9f7f5161 | 1829 | // Display the header\r |
7dc13291 | 1830 | //\r |
1831 | Status = RowAnsiArray ( SocketFD,\r | |
1832 | pPort,\r | |
1833 | "Signature",\r | |
9f7f5161 | 1834 | sizeof ( pMcfg->Signature ),\r |
1835 | (CHAR8 *)&pMcfg->Signature );\r | |
7dc13291 | 1836 | if ( EFI_ERROR ( Status )) {\r |
1837 | break;\r | |
1838 | }\r | |
1839 | Status = RowDecimalValue ( SocketFD,\r | |
1840 | pPort,\r | |
1841 | "Length",\r | |
9f7f5161 | 1842 | pMcfg->Length );\r |
1843 | if ( EFI_ERROR ( Status )) {\r | |
1844 | break;\r | |
1845 | }\r | |
1846 | \r | |
1847 | //\r | |
1848 | // Display the data from the table\r | |
1849 | //\r | |
1850 | Status = RowDump ( SocketFD,\r | |
1851 | pPort,\r | |
1852 | "Data",\r | |
1853 | pMcfg->Length - sizeof ( *pMcfg ) + 1,\r | |
1854 | (UINT8 *)( pMcfg + 1 ));\r | |
1855 | if ( EFI_ERROR ( Status )) {\r | |
1856 | break;\r | |
1857 | }\r | |
1858 | \r | |
1859 | //\r | |
1860 | // Build the table trailer\r | |
1861 | //\r | |
1862 | Status = TableTrailer ( SocketFD,\r | |
1863 | pPort,\r | |
1864 | pbDone );\r | |
1865 | break;\r | |
1866 | }\r | |
1867 | \r | |
1868 | //\r | |
1869 | // Return the operation status\r | |
1870 | //\r | |
1871 | DBG_EXIT_STATUS ( Status );\r | |
1872 | return Status;\r | |
1873 | }\r | |
1874 | \r | |
1875 | \r | |
1876 | /**\r | |
1877 | Respond with the ACPI RSDP 1.0b table\r | |
1878 | \r | |
1879 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1880 | @param [in] pPort The WSDT_PORT structure address\r | |
1881 | @param [out] pbDone Address to receive the request completion status\r | |
1882 | \r | |
1883 | @retval EFI_SUCCESS The request was successfully processed\r | |
1884 | \r | |
1885 | **/\r | |
1886 | EFI_STATUS\r | |
1887 | AcpiRsdp10Page (\r | |
1888 | IN int SocketFD,\r | |
1889 | IN WSDT_PORT * pPort,\r | |
1890 | OUT BOOLEAN * pbDone\r | |
1891 | )\r | |
1892 | {\r | |
1893 | CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER * pRsdp10b;\r | |
1894 | EFI_STATUS Status;\r | |
1895 | \r | |
1896 | DBG_ENTER ( );\r | |
1897 | \r | |
1898 | //\r | |
1899 | // Send the RSDP page\r | |
1900 | //\r | |
1901 | for ( ; ; ) {\r | |
1902 | //\r | |
1903 | // Locate the RSDP\r | |
1904 | //\r | |
1905 | Status = EfiGetSystemConfigurationTable ( &gEfiAcpi10TableGuid, (VOID **) &pRsdp10b );\r | |
1906 | if ( EFI_ERROR ( Status )) {\r | |
1907 | break;\r | |
1908 | }\r | |
1909 | \r | |
1910 | //\r | |
1911 | // Send the page and table header\r | |
1912 | //\r | |
1913 | Status = TableHeader ( SocketFD, pPort, L"RSDP - ACPI 1.0b Root System Description Pointer", pRsdp10b );\r | |
1914 | if ( EFI_ERROR ( Status )) {\r | |
1915 | break;\r | |
1916 | }\r | |
1917 | \r | |
1918 | //\r | |
1919 | // Display the RSDP\r | |
1920 | //\r | |
1921 | Status = RowAnsiArray ( SocketFD,\r | |
1922 | pPort,\r | |
1923 | "Signature",\r | |
1924 | sizeof ( pRsdp10b->Signature ),\r | |
1925 | (CHAR8 *)&pRsdp10b->Signature );\r | |
1926 | if ( EFI_ERROR ( Status )) {\r | |
1927 | break;\r | |
1928 | }\r | |
1929 | Status = RowHexValue ( SocketFD,\r | |
1930 | pPort,\r | |
1931 | "Checksum",\r | |
1932 | pRsdp10b->Checksum,\r | |
1933 | NULL );\r | |
1934 | if ( EFI_ERROR ( Status )) {\r | |
1935 | break;\r | |
1936 | }\r | |
1937 | Status = RowAnsiArray ( SocketFD,\r | |
1938 | pPort,\r | |
1939 | "OemId",\r | |
1940 | sizeof ( pRsdp10b->OemId ),\r | |
1941 | (CONST CHAR8 *)&pRsdp10b->OemId[ 0 ]);\r | |
1942 | if ( EFI_ERROR ( Status )) {\r | |
1943 | break;\r | |
1944 | }\r | |
1945 | Status = RowHexValue ( SocketFD,\r | |
1946 | pPort,\r | |
1947 | "Reserved",\r | |
1948 | pRsdp10b->Reserved,\r | |
1949 | NULL );\r | |
1950 | if ( EFI_ERROR ( Status )) {\r | |
1951 | break;\r | |
1952 | }\r | |
1953 | Status = RowPointer ( SocketFD,\r | |
1954 | pPort,\r | |
1955 | "RsdtAddress",\r | |
1956 | (VOID *)(UINTN)pRsdp10b->RsdtAddress,\r | |
1957 | PAGE_ACPI_RSDT );\r | |
1958 | if ( EFI_ERROR ( Status )) {\r | |
1959 | break;\r | |
1960 | }\r | |
1961 | \r | |
1962 | //\r | |
1963 | // Build the table trailer\r | |
1964 | //\r | |
1965 | Status = TableTrailer ( SocketFD,\r | |
1966 | pPort,\r | |
1967 | pbDone );\r | |
1968 | break;\r | |
1969 | }\r | |
1970 | \r | |
1971 | //\r | |
1972 | // Return the operation status\r | |
1973 | //\r | |
1974 | DBG_EXIT_STATUS ( Status );\r | |
1975 | return Status;\r | |
1976 | }\r | |
1977 | \r | |
1978 | \r | |
1979 | /**\r | |
1980 | Respond with the ACPI RSDP 3.0 table\r | |
1981 | \r | |
1982 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
1983 | @param [in] pPort The WSDT_PORT structure address\r | |
1984 | @param [out] pbDone Address to receive the request completion status\r | |
1985 | \r | |
1986 | @retval EFI_SUCCESS The request was successfully processed\r | |
1987 | \r | |
1988 | **/\r | |
1989 | EFI_STATUS\r | |
1990 | AcpiRsdp30Page (\r | |
1991 | IN int SocketFD,\r | |
1992 | IN WSDT_PORT * pPort,\r | |
1993 | OUT BOOLEAN * pbDone\r | |
1994 | )\r | |
1995 | {\r | |
1996 | CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER * pRsdp30;\r | |
1997 | EFI_STATUS Status;\r | |
1998 | \r | |
1999 | DBG_ENTER ( );\r | |
2000 | \r | |
2001 | //\r | |
2002 | // Send the RSDP page\r | |
2003 | //\r | |
2004 | for ( ; ; ) {\r | |
2005 | //\r | |
2006 | // Locate the RSDP\r | |
2007 | //\r | |
2008 | Status = EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid, (VOID **) &pRsdp30 );\r | |
2009 | if ( EFI_ERROR ( Status )) {\r | |
2010 | break;\r | |
2011 | }\r | |
2012 | \r | |
2013 | //\r | |
2014 | // Send the page and table header\r | |
2015 | //\r | |
2016 | Status = TableHeader ( SocketFD, pPort, L"RSDP - ACPI 3.0 Root System Description Pointer", pRsdp30 );\r | |
2017 | if ( EFI_ERROR ( Status )) {\r | |
2018 | break;\r | |
2019 | }\r | |
2020 | \r | |
2021 | //\r | |
2022 | // Display the RSDP\r | |
2023 | //\r | |
2024 | Status = RowAnsiArray ( SocketFD,\r | |
2025 | pPort,\r | |
2026 | "Signature",\r | |
2027 | sizeof ( pRsdp30->Signature ),\r | |
2028 | (CHAR8 *)&pRsdp30->Signature );\r | |
2029 | if ( EFI_ERROR ( Status )) {\r | |
2030 | break;\r | |
2031 | }\r | |
2032 | Status = RowHexValue ( SocketFD,\r | |
2033 | pPort,\r | |
2034 | "Checksum",\r | |
2035 | pRsdp30->Checksum,\r | |
2036 | NULL );\r | |
2037 | if ( EFI_ERROR ( Status )) {\r | |
2038 | break;\r | |
2039 | }\r | |
2040 | Status = RowAnsiArray ( SocketFD,\r | |
2041 | pPort,\r | |
2042 | "OemId",\r | |
2043 | sizeof ( pRsdp30->OemId ),\r | |
2044 | (CONST CHAR8 *)&pRsdp30->OemId[ 0 ]);\r | |
2045 | if ( EFI_ERROR ( Status )) {\r | |
2046 | break;\r | |
2047 | }\r | |
2048 | Status = RowHexValue ( SocketFD,\r | |
2049 | pPort,\r | |
2050 | "Revision",\r | |
2051 | pRsdp30->Revision,\r | |
2052 | NULL );\r | |
2053 | if ( EFI_ERROR ( Status )) {\r | |
2054 | break;\r | |
2055 | }\r | |
2056 | Status = RowPointer ( SocketFD,\r | |
2057 | pPort,\r | |
2058 | "RsdtAddress",\r | |
2059 | (VOID *)(UINTN)pRsdp30->RsdtAddress,\r | |
2060 | PAGE_ACPI_RSDT );\r | |
2061 | if ( EFI_ERROR ( Status )) {\r | |
2062 | break;\r | |
2063 | }\r | |
2064 | Status = RowDecimalValue ( SocketFD,\r | |
2065 | pPort,\r | |
2066 | "Length",\r | |
2067 | pRsdp30->Length );\r | |
2068 | if ( EFI_ERROR ( Status )) {\r | |
2069 | break;\r | |
2070 | }\r | |
2071 | Status = RowPointer ( SocketFD,\r | |
2072 | pPort,\r | |
2073 | "XsdtAddress",\r | |
2074 | (VOID *)(UINTN)pRsdp30->XsdtAddress,\r | |
2075 | NULL );\r | |
7dc13291 | 2076 | if ( EFI_ERROR ( Status )) {\r |
2077 | break;\r | |
2078 | }\r | |
2079 | Status = RowHexValue ( SocketFD,\r | |
2080 | pPort,\r | |
2081 | "ExtendedChecksum",\r | |
2082 | pRsdp30->ExtendedChecksum,\r | |
2083 | NULL );\r | |
2084 | if ( EFI_ERROR ( Status )) {\r | |
2085 | break;\r | |
2086 | }\r | |
2087 | Status = RowBytes ( SocketFD,\r | |
2088 | pPort,\r | |
2089 | "Reserved",\r | |
2090 | sizeof ( pRsdp30->Reserved ),\r | |
59bc0593 | 2091 | &pRsdp30->Reserved[ 0 ]);\r |
7dc13291 | 2092 | if ( EFI_ERROR ( Status )) {\r |
2093 | break;\r | |
2094 | }\r | |
2095 | \r | |
2096 | //\r | |
2097 | // Build the table trailer\r | |
2098 | //\r | |
2099 | Status = TableTrailer ( SocketFD,\r | |
2100 | pPort,\r | |
2101 | pbDone );\r | |
2102 | break;\r | |
2103 | }\r | |
2104 | \r | |
2105 | //\r | |
2106 | // Return the operation status\r | |
2107 | //\r | |
2108 | DBG_EXIT_STATUS ( Status );\r | |
2109 | return Status;\r | |
2110 | }\r | |
2111 | \r | |
2112 | \r | |
2113 | /**\r | |
2114 | Respond with the ACPI RSDT table\r | |
2115 | \r | |
2116 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
2117 | @param [in] pPort The WSDT_PORT structure address\r | |
2118 | @param [out] pbDone Address to receive the request completion status\r | |
2119 | \r | |
2120 | @retval EFI_SUCCESS The request was successfully processed\r | |
2121 | \r | |
2122 | **/\r | |
2123 | EFI_STATUS\r | |
2124 | AcpiRsdtPage (\r | |
2125 | IN int SocketFD,\r | |
2126 | IN WSDT_PORT * pPort,\r | |
2127 | OUT BOOLEAN * pbDone\r | |
2128 | )\r | |
2129 | {\r | |
2130 | CONST UINT32 * pEnd;\r | |
2131 | CONST UINT32 * pEntry;\r | |
2132 | CONST ACPI_RSDT * pRsdt;\r | |
2133 | CONST CHAR8 * pTableName;\r | |
2134 | CONST CHAR16 * pWebPage;\r | |
2135 | EFI_STATUS Status;\r | |
59bc0593 | 2136 | UINT32 TableName[ 2 ];\r |
7dc13291 | 2137 | \r |
2138 | DBG_ENTER ( );\r | |
2139 | \r | |
2140 | //\r | |
2141 | // Send the RSDT page\r | |
2142 | //\r | |
2143 | for ( ; ; ) {\r | |
2144 | //\r | |
2145 | // Locate the RSDT\r | |
2146 | //\r | |
2147 | pRsdt = LocateRsdt ( );\r | |
2148 | if ( NULL == pRsdt ) {\r | |
2149 | Status = EFI_NOT_FOUND;\r | |
2150 | break;\r | |
2151 | }\r | |
2152 | \r | |
2153 | //\r | |
2154 | // Send the page and table header\r | |
2155 | //\r | |
2156 | Status = TableHeader ( SocketFD, pPort, L"RSDT - ACPI Root System Description Table", pRsdt );\r | |
2157 | if ( EFI_ERROR ( Status )) {\r | |
2158 | break;\r | |
2159 | }\r | |
2160 | \r | |
2161 | //\r | |
2162 | // Display the RSDT\r | |
2163 | //\r | |
2164 | Status = RowAnsiArray ( SocketFD,\r | |
2165 | pPort,\r | |
2166 | "Signature",\r | |
2167 | sizeof ( pRsdt->Signature ),\r | |
2168 | (CHAR8 *)&pRsdt->Signature );\r | |
2169 | if ( EFI_ERROR ( Status )) {\r | |
2170 | break;\r | |
2171 | }\r | |
2172 | Status = RowDecimalValue ( SocketFD,\r | |
2173 | pPort,\r | |
2174 | "Length",\r | |
2175 | pRsdt->Length );\r | |
2176 | if ( EFI_ERROR ( Status )) {\r | |
2177 | break;\r | |
2178 | }\r | |
2179 | Status = RowDecimalValue ( SocketFD,\r | |
2180 | pPort,\r | |
2181 | "Revision",\r | |
2182 | pRsdt->Revision );\r | |
2183 | if ( EFI_ERROR ( Status )) {\r | |
2184 | break;\r | |
2185 | }\r | |
2186 | Status = RowHexValue ( SocketFD,\r | |
2187 | pPort,\r | |
2188 | "Checksum",\r | |
2189 | pRsdt->Checksum,\r | |
2190 | NULL );\r | |
2191 | if ( EFI_ERROR ( Status )) {\r | |
2192 | break;\r | |
2193 | }\r | |
2194 | Status = RowAnsiArray ( SocketFD,\r | |
2195 | pPort,\r | |
2196 | "OEMID",\r | |
2197 | sizeof ( pRsdt->OemId ),\r | |
d3a595ce | 2198 | (CONST CHAR8 *)&pRsdt->OemId[ 0 ]);\r |
7dc13291 | 2199 | if ( EFI_ERROR ( Status )) {\r |
2200 | break;\r | |
2201 | }\r | |
2202 | Status = RowAnsiArray ( SocketFD,\r | |
2203 | pPort,\r | |
2204 | "OEM Table ID",\r | |
2205 | sizeof ( pRsdt->OemTableId ),\r | |
d3a595ce | 2206 | (CONST CHAR8 *)&pRsdt->OemTableId[ 0 ]);\r |
7dc13291 | 2207 | if ( EFI_ERROR ( Status )) {\r |
2208 | break;\r | |
2209 | }\r | |
2210 | Status = RowRevision ( SocketFD,\r | |
2211 | pPort,\r | |
2212 | "OEM Revision",\r | |
2213 | pRsdt->OemRevision );\r | |
2214 | if ( EFI_ERROR ( Status )) {\r | |
2215 | break;\r | |
2216 | }\r | |
2217 | Status = RowAnsiArray ( SocketFD,\r | |
2218 | pPort,\r | |
2219 | "Creator ID",\r | |
2220 | sizeof ( pRsdt->CreatorId ),\r | |
2221 | (CHAR8 *)&pRsdt->CreatorId );\r | |
2222 | if ( EFI_ERROR ( Status )) {\r | |
2223 | break;\r | |
2224 | }\r | |
2225 | Status = RowRevision ( SocketFD,\r | |
2226 | pPort,\r | |
2227 | "Creator Revision",\r | |
2228 | pRsdt->CreatorRevision );\r | |
2229 | if ( EFI_ERROR ( Status )) {\r | |
2230 | break;\r | |
2231 | }\r | |
2232 | \r | |
2233 | //\r | |
2234 | // Walk the list of entries\r | |
2235 | //\r | |
59bc0593 | 2236 | pEntry = &pRsdt->Entry[ 0 ];\r |
2237 | pEnd = &pEntry[(( pRsdt->Length - sizeof ( *pRsdt )) >> 2 ) + 1 ];\r | |
2238 | TableName[ 1 ] = 0;\r | |
7dc13291 | 2239 | while ( pEnd > pEntry ) {\r |
2240 | //\r | |
2241 | // The entry is actually a 32-bit physical table address\r | |
2242 | // The first entry in the table is the 32-bit table signature\r | |
2243 | //\r | |
53c31c51 | 2244 | TableName[ 0 ] = *(UINT32 *)(UINTN)*pEntry;\r |
59bc0593 | 2245 | pWebPage = SignatureLookup ( &TableName[ 0 ], &pTableName );\r |
7dc13291 | 2246 | \r |
2247 | //\r | |
2248 | // Display the table address\r | |
2249 | //\r | |
2250 | Status = RowPointer ( SocketFD,\r | |
2251 | pPort,\r | |
2252 | pTableName,\r | |
53c31c51 | 2253 | (VOID *)(UINTN)*pEntry,\r |
7dc13291 | 2254 | pWebPage );\r |
2255 | if ( EFI_ERROR ( Status )) {\r | |
2256 | break;\r | |
2257 | }\r | |
2258 | pEntry++;\r | |
2259 | }\r | |
2260 | if ( EFI_ERROR ( Status )) {\r | |
2261 | break;\r | |
2262 | }\r | |
2263 | \r | |
2264 | //\r | |
2265 | // Build the table trailer\r | |
2266 | //\r | |
2267 | Status = TableTrailer ( SocketFD,\r | |
2268 | pPort,\r | |
2269 | pbDone );\r | |
2270 | break;\r | |
2271 | }\r | |
2272 | \r | |
2273 | //\r | |
2274 | // Return the operation status\r | |
2275 | //\r | |
2276 | DBG_EXIT_STATUS ( Status );\r | |
2277 | return Status;\r | |
2278 | }\r | |
2279 | \r | |
2280 | \r | |
9f7f5161 | 2281 | /**\r |
2282 | Respond with the SSDT table\r | |
2283 | \r | |
2284 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
2285 | @param [in] pPort The WSDT_PORT structure address\r | |
2286 | @param [out] pbDone Address to receive the request completion status\r | |
2287 | \r | |
2288 | @retval EFI_SUCCESS The request was successfully processed\r | |
2289 | \r | |
2290 | **/\r | |
2291 | EFI_STATUS\r | |
2292 | AcpiSsdtPage (\r | |
2293 | IN int SocketFD,\r | |
2294 | IN WSDT_PORT * pPort,\r | |
2295 | OUT BOOLEAN * pbDone\r | |
2296 | )\r | |
2297 | {\r | |
2298 | CONST ACPI_UNKNOWN * pSsdt;\r | |
2299 | EFI_STATUS Status;\r | |
2300 | \r | |
2301 | DBG_ENTER ( );\r | |
2302 | \r | |
2303 | //\r | |
2304 | // Send the SSDT page\r | |
2305 | //\r | |
2306 | for ( ; ; ) {\r | |
2307 | //\r | |
2308 | // Locate the SSDT\r | |
2309 | //\r | |
2310 | pSsdt = (ACPI_UNKNOWN *)LocateTable ( SSDT_SIGNATURE );\r | |
2311 | if ( NULL == pSsdt ) {\r | |
2312 | Status = EFI_NOT_FOUND;\r | |
2313 | break;\r | |
2314 | }\r | |
2315 | \r | |
2316 | //\r | |
2317 | // Send the page and table header\r | |
2318 | //\r | |
2319 | Status = TableHeader ( SocketFD, pPort, L"SSDT Table", pSsdt );\r | |
2320 | if ( EFI_ERROR ( Status )) {\r | |
2321 | break;\r | |
2322 | }\r | |
2323 | \r | |
2324 | //\r | |
2325 | // Display the header\r | |
2326 | //\r | |
2327 | Status = RowAnsiArray ( SocketFD,\r | |
2328 | pPort,\r | |
2329 | "Signature",\r | |
2330 | sizeof ( pSsdt->Signature ),\r | |
2331 | (CHAR8 *)&pSsdt->Signature );\r | |
2332 | if ( EFI_ERROR ( Status )) {\r | |
2333 | break;\r | |
2334 | }\r | |
2335 | Status = RowDecimalValue ( SocketFD,\r | |
2336 | pPort,\r | |
2337 | "Length",\r | |
2338 | pSsdt->Length );\r | |
2339 | if ( EFI_ERROR ( Status )) {\r | |
2340 | break;\r | |
2341 | }\r | |
2342 | \r | |
2343 | //\r | |
2344 | // Display the data from the table\r | |
2345 | //\r | |
2346 | Status = RowDump ( SocketFD,\r | |
2347 | pPort,\r | |
2348 | "Data",\r | |
2349 | pSsdt->Length - sizeof ( *pSsdt ) + 1,\r | |
2350 | (UINT8 *)( pSsdt + 1 ));\r | |
2351 | if ( EFI_ERROR ( Status )) {\r | |
2352 | break;\r | |
2353 | }\r | |
2354 | \r | |
2355 | //\r | |
2356 | // Build the table trailer\r | |
2357 | //\r | |
2358 | Status = TableTrailer ( SocketFD,\r | |
2359 | pPort,\r | |
2360 | pbDone );\r | |
2361 | break;\r | |
2362 | }\r | |
2363 | \r | |
2364 | //\r | |
2365 | // Return the operation status\r | |
2366 | //\r | |
2367 | DBG_EXIT_STATUS ( Status );\r | |
2368 | return Status;\r | |
2369 | }\r | |
2370 | \r | |
2371 | \r | |
2372 | /**\r | |
2373 | Respond with the TCPA table\r | |
2374 | \r | |
2375 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
2376 | @param [in] pPort The WSDT_PORT structure address\r | |
2377 | @param [out] pbDone Address to receive the request completion status\r | |
2378 | \r | |
2379 | @retval EFI_SUCCESS The request was successfully processed\r | |
2380 | \r | |
2381 | **/\r | |
2382 | EFI_STATUS\r | |
2383 | AcpiTcpaPage (\r | |
2384 | IN int SocketFD,\r | |
2385 | IN WSDT_PORT * pPort,\r | |
2386 | OUT BOOLEAN * pbDone\r | |
2387 | )\r | |
2388 | {\r | |
2389 | CONST ACPI_UNKNOWN * pTcpa;\r | |
2390 | EFI_STATUS Status;\r | |
2391 | \r | |
2392 | DBG_ENTER ( );\r | |
2393 | \r | |
2394 | //\r | |
2395 | // Send the TCPA page\r | |
2396 | //\r | |
2397 | for ( ; ; ) {\r | |
2398 | //\r | |
2399 | // Locate the TCPA\r | |
2400 | //\r | |
2401 | pTcpa = (ACPI_UNKNOWN *)LocateTable ( TCPA_SIGNATURE );\r | |
2402 | if ( NULL == pTcpa ) {\r | |
2403 | Status = EFI_NOT_FOUND;\r | |
2404 | break;\r | |
2405 | }\r | |
2406 | \r | |
2407 | //\r | |
2408 | // Send the page and table header\r | |
2409 | //\r | |
2410 | Status = TableHeader ( SocketFD, pPort, L"TCPA Table", pTcpa );\r | |
2411 | if ( EFI_ERROR ( Status )) {\r | |
2412 | break;\r | |
2413 | }\r | |
2414 | \r | |
2415 | //\r | |
2416 | // Display the header\r | |
2417 | //\r | |
2418 | Status = RowAnsiArray ( SocketFD,\r | |
2419 | pPort,\r | |
2420 | "Signature",\r | |
2421 | sizeof ( pTcpa->Signature ),\r | |
2422 | (CHAR8 *)&pTcpa->Signature );\r | |
2423 | if ( EFI_ERROR ( Status )) {\r | |
2424 | break;\r | |
2425 | }\r | |
2426 | Status = RowDecimalValue ( SocketFD,\r | |
2427 | pPort,\r | |
2428 | "Length",\r | |
2429 | pTcpa->Length );\r | |
2430 | if ( EFI_ERROR ( Status )) {\r | |
2431 | break;\r | |
2432 | }\r | |
2433 | \r | |
2434 | //\r | |
2435 | // Display the data from the table\r | |
2436 | //\r | |
2437 | Status = RowDump ( SocketFD,\r | |
2438 | pPort,\r | |
2439 | "Data",\r | |
2440 | pTcpa->Length - sizeof ( *pTcpa ) + 1,\r | |
2441 | (UINT8 *)( pTcpa + 1 ));\r | |
2442 | if ( EFI_ERROR ( Status )) {\r | |
2443 | break;\r | |
2444 | }\r | |
2445 | \r | |
2446 | //\r | |
2447 | // Build the table trailer\r | |
2448 | //\r | |
2449 | Status = TableTrailer ( SocketFD,\r | |
2450 | pPort,\r | |
2451 | pbDone );\r | |
2452 | break;\r | |
2453 | }\r | |
2454 | \r | |
2455 | //\r | |
2456 | // Return the operation status\r | |
2457 | //\r | |
2458 | DBG_EXIT_STATUS ( Status );\r | |
2459 | return Status;\r | |
2460 | }\r | |
2461 | \r | |
2462 | \r | |
2463 | /**\r | |
2464 | Respond with the UEFI table\r | |
2465 | \r | |
2466 | @param [in] SocketFD The socket's file descriptor to add to the list.\r | |
2467 | @param [in] pPort The WSDT_PORT structure address\r | |
2468 | @param [out] pbDone Address to receive the request completion status\r | |
2469 | \r | |
2470 | @retval EFI_SUCCESS The request was successfully processed\r | |
2471 | \r | |
2472 | **/\r | |
2473 | EFI_STATUS\r | |
2474 | AcpiUefiPage (\r | |
2475 | IN int SocketFD,\r | |
2476 | IN WSDT_PORT * pPort,\r | |
2477 | OUT BOOLEAN * pbDone\r | |
2478 | )\r | |
2479 | {\r | |
2480 | CONST ACPI_UNKNOWN * pUefi;\r | |
2481 | EFI_STATUS Status;\r | |
2482 | \r | |
2483 | DBG_ENTER ( );\r | |
2484 | \r | |
2485 | //\r | |
2486 | // Send the UEFI page\r | |
2487 | //\r | |
2488 | for ( ; ; ) {\r | |
2489 | //\r | |
2490 | // Locate the UEFI\r | |
2491 | //\r | |
2492 | pUefi = (ACPI_UNKNOWN *)LocateTable ( UEFI_SIGNATURE );\r | |
2493 | if ( NULL == pUefi ) {\r | |
2494 | Status = EFI_NOT_FOUND;\r | |
2495 | break;\r | |
2496 | }\r | |
2497 | \r | |
2498 | //\r | |
2499 | // Send the page and table header\r | |
2500 | //\r | |
2501 | Status = TableHeader ( SocketFD, pPort, L"UEFI Table", pUefi );\r | |
2502 | if ( EFI_ERROR ( Status )) {\r | |
2503 | break;\r | |
2504 | }\r | |
2505 | \r | |
2506 | //\r | |
2507 | // Display the header\r | |
2508 | //\r | |
2509 | Status = RowAnsiArray ( SocketFD,\r | |
2510 | pPort,\r | |
2511 | "Signature",\r | |
2512 | sizeof ( pUefi->Signature ),\r | |
2513 | (CHAR8 *)&pUefi->Signature );\r | |
2514 | if ( EFI_ERROR ( Status )) {\r | |
2515 | break;\r | |
2516 | }\r | |
2517 | Status = RowDecimalValue ( SocketFD,\r | |
2518 | pPort,\r | |
2519 | "Length",\r | |
2520 | pUefi->Length );\r | |
2521 | if ( EFI_ERROR ( Status )) {\r | |
2522 | break;\r | |
2523 | }\r | |
2524 | \r | |
2525 | //\r | |
2526 | // Display the data from the table\r | |
2527 | //\r | |
2528 | Status = RowDump ( SocketFD,\r | |
2529 | pPort,\r | |
2530 | "Data",\r | |
2531 | pUefi->Length - sizeof ( *pUefi ) + 1,\r | |
2532 | (UINT8 *)( pUefi + 1 ));\r | |
2533 | if ( EFI_ERROR ( Status )) {\r | |
2534 | break;\r | |
2535 | }\r | |
2536 | \r | |
2537 | //\r | |
2538 | // Build the table trailer\r | |
2539 | //\r | |
2540 | Status = TableTrailer ( SocketFD,\r | |
2541 | pPort,\r | |
2542 | pbDone );\r | |
2543 | break;\r | |
2544 | }\r | |
2545 | \r | |
2546 | //\r | |
2547 | // Return the operation status\r | |
2548 | //\r | |
2549 | DBG_EXIT_STATUS ( Status );\r | |
2550 | return Status;\r | |
2551 | }\r |