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 #pragma warning ( disable : 4305 )
34 // Ensure proper structure formats
40 UINT8 RegisterBitWidth
;
41 UINT8 RegisterBitOffset
;
48 UINT32 Signature
; // 0
53 UINT8 OemTableId
[8]; // 16
54 UINT32 OemRevision
; // 24
55 UINT32 CreatorId
; // 28
56 UINT32 CreatorRevision
; // 32
57 UINT8 DefinitionBlock
[1]; // 36
62 UINT32 Signature
; // 0
67 UINT8 OemTableId
[8]; // 16
68 UINT32 OemRevision
; // 24
69 UINT32 CreatorId
; // 28
70 UINT32 CreatorRevision
; // 32
71 UINT32 FirmwareCtrl
; // 36
74 UINT8 PreferredPmProfile
; // 45
77 UINT8 AcpiEnable
; // 52
78 UINT8 AcpiDisable
; // 53
79 UINT8 S4BiosReq
; // 54
80 UINT8 PStateCnt
; // 55
81 UINT32 Pm1aEvtBlk
; // 56
82 UINT32 Pm1bEvtBlk
; // 60
83 UINT32 Pm1aCntBlk
; // 64
84 UINT32 Pm1bCntBlk
; // 68
85 UINT32 Pm2CntBlk
; // 72
86 UINT32 PmTmrBlk
; // 76
89 UINT8 Pm1EvtLen
; // 88
90 UINT8 Pm1CntLen
; // 89
91 UINT8 PM2CntLen
; // 90
93 UINT8 Gpe0BlkLen
; // 92
94 UINT8 Gpe1BlkLen
; // 93
97 UINT16 PLvl2Lat
; // 96
98 UINT16 PLvl3Lat
; // 98
99 UINT16 FlushSize
; // 100
100 UINT16 FlushStride
; // 102
101 UINT8 DutyOffset
; // 104
102 UINT8 DutyWidth
; // 105
103 UINT8 DayAlrm
; // 106
104 UINT8 MonAlrm
; // 107
105 UINT8 Century
; // 108
106 UINT16 IapcBootArch
; // 109
107 UINT8 Reserved2
; // 111
109 UINT32 ResetReg
[3]; // 116
110 UINT8 ResetValue
; // 128
111 UINT8 Reserved3
[3]; // 129
112 UINT64 XFirmwareCtrl
; // 132
114 UINT32 XPm1aEvtBlk
[3]; // 148
115 UINT32 XPm1bEvtBlk
[3]; // 160
116 UINT32 XPm1aCntBlk
[3]; // 172
117 UINT32 XPm1bCntBlk
[3]; // 184
118 UINT32 XPm2CntBlk
[3]; // 196
119 UINT32 XPmTmrBlk
[3]; // 208
120 UINT32 XGpe0Blk
[3]; // 220
121 UINT32 XGpe1Blk
[3]; // 232
134 UINT32 CreatorRevision
;
144 CONST CHAR8
* pTableName
;
145 CONST CHAR16
* pWebPage
;
149 CONST TABLE_SIGNATURE mTableId
[] = {
150 { DSDT_SIGNATURE
, "DSDT", PAGE_ACPI_DSDT
},
151 { FADT_SIGNATURE
, "FADT", PAGE_ACPI_FADT
}
156 Locate the RSDT table
158 @return Table address or NULL if not found
166 CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp10b
;
167 CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp30
;
168 CONST ACPI_RSDT
* pRsdt
;
172 // Use for/break instead of goto
179 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid
, (VOID
**)&pRsdp30
);
180 if ( !EFI_ERROR ( Status
)) {
181 pRsdt
= (ACPI_RSDT
*)pRsdp30
->RsdtAddress
;
184 Status
= EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid
, (VOID
**)&pRsdp10b
);
185 if ( EFI_ERROR ( Status
)) {
188 pRsdt
= (ACPI_RSDT
*)pRsdp10b
->RsdtAddress
;
194 // The entry was not found
201 Locate the specified table
203 @param [in] Signature Table signature
205 @return Table address or NULL if not found
214 CONST UINT32
* pEntry
;
215 CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp10b
;
216 CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp30
;
217 CONST ACPI_RSDT
* pRsdt
;
218 CONST UINT32
* pSignature
;
222 // Use for/break instead of goto
228 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid
, (VOID
**)&pRsdp30
);
229 if ( !EFI_ERROR ( Status
)) {
230 pRsdt
= (ACPI_RSDT
*)pRsdp30
->RsdtAddress
;
233 Status
= EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid
, (VOID
**)&pRsdp10b
);
234 if ( EFI_ERROR ( Status
)) {
237 pRsdt
= (ACPI_RSDT
*)pRsdp10b
->RsdtAddress
;
241 // Walk the list of entries
243 pEntry
= &pRsdt
->Entry
[ 0 ];
244 pEnd
= &pEntry
[(( pRsdt
->Length
- sizeof ( *pRsdt
)) >> 2 ) + 1 ];
245 while ( pEnd
> pEntry
) {
247 // The entry is actually a 32-bit physical table address
248 // The first entry in the table is the 32-bit table signature
250 pSignature
= (UINT32
*)*pEntry
;
251 if ( *pSignature
== Signature
) {
252 return (CONST VOID
*) *pEntry
;
256 // Set the next entry
264 // The entry was not found
271 Display a row containing a hex value
273 @param [in] SocketFD The socket's file descriptor to add to the list.
274 @param [in] pPort The WSDT_PORT structure address
275 @param [in] pName Address of a zero terminated name string
276 @param [in] Length Length in bytes
277 @param [in] pChar Address of the first character
279 @retval EFI_SUCCESS The request was successfully processed
285 IN WSDT_PORT
* pPort
,
286 IN CONST CHAR8
* pName
,
288 IN CONST CHAR8
* pChar
298 // Use for/break instead of goto
304 Status
= HttpSendAnsiString ( SocketFD
,
307 if ( EFI_ERROR ( Status
)) {
310 Status
= HttpSendAnsiString ( SocketFD
,
313 if ( EFI_ERROR ( Status
)) {
316 Status
= HttpSendAnsiString ( SocketFD
,
319 if ( EFI_ERROR ( Status
)) {
324 // Display the characters
327 pEnd
= &pChar
[ Length
];
328 while ( pEnd
> pData
) {
329 Status
= HttpSendCharacter ( SocketFD
,
333 if ( EFI_ERROR ( Status
)) {
337 if ( EFI_ERROR ( Status
)) {
342 // Display the byte values
344 Status
= HttpSendAnsiString ( SocketFD
,
347 if ( EFI_ERROR ( Status
)) {
351 while ( pEnd
> pData
) {
352 Status
= HttpSendHexBits ( SocketFD
,
356 if ( EFI_ERROR ( Status
)) {
359 if ( pEnd
> pData
) {
360 Status
= HttpSendAnsiString ( SocketFD
,
363 if ( EFI_ERROR ( Status
)) {
372 Status
= HttpSendAnsiString ( SocketFD
,
374 "</code></td></tr>\r\n" );
379 // Return the operation status
381 DBG_EXIT_STATUS ( Status
);
387 Format a row with a list of bytes
389 @param [in] SocketFD The socket's file descriptor to add to the list.
390 @param [in] pPort The WSDT_PORT structure address
391 @param [in] pName Zero terminated name string
392 @param [in] ByteCount The number of bytes to display
393 @param [in] pData Address of the byte array
395 @retval EFI_SUCCESS The request was successfully processed
401 IN WSDT_PORT
* pPort
,
404 IN CONST UINT8
* pData
411 // Use for/break instead of goto
417 Status
= HttpSendAnsiString ( SocketFD
,
420 if ( EFI_ERROR ( Status
)) {
425 // Display the field name
427 Status
= HttpSendAnsiString ( SocketFD
,
430 if ( EFI_ERROR ( Status
)) {
435 // Display the field value
437 Status
= HttpSendAnsiString ( SocketFD
,
439 "</td><td><code>0x" );
440 if ( EFI_ERROR ( Status
)) {
443 pEnd
= &pData
[ ByteCount
];
444 while ( pEnd
> pData
) {
445 Status
= HttpSendHexBits ( SocketFD
,
449 if ( EFI_ERROR ( Status
)) {
452 if ( pEnd
> pData
) {
453 Status
= HttpSendAnsiString ( SocketFD
,
456 if ( EFI_ERROR ( Status
)) {
461 if ( EFI_ERROR ( Status
)) {
468 Status
= HttpSendAnsiString ( SocketFD
,
470 "</code></td></tr>\r\n" );
475 // Return the operation status
482 Format a row with a list of bytes
484 @param [in] SocketFD The socket's file descriptor to add to the list.
485 @param [in] pPort The WSDT_PORT structure address
486 @param [in] pName Zero terminated name string
487 @param [in] ByteCount The number of bytes to display
488 @param [in] pData Address of the byte array
490 @retval EFI_SUCCESS The request was successfully processed
496 IN WSDT_PORT
* pPort
,
499 IN CONST UINT8
* pData
505 // Use for/break instead of goto
511 Status
= HttpSendAnsiString ( SocketFD
,
514 if ( EFI_ERROR ( Status
)) {
519 // Display the field name
521 Status
= HttpSendAnsiString ( SocketFD
,
524 if ( EFI_ERROR ( Status
)) {
529 // Start the field value
531 Status
= HttpSendAnsiString ( SocketFD
,
534 if ( EFI_ERROR ( Status
)) {
541 Status
= HttpSendDump ( SocketFD
,
547 // Terminate the field value and row
549 Status
= HttpSendAnsiString ( SocketFD
,
556 // Return the operation status
563 Format a row with a general address
565 @param [in] SocketFD The socket's file descriptor to add to the list.
566 @param [in] pPort The WSDT_PORT structure address
567 @param [in] pName Zero terminated name string
568 @param [in] pAddr Address of the general address buffer
569 @param [in] pWebPage Zero terminated web page address
571 @retval EFI_SUCCESS The request was successfully processed
577 IN WSDT_PORT
* pPort
,
579 IN CONST UINT32
* pAddr
,
580 IN CONST CHAR16
* pWebPage
583 CONST GENERIC_ADDRESS
* pGenericAddress
;
587 // Use for/break instead of goto
593 Status
= HttpSendAnsiString ( SocketFD
,
596 if ( EFI_ERROR ( Status
)) {
601 // Display the field name
603 Status
= HttpSendAnsiString ( SocketFD
,
606 if ( EFI_ERROR ( Status
)) {
611 // Display the field value
613 Status
= HttpSendAnsiString ( SocketFD
,
616 if ( EFI_ERROR ( Status
)) {
621 // Determine the type of address
623 pGenericAddress
= (CONST GENERIC_ADDRESS
*)pAddr
;
624 if ( 0 == pGenericAddress
->AddressSpaceId
) {
625 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "System Memory" );
627 else if ( 1 == pGenericAddress
->AddressSpaceId
) {
628 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "I/O Space" );
630 else if ( 2 == pGenericAddress
->AddressSpaceId
) {
631 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "PCI Configuration Space" );
633 else if ( 3 == pGenericAddress
->AddressSpaceId
) {
634 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "Embedded Controller" );
636 else if ( 4 == pGenericAddress
->AddressSpaceId
) {
637 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "SMBus" );
639 else if ( 0x7f == pGenericAddress
->AddressSpaceId
) {
640 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "Functional Fixed Hardware" );
642 else if (( 0xc0 <= pGenericAddress
->AddressSpaceId
)
643 && ( 0xff >= pGenericAddress
->AddressSpaceId
)) {
644 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "OEM Defined" );
647 Status
= HttpSendAnsiString ( SocketFD
, pPort
, "Reserved" );
649 if ( EFI_ERROR ( Status
)) {
652 Status
= HttpSendAnsiString ( SocketFD
,
654 "<br/>Register Bit Width: " );
655 if ( EFI_ERROR ( Status
)) {
658 Status
= HttpSendValue ( SocketFD
,
660 pGenericAddress
->RegisterBitWidth
);
661 if ( EFI_ERROR ( Status
)) {
664 Status
= HttpSendAnsiString ( SocketFD
,
666 "<br/>Register Bit Offset: " );
667 if ( EFI_ERROR ( Status
)) {
670 Status
= HttpSendHexValue ( SocketFD
,
672 pGenericAddress
->RegisterBitOffset
);
673 if ( EFI_ERROR ( Status
)) {
676 Status
= HttpSendAnsiString ( SocketFD
,
678 "<br/>Access Size: " );
679 if ( EFI_ERROR ( Status
)) {
682 Status
= HttpSendValue ( SocketFD
,
684 pGenericAddress
->AccessSize
);
685 if ( EFI_ERROR ( Status
)) {
688 Status
= HttpSendAnsiString ( SocketFD
,
691 if ( EFI_ERROR ( Status
)) {
696 // Add the web-page link if necessary
698 if ( NULL
!= pWebPage
) {
699 Status
= HttpSendAnsiString ( SocketFD
,
701 "<a target=\"_blank\" href=\"" );
702 if ( EFI_ERROR ( Status
)) {
705 Status
= HttpSendUnicodeString ( SocketFD
,
708 if ( EFI_ERROR ( Status
)) {
711 Status
= HttpSendAnsiString ( SocketFD
,
714 if ( EFI_ERROR ( Status
)) {
720 // Display the address
722 Status
= HttpSendAnsiString ( SocketFD
,
725 if ( EFI_ERROR ( Status
)) {
728 Status
= HttpSendHexBits ( SocketFD
,
731 pGenericAddress
->Address
);
732 if ( EFI_ERROR ( Status
)) {
737 // Finish the web-page link if necessary
739 if ( NULL
!= pWebPage
) {
740 Status
= HttpSendAnsiString ( SocketFD
,
743 if ( EFI_ERROR ( Status
)) {
751 Status
= HttpSendAnsiString ( SocketFD
,
753 "</code></td></tr>\r\n" );
758 // Return the operation status
765 Translate a table address into a web page
767 @param [in] pSignature Address of the table signature
768 @param [out] ppTableName Address to receive the table name address
770 @return Zero terminated web page address or NULL if not found
775 IN UINT32
* pSignature
,
776 OUT CONST CHAR8
** ppTableName
779 CONST TABLE_SIGNATURE
* pTableId
;
780 CONST TABLE_SIGNATURE
* pEnd
;
784 // Walk the list of tables
786 Signature
= *pSignature
;
787 pTableId
= &mTableId
[ 0 ];
788 pEnd
= &pTableId
[ sizeof ( mTableId
) / sizeof ( mTableId
[ 0 ])];
789 while ( pEnd
> pTableId
) {
791 // Attempt to locate the table signature
793 if ( pTableId
->Signature
== Signature
) {
795 // The signature was found
796 // Return the web page
798 *ppTableName
= pTableId
->pTableName
;
799 return pTableId
->pWebPage
;
803 // Set the next table
809 // The table was not found
811 *ppTableName
= (CONST CHAR8
*)pSignature
;
817 Respond with the ACPI DSDT table
819 @param [in] SocketFD The socket's file descriptor to add to the list.
820 @param [in] pPort The WSDT_PORT structure address
821 @param [out] pbDone Address to receive the request completion status
823 @retval EFI_SUCCESS The request was successfully processed
829 IN WSDT_PORT
* pPort
,
833 CONST ACPI_DSDT
* pDsdt
;
834 CONST ACPI_FADT
* pFadt
;
840 // Send the DADT page
846 pFadt
= (ACPI_FADT
*)LocateTable ( FADT_SIGNATURE
);
847 if ( NULL
== pFadt
) {
848 Status
= EFI_NOT_FOUND
;
851 pDsdt
= (VOID
*)pFadt
->XDsdt
;
854 // Send the page and table header
856 Status
= TableHeader ( SocketFD
, pPort
, L
"DSDT - Differentiated System Description Table", pDsdt
);
857 if ( EFI_ERROR ( Status
)) {
862 // Display the DSDT header
864 Status
= RowAnsiArray ( SocketFD
,
867 sizeof ( pDsdt
->Signature
),
868 (CHAR8
*)&pDsdt
->Signature
);
869 if ( EFI_ERROR ( Status
)) {
872 Status
= RowDecimalValue ( SocketFD
,
876 if ( EFI_ERROR ( Status
)) {
879 Status
= RowDecimalValue ( SocketFD
,
883 if ( EFI_ERROR ( Status
)) {
886 Status
= RowHexValue ( SocketFD
,
891 if ( EFI_ERROR ( Status
)) {
894 Status
= RowAnsiArray ( SocketFD
,
897 sizeof ( pDsdt
->OemId
),
898 &pDsdt
->OemId
[ 0 ]);
899 if ( EFI_ERROR ( Status
)) {
902 Status
= RowAnsiArray ( SocketFD
,
905 sizeof ( pDsdt
->OemTableId
),
906 &pDsdt
->OemTableId
[ 0 ]);
907 if ( EFI_ERROR ( Status
)) {
910 Status
= RowRevision ( SocketFD
,
913 pDsdt
->OemRevision
);
914 if ( EFI_ERROR ( Status
)) {
917 Status
= RowAnsiArray ( SocketFD
,
920 sizeof ( pDsdt
->CreatorId
),
921 (CHAR8
*)&pDsdt
->CreatorId
);
922 if ( EFI_ERROR ( Status
)) {
925 Status
= RowRevision ( SocketFD
,
928 pDsdt
->CreatorRevision
);
929 if ( EFI_ERROR ( Status
)) {
934 // Display the data from the DSDT
936 Status
= RowDump ( SocketFD
,
939 pDsdt
->Length
- sizeof ( *pDsdt
) + 1,
940 &pDsdt
->DefinitionBlock
[0]);
941 if ( EFI_ERROR ( Status
)) {
946 // Build the table trailer
948 Status
= TableTrailer ( SocketFD
,
955 // Return the operation status
957 DBG_EXIT_STATUS ( Status
);
963 Respond with the ACPI FADT table
965 @param [in] SocketFD The socket's file descriptor to add to the list.
966 @param [in] pPort The WSDT_PORT structure address
967 @param [out] pbDone Address to receive the request completion status
969 @retval EFI_SUCCESS The request was successfully processed
975 IN WSDT_PORT
* pPort
,
979 CONST ACPI_FADT
* pFadt
;
985 // Send the FADT page
991 pFadt
= (ACPI_FADT
*)LocateTable ( FADT_SIGNATURE
);
992 if ( NULL
== pFadt
) {
993 Status
= EFI_NOT_FOUND
;
998 // Send the page and table header
1000 Status
= TableHeader ( SocketFD
, pPort
, L
"FADT - Fixed ACPI Description Table", pFadt
);
1001 if ( EFI_ERROR ( Status
)) {
1006 // Display the FSDT header
1008 Status
= RowAnsiArray ( SocketFD
,
1011 sizeof ( pFadt
->Signature
),
1012 (CHAR8
*)&pFadt
->Signature
);
1013 if ( EFI_ERROR ( Status
)) {
1016 Status
= RowDecimalValue ( SocketFD
,
1020 if ( EFI_ERROR ( Status
)) {
1023 Status
= RowDecimalValue ( SocketFD
,
1027 if ( EFI_ERROR ( Status
)) {
1030 Status
= RowHexValue ( SocketFD
,
1035 if ( EFI_ERROR ( Status
)) {
1038 Status
= RowAnsiArray ( SocketFD
,
1041 sizeof ( pFadt
->OemId
),
1042 &pFadt
->OemId
[ 0 ]);
1043 if ( EFI_ERROR ( Status
)) {
1046 Status
= RowAnsiArray ( SocketFD
,
1049 sizeof ( pFadt
->OemTableId
),
1050 &pFadt
->OemTableId
[ 0 ]);
1051 if ( EFI_ERROR ( Status
)) {
1054 Status
= RowRevision ( SocketFD
,
1057 pFadt
->OemRevision
);
1058 if ( EFI_ERROR ( Status
)) {
1061 Status
= RowAnsiArray ( SocketFD
,
1064 sizeof ( pFadt
->CreatorId
),
1065 (CHAR8
*)&pFadt
->CreatorId
);
1066 if ( EFI_ERROR ( Status
)) {
1069 Status
= RowRevision ( SocketFD
,
1072 pFadt
->CreatorRevision
);
1073 if ( EFI_ERROR ( Status
)) {
1078 // Display the data from the FADT
1080 Status
= RowPointer ( SocketFD
,
1083 (CONST VOID
*)pFadt
->FirmwareCtrl
,
1085 if ( EFI_ERROR ( Status
)) {
1088 Status
= RowPointer ( SocketFD
,
1091 (CONST VOID
*)pFadt
->DSDT
,
1092 ( pFadt
->DSDT
== pFadt
->XDsdt
) ? PAGE_ACPI_DSDT
: NULL
);
1093 if ( EFI_ERROR ( Status
)) {
1096 Status
= RowHexValue ( SocketFD
,
1101 if ( EFI_ERROR ( Status
)) {
1104 Status
= RowHexValue ( SocketFD
,
1106 "Preferred_PM_Profile",
1107 pFadt
->PreferredPmProfile
,
1109 if ( EFI_ERROR ( Status
)) {
1112 Status
= RowHexValue ( SocketFD
,
1117 if ( EFI_ERROR ( Status
)) {
1120 Status
= RowHexValue ( SocketFD
,
1125 if ( EFI_ERROR ( Status
)) {
1128 Status
= RowHexValue ( SocketFD
,
1133 if ( EFI_ERROR ( Status
)) {
1136 Status
= RowHexValue ( SocketFD
,
1141 if ( EFI_ERROR ( Status
)) {
1144 Status
= RowHexValue ( SocketFD
,
1149 if ( EFI_ERROR ( Status
)) {
1152 Status
= RowHexValue ( SocketFD
,
1157 if ( EFI_ERROR ( Status
)) {
1160 Status
= RowHexValue ( SocketFD
,
1165 if ( EFI_ERROR ( Status
)) {
1168 Status
= RowHexValue ( SocketFD
,
1173 if ( EFI_ERROR ( Status
)) {
1176 Status
= RowHexValue ( SocketFD
,
1181 if ( EFI_ERROR ( Status
)) {
1184 Status
= RowHexValue ( SocketFD
,
1189 if ( EFI_ERROR ( Status
)) {
1192 Status
= RowHexValue ( SocketFD
,
1197 if ( EFI_ERROR ( Status
)) {
1200 Status
= RowHexValue ( SocketFD
,
1205 if ( EFI_ERROR ( Status
)) {
1209 Status
= RowHexValue ( SocketFD
,
1214 if ( EFI_ERROR ( Status
)) {
1217 Status
= RowHexValue ( SocketFD
,
1222 if ( EFI_ERROR ( Status
)) {
1225 Status
= RowDecimalValue ( SocketFD
,
1229 if ( EFI_ERROR ( Status
)) {
1232 Status
= RowDecimalValue ( SocketFD
,
1236 if ( EFI_ERROR ( Status
)) {
1239 Status
= RowDecimalValue ( SocketFD
,
1243 if ( EFI_ERROR ( Status
)) {
1246 Status
= RowDecimalValue ( SocketFD
,
1250 if ( EFI_ERROR ( Status
)) {
1253 Status
= RowDecimalValue ( SocketFD
,
1256 pFadt
->Gpe0BlkLen
);
1257 if ( EFI_ERROR ( Status
)) {
1260 Status
= RowDecimalValue ( SocketFD
,
1263 pFadt
->Gpe1BlkLen
);
1264 if ( EFI_ERROR ( Status
)) {
1267 Status
= RowHexValue ( SocketFD
,
1272 if ( EFI_ERROR ( Status
)) {
1275 Status
= RowDecimalValue ( SocketFD
,
1279 if ( EFI_ERROR ( Status
)) {
1282 Status
= RowHexValue ( SocketFD
,
1287 if ( EFI_ERROR ( Status
)) {
1290 Status
= RowHexValue ( SocketFD
,
1295 if ( EFI_ERROR ( Status
)) {
1298 Status
= RowDecimalValue ( SocketFD
,
1302 if ( EFI_ERROR ( Status
)) {
1305 Status
= RowDecimalValue ( SocketFD
,
1308 pFadt
->FlushStride
);
1309 if ( EFI_ERROR ( Status
)) {
1312 Status
= RowHexValue ( SocketFD
,
1317 if ( EFI_ERROR ( Status
)) {
1320 Status
= RowHexValue ( SocketFD
,
1325 if ( EFI_ERROR ( Status
)) {
1328 Status
= RowHexValue ( SocketFD
,
1333 if ( EFI_ERROR ( Status
)) {
1336 Status
= RowHexValue ( SocketFD
,
1341 if ( EFI_ERROR ( Status
)) {
1344 Status
= RowHexValue ( SocketFD
,
1349 if ( EFI_ERROR ( Status
)) {
1352 Status
= RowHexValue ( SocketFD
,
1355 pFadt
->IapcBootArch
,
1357 if ( EFI_ERROR ( Status
)) {
1360 Status
= RowHexValue ( SocketFD
,
1365 if ( EFI_ERROR ( Status
)) {
1368 Status
= RowHexValue ( SocketFD
,
1373 if ( EFI_ERROR ( Status
)) {
1376 Status
= RowGenericAddress ( SocketFD
,
1379 &pFadt
->ResetReg
[0],
1381 if ( EFI_ERROR ( Status
)) {
1384 Status
= RowHexValue ( SocketFD
,
1389 if ( EFI_ERROR ( Status
)) {
1392 Status
= RowHexValue ( SocketFD
,
1395 pFadt
->Reserved3
[0],
1397 if ( EFI_ERROR ( Status
)) {
1400 Status
= RowHexValue ( SocketFD
,
1403 pFadt
->Reserved3
[1],
1405 if ( EFI_ERROR ( Status
)) {
1408 Status
= RowHexValue ( SocketFD
,
1411 pFadt
->Reserved3
[2],
1413 if ( EFI_ERROR ( Status
)) {
1416 Status
= RowHexValue ( SocketFD
,
1419 pFadt
->XFirmwareCtrl
,
1421 if ( EFI_ERROR ( Status
)) {
1424 Status
= RowHexValue ( SocketFD
,
1429 if ( EFI_ERROR ( Status
)) {
1432 Status
= RowGenericAddress ( SocketFD
,
1435 &pFadt
->XPm1aEvtBlk
[0],
1437 if ( EFI_ERROR ( Status
)) {
1440 Status
= RowGenericAddress ( SocketFD
,
1443 &pFadt
->XPm1bEvtBlk
[0],
1445 if ( EFI_ERROR ( Status
)) {
1448 Status
= RowGenericAddress ( SocketFD
,
1451 &pFadt
->XPm1aCntBlk
[0],
1453 if ( EFI_ERROR ( Status
)) {
1456 Status
= RowGenericAddress ( SocketFD
,
1459 &pFadt
->XPm1bCntBlk
[0],
1461 if ( EFI_ERROR ( Status
)) {
1464 Status
= RowGenericAddress ( SocketFD
,
1467 &pFadt
->XPm2CntBlk
[0],
1469 if ( EFI_ERROR ( Status
)) {
1472 Status
= RowGenericAddress ( SocketFD
,
1475 &pFadt
->XPmTmrBlk
[0],
1477 if ( EFI_ERROR ( Status
)) {
1480 Status
= RowGenericAddress ( SocketFD
,
1483 &pFadt
->XGpe0Blk
[0],
1485 if ( EFI_ERROR ( Status
)) {
1488 Status
= RowGenericAddress ( SocketFD
,
1491 &pFadt
->XGpe1Blk
[0],
1493 if ( EFI_ERROR ( Status
)) {
1498 // Build the table trailer
1500 Status
= TableTrailer ( SocketFD
,
1507 // Return the operation status
1509 DBG_EXIT_STATUS ( Status
);
1515 Respond with the ACPI RSDP 1.0b table
1517 @param [in] SocketFD The socket's file descriptor to add to the list.
1518 @param [in] pPort The WSDT_PORT structure address
1519 @param [out] pbDone Address to receive the request completion status
1521 @retval EFI_SUCCESS The request was successfully processed
1527 IN WSDT_PORT
* pPort
,
1528 OUT BOOLEAN
* pbDone
1531 CONST EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp10b
;
1537 // Send the RSDP page
1543 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpi10TableGuid
, (VOID
**) &pRsdp10b
);
1544 if ( EFI_ERROR ( Status
)) {
1549 // Send the page and table header
1551 Status
= TableHeader ( SocketFD
, pPort
, L
"RSDP - ACPI 1.0b Root System Description Pointer", pRsdp10b
);
1552 if ( EFI_ERROR ( Status
)) {
1559 Status
= RowAnsiArray ( SocketFD
,
1562 sizeof ( pRsdp10b
->Signature
),
1563 (CHAR8
*)&pRsdp10b
->Signature
);
1564 if ( EFI_ERROR ( Status
)) {
1567 Status
= RowHexValue ( SocketFD
,
1572 if ( EFI_ERROR ( Status
)) {
1575 Status
= RowAnsiArray ( SocketFD
,
1578 sizeof ( pRsdp10b
->OemId
),
1579 &pRsdp10b
->OemId
[ 0 ]);
1580 if ( EFI_ERROR ( Status
)) {
1583 Status
= RowHexValue ( SocketFD
,
1588 if ( EFI_ERROR ( Status
)) {
1591 Status
= RowPointer ( SocketFD
,
1594 (VOID
*)pRsdp10b
->RsdtAddress
,
1596 if ( EFI_ERROR ( Status
)) {
1601 // Build the table trailer
1603 Status
= TableTrailer ( SocketFD
,
1610 // Return the operation status
1612 DBG_EXIT_STATUS ( Status
);
1618 Respond with the ACPI RSDP 3.0 table
1620 @param [in] SocketFD The socket's file descriptor to add to the list.
1621 @param [in] pPort The WSDT_PORT structure address
1622 @param [out] pbDone Address to receive the request completion status
1624 @retval EFI_SUCCESS The request was successfully processed
1630 IN WSDT_PORT
* pPort
,
1631 OUT BOOLEAN
* pbDone
1634 CONST EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER
* pRsdp30
;
1640 // Send the RSDP page
1646 Status
= EfiGetSystemConfigurationTable ( &gEfiAcpiTableGuid
, (VOID
**) &pRsdp30
);
1647 if ( EFI_ERROR ( Status
)) {
1652 // Send the page and table header
1654 Status
= TableHeader ( SocketFD
, pPort
, L
"RSDP - ACPI 3.0 Root System Description Pointer", pRsdp30
);
1655 if ( EFI_ERROR ( Status
)) {
1662 Status
= RowAnsiArray ( SocketFD
,
1665 sizeof ( pRsdp30
->Signature
),
1666 (CHAR8
*)&pRsdp30
->Signature
);
1667 if ( EFI_ERROR ( Status
)) {
1670 Status
= RowHexValue ( SocketFD
,
1675 if ( EFI_ERROR ( Status
)) {
1678 Status
= RowAnsiArray ( SocketFD
,
1681 sizeof ( pRsdp30
->OemId
),
1682 &pRsdp30
->OemId
[ 0 ]);
1683 if ( EFI_ERROR ( Status
)) {
1686 Status
= RowHexValue ( SocketFD
,
1691 if ( EFI_ERROR ( Status
)) {
1694 Status
= RowPointer ( SocketFD
,
1697 (VOID
*)pRsdp30
->RsdtAddress
,
1699 if ( EFI_ERROR ( Status
)) {
1702 Status
= RowDecimalValue ( SocketFD
,
1706 if ( EFI_ERROR ( Status
)) {
1709 Status
= RowPointer ( SocketFD
,
1712 (VOID
*)pRsdp30
->XsdtAddress
,
1714 if ( EFI_ERROR ( Status
)) {
1717 Status
= RowHexValue ( SocketFD
,
1720 pRsdp30
->ExtendedChecksum
,
1722 if ( EFI_ERROR ( Status
)) {
1725 Status
= RowBytes ( SocketFD
,
1728 sizeof ( pRsdp30
->Reserved
),
1729 &pRsdp30
->Reserved
[ 0 ]);
1730 if ( EFI_ERROR ( Status
)) {
1735 // Build the table trailer
1737 Status
= TableTrailer ( SocketFD
,
1744 // Return the operation status
1746 DBG_EXIT_STATUS ( Status
);
1752 Respond with the ACPI RSDT table
1754 @param [in] SocketFD The socket's file descriptor to add to the list.
1755 @param [in] pPort The WSDT_PORT structure address
1756 @param [out] pbDone Address to receive the request completion status
1758 @retval EFI_SUCCESS The request was successfully processed
1764 IN WSDT_PORT
* pPort
,
1765 OUT BOOLEAN
* pbDone
1768 CONST UINT32
* pEnd
;
1769 CONST UINT32
* pEntry
;
1770 CONST ACPI_RSDT
* pRsdt
;
1771 CONST CHAR8
* pTableName
;
1772 CONST CHAR16
* pWebPage
;
1774 UINT32 TableName
[ 2 ];
1779 // Send the RSDT page
1785 pRsdt
= LocateRsdt ( );
1786 if ( NULL
== pRsdt
) {
1787 Status
= EFI_NOT_FOUND
;
1792 // Send the page and table header
1794 Status
= TableHeader ( SocketFD
, pPort
, L
"RSDT - ACPI Root System Description Table", pRsdt
);
1795 if ( EFI_ERROR ( Status
)) {
1802 Status
= RowAnsiArray ( SocketFD
,
1805 sizeof ( pRsdt
->Signature
),
1806 (CHAR8
*)&pRsdt
->Signature
);
1807 if ( EFI_ERROR ( Status
)) {
1810 Status
= RowDecimalValue ( SocketFD
,
1814 if ( EFI_ERROR ( Status
)) {
1817 Status
= RowDecimalValue ( SocketFD
,
1821 if ( EFI_ERROR ( Status
)) {
1824 Status
= RowHexValue ( SocketFD
,
1829 if ( EFI_ERROR ( Status
)) {
1832 Status
= RowAnsiArray ( SocketFD
,
1835 sizeof ( pRsdt
->OemId
),
1836 &pRsdt
->OemId
[ 0 ]);
1837 if ( EFI_ERROR ( Status
)) {
1840 Status
= RowAnsiArray ( SocketFD
,
1843 sizeof ( pRsdt
->OemTableId
),
1844 &pRsdt
->OemTableId
[ 0 ]);
1845 if ( EFI_ERROR ( Status
)) {
1848 Status
= RowRevision ( SocketFD
,
1851 pRsdt
->OemRevision
);
1852 if ( EFI_ERROR ( Status
)) {
1855 Status
= RowAnsiArray ( SocketFD
,
1858 sizeof ( pRsdt
->CreatorId
),
1859 (CHAR8
*)&pRsdt
->CreatorId
);
1860 if ( EFI_ERROR ( Status
)) {
1863 Status
= RowRevision ( SocketFD
,
1866 pRsdt
->CreatorRevision
);
1867 if ( EFI_ERROR ( Status
)) {
1872 // Walk the list of entries
1874 pEntry
= &pRsdt
->Entry
[ 0 ];
1875 pEnd
= &pEntry
[(( pRsdt
->Length
- sizeof ( *pRsdt
)) >> 2 ) + 1 ];
1876 TableName
[ 1 ] = 0;
1877 while ( pEnd
> pEntry
) {
1879 // The entry is actually a 32-bit physical table address
1880 // The first entry in the table is the 32-bit table signature
1882 TableName
[ 0 ] = *(UINT32
*)*pEntry
;
1883 pWebPage
= SignatureLookup ( &TableName
[ 0 ], &pTableName
);
1886 // Display the table address
1888 Status
= RowPointer ( SocketFD
,
1893 if ( EFI_ERROR ( Status
)) {
1898 if ( EFI_ERROR ( Status
)) {
1903 // Build the table trailer
1905 Status
= TableTrailer ( SocketFD
,
1912 // Return the operation status
1914 DBG_EXIT_STATUS ( Status
);