ACPICA: Implemented support for data sub tables in the ASF! table

This commit is contained in:
rmoore1 2006-09-07 17:25:14 +00:00
parent 155a7c6c1b
commit 1a8fe15599
5 changed files with 128 additions and 11 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dmtable - Support for ACPI tables that contain no AML code
* $Revision: 1.9 $
* $Revision: 1.10 $
*
*****************************************************************************/
@ -419,6 +419,7 @@ AcpiDmLineHeader2 (
* TableOffset - Starting offset within the table for this
* sub-descriptor (0 if main table)
* Table - The ACPI table
* SubtableLength - Lenghth of this sub-descriptor
* Info - Info table for this ACPI table
*
* RETURN: None

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dmtbdump - Dump ACPI data tables that contain no AML code
* $Revision: 1.10 $
* $Revision: 1.11 $
*
*****************************************************************************/
@ -293,6 +293,13 @@ AcpiDmDumpAsf (
UINT32 Offset = sizeof (ACPI_TABLE_HEADER);
ACPI_ASF_INFO *SubTable;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_DMTABLE_INFO *DataInfoTable = NULL;
UINT8 *DataTable = NULL;
ACPI_NATIVE_UINT DataCount = 0;
ACPI_NATIVE_UINT DataLength = 0;
ACPI_NATIVE_UINT DataOffset = 0;
ACPI_NATIVE_UINT i;
/* No main table, only sub-tables */
@ -309,24 +316,79 @@ AcpiDmDumpAsf (
case ACPI_ASF_TYPE_INFO:
InfoTable = AcpiDmTableInfoAsf0;
break;
case ACPI_ASF_TYPE_ALERT:
InfoTable = AcpiDmTableInfoAsf1;
DataInfoTable = AcpiDmTableInfoAsf1a;
DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts;
DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength;
DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
break;
case ACPI_ASF_TYPE_CONTROL:
InfoTable = AcpiDmTableInfoAsf2;
DataInfoTable = AcpiDmTableInfoAsf2a;
DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls;
DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength;
DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
break;
case ACPI_ASF_TYPE_BOOT:
InfoTable = AcpiDmTableInfoAsf3;
break;
case ACPI_ASF_TYPE_ADDRESS:
InfoTable = AcpiDmTableInfoAsf4;
DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices;
DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
break;
default:
AcpiOsPrintf ("\n**** Unknown ASF sub-table type %X\n", SubTable->Header.Type);
return;
}
AcpiDmDumpTable (Table->Length, Offset, SubTable, SubTable->Header.Length, InfoTable);
/* Dump variable-length extra data */
switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
{
case ACPI_ASF_TYPE_ALERT:
case ACPI_ASF_TYPE_CONTROL:
for (i = 0; i < DataCount; i++)
{
AcpiOsPrintf ("\n");
AcpiDmDumpTable (Table->Length, DataOffset, DataTable, DataLength, DataInfoTable);
DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
DataOffset += DataLength;
}
break;
case ACPI_ASF_TYPE_ADDRESS:
for (i = 0; i < DataLength; i++)
{
if (!(i % 16))
{
AcpiDmLineHeader (DataOffset, 1, "Addresses");
}
AcpiOsPrintf ("%2.2X ", *DataTable);
DataTable++;
DataOffset++;
}
AcpiOsPrintf ("\n");
break;
}
AcpiOsPrintf ("\n");
/* Point to next sub-table */

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dmtbinfo - Table info for non-AML tables
* $Revision: 1.10 $
* $Revision: 1.11 $
*
*****************************************************************************/
@ -149,7 +149,9 @@
#define ACPI_ASF0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_INFO,f)
#define ACPI_ASF1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT,f)
#define ACPI_ASF1a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f)
#define ACPI_ASF2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_REMOTE,f)
#define ACPI_ASF2a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
#define ACPI_ASF3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CPEP0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
@ -425,7 +427,25 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1[] =
{ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DeassertMask), "DeassertMask"},
{ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (Alerts), "Alert Count"},
{ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DataLength), "Alert Data Length"},
/* TBD: Alert array */
{ACPI_DMT_EXIT, 0, NULL}
};
/* 1a: ASF Alert data */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a[] =
{
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Address), "Address"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Command), "Command"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Mask), "Mask"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Value), "Value"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorType), "SensorType"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Type), "Type"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Offset), "Offset"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SourceType), "SourceType"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Severity), "Severity"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorNumber), "SensorNumber"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Entity), "Entity"},
{ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Instance), "Instance"},
{ACPI_DMT_EXIT, 0, NULL}
};
@ -436,7 +456,17 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2[] =
{ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (Controls), "Control Count"},
{ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (DataLength), "Control Data Length"},
{ACPI_DMT_UINT16, ACPI_ASF2_OFFSET (Reserved2), "Reserved"},
/* TBD: Control array */
{ACPI_DMT_EXIT, 0, NULL}
};
/* 2a: ASF Control data */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[] =
{
{ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Function), "Function"},
{ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Address), "Address"},
{ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Command), "Command"},
{ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Value), "Value"},
{ACPI_DMT_EXIT, 0, NULL}
};
@ -460,7 +490,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[] =
{
{ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (EpromAddress), "Eprom Address"},
{ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (Devices), "Device Count"},
/* TBD: Address array */
{ACPI_DMT_EXIT, 0, NULL}
};

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl1.h - Additional ACPI table definitions
* $Revision: 1.45 $
* $Revision: 1.46 $
*
*****************************************************************************/
@ -238,10 +238,26 @@ typedef struct acpi_asf_alert
UINT8 DeassertMask;
UINT8 Alerts;
UINT8 DataLength;
UINT8 Array[1];
} ACPI_ASF_ALERT;
typedef struct acpi_asf_alert_data
{
UINT8 Address;
UINT8 Command;
UINT8 Mask;
UINT8 Value;
UINT8 SensorType;
UINT8 Type;
UINT8 Offset;
UINT8 SourceType;
UINT8 Severity;
UINT8 SensorNumber;
UINT8 Entity;
UINT8 Instance;
} ACPI_ASF_ALERT_DATA;
/* 2: ASF Remote Control */
typedef struct acpi_asf_remote
@ -250,10 +266,18 @@ typedef struct acpi_asf_remote
UINT8 Controls;
UINT8 DataLength;
UINT16 Reserved2;
UINT8 Array[1];
} ACPI_ASF_REMOTE;
typedef struct acpi_asf_control_data
{
UINT8 Function;
UINT8 Address;
UINT8 Command;
UINT8 Value;
} ACPI_ASF_CONTROL_DATA;
/* 3: ASF RMCP Boot Options */
typedef struct acpi_asf_rmcp
@ -276,7 +300,6 @@ typedef struct acpi_asf_address
ACPI_ASF_HEADER Header;
UINT8 EpromAddress;
UINT8 Devices;
UINT8 SmbusAddresses[1];
} ACPI_ASF_ADDRESS;

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: astable - Tables used for source conversion
* $Revision: 1.12 $
* $Revision: 1.13 $
*
*****************************************************************************/
@ -512,6 +512,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_ASF_ADDRESS", SRC_TYPE_STRUCT},
{"ACPI_ASF_ALERT", SRC_TYPE_STRUCT},
{"ACPI_ASF_ALERT_DATA", SRC_TYPE_STRUCT},
{"ACPI_ASF_CONTROL_DATA", SRC_TYPE_STRUCT},
{"ACPI_ASF_HEADER", SRC_TYPE_STRUCT},
{"ACPI_ASF_INFO", SRC_TYPE_STRUCT},
{"ACPI_ASF_REMOTE", SRC_TYPE_STRUCT},