3 Display the configuration table
5 Copyright (c) 2011-2012, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <WebServer.h>
17 #include <Guid/Acpi.h>
18 #include <Guid/DebugImageInfoTable.h>
19 #include <Guid/DxeServices.h>
20 #include <Guid/HobList.h>
21 #include <Guid/MemoryTypeInformation.h>
22 #include <Guid/LoadModuleAtFixedAddress.h>
31 CONST GUID_NAME mGuidName
[] = {
32 { L
"gEfiAcpi10TableGuid", &gEfiAcpi10TableGuid
, PAGE_ACPI_RSDP_10B
},
33 { L
"gEfiAcpiTableGuid", &gEfiAcpiTableGuid
, PAGE_ACPI_RSDP_30
},
34 { L
"gEfiDebugImageInfoTableGuid", &gEfiDebugImageInfoTableGuid
, NULL
},
35 { L
"gEfiDxeServicesTableGuid", &gEfiDxeServicesTableGuid
, PAGE_DXE_SERVICES_TABLE
},
36 { L
"gEfiHobListGuid", &gEfiHobListGuid
, NULL
},
37 { L
"gEfiMemoryTypeInformationGuid", &gEfiMemoryTypeInformationGuid
, NULL
},
38 { L
"gLoadFixedAddressConfigurationTableGuid", &gLoadFixedAddressConfigurationTableGuid
, NULL
}
42 Display a row containing a GUID value
44 @param [in] SocketFD The socket's file descriptor to add to the list.
45 @param [in] pPort The WSDT_PORT structure address
46 @param [in] pName Address of a zero terminated name string
47 @param [in] pGuid Address of the GUID to display
49 @retval EFI_SUCCESS The request was successfully processed
56 IN CONST CHAR8
* pName
,
57 IN CONST EFI_GUID
* pGuid
60 CONST GUID_NAME
* pGuidName
;
61 CONST GUID_NAME
* pGuidNameEnd
;
68 // Use for/break instead of goto
71 Status
= HttpSendAnsiString ( SocketFD
,
74 if ( EFI_ERROR ( Status
)) {
77 Status
= HttpSendAnsiString ( SocketFD
,
80 if ( EFI_ERROR ( Status
)) {
83 Status
= HttpSendAnsiString ( SocketFD
,
86 if ( EFI_ERROR ( Status
)) {
91 // Determine if this is a known GUID
93 pGuidName
= &mGuidName
[0];
94 pGuidNameEnd
= &pGuidName
[ sizeof ( mGuidName
) / sizeof ( mGuidName
[0])];
95 while ( pGuidNameEnd
> pGuidName
) {
96 if ( CompareGuid ( pGuidName
->pGuid
, pGuid
)) {
98 // Display the web link if available
100 if ( NULL
!= pGuidName
->pWebPage
) {
101 Status
= HttpSendAnsiString ( SocketFD
,
103 "<a target=\"_blank\" href=\"" );
104 if ( EFI_ERROR ( Status
)) {
107 Status
= HttpSendUnicodeString ( SocketFD
,
109 pGuidName
->pWebPage
);
110 if ( EFI_ERROR ( Status
)) {
113 Status
= HttpSendAnsiString ( SocketFD
,
116 if ( EFI_ERROR ( Status
)) {
122 // Display the GUID name
124 Status
= HttpSendUnicodeString ( SocketFD
,
126 pGuidName
->GuidName
);
129 // Complete the web link if available
131 if ( NULL
!= pGuidName
->pWebPage
) {
132 if ( EFI_ERROR ( Status
)) {
135 Status
= HttpSendAnsiString ( SocketFD
,
143 // Set the next GUID name
147 if ( EFI_ERROR ( Status
)) {
152 // Only if the entry is not known, display the GUID and type
154 if ( pGuidNameEnd
<= pGuidName
) {
158 Status
= HttpSendGuid ( SocketFD
,
161 if ( EFI_ERROR ( Status
)) {
166 // Display the GUID type
168 Status
= HttpSendAnsiString ( SocketFD
,
170 "<br/><a target=\"_blank\" href=\"http://www.ietf.org/rfc/rfc4122.txt\">Guid Type</a>: " );
171 if ( EFI_ERROR ( Status
)) {
174 Value
= pGuid
->Data4
[1];
180 Status
= HttpSendAnsiString ( SocketFD
,
184 else if ( 5 >= Value
) {
188 Status
= HttpSendAnsiString ( SocketFD
,
191 if ( EFI_ERROR ( Status
)) {
196 // Decode the standard type using RFC 4122
198 Value
= pGuid
->Data3
;
203 // Display the MAC address
205 Status
= HttpSendAnsiString ( SocketFD
,
208 if ( EFI_ERROR ( Status
)) {
211 Status
= HttpSendValue ( SocketFD
,
213 pGuid
->Data3
>> 12 );
217 Status
= HttpSendAnsiString ( SocketFD
,
223 Status
= HttpSendAnsiString ( SocketFD
,
229 Status
= HttpSendAnsiString ( SocketFD
,
235 Status
= HttpSendAnsiString ( SocketFD
,
241 Status
= HttpSendAnsiString ( SocketFD
,
247 else if ( 6 == Value
) {
249 // Microsoft's Component Object Model (COM) type
251 Status
= HttpSendAnsiString ( SocketFD
,
259 Status
= HttpSendAnsiString ( SocketFD
,
266 // Done with this entry
268 Status
= HttpSendAnsiString ( SocketFD
,
270 "</code></td></tr>\r\n" );
275 // Return the operation status
277 DBG_EXIT_STATUS ( Status
);
283 Respond with the configuration tables
285 @param [in] SocketFD The socket's file descriptor to add to the list.
286 @param [in] pPort The WSDT_PORT structure address
287 @param [out] pbDone Address to receive the request completion status
289 @retval EFI_SUCCESS The request was successfully processed
293 ConfigurationTablePage (
295 IN WSDT_PORT
* pPort
,
299 EFI_CONFIGURATION_TABLE
* pEnd
;
300 EFI_CONFIGURATION_TABLE
* pTable
;
306 // Send the system table page
310 // Send the page and table header
312 Status
= TableHeader ( SocketFD
, pPort
, L
"Configuration Tables", gST
);
313 if ( EFI_ERROR ( Status
)) {
318 // Display the table size
320 Status
= RowDecimalValue ( SocketFD
,
323 gST
->NumberOfTableEntries
);
324 if ( EFI_ERROR ( Status
)) {
329 // Determine the location of the configuration tables
331 pTable
= gST
->ConfigurationTable
;
332 pEnd
= &pTable
[ gST
->NumberOfTableEntries
];
333 while ( pEnd
> pTable
) {
334 Status
= RowGuid ( SocketFD
,
337 &pTable
->VendorGuid
);
338 if ( EFI_ERROR ( Status
)) {
341 Status
= RowPointer ( SocketFD
,
344 (VOID
*)pTable
->VendorTable
,
346 if ( EFI_ERROR ( Status
)) {
357 // Build the table trailer
359 Status
= TableTrailer ( SocketFD
,
366 // Return the operation status
368 DBG_EXIT_STATUS ( Status
);