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