summaryrefslogtreecommitdiff
path: root/AppPkg/Applications/Sockets/WebServer
diff options
context:
space:
mode:
Diffstat (limited to 'AppPkg/Applications/Sockets/WebServer')
-rw-r--r--AppPkg/Applications/Sockets/WebServer/ACPI.c683
-rw-r--r--AppPkg/Applications/Sockets/WebServer/BootServicesTable.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c44
-rw-r--r--AppPkg/Applications/Sockets/WebServer/DhcpOptions.c32
-rw-r--r--AppPkg/Applications/Sockets/WebServer/DxeServicesTable.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Exit.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Firmware.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/HTTP.c33
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Handles.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Hello.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Index.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/MemoryMap.c364
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Mtrr.c825
-rw-r--r--AppPkg/Applications/Sockets/WebServer/PageList.c45
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Ports.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/Reboot.c32
-rw-r--r--AppPkg/Applications/Sockets/WebServer/RuntimeServicesTable.c30
-rw-r--r--AppPkg/Applications/Sockets/WebServer/SystemTable.c32
-rw-r--r--AppPkg/Applications/Sockets/WebServer/WebServer.c36
-rw-r--r--AppPkg/Applications/Sockets/WebServer/WebServer.h170
-rw-r--r--AppPkg/Applications/Sockets/WebServer/WebServer.inf44
21 files changed, 2234 insertions, 376 deletions
diff --git a/AppPkg/Applications/Sockets/WebServer/ACPI.c b/AppPkg/Applications/Sockets/WebServer/ACPI.c
index 7387439f59..e086a2d585 100644
--- a/AppPkg/Applications/Sockets/WebServer/ACPI.c
+++ b/AppPkg/Applications/Sockets/WebServer/ACPI.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
- Display the runtime services table
+/**
+ @file
+ Display the ACPI tables
+
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -138,6 +128,11 @@ typedef struct {
} ACPI_RSDT;
+typedef struct {
+ UINT32 Signature; // 0
+ UINT32 Length; // 4
+} ACPI_UNKNOWN;
+
#pragma pack()
@@ -149,8 +144,15 @@ typedef struct {
CONST TABLE_SIGNATURE mTableId[] = {
+ { APIC_SIGNATURE, "APIC", PAGE_ACPI_APIC },
+ { BGRT_SIGNATURE, "BGRT", PAGE_ACPI_BGRT },
{ DSDT_SIGNATURE, "DSDT", PAGE_ACPI_DSDT },
- { FADT_SIGNATURE, "FADT", PAGE_ACPI_FADT }
+ { FADT_SIGNATURE, "FADT", PAGE_ACPI_FADT },
+ { HPET_SIGNATURE, "HPET", PAGE_ACPI_HPET },
+ { MCFG_SIGNATURE, "MCFG", PAGE_ACPI_MCFG },
+ { SSDT_SIGNATURE, "SSDT", PAGE_ACPI_SSDT },
+ { TCPA_SIGNATURE, "TCPA", PAGE_ACPI_TCPA },
+ { UEFI_SIGNATURE, "UEFI", PAGE_ACPI_UEFI }
};
@@ -816,6 +818,188 @@ SignatureLookup (
/**
+ Respond with the APIC table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiApicPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pApic;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the APIC page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the APIC
+ //
+ pApic = (ACPI_UNKNOWN *)LocateTable ( APIC_SIGNATURE );
+ if ( NULL == pApic ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"APIC Table", pApic );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pApic->Signature ),
+ (CHAR8 *)&pApic->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pApic->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pApic->Length - sizeof ( *pApic ) + 1,
+ (UINT8 *)( pApic + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
+
+
+/**
+ Respond with the BGRT table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiBgrtPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pBgrt;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the BGRT page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the BGRT
+ //
+ pBgrt = (ACPI_UNKNOWN *)LocateTable ( BGRT_SIGNATURE );
+ if ( NULL == pBgrt ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"BGRT Table", pBgrt );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pBgrt->Signature ),
+ (CHAR8 *)&pBgrt->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pBgrt->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pBgrt->Length - sizeof ( *pBgrt ) + 1,
+ (UINT8 *)( pBgrt + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
+
+
+/**
Respond with the ACPI DSDT table
@param [in] SocketFD The socket's file descriptor to add to the list.
@@ -1514,6 +1698,188 @@ AcpiFadtPage (
/**
+ Respond with the HPET table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiHpetPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pHpet;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the HPET page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the HPET
+ //
+ pHpet = (ACPI_UNKNOWN *)LocateTable ( HPET_SIGNATURE );
+ if ( NULL == pHpet ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"HPET Table", pHpet );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pHpet->Signature ),
+ (CHAR8 *)&pHpet->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pHpet->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pHpet->Length - sizeof ( *pHpet ) + 1,
+ (UINT8 *)( pHpet + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
+
+
+/**
+ Respond with the MCFG table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiMcfgPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pMcfg;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the MCFG page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the MCFG
+ //
+ pMcfg = (ACPI_UNKNOWN *)LocateTable ( MCFG_SIGNATURE );
+ if ( NULL == pMcfg ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"MCFG Table", pMcfg );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pMcfg->Signature ),
+ (CHAR8 *)&pMcfg->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pMcfg->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pMcfg->Length - sizeof ( *pMcfg ) + 1,
+ (UINT8 *)( pMcfg + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
+
+
+/**
Respond with the ACPI RSDP 1.0b table
@param [in] SocketFD The socket's file descriptor to add to the list.
@@ -1918,3 +2284,274 @@ AcpiRsdtPage (
}
+/**
+ Respond with the SSDT table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiSsdtPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pSsdt;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the SSDT page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the SSDT
+ //
+ pSsdt = (ACPI_UNKNOWN *)LocateTable ( SSDT_SIGNATURE );
+ if ( NULL == pSsdt ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"SSDT Table", pSsdt );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pSsdt->Signature ),
+ (CHAR8 *)&pSsdt->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pSsdt->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pSsdt->Length - sizeof ( *pSsdt ) + 1,
+ (UINT8 *)( pSsdt + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
+
+
+/**
+ Respond with the TCPA table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiTcpaPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pTcpa;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the TCPA page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the TCPA
+ //
+ pTcpa = (ACPI_UNKNOWN *)LocateTable ( TCPA_SIGNATURE );
+ if ( NULL == pTcpa ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"TCPA Table", pTcpa );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pTcpa->Signature ),
+ (CHAR8 *)&pTcpa->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pTcpa->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pTcpa->Length - sizeof ( *pTcpa ) + 1,
+ (UINT8 *)( pTcpa + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
+
+
+/**
+ Respond with the UEFI table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiUefiPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ CONST ACPI_UNKNOWN * pUefi;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the UEFI page
+ //
+ for ( ; ; ) {
+ //
+ // Locate the UEFI
+ //
+ pUefi = (ACPI_UNKNOWN *)LocateTable ( UEFI_SIGNATURE );
+ if ( NULL == pUefi ) {
+ Status = EFI_NOT_FOUND;
+ break;
+ }
+
+ //
+ // Send the page and table header
+ //
+ Status = TableHeader ( SocketFD, pPort, L"UEFI Table", pUefi );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the header
+ //
+ Status = RowAnsiArray ( SocketFD,
+ pPort,
+ "Signature",
+ sizeof ( pUefi->Signature ),
+ (CHAR8 *)&pUefi->Signature );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = RowDecimalValue ( SocketFD,
+ pPort,
+ "Length",
+ pUefi->Length );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the data from the table
+ //
+ Status = RowDump ( SocketFD,
+ pPort,
+ "Data",
+ pUefi->Length - sizeof ( *pUefi ) + 1,
+ (UINT8 *)( pUefi + 1 ));
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Build the table trailer
+ //
+ Status = TableTrailer ( SocketFD,
+ pPort,
+ pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
diff --git a/AppPkg/Applications/Sockets/WebServer/BootServicesTable.c b/AppPkg/Applications/Sockets/WebServer/BootServicesTable.c
index ab0164976f..4fc1324701 100644
--- a/AppPkg/Applications/Sockets/WebServer/BootServicesTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/BootServicesTable.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Display the boot services table
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Display the boot services table
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c b/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c
index 9208a46b5e..f6303dfed6 100644
--- a/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/ConfigurationTable.c
@@ -1,35 +1,25 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
+/**
+ @file
Display the configuration table
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
**/
#include <WebServer.h>
-#include <Guid\Acpi.h>
-#include <Guid\DebugImageInfoTable.h>
-#include <Guid\DxeServices.h>
-#include <Guid\HobList.h>
-#include <Guid\MemoryTypeInformation.h>
-#include <Guid\LoadModuleAtFixedAddress.h>
+#include <Guid/Acpi.h>
+#include <Guid/DebugImageInfoTable.h>
+#include <Guid/DxeServices.h>
+#include <Guid/HobList.h>
+#include <Guid/MemoryTypeInformation.h>
+#include <Guid/LoadModuleAtFixedAddress.h>
typedef struct {
diff --git a/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c b/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
index 0a2e6cfde1..e3e77f3544 100644
--- a/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
+++ b/AppPkg/Applications/Sockets/WebServer/DhcpOptions.c
@@ -1,26 +1,16 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
+/**
+ @file
Display the DHCP options
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
**/
#include <WebServer.h>
diff --git a/AppPkg/Applications/Sockets/WebServer/DxeServicesTable.c b/AppPkg/Applications/Sockets/WebServer/DxeServicesTable.c
index bfe90cd907..d46ce7096e 100644
--- a/AppPkg/Applications/Sockets/WebServer/DxeServicesTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/DxeServicesTable.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Display the DXE services table
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Display the DXE services table
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/Exit.c b/AppPkg/Applications/Sockets/WebServer/Exit.c
index cad4b006b2..5ff09d3150 100644
--- a/AppPkg/Applications/Sockets/WebServer/Exit.c
+++ b/AppPkg/Applications/Sockets/WebServer/Exit.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Exit response page
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Exit response page
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/Firmware.c b/AppPkg/Applications/Sockets/WebServer/Firmware.c
index 4d5aad6d8f..a29da5e01f 100644
--- a/AppPkg/Applications/Sockets/WebServer/Firmware.c
+++ b/AppPkg/Applications/Sockets/WebServer/Firmware.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Display the firmware
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Display the firmware
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/HTTP.c b/AppPkg/Applications/Sockets/WebServer/HTTP.c
index 5237ac1a49..fae1dd9269 100644
--- a/AppPkg/Applications/Sockets/WebServer/HTTP.c
+++ b/AppPkg/Applications/Sockets/WebServer/HTTP.c
@@ -1,30 +1,21 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
+/**
+ @file
HTTP processing for the web server.
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
**/
#include <WebServer.h>
+
/**
Get a UTF-8 character from the buffer
diff --git a/AppPkg/Applications/Sockets/WebServer/Handles.c b/AppPkg/Applications/Sockets/WebServer/Handles.c
index f39620aa48..19a55ddbc5 100644
--- a/AppPkg/Applications/Sockets/WebServer/Handles.c
+++ b/AppPkg/Applications/Sockets/WebServer/Handles.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Display the handles in the system
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Display the handles in the system
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/Hello.c b/AppPkg/Applications/Sockets/WebServer/Hello.c
index 5f65133f47..3d1f979535 100644
--- a/AppPkg/Applications/Sockets/WebServer/Hello.c
+++ b/AppPkg/Applications/Sockets/WebServer/Hello.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Hello World response page
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Hello World response page
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/Index.c b/AppPkg/Applications/Sockets/WebServer/Index.c
index 688d197282..64c1ffcb5c 100644
--- a/AppPkg/Applications/Sockets/WebServer/Index.c
+++ b/AppPkg/Applications/Sockets/WebServer/Index.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Generate the list of known pages.
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Generate the list of known pages.
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/MemoryMap.c b/AppPkg/Applications/Sockets/WebServer/MemoryMap.c
new file mode 100644
index 0000000000..71a5b1d8c6
--- /dev/null
+++ b/AppPkg/Applications/Sockets/WebServer/MemoryMap.c
@@ -0,0 +1,364 @@
+/**
+ @file
+ Display the memory map
+
+ Copyright (c) 2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <WebServer.h>
+#include <PiDxe.h>
+#include <Library/DxeServicesTableLib.h>
+
+
+CONST char * mpMemoryType[ ] = {
+ "Non-existent",
+ "Reserved",
+ "System Memory",
+ "Memory Mapped I/O"
+};
+
+
+/**
+ Page to display the memory map
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+MemoryMapPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ UINT64 Attributes;
+ BOOLEAN bSomethingDisplayed;
+ UINTN Count;
+ EFI_GCD_MEMORY_SPACE_DESCRIPTOR * pMemoryEnd;
+ EFI_GCD_MEMORY_SPACE_DESCRIPTOR * pMemoryDescriptor;
+ EFI_GCD_MEMORY_SPACE_DESCRIPTOR * pMemoryDescriptorStart;
+ EFI_STATUS Status;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the memory map page
+ //
+ pMemoryDescriptorStart = NULL;
+ for ( ; ; ) {
+ //
+ // Send the page header
+ //
+ Status = HttpPageHeader ( SocketFD, pPort, L"Memory Map" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Start the table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<h1>Memory Map</h1>\r\n"
+ "<table>\r\n"
+ " <tr><th align=\"right\">Type</th><th align=\"right\">Start</th><th align=\"right\">End</th><th align=\"right\">Attributes</th></tr>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Get the memory map
+ //
+ Status = gDS->GetMemorySpaceMap ( &Count,
+ &pMemoryDescriptor );
+ if ( !EFI_ERROR ( Status )) {
+ pMemoryDescriptorStart = pMemoryDescriptor;
+ pMemoryEnd = &pMemoryDescriptor[ Count ];
+ while ( pMemoryEnd > pMemoryDescriptor ) {
+ //
+ // Display the type
+ //
+ Status = HttpSendAnsiString ( SocketFD, pPort, "<tr><td align=\"right\"><code>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ if ( DIM ( mpMemoryType ) > pMemoryDescriptor->GcdMemoryType ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ mpMemoryType[ pMemoryDescriptor->GcdMemoryType ]);
+ }
+ else {
+ Status = HttpSendValue ( SocketFD,
+ pPort,
+ pMemoryDescriptor->GcdMemoryType );
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the start address
+ //
+ Status = HttpSendAnsiString ( SocketFD, pPort, "</code></td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ pMemoryDescriptor->BaseAddress );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the end address
+ //
+ Status = HttpSendAnsiString ( SocketFD, pPort, "</code></td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ pMemoryDescriptor->BaseAddress
+ + pMemoryDescriptor->Length
+ - 1 );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the attributes
+ //
+ Status = HttpSendAnsiString ( SocketFD, pPort, "</code></td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ pMemoryDescriptor->Attributes );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Decode the attributes
+ //
+ Status = HttpSendAnsiString ( SocketFD, pPort, "</code></td><td>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ bSomethingDisplayed = FALSE;
+ Attributes = pMemoryDescriptor->Attributes;
+
+ if ( 0 != ( Attributes & EFI_MEMORY_RUNTIME )) {
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Runtime" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_XP )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "No Execute" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_RP )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "No Read" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_WP )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "No Write" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_UCE )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "UCE" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+
+ if ( 0 != ( Attributes & EFI_MEMORY_WB )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Write Back" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_WT )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Write Through" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_WC )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Write Combining" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ if ( 0 != ( Attributes & EFI_MEMORY_UC )) {
+ if ( bSomethingDisplayed ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ bSomethingDisplayed = TRUE;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Uncached" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ //
+ // Finish the row
+ //
+ Status = HttpSendAnsiString ( SocketFD, pPort, "</td></tr>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Set the next memory descriptor
+ //
+ pMemoryDescriptor += 1;
+ }
+ }
+
+ //
+ // Finish the table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</table>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Send the page trailer
+ //
+ Status = HttpPageTrailer ( SocketFD, pPort, pbDone );
+ break;
+ }
+
+ //
+ // Release the memory descriptors
+ //
+ if ( NULL != pMemoryDescriptorStart ) {
+ FreePool ( pMemoryDescriptorStart );
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
diff --git a/AppPkg/Applications/Sockets/WebServer/Mtrr.c b/AppPkg/Applications/Sockets/WebServer/Mtrr.c
new file mode 100644
index 0000000000..92f90b0ae0
--- /dev/null
+++ b/AppPkg/Applications/Sockets/WebServer/Mtrr.c
@@ -0,0 +1,825 @@
+/**
+ @file
+ Display the memory type range registers
+
+ Copyright (c) 2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <WebServer.h>
+#include <Library/MtrrLib.h>
+
+#define VARIABLE_MTRR_VALID 0x800
+
+CONST char * mMemoryType [ ] = {
+ "Uncached",
+ "Write Combining",
+ "Reserved",
+ "Reserved",
+ "Write Through",
+ "Write Protected",
+ "Writeback"
+};
+
+
+/**
+ Display a fixed MTRR row
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [in] Start Start address for the region
+ @param [in] End End address for the region
+ @param [in] Type Memory type
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+MtrrDisplayFixedRow (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ IN UINT64 Start,
+ IN UINT64 End,
+ IN UINT64 Type
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // Use break instead of goto
+ //
+ for ( ; ; ) {
+ //
+ // Start the row
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ " <tr><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Start
+ //
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Start );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ End - 1 );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Type
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Type &= 0xff;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ( DIM ( mMemoryType ) > Type )
+ ? mMemoryType [ Type ]
+ : "Reserved" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End of row
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</td></tr>\r\n" );
+ break;
+ }
+
+ //
+ // Return the final status
+ //
+ return Status;
+}
+
+
+/**
+ Display the memory type registers
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+MemoryTypeRegistersPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ )
+{
+ UINT64 Addr;
+ BOOLEAN bValid;
+ UINT64 Capabilities;
+ UINTN Count;
+ UINT64 DefType;
+ UINTN Index;
+ UINT64 Mask;
+ UINT64 MaxMtrrs;
+ CONST UINT64 mFixedAddresses [( 8 * MTRR_NUMBER_OF_FIXED_MTRR ) + 1 ] = {
+ 0ULL,
+ 0x10000ULL,
+ 0x20000ULL,
+ 0x30000ULL,
+ 0x40000ULL,
+ 0x50000ULL,
+ 0x60000ULL,
+ 0x70000ULL,
+
+ 0x80000ULL,
+ 0x84000ULL,
+ 0x88000ULL,
+ 0x8c000ULL,
+ 0x90000ULL,
+ 0x94000ULL,
+ 0x98000ULL,
+ 0x9c000ULL,
+
+ 0xa0000ULL,
+ 0xa4000ULL,
+ 0xa8000ULL,
+ 0xac000ULL,
+ 0xb0000ULL,
+ 0xb4000ULL,
+ 0xb8000ULL,
+ 0xbc000ULL,
+
+ 0xc0000ULL,
+ 0xc1000ULL,
+ 0xc2000ULL,
+ 0xc3000ULL,
+ 0xc4000ULL,
+ 0xc5000ULL,
+ 0xc6000ULL,
+ 0xc7000ULL,
+
+ 0xc8000ULL,
+ 0xc9000ULL,
+ 0xca000ULL,
+ 0xcb000ULL,
+ 0xcc000ULL,
+ 0xcd000ULL,
+ 0xce000ULL,
+ 0xcf000ULL,
+
+ 0xd0000ULL,
+ 0xd1000ULL,
+ 0xd2000ULL,
+ 0xd3000ULL,
+ 0xd4000ULL,
+ 0xd5000ULL,
+ 0xd6000ULL,
+ 0xd7000ULL,
+
+ 0xd8000ULL,
+ 0xd9000ULL,
+ 0xda000ULL,
+ 0xdb000ULL,
+ 0xdc000ULL,
+ 0xdd000ULL,
+ 0xde000ULL,
+ 0xdf000ULL,
+
+ 0xe0000ULL,
+ 0xe1000ULL,
+ 0xe2000ULL,
+ 0xe3000ULL,
+ 0xe4000ULL,
+ 0xe5000ULL,
+ 0xe6000ULL,
+ 0xe7000ULL,
+
+ 0xe8000ULL,
+ 0xe9000ULL,
+ 0xea000ULL,
+ 0xeb000ULL,
+ 0xec000ULL,
+ 0xed000ULL,
+ 0xee000ULL,
+ 0xef000ULL,
+
+ 0xf0000ULL,
+ 0xf1000ULL,
+ 0xf2000ULL,
+ 0xf3000ULL,
+ 0xf4000ULL,
+ 0xf5000ULL,
+ 0xf6000ULL,
+ 0xf7000ULL,
+
+ 0xf8000ULL,
+ 0xf9000ULL,
+ 0xfa000ULL,
+ 0xfb000ULL,
+ 0xfc000ULL,
+ 0xfd000ULL,
+ 0xfe000ULL,
+ 0xff000ULL,
+
+ 0x100000ULL
+ };
+ MTRR_SETTINGS Mtrr;
+ CONST UINT64 * pMemEnd;
+ CONST UINT64 * pMemStart;
+ UINT64 PreviousType;
+ UINT64 ShiftCount;
+ EFI_STATUS Status;
+ UINT64 Type;
+ INT64 Value;
+
+ DBG_ENTER ( );
+
+ //
+ // Send the Memory Type Registers page
+ //
+ for ( ; ; ) {
+ //
+ // Send the page header
+ //
+ Status = HttpPageHeader ( SocketFD, pPort, L"Memory Type Range Registers" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Send the header
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<h1>Memory Type Range Registers</h1>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Determine if MTRRs are supported
+ //
+ if ( !IsMtrrSupported ( )) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<p>Memory Type Range Registers are not supported!\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ else {
+ //
+ // Get the capabilities
+ //
+ Capabilities = AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_CAP );
+ DefType = AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_DEF_TYPE );
+
+ //
+ // Display the capabilities
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<p>Capabilities: " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Capabilities );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<br>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the default type
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Def Type: " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ DefType );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", MTRRs " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ( 0 != ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED ))
+ ? "Enabled"
+ : "Disabled" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", Fixed MTRRs " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ( 0 != ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED ))
+ ? "Enabled"
+ : "Disabled" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ", " );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Type = DefType & 0xff;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ( DIM ( mMemoryType ) > Type )
+ ? mMemoryType [ Type ]
+ : "Reserved" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</p>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Determine if MTRRs are enabled
+ //
+ if ( 0 == ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED )) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<p>All memory is uncached!</p>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ else {
+ //
+ // Get the MTRRs
+ //
+ MtrrGetAllMtrrs ( &Mtrr );
+
+ //
+ // Determine if the fixed MTRRs are supported
+ //
+ if (( 0 != ( Capabilities & 0x100 ))
+ && ( 0 != ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED ))) {
+
+ //
+ // Beginning of table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<h2>Fixed MTRRs</h2>\r\n"
+ "<table>\r\n"
+ " <tr><th>Index</th><th align=\"right\">Value</th><th align=\"right\">Start</th><th align=\"right\">End</th></tr>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the fixed MTRRs
+ //
+ pMemStart = &mFixedAddresses[ 0 ];
+ for ( Count = 0; DIM ( Mtrr.Fixed.Mtrr ) > Count; Count++ ) {
+ //
+ // Start the row
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ " <tr><td>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Index
+ //
+ Status = HttpSendValue ( SocketFD,
+ pPort,
+ Count );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Value
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Mtrr.Fixed.Mtrr[ Count ]);
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Start
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ *pMemStart );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ pMemStart += 8;
+
+ //
+ // Value
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ *pMemStart - 1 );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End of row
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td></tr>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End of table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</table>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Beginning of table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<table>\r\n"
+ " <tr><th align=\"right\">Start</th><th align=\"right\">End</th><th align=\"left\">Type</th></tr>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Decode the fixed MTRRs
+ //
+ PreviousType = Mtrr.Fixed.Mtrr[ 0 ] & 0xff;
+ pMemStart = &mFixedAddresses[ 0 ];
+ pMemEnd = pMemStart;
+ for ( Count = 0; DIM ( Mtrr.Fixed.Mtrr ) > Count; Count++ ) {
+ //
+ // Get the memory types
+ //
+ Type = Mtrr.Fixed.Mtrr[ Count ];
+
+ //
+ // Walk the memory range
+ //
+ for ( Index = 0; 8 > Index; Index++ ) {
+ //
+ // Determine if this is the same memory type
+ //
+ if ( PreviousType != ( Type & 0xff )) {
+ //
+ // Display the row
+ //
+ Status = MtrrDisplayFixedRow ( SocketFD,
+ pPort,
+ *pMemStart,
+ *pMemEnd,
+ PreviousType );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Start the next range of addresses
+ //
+ pMemStart = pMemEnd;
+ PreviousType = Type & 0xff;
+ }
+
+ //
+ // Set the next memory range and type
+ //
+ Type >>= 8;
+ pMemEnd += 1;
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the final row
+ //
+ Status = MtrrDisplayFixedRow ( SocketFD,
+ pPort,
+ *pMemStart,
+ *pMemEnd,
+ PreviousType );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End of table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</table>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+
+ //
+ // Determine if the variable MTRRs are supported
+ //
+ MaxMtrrs = Capabilities & MTRR_LIB_IA32_MTRR_CAP_VCNT_MASK;
+ if ( 0 < MaxMtrrs ) {
+ //
+ // Beginning of table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "<h2>Variable MTRRs</h2>\r\n"
+ "<table>\r\n"
+ " <tr><th>Index</th><th align=\"right\">Base</th><th align=\"right\">Mask</th><th align=\"right\">Start</th><th align=\"right\">End</th></tr>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Display the variable MTRRs
+ //
+ for ( Count = 0; MaxMtrrs > Count; Count++ ) {
+ //
+ // Start the row
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ " <tr><td>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Index
+ //
+ Status = HttpSendValue ( SocketFD,
+ pPort,
+ Count );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Base
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Mtrr.Variables.Mtrr[ Count ].Base );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Mask
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</td><td align=\"right\"><code>0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Mtrr.Variables.Mtrr[ Count ].Mask );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Determine if the entry is valid
+ //
+ bValid = ( Mtrr.Variables.Mtrr[ Count ].Mask & VARIABLE_MTRR_VALID ) ? TRUE : FALSE;
+
+ //
+ // Start
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td align=\"right\"><code>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Addr = Mtrr.Variables.Mtrr[ Count ].Base & 0xfffffffffffff000ULL;
+ if ( bValid ) {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Addr );
+ }
+ else {
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "Invalid" );
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td align=\"right\"><code>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ if ( bValid ) {
+ //
+ // Determine the end address
+ //
+ Mask = Mtrr.Variables.Mtrr[ Count ].Mask;
+ Value = Mask;
+ ShiftCount = 0;
+ while ( 0 < Value ) {
+ Value <<= 1;
+ ShiftCount += 1;
+ }
+ Value = 1;
+ Value <<= 64 - ShiftCount;
+ Value -= 1;
+ Value = ~Value;
+ Value |= Mask;
+ Value &= ~VARIABLE_MTRR_VALID;
+ Value = ~Value;
+
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "0x" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ Status = HttpSendHexValue ( SocketFD,
+ pPort,
+ Addr + Value );
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // Type
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</code></td><td>" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ if ( bValid ) {
+ Type = Mtrr.Variables.Mtrr[ Count ].Base & 0xFF;
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ ( DIM ( mMemoryType ) > Type )
+ ? mMemoryType [ Type ]
+ : "Reserved" );
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End of row
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</td></tr>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+
+ //
+ // End of table
+ //
+ Status = HttpSendAnsiString ( SocketFD,
+ pPort,
+ "</table>\r\n" );
+ if ( EFI_ERROR ( Status )) {
+ break;
+ }
+ }
+ }
+ }
+
+ //
+ // Send the page trailer
+ //
+ Status = HttpPageTrailer ( SocketFD, pPort, pbDone );
+ break;
+ }
+
+ //
+ // Return the operation status
+ //
+ DBG_EXIT_STATUS ( Status );
+ return Status;
+}
diff --git a/AppPkg/Applications/Sockets/WebServer/PageList.c b/AppPkg/Applications/Sockets/WebServer/PageList.c
index 98927e8e1d..1e271e566c 100644
--- a/AppPkg/Applications/Sockets/WebServer/PageList.c
+++ b/AppPkg/Applications/Sockets/WebServer/PageList.c
@@ -1,26 +1,16 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
+/**
+ @file
List of pages to display
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
**/
#include <WebServer.h>
@@ -42,6 +32,8 @@ CONST DT_PAGE mPageList[] = {
{ PAGE_BOOT_SERVICES_TABLE, BootServicesTablePage, L"Boot Services Table" }, ///< Format boot services table
{ PAGE_CONFIGURATION_TABLE, ConfigurationTablePage, L"Configuration Table" }, ///< Format configuration table
{ L"/DhcpOptions", DhcpOptionsPage, L"DHCP Options" }, ///< Display the DHCP options
+ { PAGE_ACPI_APIC, AcpiApicPage, L"APIC" }, ///< Format APIC
+ { PAGE_ACPI_BGRT, AcpiBgrtPage, L"BGRT" }, ///< Format BGRT
{ PAGE_ACPI_DSDT, AcpiDsdtPage, L"DSDT - Differentiated System Description Table" }, ///< Format DSDT
{ PAGE_DXE_SERVICES_TABLE, DxeServicesTablePage, L"DXE Services Table" }, ///< Format DXE services table
{ L"/Exit", ExitPage, L"Exit the web server" }, ///< Exit the web server application
@@ -49,13 +41,22 @@ CONST DT_PAGE mPageList[] = {
{ L"/Firmware", FirmwarePage, L"Firmware" }, ///< Firmware status
{ L"/Handles", HandlePage, L"Display handles and associated protocol GUIDs" }, ///< Handle database page
{ L"/Hello", HelloPage, L"Hello World" }, ///< Hello world page
+ { PAGE_ACPI_HPET, AcpiHpetPage, L"HPET" }, ///< Format HPET
+ { PAGE_ACPI_MCFG, AcpiMcfgPage, L"MCFG" }, ///< Format MCFG
+ { L"/MemoryMap", MemoryMapPage, L"Memory Map" }, ///< Memory list
+#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
+ { L"/MTRRs", MemoryTypeRegistersPage, L"Memory Type Range Registers" }, ///< Memory type range register table
+#endif // Intel
{ L"/Ports", PortsPage, L"Display web-server ports" },///< Web-server ports page
{ L"/Reboot", RebootPage, L"Reboot the sytem" }, ///< Reboot page
{ PAGE_ACPI_RSDP_10B, AcpiRsdp10Page, L"RSDP 1.0b - ACPI Root System Description Pointer" }, ///< Format RSDP 1.0b table
{ PAGE_ACPI_RSDP_30, AcpiRsdp30Page, L"RSDP 3.0 - ACPI Root System Description Pointer" }, ///< Format RSDP 3.0 table
{ PAGE_ACPI_RSDT, AcpiRsdtPage, L"RSDT - ACPI Root System Description Table" }, ///< Format RSDT
{ PAGE_RUNTIME_SERVICES_TABLE, RuntimeSservicesTablePage, L"Runtime Services Table" },///< Format runtime services table
- { L"/SystemTable", SystemTablePage, L"System Table" } ///< Format system table
+ { PAGE_ACPI_SSDT, AcpiSsdtPage, L"SSDT" }, ///< Format SSDT
+ { L"/SystemTable", SystemTablePage, L"System Table" },///< Format system table
+ { PAGE_ACPI_TCPA, AcpiTcpaPage, L"TCPA" }, ///< Format TCPA
+ { PAGE_ACPI_UEFI, AcpiUefiPage, L"UEFI" } ///< Format UEFI
};
CONST UINTN mPageCount = DIM ( mPageList );
diff --git a/AppPkg/Applications/Sockets/WebServer/Ports.c b/AppPkg/Applications/Sockets/WebServer/Ports.c
index e9190bf68d..f9b6680af0 100644
--- a/AppPkg/Applications/Sockets/WebServer/Ports.c
+++ b/AppPkg/Applications/Sockets/WebServer/Ports.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Ports response page
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Ports response page
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/Reboot.c b/AppPkg/Applications/Sockets/WebServer/Reboot.c
index 51c72d67ec..2fc8fecf63 100644
--- a/AppPkg/Applications/Sockets/WebServer/Reboot.c
+++ b/AppPkg/Applications/Sockets/WebServer/Reboot.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Reboot the system
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Reboot the system
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -49,7 +39,7 @@ RebootPage (
DBG_ENTER ( );
//
- // Send the Hello World page
+ // Send the Reboot page
//
for ( ; ; ) {
//
diff --git a/AppPkg/Applications/Sockets/WebServer/RuntimeServicesTable.c b/AppPkg/Applications/Sockets/WebServer/RuntimeServicesTable.c
index 778d3bbba9..d5fed0c7c3 100644
--- a/AppPkg/Applications/Sockets/WebServer/RuntimeServicesTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/RuntimeServicesTable.c
@@ -1,25 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
+/**
+ @file
+ Display the runtime services table
---*/
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
-/** @file
- Display the runtime services table
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/SystemTable.c b/AppPkg/Applications/Sockets/WebServer/SystemTable.c
index 916c4b92b6..83f60308b2 100644
--- a/AppPkg/Applications/Sockets/WebServer/SystemTable.c
+++ b/AppPkg/Applications/Sockets/WebServer/SystemTable.c
@@ -1,26 +1,16 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
+/**
+ @file
Display the system table
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
**/
#include <WebServer.h>
diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.c b/AppPkg/Applications/Sockets/WebServer/WebServer.c
index 00f8633efb..f8a2d3ad4c 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.c
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.c
@@ -1,27 +1,15 @@
-/*++
- This file contains an 'Intel UEFI Application' and is
- licensed for Intel CPUs and chipsets under the terms of your
- license agreement with Intel or your vendor. This file may
- be modified by the user, subject to additional terms of the
- license agreement
---*/
-/*++
-
-Copyright (c) 2011 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
---*/
-
-/** @file
- This is a simple shell application
-
- This should be executed with "/Param2 Val1" and "/Param1" as the 2 command line options!
+/**
+ @file
+ Web server application
+
+ Copyright (c) 2011-2012, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h b/AppPkg/Applications/Sockets/WebServer/WebServer.h
index 48839f3456..16c30c8d6d 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
@@ -1,7 +1,7 @@
/** @file
Definitions for the web server.
- Copyright (c) 2011, Intel Corporation
+ Copyright (c) 2011-2012, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -22,6 +22,7 @@
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
@@ -43,11 +44,18 @@
// Pages
//------------------------------------------------------------------------------
+#define PAGE_ACPI_APIC L"/APIC"
+#define PAGE_ACPI_BGRT L"/BGRT"
#define PAGE_ACPI_DSDT L"/DSDT"
#define PAGE_ACPI_FADT L"/FADT"
+#define PAGE_ACPI_HPET L"/HPET"
+#define PAGE_ACPI_MCFG L"/MCFG"
#define PAGE_ACPI_RSDP_10B L"/RSDP1.0b"
#define PAGE_ACPI_RSDP_30 L"/RSDP3.0"
#define PAGE_ACPI_RSDT L"/RSDT"
+#define PAGE_ACPI_SSDT L"/SSDT"
+#define PAGE_ACPI_TCPA L"/TCPA"
+#define PAGE_ACPI_UEFI L"/UEFI"
#define PAGE_BOOT_SERVICES_TABLE L"/BootServicesTable"
#define PAGE_CONFIGURATION_TABLE L"/ConfigurationTable"
#define PAGE_DXE_SERVICES_TABLE L"/DxeServicesTable"
@@ -57,8 +65,15 @@
// Signatures
//------------------------------------------------------------------------------
+#define APIC_SIGNATURE 0x43495041
+#define BGRT_SIGNATURE 0x54524742
#define DSDT_SIGNATURE 0x54445344
#define FADT_SIGNATURE 0x50434146
+#define HPET_SIGNATURE 0x54455048
+#define MCFG_SIGNATURE 0x4746434d
+#define SSDT_SIGNATURE 0x54445353
+#define TCPA_SIGNATURE 0x41504354
+#define UEFI_SIGNATURE 0x49464555
//------------------------------------------------------------------------------
// Macros
@@ -228,6 +243,40 @@ extern CONST UINTN mPageCount; ///< Number of pages
//------------------------------------------------------------------------------
/**
+ Respond with the APIC table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiApicPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
+ Respond with the BGRT table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiBgrtPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
Respond with the ACPI DSDT table
@param [in] SocketFD The socket's file descriptor to add to the list.
@@ -262,6 +311,40 @@ AcpiFadtPage (
);
/**
+ Respond with the HPET table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiHpetPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
+ Respond with the MCFG table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiMcfgPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
Respond with the ACPI RSDP 1.0b table
@param [in] SocketFD The socket's file descriptor to add to the list.
@@ -313,6 +396,57 @@ AcpiRsdtPage (
);
/**
+ Respond with the SSDT table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiSsdtPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
+ Respond with the TCPA table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiTcpaPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
+ Respond with the UEFI table
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+AcpiUefiPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
Respond with the boot services table
@param [in] SocketFD The socket's file descriptor to add to the list.
@@ -466,6 +600,40 @@ IndexPage (
);
/**
+ Page to display the memory map
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+MemoryMapPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
+ Display the memory type registers
+
+ @param [in] SocketFD The socket's file descriptor to add to the list.
+ @param [in] pPort The WSDT_PORT structure address
+ @param [out] pbDone Address to receive the request completion status
+
+ @retval EFI_SUCCESS The request was successfully processed
+
+**/
+EFI_STATUS
+MemoryTypeRegistersPage (
+ IN int SocketFD,
+ IN WSDT_PORT * pPort,
+ OUT BOOLEAN * pbDone
+ );
+
+/**
Respond with the Ports page
@param [in] SocketFD The socket's file descriptor to add to the list.
diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.inf b/AppPkg/Applications/Sockets/WebServer/WebServer.inf
index c250007295..3650aef96e 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.inf
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.inf
@@ -1,21 +1,14 @@
-#/** @file
+## @file
# Web Server Application
#
-# This file contains an 'Intel Peripheral Driver' and is
-# licensed for Intel CPUs and chipsets under the terms of your
-# license agreement with Intel or your vendor. This file may
-# be modified by the user, subject to additional terms of the
-# license agreement
+# Copyright (c) 2011-2012, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
#
-#
-# Copyright (c) 2011 Intel Corporation. All rights reserved
-# This software and associated documentation (if any) is furnished
-# under a license and may only be used or copied in accordance
-# with the terms of the license. Except as permitted by such
-# license, no part of this software or documentation may be
-# reproduced, stored in a retrieval system, or transmitted in any
-# form or by any means without the express written consent of
-# Intel Corporation.
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
@@ -46,6 +39,7 @@
Hello.c
HTTP.c
Index.c
+ MemoryMap.c
PageList.c
Ports.c
Reboot.c
@@ -53,6 +47,12 @@
SystemTable.c
WebServer.c
+[Sources.IA32]
+ Mtrr.c
+
+[Sources.X64]
+ Mtrr.c
+
[Pcd]
gAppPkgTokenSpaceGuid.WebServer_HttpPort
@@ -64,12 +64,19 @@
ShellPkg/ShellPkg.dec
StdLib/StdLib.dec
+[Packages.IA32]
+ UefiCpuPkg/UefiCpuPkg.dec
+
+[Packages.X64]
+ UefiCpuPkg/UefiCpuPkg.dec
+
[LibraryClasses]
BaseMemoryLib
BsdSocketLib
DebugLib
DevShell
+ DxeServicesTableLib
EfiSocketLib
LibC
ShellLib
@@ -79,6 +86,13 @@
UefiRuntimeServicesTableLib
# UseSocketDxe
+[LibraryClasses.IA32]
+ MtrrLib
+
+[LibraryClasses.X64]
+ MtrrLib
+
+
[Guids]
gEfiAcpi10TableGuid
gEfiAcpiTableGuid