3 Display the configuration table
5 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <WebServer.h>
11 #include <Guid/Acpi.h>
12 #include <Guid/DebugImageInfoTable.h>
13 #include <Guid/DxeServices.h>
14 #include <Guid/HobList.h>
15 #include <Guid/MemoryTypeInformation.h>
16 #include <Guid/LoadModuleAtFixedAddress.h>
25 CONST GUID_NAME mGuidName
[] = {
26 { L
"gEfiAcpi10TableGuid", &gEfiAcpi10TableGuid
, PAGE_ACPI_RSDP_10B
},
27 { L
"gEfiAcpiTableGuid", &gEfiAcpiTableGuid
, PAGE_ACPI_RSDP_30
},
28 { L
"gEfiDebugImageInfoTableGuid", &gEfiDebugImageInfoTableGuid
, NULL
},
29 { L
"gEfiDxeServicesTableGuid", &gEfiDxeServicesTableGuid
, PAGE_DXE_SERVICES_TABLE
},
30 { L
"gEfiHobListGuid", &gEfiHobListGuid
, NULL
},
31 { L
"gEfiMemoryTypeInformationGuid", &gEfiMemoryTypeInformationGuid
, NULL
},
32 { L
"gLoadFixedAddressConfigurationTableGuid", &gLoadFixedAddressConfigurationTableGuid
, NULL
}
36 Display a row containing a GUID value
38 @param [in] SocketFD The socket's file descriptor to add to the list.
39 @param [in] pPort The WSDT_PORT structure address
40 @param [in] pName Address of a zero terminated name string
41 @param [in] pGuid Address of the GUID to display
43 @retval EFI_SUCCESS The request was successfully processed
50 IN CONST CHAR8
* pName
,
51 IN CONST EFI_GUID
* pGuid
54 CONST GUID_NAME
* pGuidName
;
55 CONST GUID_NAME
* pGuidNameEnd
;
62 // Use for/break instead of goto
65 Status
= HttpSendAnsiString ( SocketFD
,
68 if ( EFI_ERROR ( Status
)) {
71 Status
= HttpSendAnsiString ( SocketFD
,
74 if ( EFI_ERROR ( Status
)) {
77 Status
= HttpSendAnsiString ( SocketFD
,
80 if ( EFI_ERROR ( Status
)) {
85 // Determine if this is a known GUID
87 pGuidName
= &mGuidName
[0];
88 pGuidNameEnd
= &pGuidName
[ sizeof ( mGuidName
) / sizeof ( mGuidName
[0])];
89 while ( pGuidNameEnd
> pGuidName
) {
90 if ( CompareGuid ( pGuidName
->pGuid
, pGuid
)) {
92 // Display the web link if available
94 if ( NULL
!= pGuidName
->pWebPage
) {
95 Status
= HttpSendAnsiString ( SocketFD
,
97 "<a target=\"_blank\" href=\"" );
98 if ( EFI_ERROR ( Status
)) {
101 Status
= HttpSendUnicodeString ( SocketFD
,
103 pGuidName
->pWebPage
);
104 if ( EFI_ERROR ( Status
)) {
107 Status
= HttpSendAnsiString ( SocketFD
,
110 if ( EFI_ERROR ( Status
)) {
116 // Display the GUID name
118 Status
= HttpSendUnicodeString ( SocketFD
,
120 pGuidName
->GuidName
);
123 // Complete the web link if available
125 if ( NULL
!= pGuidName
->pWebPage
) {
126 if ( EFI_ERROR ( Status
)) {
129 Status
= HttpSendAnsiString ( SocketFD
,
137 // Set the next GUID name
141 if ( EFI_ERROR ( Status
)) {
146 // Only if the entry is not known, display the GUID and type
148 if ( pGuidNameEnd
<= pGuidName
) {
152 Status
= HttpSendGuid ( SocketFD
,
155 if ( EFI_ERROR ( Status
)) {
160 // Display the GUID type
162 Status
= HttpSendAnsiString ( SocketFD
,
164 "<br/><a target=\"_blank\" href=\"http://www.ietf.org/rfc/rfc4122.txt\">Guid Type</a>: " );
165 if ( EFI_ERROR ( Status
)) {
168 Value
= pGuid
->Data4
[1];
174 Status
= HttpSendAnsiString ( SocketFD
,
178 else if ( 5 >= Value
) {
182 Status
= HttpSendAnsiString ( SocketFD
,
185 if ( EFI_ERROR ( Status
)) {
190 // Decode the standard type using RFC 4122
192 Value
= pGuid
->Data3
;
197 // Display the MAC address
199 Status
= HttpSendAnsiString ( SocketFD
,
202 if ( EFI_ERROR ( Status
)) {
205 Status
= HttpSendValue ( SocketFD
,
207 pGuid
->Data3
>> 12 );
211 Status
= HttpSendAnsiString ( SocketFD
,
217 Status
= HttpSendAnsiString ( SocketFD
,
223 Status
= HttpSendAnsiString ( SocketFD
,
229 Status
= HttpSendAnsiString ( SocketFD
,
235 Status
= HttpSendAnsiString ( SocketFD
,
241 else if ( 6 == Value
) {
243 // Microsoft's Component Object Model (COM) type
245 Status
= HttpSendAnsiString ( SocketFD
,
253 Status
= HttpSendAnsiString ( SocketFD
,
260 // Done with this entry
262 Status
= HttpSendAnsiString ( SocketFD
,
264 "</code></td></tr>\r\n" );
269 // Return the operation status
271 DBG_EXIT_STATUS ( Status
);
277 Respond with the configuration tables
279 @param [in] SocketFD The socket's file descriptor to add to the list.
280 @param [in] pPort The WSDT_PORT structure address
281 @param [out] pbDone Address to receive the request completion status
283 @retval EFI_SUCCESS The request was successfully processed
287 ConfigurationTablePage (
289 IN WSDT_PORT
* pPort
,
293 EFI_CONFIGURATION_TABLE
* pEnd
;
294 EFI_CONFIGURATION_TABLE
* pTable
;
300 // Send the system table page
304 // Send the page and table header
306 Status
= TableHeader ( SocketFD
, pPort
, L
"Configuration Tables", gST
);
307 if ( EFI_ERROR ( Status
)) {
312 // Display the table size
314 Status
= RowDecimalValue ( SocketFD
,
317 gST
->NumberOfTableEntries
);
318 if ( EFI_ERROR ( Status
)) {
323 // Determine the location of the configuration tables
325 pTable
= gST
->ConfigurationTable
;
326 pEnd
= &pTable
[ gST
->NumberOfTableEntries
];
327 while ( pEnd
> pTable
) {
328 Status
= RowGuid ( SocketFD
,
331 &pTable
->VendorGuid
);
332 if ( EFI_ERROR ( Status
)) {
335 Status
= RowPointer ( SocketFD
,
338 (VOID
*)pTable
->VendorTable
,
340 if ( EFI_ERROR ( Status
)) {
351 // Build the table trailer
353 Status
= TableTrailer ( SocketFD
,
360 // Return the operation status
362 DBG_EXIT_STATUS ( Status
);