2 This file contains an 'Intel UEFI Application' and is
3 licensed for Intel CPUs and chipsets under the terms of your
4 license agreement with Intel or your vendor. This file may
5 be modified by the user, subject to additional terms of the
10 Copyright (c) 2011 Intel Corporation. All rights reserved
11 This software and associated documentation (if any) is furnished
12 under a license and may only be used or copied in accordance
13 with the terms of the license. Except as permitted by such
14 license, no part of this software or documentation may be
15 reproduced, stored in a retrieval system, or transmitted in any
16 form or by any means without the express written consent of
22 Display the runtime services table
26 #include <WebServer.h>
27 #include <Guid/Acpi.h>
28 #include <IndustryStandard/Acpi10.h>
29 #include <IndustryStandard/Acpi30.h>
31 #if defined(_MSC_VER) // Handle Microsoft VC++ compiler specifics.
32 #pragma warning ( disable : 4305 )
33 #endif // defined(_MSC_VER)
36 // Ensure proper structure formats
42 UINT8 RegisterBitWidth
;
43 UINT8 RegisterBitOffset
;
50 UINT32 Signature
; // 0
55 UINT8 OemTableId
[8]; // 16
56 UINT32 OemRevision
; // 24
57 UINT32 CreatorId
; // 28
58 UINT32 CreatorRevision
; // 32
59 UINT8 DefinitionBlock
[1]; // 36
64 UINT32 Signature
; // 0
69 UINT8 OemTableId
[8]; // 16
70 UINT32 OemRevision
; // 24
71 UINT32 CreatorId
; // 28
72 UINT32 CreatorRevision
; // 32
73 UINT32 FirmwareCtrl
; // 36
76 UINT8 PreferredPmProfile
; // 45
79 UINT8 AcpiEnable
; // 52
80 UINT8 AcpiDisable
; // 53
81 UINT8 S4BiosReq
; // 54
82 UINT8 PStateCnt
; // 55
83 UINT32 Pm1aEvtBlk
; // 56
84 UINT32 Pm1bEvtBlk
; // 60
85 UINT32 Pm1aCntBlk
; // 64
86 UINT32 Pm1bCntBlk
; // 68
87 UINT32 Pm2CntBlk
; // 72
88 UINT32 PmTmrBlk
; // 76
91 UINT8 Pm1EvtLen
; // 88
92 UINT8 Pm1CntLen
; // 89
93 UINT8 PM2CntLen
; // 90
95 UINT8 Gpe0BlkLen
; // 92
96 UINT8 Gpe1BlkLen
; // 93
99 UINT16 PLvl2Lat
; // 96
100 UINT16 PLvl3Lat
; // 98
101 UINT16 FlushSize
; // 100
102 UINT16 FlushStride
; // 102
103 UINT8 DutyOffset
; // 104
104 UINT8 DutyWidth
; // 105
105 UINT8 DayAlrm
; // 106
106 UINT8 MonAlrm
; // 107
107 UINT8 Century
; // 108
108 UINT16 IapcBootArch
; // 109
109 UINT8 Reserved2
; // 111
111 UINT32 ResetReg
[3]; // 116
112 UINT8 ResetValue
; // 128
113 UINT8 Reserved3
[3]; // 129
114 UINT64 XFirmwareCtrl
; // 132
116 UINT32 XPm1aEvtBlk
[3]; // 148
117 UINT32 XPm1bEvtBlk
[3]; // 160
118 UINT32 XPm1aCntBlk
[3]; // 172
119 UINT32 XPm1bCntBlk
[3]; // 184
120 UINT32 XPm2CntBlk
[3]; // 196
121 UINT32 XPmTmrBlk
[3]; // 208
122 UINT32 XGpe0Blk
[3]; // 220
123 UINT32 XGpe1Blk
[3]; // 232
136 UINT32 CreatorRevision
;
146 CONST CHAR8
* pTableName
;
147 CONST CHAR16
* pWebPage
;
151 CONST TABLE_SIGNATURE mTableId
[] = {
152 { DSDT_SIGNATURE
, "DSDT", PAGE_ACPI_DSDT
},
153 { FADT_SIGNATURE
, "FADT", PAGE_ACPI_FADT
}
158 Locate the RSDT table
160 @return Table address or NULL if not found
168 CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp10b
;
169 CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp30
;
170 CONST ACPI_RSDT
* pRsdt
;
174 // Use for/break instead of goto
181 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid
, (VOID
**)&pRsdp30
);
182 if ( !EFI_ERROR ( Status
)) {
183 pRsdt
= (ACPI_RSDT
*)pRsdp30
->RsdtAddress
;
186 Status
= EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid
, (VOID
**)&pRsdp10b
);
187 if ( EFI_ERROR ( Status
)) {
190 pRsdt
= (ACPI_RSDT
*)pRsdp10b
->RsdtAddress
;
196 // The entry was not found
203 Locate the specified table
205 @param [in] Signature Table signature
207 @return Table address or NULL if not found
216 CONST UINT32
* pEntry
;
217 CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp10b
;
218 CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp30
;
219 CONST ACPI_RSDT
* pRsdt
;
220 CONST UINT32
* pSignature
;
224 // Use for/break instead of goto
230 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid
, (VOID
**)&pRsdp30
);
231 if ( !EFI_ERROR ( Status
)) {
232 pRsdt
= (ACPI_RSDT
*)pRsdp30
->RsdtAddress
;
235 Status
= EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid
, (VOID
**)&pRsdp10b
);
236 if ( EFI_ERROR ( Status
)) {
239 pRsdt
= (ACPI_RSDT
*)pRsdp10b
->RsdtAddress
;
243 // Walk the list of entries
245 pEntry
= &pRsdt
->Entry
[ 0 ];
246 pEnd
= &pEntry
[(( pRsdt
->Length
- sizeof ( *pRsdt
)) >> 2 ) + 1 ];
247 while ( pEnd
> pEntry
) {
249 // The entry is actually a 32-bit physical table address
250 // The first entry in the table is the 32-bit table signature
252 pSignature
= (UINT32
*)*pEntry
;
253 if ( *pSignature
== Signature
) {
254 return (CONST VOID
*) *pEntry
;
258 // Set the next entry
266 // The entry was not found
273 Display a row containing a hex value
275 @param [in] SocketFD The socket's file descriptor to add to the list.
276 @param [in] pPort The WSDT_PORT structure address
277 @param [in] pName Address of a zero terminated name string
278 @param [in] Length Length in bytes
279 @param [in] pChar Address of the first character
281 @retval EFI_SUCCESS The request was successfully processed
287 IN WSDT_PORT
* pPort
,
288 IN CONST CHAR8
* pName
,
290 IN CONST CHAR8
* pChar
300 // Use for/break instead of goto
306 Status
= HttpSendAnsiString ( SocketFD
,
309 if ( EFI_ERROR ( Status
)) {
312 Status
= HttpSendAnsiString ( SocketFD
,
315 if ( EFI_ERROR ( Status
)) {
318 Status
= HttpSendAnsiString ( SocketFD
,
321 if ( EFI_ERROR ( Status
)) {
326 // Display the characters
329 pEnd
= &pChar
[ Length
];
330 while ( pEnd
> pData
) {
331 Status
= HttpSendCharacter ( SocketFD
,
335 if ( EFI_ERROR ( Status
)) {
339 if ( EFI_ERROR ( Status
)) {
344 // Display the byte values
346 Status
= HttpSendAnsiString ( SocketFD
,
349 if ( EFI_ERROR ( Status
)) {
353 while ( pEnd
> pData
) {
354 Status
= HttpSendHexBits ( SocketFD
,
358 if ( EFI_ERROR ( Status
)) {
361 if ( pEnd
> pData
) {
362 Status
= HttpSendAnsiString ( SocketFD
,
365 if ( EFI_ERROR ( Status
)) {
374 Status
= HttpSendAnsiString ( SocketFD
,
376 "</code></td></tr>\r\n" );
381 // Return the operation status
383 DBG_EXIT_STATUS ( Status
);
389 Format a row with a list of bytes
391 @param [in] SocketFD The socket's file descriptor to add to the list.
392 @param [in] pPort The WSDT_PORT structure address
393 @param [in] pName Zero terminated name string
394 @param [in] ByteCount The number of bytes to display
395 @param [in] pData Address of the byte array
397 @retval EFI_SUCCESS The request was successfully processed
403 IN WSDT_PORT
* pPort
,
406 IN CONST UINT8
* pData
413 // Use for/break instead of goto
419 Status
= HttpSendAnsiString ( SocketFD
,
422 if ( EFI_ERROR ( Status
)) {
427 // Display the field name
429 Status
= HttpSendAnsiString ( SocketFD
,
432 if ( EFI_ERROR ( Status
)) {
437 // Display the field value
439 Status
= HttpSendAnsiString ( SocketFD
,
441 "</td><td><code>0x" );
442 if ( EFI_ERROR ( Status
)) {
445 pEnd
= &pData
[ ByteCount
];
446 while ( pEnd
> pData
) {
447 Status
= HttpSendHexBits ( SocketFD
,
451 if ( EFI_ERROR ( Status
)) {
454 if ( pEnd
> pData
) {
455 Status
= HttpSendAnsiString ( SocketFD
,
458 if ( EFI_ERROR ( Status
)) {
463 if ( EFI_ERROR ( Status
)) {
470 Status
= HttpSendAnsiString ( SocketFD
,
472 "</code></td></tr>\r\n" );
477 // Return the operation status
484 Format a row with a list of bytes
486 @param [in] SocketFD The socket's file descriptor to add to the list.
487 @param [in] pPort The WSDT_PORT structure address
488 @param [in] pName Zero terminated name string
489 @param [in] ByteCount The number of bytes to display
490 @param [in] pData Address of the byte array
492 @retval EFI_SUCCESS The request was successfully processed
498 IN WSDT_PORT
* pPort
,
501 IN CONST UINT8
* pData
507 // Use for/break instead of goto
513 Status
= HttpSendAnsiString ( SocketFD
,
516 if ( EFI_ERROR ( Status
)) {
521 // Display the field name
523 Status
= HttpSendAnsiString ( SocketFD
,
526 if ( EFI_ERROR ( Status
)) {
531 // Start the field value
533 Status
= HttpSendAnsiString ( SocketFD
,
536 if ( EFI_ERROR ( Status
)) {
543 Status
= HttpSendDump ( SocketFD
,
549 // Terminate the field value and row
551 Status
= HttpSendAnsiString ( SocketFD
,
558 // Return the operation status
565 Format a row with a general address
567 @param [in] SocketFD The socket's file descriptor to add to the list.
568 @param [in] pPort The WSDT_PORT structure address
569 @param [in] pName Zero terminated name string
570 @param [in] pAddr Address of the general address buffer
571 @param [in] pWebPage Zero terminated web page address
573 @retval EFI_SUCCESS The request was successfully processed
579 IN WSDT_PORT
* pPort
,
581 IN CONST UINT32
* pAddr
,
582 IN CONST CHAR16
* pWebPage
585 CONST GENERIC_ADDRESS
* pGenericAddress
;
589 // Use for/break instead of goto
595 Status
= HttpSendAnsiString ( SocketFD
,
598 if ( EFI_ERROR ( Status
)) {
603 // Display the field name
605 Status
= HttpSendAnsiString ( SocketFD
,
608 if ( EFI_ERROR ( Status
)) {
613 // Display the field value
615 Status
= HttpSendAnsiString ( SocketFD
,
618 if ( EFI_ERROR ( Status
)) {
623 // Determine the type of address
625 pGenericAddress
= (CONST GENERIC_ADDRESS
*)pAddr
;
626 if ( 0 == pGenericAddress
->AddressSpaceId
) {
627 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "System Memory" );
629 else if ( 1 == pGenericAddress
->AddressSpaceId
) {
630 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "I/O Space" );
632 else if ( 2 == pGenericAddress
->AddressSpaceId
) {
633 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "PCI Configuration Space" );
635 else if ( 3 == pGenericAddress
->AddressSpaceId
) {
636 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "Embedded Controller" );
638 else if ( 4 == pGenericAddress
->AddressSpaceId
) {
639 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "SMBus" );
641 else if ( 0x7f == pGenericAddress
->AddressSpaceId
) {
642 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "Functional Fixed Hardware" );
644 else if (( 0xc0 <= pGenericAddress
->AddressSpaceId
)
645 && ( 0xff >= pGenericAddress
->AddressSpaceId
)) {
646 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "OEM Defined" );
649 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "Reserved" );
651 if ( EFI_ERROR ( Status
)) {
654 Status
= HttpSendAnsiString ( SocketFD
,
656 "<br/>Register Bit Width: " );
657 if ( EFI_ERROR ( Status
)) {
660 Status
= HttpSendValue ( SocketFD
,
662 pGenericAddress
->RegisterBitWidth
);
663 if ( EFI_ERROR ( Status
)) {
666 Status
= HttpSendAnsiString ( SocketFD
,
668 "<br/>Register Bit Offset: " );
669 if ( EFI_ERROR ( Status
)) {
672 Status
= HttpSendHexValue ( SocketFD
,
674 pGenericAddress
->RegisterBitOffset
);
675 if ( EFI_ERROR ( Status
)) {
678 Status
= HttpSendAnsiString ( SocketFD
,
680 "<br/>Access Size: " );
681 if ( EFI_ERROR ( Status
)) {
684 Status
= HttpSendValue ( SocketFD
,
686 pGenericAddress
->AccessSize
);
687 if ( EFI_ERROR ( Status
)) {
690 Status
= HttpSendAnsiString ( SocketFD
,
693 if ( EFI_ERROR ( Status
)) {
698 // Add the web-page link if necessary
700 if ( NULL
!= pWebPage
) {
701 Status
= HttpSendAnsiString ( SocketFD
,
703 "<a target=\"_blank\" href=\"" );
704 if ( EFI_ERROR ( Status
)) {
707 Status
= HttpSendUnicodeString ( SocketFD
,
710 if ( EFI_ERROR ( Status
)) {
713 Status
= HttpSendAnsiString ( SocketFD
,
716 if ( EFI_ERROR ( Status
)) {
722 // Display the address
724 Status
= HttpSendAnsiString ( SocketFD
,
727 if ( EFI_ERROR ( Status
)) {
730 Status
= HttpSendHexBits ( SocketFD
,
733 pGenericAddress
->Address
);
734 if ( EFI_ERROR ( Status
)) {
739 // Finish the web-page link if necessary
741 if ( NULL
!= pWebPage
) {
742 Status
= HttpSendAnsiString ( SocketFD
,
745 if ( EFI_ERROR ( Status
)) {
753 Status
= HttpSendAnsiString ( SocketFD
,
755 "</code></td></tr>\r\n" );
760 // Return the operation status
767 Translate a table address into a web page
769 @param [in] pSignature Address of the table signature
770 @param [out] ppTableName Address to receive the table name address
772 @return Zero terminated web page address or NULL if not found
777 IN UINT32
* pSignature
,
778 OUT CONST CHAR8
** ppTableName
781 CONST TABLE_SIGNATURE
* pTableId
;
782 CONST TABLE_SIGNATURE
* pEnd
;
786 // Walk the list of tables
788 Signature
= *pSignature
;
789 pTableId
= &mTableId
[ 0 ];
790 pEnd
= &pTableId
[ sizeof ( mTableId
) / sizeof ( mTableId
[ 0 ])];
791 while ( pEnd
> pTableId
) {
793 // Attempt to locate the table signature
795 if ( pTableId
->Signature
== Signature
) {
797 // The signature was found
798 // Return the web page
800 *ppTableName
= pTableId
->pTableName
;
801 return pTableId
->pWebPage
;
805 // Set the next table
811 // The table was not found
813 *ppTableName
= (CONST CHAR8
*)pSignature
;
819 Respond with the ACPI DSDT table
821 @param [in] SocketFD The socket's file descriptor to add to the list.
822 @param [in] pPort The WSDT_PORT structure address
823 @param [out] pbDone Address to receive the request completion status
825 @retval EFI_SUCCESS The request was successfully processed
831 IN WSDT_PORT
* pPort
,
835 CONST ACPI_DSDT
* pDsdt
;
836 CONST ACPI_FADT
* pFadt
;
842 // Send the DADT page
848 pFadt
= (ACPI_FADT
*)LocateTable ( FADT_SIGNATURE
);
849 if ( NULL
== pFadt
) {
850 Status
= EFI_NOT_FOUND
;
853 pDsdt
= (VOID
*)(UINTN
)pFadt
->XDsdt
;
856 // Send the page and table header
858 Status
= TableHeader ( SocketFD
, pPort
, L
"DSDT - Differentiated System Description Table", pDsdt
);
859 if ( EFI_ERROR ( Status
)) {
864 // Display the DSDT header
866 Status
= RowAnsiArray ( SocketFD
,
869 sizeof ( pDsdt
->Signature
),
870 (CHAR8
*)&pDsdt
->Signature
);
871 if ( EFI_ERROR ( Status
)) {
874 Status
= RowDecimalValue ( SocketFD
,
878 if ( EFI_ERROR ( Status
)) {
881 Status
= RowDecimalValue ( SocketFD
,
885 if ( EFI_ERROR ( Status
)) {
888 Status
= RowHexValue ( SocketFD
,
893 if ( EFI_ERROR ( Status
)) {
896 Status
= RowAnsiArray ( SocketFD
,
899 sizeof ( pDsdt
->OemId
),
900 (CONST CHAR8
*)&pDsdt
->OemId
[ 0 ]);
901 if ( EFI_ERROR ( Status
)) {
904 Status
= RowAnsiArray ( SocketFD
,
907 sizeof ( pDsdt
->OemTableId
),
908 (CONST CHAR8
*)&pDsdt
->OemTableId
[ 0 ]);
909 if ( EFI_ERROR ( Status
)) {
912 Status
= RowRevision ( SocketFD
,
915 pDsdt
->OemRevision
);
916 if ( EFI_ERROR ( Status
)) {
919 Status
= RowAnsiArray ( SocketFD
,
922 sizeof ( pDsdt
->CreatorId
),
923 (CHAR8
*)&pDsdt
->CreatorId
);
924 if ( EFI_ERROR ( Status
)) {
927 Status
= RowRevision ( SocketFD
,
930 pDsdt
->CreatorRevision
);
931 if ( EFI_ERROR ( Status
)) {
936 // Display the data from the DSDT
938 Status
= RowDump ( SocketFD
,
941 pDsdt
->Length
- sizeof ( *pDsdt
) + 1,
942 &pDsdt
->DefinitionBlock
[0]);
943 if ( EFI_ERROR ( Status
)) {
948 // Build the table trailer
950 Status
= TableTrailer ( SocketFD
,
957 // Return the operation status
959 DBG_EXIT_STATUS ( Status
);
965 Respond with the ACPI FADT table
967 @param [in] SocketFD The socket's file descriptor to add to the list.
968 @param [in] pPort The WSDT_PORT structure address
969 @param [out] pbDone Address to receive the request completion status
971 @retval EFI_SUCCESS The request was successfully processed
977 IN WSDT_PORT
* pPort
,
981 CONST ACPI_FADT
* pFadt
;
987 // Send the FADT page
993 pFadt
= (ACPI_FADT
*)LocateTable ( FADT_SIGNATURE
);
994 if ( NULL
== pFadt
) {
995 Status
= EFI_NOT_FOUND
;
1000 // Send the page and table header
1002 Status
= TableHeader ( SocketFD
, pPort
, L
"FADT - Fixed ACPI Description Table", pFadt
);
1003 if ( EFI_ERROR ( Status
)) {
1008 // Display the FSDT header
1010 Status
= RowAnsiArray ( SocketFD
,
1013 sizeof ( pFadt
->Signature
),
1014 (CHAR8
*)&pFadt
->Signature
);
1015 if ( EFI_ERROR ( Status
)) {
1018 Status
= RowDecimalValue ( SocketFD
,
1022 if ( EFI_ERROR ( Status
)) {
1025 Status
= RowDecimalValue ( SocketFD
,
1029 if ( EFI_ERROR ( Status
)) {
1032 Status
= RowHexValue ( SocketFD
,
1037 if ( EFI_ERROR ( Status
)) {
1040 Status
= RowAnsiArray ( SocketFD
,
1043 sizeof ( pFadt
->OemId
),
1044 (CONST CHAR8
*)&pFadt
->OemId
[ 0 ]);
1045 if ( EFI_ERROR ( Status
)) {
1048 Status
= RowAnsiArray ( SocketFD
,
1051 sizeof ( pFadt
->OemTableId
),
1052 (CONST CHAR8
*)&pFadt
->OemTableId
[ 0 ]);
1053 if ( EFI_ERROR ( Status
)) {
1056 Status
= RowRevision ( SocketFD
,
1059 pFadt
->OemRevision
);
1060 if ( EFI_ERROR ( Status
)) {
1063 Status
= RowAnsiArray ( SocketFD
,
1066 sizeof ( pFadt
->CreatorId
),
1067 (CHAR8
*)&pFadt
->CreatorId
);
1068 if ( EFI_ERROR ( Status
)) {
1071 Status
= RowRevision ( SocketFD
,
1074 pFadt
->CreatorRevision
);
1075 if ( EFI_ERROR ( Status
)) {
1080 // Display the data from the FADT
1082 Status
= RowPointer ( SocketFD
,
1085 (CONST VOID
*)pFadt
->FirmwareCtrl
,
1087 if ( EFI_ERROR ( Status
)) {
1090 Status
= RowPointer ( SocketFD
,
1093 (CONST VOID
*)pFadt
->DSDT
,
1094 ( pFadt
->DSDT
== pFadt
->XDsdt
) ? PAGE_ACPI_DSDT
: NULL
);
1095 if ( EFI_ERROR ( Status
)) {
1098 Status
= RowHexValue ( SocketFD
,
1103 if ( EFI_ERROR ( Status
)) {
1106 Status
= RowHexValue ( SocketFD
,
1108 "Preferred_PM_Profile",
1109 pFadt
->PreferredPmProfile
,
1111 if ( EFI_ERROR ( Status
)) {
1114 Status
= RowHexValue ( SocketFD
,
1119 if ( EFI_ERROR ( Status
)) {
1122 Status
= RowHexValue ( SocketFD
,
1127 if ( EFI_ERROR ( Status
)) {
1130 Status
= RowHexValue ( SocketFD
,
1135 if ( EFI_ERROR ( Status
)) {
1138 Status
= RowHexValue ( SocketFD
,
1143 if ( EFI_ERROR ( Status
)) {
1146 Status
= RowHexValue ( SocketFD
,
1151 if ( EFI_ERROR ( Status
)) {
1154 Status
= RowHexValue ( SocketFD
,
1159 if ( EFI_ERROR ( Status
)) {
1162 Status
= RowHexValue ( SocketFD
,
1167 if ( EFI_ERROR ( Status
)) {
1170 Status
= RowHexValue ( SocketFD
,
1175 if ( EFI_ERROR ( Status
)) {
1178 Status
= RowHexValue ( SocketFD
,
1183 if ( EFI_ERROR ( Status
)) {
1186 Status
= RowHexValue ( SocketFD
,
1191 if ( EFI_ERROR ( Status
)) {
1194 Status
= RowHexValue ( SocketFD
,
1199 if ( EFI_ERROR ( Status
)) {
1202 Status
= RowHexValue ( SocketFD
,
1207 if ( EFI_ERROR ( Status
)) {
1211 Status
= RowHexValue ( SocketFD
,
1216 if ( EFI_ERROR ( Status
)) {
1219 Status
= RowHexValue ( SocketFD
,
1224 if ( EFI_ERROR ( Status
)) {
1227 Status
= RowDecimalValue ( SocketFD
,
1231 if ( EFI_ERROR ( Status
)) {
1234 Status
= RowDecimalValue ( SocketFD
,
1238 if ( EFI_ERROR ( Status
)) {
1241 Status
= RowDecimalValue ( SocketFD
,
1245 if ( EFI_ERROR ( Status
)) {
1248 Status
= RowDecimalValue ( SocketFD
,
1252 if ( EFI_ERROR ( Status
)) {
1255 Status
= RowDecimalValue ( SocketFD
,
1258 pFadt
->Gpe0BlkLen
);
1259 if ( EFI_ERROR ( Status
)) {
1262 Status
= RowDecimalValue ( SocketFD
,
1265 pFadt
->Gpe1BlkLen
);
1266 if ( EFI_ERROR ( Status
)) {
1269 Status
= RowHexValue ( SocketFD
,
1274 if ( EFI_ERROR ( Status
)) {
1277 Status
= RowDecimalValue ( SocketFD
,
1281 if ( EFI_ERROR ( Status
)) {
1284 Status
= RowHexValue ( SocketFD
,
1289 if ( EFI_ERROR ( Status
)) {
1292 Status
= RowHexValue ( SocketFD
,
1297 if ( EFI_ERROR ( Status
)) {
1300 Status
= RowDecimalValue ( SocketFD
,
1304 if ( EFI_ERROR ( Status
)) {
1307 Status
= RowDecimalValue ( SocketFD
,
1310 pFadt
->FlushStride
);
1311 if ( EFI_ERROR ( Status
)) {
1314 Status
= RowHexValue ( SocketFD
,
1319 if ( EFI_ERROR ( Status
)) {
1322 Status
= RowHexValue ( SocketFD
,
1327 if ( EFI_ERROR ( Status
)) {
1330 Status
= RowHexValue ( SocketFD
,
1335 if ( EFI_ERROR ( Status
)) {
1338 Status
= RowHexValue ( SocketFD
,
1343 if ( EFI_ERROR ( Status
)) {
1346 Status
= RowHexValue ( SocketFD
,
1351 if ( EFI_ERROR ( Status
)) {
1354 Status
= RowHexValue ( SocketFD
,
1357 pFadt
->IapcBootArch
,
1359 if ( EFI_ERROR ( Status
)) {
1362 Status
= RowHexValue ( SocketFD
,
1367 if ( EFI_ERROR ( Status
)) {
1370 Status
= RowHexValue ( SocketFD
,
1375 if ( EFI_ERROR ( Status
)) {
1378 Status
= RowGenericAddress ( SocketFD
,
1381 &pFadt
->ResetReg
[0],
1383 if ( EFI_ERROR ( Status
)) {
1386 Status
= RowHexValue ( SocketFD
,
1391 if ( EFI_ERROR ( Status
)) {
1394 Status
= RowHexValue ( SocketFD
,
1397 pFadt
->Reserved3
[0],
1399 if ( EFI_ERROR ( Status
)) {
1402 Status
= RowHexValue ( SocketFD
,
1405 pFadt
->Reserved3
[1],
1407 if ( EFI_ERROR ( Status
)) {
1410 Status
= RowHexValue ( SocketFD
,
1413 pFadt
->Reserved3
[2],
1415 if ( EFI_ERROR ( Status
)) {
1418 Status
= RowHexValue ( SocketFD
,
1421 pFadt
->XFirmwareCtrl
,
1423 if ( EFI_ERROR ( Status
)) {
1426 Status
= RowHexValue ( SocketFD
,
1431 if ( EFI_ERROR ( Status
)) {
1434 Status
= RowGenericAddress ( SocketFD
,
1437 &pFadt
->XPm1aEvtBlk
[0],
1439 if ( EFI_ERROR ( Status
)) {
1442 Status
= RowGenericAddress ( SocketFD
,
1445 &pFadt
->XPm1bEvtBlk
[0],
1447 if ( EFI_ERROR ( Status
)) {
1450 Status
= RowGenericAddress ( SocketFD
,
1453 &pFadt
->XPm1aCntBlk
[0],
1455 if ( EFI_ERROR ( Status
)) {
1458 Status
= RowGenericAddress ( SocketFD
,
1461 &pFadt
->XPm1bCntBlk
[0],
1463 if ( EFI_ERROR ( Status
)) {
1466 Status
= RowGenericAddress ( SocketFD
,
1469 &pFadt
->XPm2CntBlk
[0],
1471 if ( EFI_ERROR ( Status
)) {
1474 Status
= RowGenericAddress ( SocketFD
,
1477 &pFadt
->XPmTmrBlk
[0],
1479 if ( EFI_ERROR ( Status
)) {
1482 Status
= RowGenericAddress ( SocketFD
,
1485 &pFadt
->XGpe0Blk
[0],
1487 if ( EFI_ERROR ( Status
)) {
1490 Status
= RowGenericAddress ( SocketFD
,
1493 &pFadt
->XGpe1Blk
[0],
1495 if ( EFI_ERROR ( Status
)) {
1500 // Build the table trailer
1502 Status
= TableTrailer ( SocketFD
,
1509 // Return the operation status
1511 DBG_EXIT_STATUS ( Status
);
1517 Respond with the ACPI RSDP 1.0b table
1519 @param [in] SocketFD The socket's file descriptor to add to the list.
1520 @param [in] pPort The WSDT_PORT structure address
1521 @param [out] pbDone Address to receive the request completion status
1523 @retval EFI_SUCCESS The request was successfully processed
1529 IN WSDT_PORT
* pPort
,
1530 OUT BOOLEAN
* pbDone
1533 CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp10b
;
1539 // Send the RSDP page
1545 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpi10TableGuid
, (VOID
**) &pRsdp10b
);
1546 if ( EFI_ERROR ( Status
)) {
1551 // Send the page and table header
1553 Status
= TableHeader ( SocketFD
, pPort
, L
"RSDP - ACPI 1.0b Root System Description Pointer", pRsdp10b
);
1554 if ( EFI_ERROR ( Status
)) {
1561 Status
= RowAnsiArray ( SocketFD
,
1564 sizeof ( pRsdp10b
->Signature
),
1565 (CHAR8
*)&pRsdp10b
->Signature
);
1566 if ( EFI_ERROR ( Status
)) {
1569 Status
= RowHexValue ( SocketFD
,
1574 if ( EFI_ERROR ( Status
)) {
1577 Status
= RowAnsiArray ( SocketFD
,
1580 sizeof ( pRsdp10b
->OemId
),
1581 (CONST CHAR8
*)&pRsdp10b
->OemId
[ 0 ]);
1582 if ( EFI_ERROR ( Status
)) {
1585 Status
= RowHexValue ( SocketFD
,
1590 if ( EFI_ERROR ( Status
)) {
1593 Status
= RowPointer ( SocketFD
,
1596 (VOID
*)pRsdp10b
->RsdtAddress
,
1598 if ( EFI_ERROR ( Status
)) {
1603 // Build the table trailer
1605 Status
= TableTrailer ( SocketFD
,
1612 // Return the operation status
1614 DBG_EXIT_STATUS ( Status
);
1620 Respond with the ACPI RSDP 3.0 table
1622 @param [in] SocketFD The socket's file descriptor to add to the list.
1623 @param [in] pPort The WSDT_PORT structure address
1624 @param [out] pbDone Address to receive the request completion status
1626 @retval EFI_SUCCESS The request was successfully processed
1632 IN WSDT_PORT
* pPort
,
1633 OUT BOOLEAN
* pbDone
1636 CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp30
;
1642 // Send the RSDP page
1648 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid
, (VOID
**) &pRsdp30
);
1649 if ( EFI_ERROR ( Status
)) {
1654 // Send the page and table header
1656 Status
= TableHeader ( SocketFD
, pPort
, L
"RSDP - ACPI 3.0 Root System Description Pointer", pRsdp30
);
1657 if ( EFI_ERROR ( Status
)) {
1664 Status
= RowAnsiArray ( SocketFD
,
1667 sizeof ( pRsdp30
->Signature
),
1668 (CHAR8
*)&pRsdp30
->Signature
);
1669 if ( EFI_ERROR ( Status
)) {
1672 Status
= RowHexValue ( SocketFD
,
1677 if ( EFI_ERROR ( Status
)) {
1680 Status
= RowAnsiArray ( SocketFD
,
1683 sizeof ( pRsdp30
->OemId
),
1684 (CONST CHAR8
*)&pRsdp30
->OemId
[ 0 ]);
1685 if ( EFI_ERROR ( Status
)) {
1688 Status
= RowHexValue ( SocketFD
,
1693 if ( EFI_ERROR ( Status
)) {
1696 Status
= RowPointer ( SocketFD
,
1699 (VOID
*)pRsdp30
->RsdtAddress
,
1701 if ( EFI_ERROR ( Status
)) {
1704 Status
= RowDecimalValue ( SocketFD
,
1708 if ( EFI_ERROR ( Status
)) {
1711 Status
= RowPointer ( SocketFD
,
1714 (VOID
*)(UINTN
)pRsdp30
->XsdtAddress
,
1716 if ( EFI_ERROR ( Status
)) {
1719 Status
= RowHexValue ( SocketFD
,
1722 pRsdp30
->ExtendedChecksum
,
1724 if ( EFI_ERROR ( Status
)) {
1727 Status
= RowBytes ( SocketFD
,
1730 sizeof ( pRsdp30
->Reserved
),
1731 &pRsdp30
->Reserved
[ 0 ]);
1732 if ( EFI_ERROR ( Status
)) {
1737 // Build the table trailer
1739 Status
= TableTrailer ( SocketFD
,
1746 // Return the operation status
1748 DBG_EXIT_STATUS ( Status
);
1754 Respond with the ACPI RSDT table
1756 @param [in] SocketFD The socket's file descriptor to add to the list.
1757 @param [in] pPort The WSDT_PORT structure address
1758 @param [out] pbDone Address to receive the request completion status
1760 @retval EFI_SUCCESS The request was successfully processed
1766 IN WSDT_PORT
* pPort
,
1767 OUT BOOLEAN
* pbDone
1770 CONST UINT32
* pEnd
;
1771 CONST UINT32
* pEntry
;
1772 CONST ACPI_RSDT
* pRsdt
;
1773 CONST CHAR8
* pTableName
;
1774 CONST CHAR16
* pWebPage
;
1776 UINT32 TableName
[ 2 ];
1781 // Send the RSDT page
1787 pRsdt
= LocateRsdt ( );
1788 if ( NULL
== pRsdt
) {
1789 Status
= EFI_NOT_FOUND
;
1794 // Send the page and table header
1796 Status
= TableHeader ( SocketFD
, pPort
, L
"RSDT - ACPI Root System Description Table", pRsdt
);
1797 if ( EFI_ERROR ( Status
)) {
1804 Status
= RowAnsiArray ( SocketFD
,
1807 sizeof ( pRsdt
->Signature
),
1808 (CHAR8
*)&pRsdt
->Signature
);
1809 if ( EFI_ERROR ( Status
)) {
1812 Status
= RowDecimalValue ( SocketFD
,
1816 if ( EFI_ERROR ( Status
)) {
1819 Status
= RowDecimalValue ( SocketFD
,
1823 if ( EFI_ERROR ( Status
)) {
1826 Status
= RowHexValue ( SocketFD
,
1831 if ( EFI_ERROR ( Status
)) {
1834 Status
= RowAnsiArray ( SocketFD
,
1837 sizeof ( pRsdt
->OemId
),
1838 (CONST CHAR8
*)&pRsdt
->OemId
[ 0 ]);
1839 if ( EFI_ERROR ( Status
)) {
1842 Status
= RowAnsiArray ( SocketFD
,
1845 sizeof ( pRsdt
->OemTableId
),
1846 (CONST CHAR8
*)&pRsdt
->OemTableId
[ 0 ]);
1847 if ( EFI_ERROR ( Status
)) {
1850 Status
= RowRevision ( SocketFD
,
1853 pRsdt
->OemRevision
);
1854 if ( EFI_ERROR ( Status
)) {
1857 Status
= RowAnsiArray ( SocketFD
,
1860 sizeof ( pRsdt
->CreatorId
),
1861 (CHAR8
*)&pRsdt
->CreatorId
);
1862 if ( EFI_ERROR ( Status
)) {
1865 Status
= RowRevision ( SocketFD
,
1868 pRsdt
->CreatorRevision
);
1869 if ( EFI_ERROR ( Status
)) {
1874 // Walk the list of entries
1876 pEntry
= &pRsdt
->Entry
[ 0 ];
1877 pEnd
= &pEntry
[(( pRsdt
->Length
- sizeof ( *pRsdt
)) >> 2 ) + 1 ];
1879 while ( pEnd
> pEntry
) {
1881 // The entry is actually a 32-bit physical table address
1882 // The first entry in the table is the 32-bit table signature
1884 TableName
[ 0 ] = *(UINT32
*)*pEntry
;
1885 pWebPage
= SignatureLookup ( &TableName
[ 0 ], &pTableName
);
1888 // Display the table address
1890 Status
= RowPointer ( SocketFD
,
1895 if ( EFI_ERROR ( Status
)) {
1900 if ( EFI_ERROR ( Status
)) {
1905 // Build the table trailer
1907 Status
= TableTrailer ( SocketFD
,
1914 // Return the operation status
1916 DBG_EXIT_STATUS ( Status
);