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 configuration table
26 #include <WebServer.h>
27 #include <Guid\Acpi.h>
28 #include <Guid\DebugImageInfoTable.h>
29 #include <Guid\DxeServices.h>
30 #include <Guid\HobList.h>
31 #include <Guid\MemoryTypeInformation.h>
32 #include <Guid\LoadModuleAtFixedAddress.h>
41 CONST GUID_NAME mGuidName
[] = {
42 { L
"gEfiAcpi10TableGuid", &gEfiAcpi10TableGuid
, PAGE_ACPI_RSDP_10B
},
43 { L
"gEfiAcpiTableGuid", &gEfiAcpiTableGuid
, PAGE_ACPI_RSDP_30
},
44 { L
"gEfiDebugImageInfoTableGuid", &gEfiDebugImageInfoTableGuid
, NULL
},
45 { L
"gEfiDxeServicesTableGuid", &gEfiDxeServicesTableGuid
, PAGE_DXE_SERVICES_TABLE
},
46 { L
"gEfiHobListGuid", &gEfiHobListGuid
, NULL
},
47 { L
"gEfiMemoryTypeInformationGuid", &gEfiMemoryTypeInformationGuid
, NULL
},
48 { L
"gLoadFixedAddressConfigurationTableGuid", &gLoadFixedAddressConfigurationTableGuid
, NULL
}
52 Display a row containing a GUID value
54 @param [in] SocketFD The socket's file descriptor to add to the list.
55 @param [in] pPort The WSDT_PORT structure address
56 @param [in] pName Address of a zero terminated name string
57 @param [in] pGuid Address of the GUID to display
59 @retval EFI_SUCCESS The request was successfully processed
66 IN CONST CHAR8
* pName
,
67 IN CONST EFI_GUID
* pGuid
70 CONST GUID_NAME
* pGuidName
;
71 CONST GUID_NAME
* pGuidNameEnd
;
78 // Use for/break instead of goto
81 Status
= HttpSendAnsiString ( SocketFD
,
84 if ( EFI_ERROR ( Status
)) {
87 Status
= HttpSendAnsiString ( SocketFD
,
90 if ( EFI_ERROR ( Status
)) {
93 Status
= HttpSendAnsiString ( SocketFD
,
96 if ( EFI_ERROR ( Status
)) {
101 // Determine if this is a known GUID
103 pGuidName
= &mGuidName
[0];
104 pGuidNameEnd
= &pGuidName
[ sizeof ( mGuidName
) / sizeof ( mGuidName
[0])];
105 while ( pGuidNameEnd
> pGuidName
) {
106 if ( CompareGuid ( pGuidName
->pGuid
, pGuid
)) {
108 // Display the web link if available
110 if ( NULL
!= pGuidName
->pWebPage
) {
111 Status
= HttpSendAnsiString ( SocketFD
,
113 "<a target=\"_blank\" href=\"" );
114 if ( EFI_ERROR ( Status
)) {
117 Status
= HttpSendUnicodeString ( SocketFD
,
119 pGuidName
->pWebPage
);
120 if ( EFI_ERROR ( Status
)) {
123 Status
= HttpSendAnsiString ( SocketFD
,
126 if ( EFI_ERROR ( Status
)) {
132 // Display the GUID name
134 Status
= HttpSendUnicodeString ( SocketFD
,
136 pGuidName
->GuidName
);
139 // Complete the web link if available
141 if ( NULL
!= pGuidName
->pWebPage
) {
142 if ( EFI_ERROR ( Status
)) {
145 Status
= HttpSendAnsiString ( SocketFD
,
153 // Set the next GUID name
157 if ( EFI_ERROR ( Status
)) {
162 // Only if the entry is not known, display the GUID and type
164 if ( pGuidNameEnd
<= pGuidName
) {
168 Status
= HttpSendGuid ( SocketFD
,
171 if ( EFI_ERROR ( Status
)) {
176 // Display the GUID type
178 Status
= HttpSendAnsiString ( SocketFD
,
180 "<br/><a target=\"_blank\" href=\"http://www.ietf.org/rfc/rfc4122.txt\">Guid Type</a>: " );
181 if ( EFI_ERROR ( Status
)) {
184 Value
= pGuid
->Data4
[1];
190 Status
= HttpSendAnsiString ( SocketFD
,
194 else if ( 5 >= Value
) {
198 Status
= HttpSendAnsiString ( SocketFD
,
201 if ( EFI_ERROR ( Status
)) {
206 // Decode the standard type using RFC 4122
208 Value
= pGuid
->Data3
;
213 // Display the MAC address
215 Status
= HttpSendAnsiString ( SocketFD
,
218 if ( EFI_ERROR ( Status
)) {
221 Status
= HttpSendValue ( SocketFD
,
223 pGuid
->Data3
>> 12 );
227 Status
= HttpSendAnsiString ( SocketFD
,
233 Status
= HttpSendAnsiString ( SocketFD
,
239 Status
= HttpSendAnsiString ( SocketFD
,
245 Status
= HttpSendAnsiString ( SocketFD
,
251 Status
= HttpSendAnsiString ( SocketFD
,
257 else if ( 6 == Value
) {
259 // Microsoft's Component Object Model (COM) type
261 Status
= HttpSendAnsiString ( SocketFD
,
269 Status
= HttpSendAnsiString ( SocketFD
,
276 // Done with this entry
278 Status
= HttpSendAnsiString ( SocketFD
,
280 "</code></td></tr>\r\n" );
285 // Return the operation status
287 DBG_EXIT_STATUS ( Status
);
293 Respond with the configuration tables
295 @param [in] SocketFD The socket's file descriptor to add to the list.
296 @param [in] pPort The WSDT_PORT structure address
297 @param [out] pbDone Address to receive the request completion status
299 @retval EFI_SUCCESS The request was successfully processed
303 ConfigurationTablePage (
305 IN WSDT_PORT
* pPort
,
309 EFI_CONFIGURATION_TABLE
* pEnd
;
310 EFI_CONFIGURATION_TABLE
* pTable
;
316 // Send the system table page
320 // Send the page and table header
322 Status
= TableHeader ( SocketFD
, pPort
, L
"Configuration Tables", gST
);
323 if ( EFI_ERROR ( Status
)) {
328 // Display the table size
330 Status
= RowDecimalValue ( SocketFD
,
333 gST
->NumberOfTableEntries
);
334 if ( EFI_ERROR ( Status
)) {
339 // Determine the location of the configuration tables
341 pTable
= gST
->ConfigurationTable
;
342 pEnd
= &pTable
[ gST
->NumberOfTableEntries
];
343 while ( pEnd
> pTable
) {
344 Status
= RowGuid ( SocketFD
,
347 &pTable
->VendorGuid
);
348 if ( EFI_ERROR ( Status
)) {
351 Status
= RowPointer ( SocketFD
,
354 (VOID
*)pTable
->VendorTable
,
356 if ( EFI_ERROR ( Status
)) {
367 // Build the table trailer
369 Status
= TableTrailer ( SocketFD
,
376 // Return the operation status
378 DBG_EXIT_STATUS ( Status
);