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