/*++
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
**/
#include <WebServer.h>
#include <IndustryStandard/Acpi10.h>
#include <IndustryStandard/Acpi30.h>
//
// Ensure proper structure formats
//
#pragma pack(1)
typedef struct {
typedef struct {
} ACPI_DSDT;
typedef struct {
} ACPI_FADT;
typedef struct {
} ACPI_RSDT;
#pragma pack()
typedef struct {
};
/**
Locate the RSDT table
@return Table address or NULL if not found
**/
)
{
//
//
for ( ; ; ) {
//
// Locate the RSDT
//
}
else {
break;
}
}
break;
}
//
// The entry was not found
//
return pRsdt;
}
/**
Locate the specified table
@param [in] Signature Table signature
@return Table address or NULL if not found
**/
)
{
//
//
for ( ; ; ) {
//
// Locate the RSDT
//
}
else {
break;
}
}
//
// Walk the list of entries
//
//
// The entry is actually a 32-bit physical table address
// The first entry in the table is the 32-bit table signature
//
if ( *pSignature == Signature ) {
}
//
// Set the next entry
//
pEntry++;
}
break;
}
//
// The entry was not found
//
return NULL;
}
/**
Display a row containing a hex value
@param [in] SocketFD The socket's file descriptor to add to the list.
@param [in] pPort The WSDT_PORT structure address
@param [in] pName Address of a zero terminated name string
@param [in] Length Length in bytes
@param [in] pChar Address of the first character
@retval EFI_SUCCESS The request was successfully processed
**/
)
{
DBG_ENTER ( );
//
//
for ( ; ; ) {
//
// Start the row
//
"<tr><td>" );
break;
}
pName );
break;
}
"</td><td><code>" );
break;
}
//
// Display the characters
//
*pData++,
" " );
break;
}
}
break;
}
//
// Display the byte values
//
"<br/>0x" );
break;
}
8,
*pData++ );
break;
}
" 0x" );
break;
}
}
}
//
// Terminate the row
//
"</code></td></tr>\r\n" );
break;
}
//
// Return the operation status
//
DBG_EXIT_STATUS ( Status );
return Status;
}
/**
Format a row with a list of bytes
@param [in] SocketFD The socket's file descriptor to add to the list.
@param [in] pPort The WSDT_PORT structure address
@param [in] pName Zero terminated name string
@param [in] ByteCount The number of bytes to display
@param [in] pData Address of the byte array
@retval EFI_SUCCESS The request was successfully processed
**/
RowBytes (
)
{
//
//
for ( ; ; ) {
//
// Start the row
//
"<tr><td>" );
break;
}
//
// Display the field name
//
pName );
break;
}
//
// Display the field value
//
"</td><td><code>0x" );
break;
}
8,
*pData++ );
break;
}
" 0x" );
break;
}
}
}
break;
}
//
// Terminate the row
//
"</code></td></tr>\r\n" );
break;
}
//
// Return the operation status
//
return Status;
}
/**
Format a row with a list of bytes
@param [in] SocketFD The socket's file descriptor to add to the list.
@param [in] pPort The WSDT_PORT structure address
@param [in] pName Zero terminated name string
@param [in] ByteCount The number of bytes to display
@param [in] pData Address of the byte array
@retval EFI_SUCCESS The request was successfully processed
**/
RowDump (
)
{
//
//
for ( ; ; ) {
//
// Start the row
//
"<tr><td>" );
break;
}
//
// Display the field name
//
pName );
break;
}
//
// Start the field value
//
"</td><td>" );
break;
}
//
// Dump the buffer
//
pData );
//
// Terminate the field value and row
//
"</td></tr>\r\n" );
break;
}
//
// Return the operation status
//
return Status;
}
/**
Format a row with a general address
@param [in] SocketFD The socket's file descriptor to add to the list.
@param [in] pPort The WSDT_PORT structure address
@param [in] pName Zero terminated name string
@param [in] pAddr Address of the general address buffer
@param [in] pWebPage Zero terminated web page address
@retval EFI_SUCCESS The request was successfully processed
**/
)
{
//
//
for ( ; ; ) {
//
// Start the row
//
"<tr><td>" );
break;
}
//
// Display the field name
//
pName );
break;
}
//
// Display the field value
//
"</td><td><code>" );
break;
}
//
// Determine the type of address
//
if ( 0 == pGenericAddress->AddressSpaceId ) {
}
}
}
}
}
}
}
else {
}
break;
}
"<br/>Register Bit Width: " );
break;
}
break;
}
"<br/>Register Bit Offset: " );
break;
}
break;
}
"<br/>Access Size: " );
break;
}
break;
}
"<br/>Address: " );
break;
}
//
// Add the web-page link if necessary
//
"<a target=\"_blank\" href=\"" );
break;
}
pWebPage );
break;
}
"\">" );
break;
}
}
//
// Display the address
//
"0x" );
break;
}
64,
break;
}
//
// Finish the web-page link if necessary
//
"</a>" );
break;
}
}
//
// Terminate the row
//
"</code></td></tr>\r\n" );
break;
}
//
// Return the operation status
//
return Status;
}
/**
Translate a table address into a web page
@param [in] pSignature Address of the table signature
@param [out] ppTableName Address to receive the table name address
@return Zero terminated web page address or NULL if not found
**/
)
{
//
// Walk the list of tables
//
Signature = *pSignature;
//
// Attempt to locate the table signature
//
//
// The signature was found
// Return the web page
//
}
//
// Set the next table
//
pTableId += 1;
}
//
// The table was not found
//
return NULL;
}
/**
Respond with the ACPI DSDT 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
**/
)
{
DBG_ENTER ( );
//
// Send the DADT page
//
for ( ; ; ) {
//
// Locate the DADT
//
break;
}
//
// Send the page and table header
//
break;
}
//
// Display the DSDT header
//
"Signature",
break;
}
"Length",
break;
}
"Revision",
break;
}
"Checksum",
NULL );
break;
}
"OEMID",
break;
}
"OEM Table ID",
sizeof ( pDsdt->OemTableId ),
&pDsdt->OemTableId[ 0 ]);
break;
}
"OEM Revision",
pDsdt->OemRevision );
break;
}
"Creator ID",
break;
}
"Creator Revision",
pDsdt->CreatorRevision );
break;
}
//
// Display the data from the DSDT
//
"Definition Block",
&pDsdt->DefinitionBlock[0]);
break;
}
//
// Build the table trailer
//
pbDone );
break;
}
//
// Return the operation status
//
DBG_EXIT_STATUS ( Status );
return Status;
}
/**
Respond with the ACPI FADT 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
**/
)
{
DBG_ENTER ( );
//
// Send the FADT page
//
for ( ; ; ) {
//
// Locate the FADT
//
break;
}
//
// Send the page and table header
//
break;
}
//
// Display the FSDT header
//
"Signature",
break;
}
"Length",
break;
}
"Revision",
break;
}
"Checksum",
NULL );
break;
}
"OEMID",
break;
}
"OEM Table ID",
sizeof ( pFadt->OemTableId ),
&pFadt->OemTableId[ 0 ]);
break;
}
"OEM Revision",
pFadt->OemRevision );
break;
}
"Creator ID",
break;
}
"Creator Revision",
pFadt->CreatorRevision );
break;
}
//
// Display the data from the FADT
//
"FIRMWARE_CTRL",
NULL );
break;
}
"DSDT",
break;
}
"Reserved",
NULL );
break;
}
"Preferred_PM_Profile",
NULL );
break;
}
"SCI_INT",
NULL );
break;
}
"SMI_CMD",
NULL );
break;
}
"ACPI_ENABLE",
NULL );
break;
}
"ACPI_DISABLE",
NULL );
break;
}
"S4BIOS_REQ",
NULL );
break;
}
"PSTATE_CNT",
NULL );
break;
}
"PM1a_EVT_BLK",
NULL );
break;
}
"PM1b_EVT_BLK",
NULL );
break;
}
"PM1a_CNT_BLK",
NULL );
break;
}
"PM1b_CNT_BLK",
NULL );
break;
}
"PM2_CNT_BLK",
NULL );
break;
}
"PM_TMR_BLK",
NULL );
break;
}
"GPE0_BLK",
NULL );
break;
}
"GPE1_BLK",
NULL );
break;
}
"PM1_EVT_LEN",
break;
}
"PM1_CNT_LEN",
break;
}
"PM2_CNT_LEN",
break;
}
"PM_TMR_LEN",
break;
}
"GPE0_BLK_LEN",
pFadt->Gpe0BlkLen );
break;
}
"GPE1_BLK_LEN",
pFadt->Gpe1BlkLen );
break;
}
"GPE1_BASE",
NULL );
break;
}
"CST_CNT",
break;
}
"P_LVL2_LAT",
NULL );
break;
}
"P_LVL3_LAT",
NULL );
break;
}
"FLUSH_SIZE",
break;
}
"FLUSH_Stride",
pFadt->FlushStride );
break;
}
"DUTY_OFFSET",
NULL );
break;
}
"DUTY_WIDTH",
NULL );
break;
}
"DAY_ALRM",
NULL );
break;
}
"MON_ALRM",
NULL );
break;
}
"CENTURY",
NULL );
break;
}
"IAPC_BOOT_ARCH",
NULL );
break;
}
"Reserved",
NULL );
break;
}
"Flags",
NULL );
break;
}
"RESET_REG",
NULL );
break;
}
"RESET_VALUE",
NULL );
break;
}
"Reserved",
NULL );
break;
}
"Reserved",
NULL );
break;
}
"Reserved",
NULL );
break;
}
"X_FIRMWARE_CTRL",
NULL );
break;
}
"X_DSDT",
break;
}
"X_PM1a_EVT_BLK",
&pFadt->XPm1aEvtBlk[0],
NULL );
break;
}
"X_PM1b_EVT_BLK",
&pFadt->XPm1bEvtBlk[0],
NULL );
break;
}
"X_PM1a_CNT_BLK",
&pFadt->XPm1aCntBlk[0],
NULL );
break;
}
"X_PM1b_CNT_BLK",
&pFadt->XPm1bCntBlk[0],
NULL );
break;
}
"X_PM2_CNT_BLK",
&pFadt->XPm2CntBlk[0],
NULL );
break;
}
"X_PM_TMR_BLK",
NULL );
break;
}
"X_GPE0_BLK",
NULL );
break;
}
"X_GPE1_BLK",
NULL );
break;
}
//
// Build the table trailer
//
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.
@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
**/
)
{
DBG_ENTER ( );
//
// Send the RSDP page
//
for ( ; ; ) {
//
// Locate the RSDP
//
break;
}
//
// Send the page and table header
//
Status = TableHeader ( SocketFD, pPort, L"RSDP - ACPI 1.0b Root System Description Pointer", pRsdp10b );
break;
}
//
// Display the RSDP
//
"Signature",
break;
}
"Checksum",
NULL );
break;
}
"OemId",
break;
}
"Reserved",
NULL );
break;
}
"RsdtAddress",
break;
}
//
// Build the table trailer
//
pbDone );
break;
}
//
// Return the operation status
//
DBG_EXIT_STATUS ( Status );
return Status;
}
/**
Respond with the ACPI RSDP 3.0 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
**/
)
{
DBG_ENTER ( );
//
// Send the RSDP page
//
for ( ; ; ) {
//
// Locate the RSDP
//
break;
}
//
// Send the page and table header
//
Status = TableHeader ( SocketFD, pPort, L"RSDP - ACPI 3.0 Root System Description Pointer", pRsdp30 );
break;
}
//
// Display the RSDP
//
"Signature",
break;
}
"Checksum",
NULL );
break;
}
"OemId",
break;
}
"Revision",
NULL );
break;
}
"RsdtAddress",
break;
}
"Length",
break;
}
"XsdtAddress",
NULL );
break;
}
"ExtendedChecksum",
NULL );
break;
}
"Reserved",
break;
}
//
// Build the table trailer
//
pbDone );
break;
}
//
// Return the operation status
//
DBG_EXIT_STATUS ( Status );
return Status;
}
/**
Respond with the ACPI RSDT 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
**/
)
{
DBG_ENTER ( );
//
// Send the RSDT page
//
for ( ; ; ) {
//
// Locate the RSDT
//
pRsdt = LocateRsdt ( );
break;
}
//
// Send the page and table header
//
break;
}
//
// Display the RSDT
//
"Signature",
break;
}
"Length",
break;
}
"Revision",
break;
}
"Checksum",
NULL );
break;
}
"OEMID",
break;
}
"OEM Table ID",
sizeof ( pRsdt->OemTableId ),
&pRsdt->OemTableId[ 0 ]);
break;
}
"OEM Revision",
pRsdt->OemRevision );
break;
}
"Creator ID",
break;
}
"Creator Revision",
pRsdt->CreatorRevision );
break;
}
//
// Walk the list of entries
//
TableName[ 1 ] = 0;
//
// The entry is actually a 32-bit physical table address
// The first entry in the table is the 32-bit table signature
//
//
// Display the table address
//
pWebPage );
break;
}
pEntry++;
}
break;
}
//
// Build the table trailer
//
pbDone );
break;
}
//
// Return the operation status
//
DBG_EXIT_STATUS ( Status );
return Status;
}