Merge ACPICA 20150410.

This commit is contained in:
Jung-uk Kim 2015-04-11 03:23:41 +00:00
commit 7cf3e94a41
80 changed files with 1603 additions and 1233 deletions

View File

@ -18,11 +18,12 @@ fulldirs="common compiler components include os_specific"
# files to remove
stripdirs="generate libraries tests tools"
stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \
aclinux.h aclinuxex.h acmacosx.h acmsvc.h acnetbsd.h acos2.h \
acwin.h acwin64.h new_table.txt osefitbl.c osefixf.c \
osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c \
oswintbl.c oswinxf.c readme.txt utclib.c"
stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \
acefi.h achaiku.h acintel.h aclinux.h aclinuxex.h acmacosx.h \
acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h new_table.txt \
osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \
osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \
readme.txt utclib.c"
# include files to canonify
src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \

View File

@ -1,8 +1,85 @@
----------------------------------------
10 April 2015. Summary of changes for version 20150410:
Reverted a change introduced in version 20150408 that caused
a regression in the disassembler where incorrect operator
symbols could be emitted.
----------------------------------------
08 April 2015. Summary of changes for version 20150408:
1) ACPICA kernel-resident subsystem:
Permanently set the return value for the _REV predefined name. It now
returns 2 (was 5). This matches other ACPI implementations. _REV will be
deprecated in the future, and is now defined to be 1 for ACPI 1.0, and 2
for ACPI 2.0 and later. It should never be used to differentiate or
identify operating systems.
Added the "Windows 2015" string to the _OSI support. ACPICA will now
return TRUE to a query with this string.
Fixed several issues with the local version of the printf function.
Added the C99 compiler option (-std=c99) to the Unix makefiles.
Current Release:
Non-Debug Version: 99.9K Code, 27.4K Data, 127.3K Total
Debug Version: 195.2K Code, 80.7K Data, 275.9K Total
Previous Release:
Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
2) iASL Compiler/Disassembler and Tools:
iASL: Implemented an enhancement to the constant folding feature to
transform the parse tree to a simple Store operation whenever possible:
Add (2, 3, X) ==> is converted to: Store (5, X)
X = 2 + 3 ==> is converted to: Store (5, X)
Updated support for the SLIC table (Software Licensing Description Table)
in both the Data Table compiler and the disassembler. The SLIC table
support now conforms to "Microsoft Software Licensing Tables (SLIC and
MSDM). November 29, 2011. Copyright 2011 Microsoft". Note: Any SLIC data
following the ACPI header is now defined to be "Proprietary Data", and as
such, can only be entered or displayed as a hex data block.
Implemented full support for the MSDM table as described in the document
above. Note: The format of MSDM is similar to SLIC. Any MSDM data
following the ACPI header is defined to be "Proprietary Data", and can
only be entered or displayed as a hex data block.
Implemented the -Pn option for the iASL Table Compiler (was only
implemented for the ASL compiler). This option disables the iASL
preprocessor.
Disassembler: For disassembly of Data Tables, added a comment field
around the Ascii equivalent data that is emitted as part of the "Raw
Table Data" block. This prevents the iASL Preprocessor from possible
confusion if/when the table is compiled.
Disassembler: Added an option (-df) to force the disassembler to assume
that the table being disassembled contains valid AML. This feature is
useful for disassembling AML files that contain ACPI signatures other
than DSDT or SSDT (such as OEMx or other signatures).
Changes for the EFI version of the tools:
1) Fixed a build error/issue
2) Fixed a cast warning
iASL: Fixed a path issue with the __FILE__ operator by making the
directory prefix optional within the internal SplitInputFilename
function.
Debugger: Removed some unused global variables.
Tests: Updated the makefile for proper generation of the AAPITS suite.
----------------------------------------
04 February 2015. Summary of changes for version 20150204:
This release is available at https://acpica.org/downloads
ACPICA kernel-resident subsystem:
Updated all ACPICA copyrights and signons to 2014. Added the 2014
@ -14,24 +91,26 @@ Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues.
A raw gpe handling mechanism was created to allow better handling of GPE
storms that aren't easily managed by the normal handler. The raw handler
allows disabling/renabling of the the GPE so that interrupt storms can be
avoided in cases where events cannot be timely serviced. In this scenario,
handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API
will leave the reference counts undisturbed, thereby preventing unintentional
clearing of the GPE when the intent in only to temporarily disable it. Raw
handlers allow enabling and disabling of a GPE by removing GPE register
locking. As such, raw handlers much provide their own locks while using
GPE API's to protect access to GPE data structures.
avoided in cases where events cannot be timely serviced. In this
scenario, handlers should use the AcpiSetGpe() API to disable/enable the
GPE. This API will leave the reference counts undisturbed, thereby
preventing unintentional clearing of the GPE when the intent in only to
temporarily disable it. Raw handlers allow enabling and disabling of a
GPE by removing GPE register locking. As such, raw handlers much provide
their own locks while using GPE API's to protect access to GPE data
structures.
Lv Zheng
Events: Always modify GPE registers under the GPE lock.
Applies GPE lock around AcpiFinishGpe() to protect access to GPE register
values. Reported as bug by joe.liu@apple.com.
Unix makefiles: Separate option to disable optimizations and _FORTIFY_SOURCE.
This change removes the _FORTIFY_SOURCE flag from the NOOPT disable option and
creates a separate flag (NOFORTIFY) for this purpose. Some toolchains may
define _FORTIFY_SOURCE which leads redefined errors when building ACPICA. This
allows disabling the option without also having to disable optimazations.
Unix makefiles: Separate option to disable optimizations and
_FORTIFY_SOURCE. This change removes the _FORTIFY_SOURCE flag from the
NOOPT disable option and creates a separate flag (NOFORTIFY) for this
purpose. Some toolchains may define _FORTIFY_SOURCE which leads redefined
errors when building ACPICA. This allows disabling the option without
also having to disable optimazations.
David Box
Current Release:

View File

@ -295,7 +295,10 @@ FlSplitInputPathname (
char *Filename;
*OutDirectoryPath = NULL;
if (OutDirectoryPath)
{
*OutDirectoryPath = NULL;
}
if (!InputPath)
{
@ -340,7 +343,10 @@ FlSplitInputPathname (
return (AE_NO_MEMORY);
}
*OutDirectoryPath = DirectoryPath;
if (OutDirectoryPath)
{
*OutDirectoryPath = DirectoryPath;
}
if (OutFilename)
{

View File

@ -64,6 +64,11 @@ AdCreateTableHeader (
char *Filename,
ACPI_TABLE_HEADER *Table);
static ACPI_STATUS
AdStoreTable (
ACPI_TABLE_HEADER *Table,
UINT32 *TableIndex);
/* Stubs for ASL compiler */
#ifndef ACPI_ASL_COMPILER
@ -298,7 +303,7 @@ AdAmlDisassemble (
return (Status);
}
if (!AcpiGbl_DbOpt_disasm)
if (!AcpiGbl_DbOpt_Disasm)
{
return (AE_OK);
}
@ -337,7 +342,6 @@ AdAmlDisassemble (
{
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
Status = AE_ERROR;
ACPI_FREE (DisasmFilename);
goto Cleanup;
}
@ -346,9 +350,11 @@ AdAmlDisassemble (
*OutFilename = DisasmFilename;
if (!AcpiUtIsAmlTable (Table))
/* ForceAmlDisassembly means to assume the table contains valid AML */
if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table))
{
AdDisassemblerHeader (Filename);
AdDisassemblerHeader (Filename, ACPI_IS_DATA_TABLE);
AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
Table->Signature);
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
@ -486,7 +492,7 @@ AdAmlDisassemble (
/* Optional displays */
if (AcpiGbl_DbOpt_disasm)
if (AcpiGbl_DbOpt_Disasm)
{
/* This is the real disassembly */
@ -515,7 +521,7 @@ AdAmlDisassemble (
Cleanup:
if (Table && !AcpiUtIsAmlTable (Table))
if (Table && !AcpiGbl_ForceAmlDisassembly &&!AcpiUtIsAmlTable (Table))
{
ACPI_FREE (Table);
}
@ -543,6 +549,7 @@ AdAmlDisassemble (
* FUNCTION: AdDisassemblerHeader
*
* PARAMETERS: Filename - Input file for the table
* TableType - Either AML or DataTable
*
* RETURN: None
*
@ -553,7 +560,8 @@ AdAmlDisassemble (
void
AdDisassemblerHeader (
char *Filename)
char *Filename,
UINT8 TableType)
{
time_t Timer;
@ -565,17 +573,20 @@ AdDisassemblerHeader (
AcpiOsPrintf ("/*\n");
AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
if (AcpiGbl_CstyleDisassembly)
if (TableType == ACPI_IS_AML_TABLE)
{
AcpiOsPrintf (
" * Disassembling to symbolic ASL+ operators\n"
" *\n");
}
else
{
AcpiOsPrintf (
" * Disassembling to non-symbolic legacy ASL operators\n"
" *\n");
if (AcpiGbl_CstyleDisassembly)
{
AcpiOsPrintf (
" * Disassembling to symbolic ASL+ operators\n"
" *\n");
}
else
{
AcpiOsPrintf (
" * Disassembling to non-symbolic legacy ASL operators\n"
" *\n");
}
}
AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
@ -609,7 +620,7 @@ AdCreateTableHeader (
/*
* Print file header and dump original table header
*/
AdDisassemblerHeader (Filename);
AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE);
AcpiOsPrintf (" * Original Table Header:\n");
AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
@ -717,7 +728,7 @@ AdDisplayTables (
return (AE_NOT_EXIST);
}
if (!AcpiGbl_DbOpt_verbose)
if (!AcpiGbl_DbOpt_Verbose)
{
AdCreateTableHeader (Filename, Table);
}
@ -725,7 +736,7 @@ AdDisplayTables (
AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
MpEmitMappingInfo ();
if (AcpiGbl_DbOpt_verbose)
if (AcpiGbl_DbOpt_Verbose)
{
AcpiOsPrintf ("\n\nTable Header:\n");
AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
@ -740,6 +751,43 @@ AdDisplayTables (
}
/*******************************************************************************
*
* FUNCTION: AdStoreTable
*
* PARAMETERS: Table - Table header
* TableIndex - Where the table index is returned
*
* RETURN: Status and table index.
*
* DESCRIPTION: Add an ACPI table to the global table list
*
******************************************************************************/
static ACPI_STATUS
AdStoreTable (
ACPI_TABLE_HEADER *Table,
UINT32 *TableIndex)
{
ACPI_STATUS Status;
ACPI_TABLE_DESC *TableDesc;
Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Initialize added table */
AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
AcpiTbValidateTable (TableDesc);
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: AdGetLocalTables
@ -777,8 +825,7 @@ AdGetLocalTables (
/* Store DSDT in the Table Manager */
Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
0, &TableIndex);
Status = AdStoreTable (NewTable, &TableIndex);
if (ACPI_FAILURE (Status))
{
fprintf (stderr, "Could not store DSDT\n");
@ -871,9 +918,7 @@ AdParseTable (
if (LoadTable)
{
Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table,
Table->Length, ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
&TableIndex);
Status = AdStoreTable (Table, &TableIndex);
if (ACPI_FAILURE (Status))
{
return (Status);

View File

@ -241,13 +241,6 @@ static const char *AcpiDmPmttSubnames[] =
"Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmSlicSubnames[] =
{
"Public Key Structure",
"Windows Marker Structure",
"Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmSratSubnames[] =
{
"Processor Local APIC/SAPIC Affinity",
@ -339,6 +332,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
{ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm, "Microsoft Data Management table"},
{ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"},
{ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "Platform Communications Channel Table"},
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"},
@ -515,10 +509,20 @@ AcpiDmDumpDataTable (
}
else
{
AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n",
AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
Table->Signature);
fprintf (stderr, "Unknown ACPI table signature [%4.4s], decoding header only\n",
fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
Table->Signature);
if (!AcpiGbl_ForceAmlDisassembly)
{
fprintf (stderr, "decoding ACPI table header only\n");
}
else
{
fprintf (stderr, "assuming table contains valid AML code\n");
}
}
}
else if (TableData->TableHandler)
@ -686,6 +690,7 @@ AcpiDmDumpTable (
UINT32 ByteLength;
UINT8 Temp8;
UINT16 Temp16;
UINT32 Temp32;
UINT64 Value;
ACPI_DMTABLE_DATA *TableData;
const char *Name;
@ -715,7 +720,8 @@ AcpiDmDumpTable (
if ((CurrentOffset >= TableLength) ||
(SubtableLength && (Info->Offset >= SubtableLength)))
{
AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
AcpiOsPrintf (
"**** ACPI table terminates in the middle of a data structure! (dump table)\n");
return (AE_BAD_DATA);
}
@ -760,7 +766,6 @@ AcpiDmDumpTable (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
case ACPI_DMT_LPIT:
ByteLength = 4;
@ -805,6 +810,12 @@ AcpiDmDumpTable (
ByteLength = 128;
break;
case ACPI_DMT_BUFFER:
case ACPI_DMT_RAW_BUFFER:
ByteLength = SubtableLength;
break;
case ACPI_DMT_STRING:
ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
@ -838,7 +849,8 @@ AcpiDmDumpTable (
if (CurrentOffset + ByteLength > TableLength)
{
AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
AcpiOsPrintf (
"**** ACPI table terminates in the middle of a data structure!\n");
return (AE_BAD_DATA);
}
@ -1005,8 +1017,9 @@ AcpiDmDumpTable (
AcpiOsPrintf ("%2.2X", *Target);
Temp8 = AcpiDmGenerateChecksum (Table,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
{
AcpiOsPrintf (
@ -1032,7 +1045,7 @@ AcpiDmDumpTable (
Temp8 = ACPI_GAS_WIDTH_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, Temp8, AcpiDmGasAccessWidth[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);
break;
case ACPI_DMT_GAS:
@ -1069,7 +1082,8 @@ AcpiDmDumpTable (
Temp16 = ACPI_DMAR_TYPE_RESERVED;
}
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
AcpiDmDmarSubnames[Temp16]);
break;
case ACPI_DMT_DMAR_SCOPE:
@ -1082,7 +1096,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmDmarScope[Temp8]);
break;
case ACPI_DMT_EINJACT:
@ -1095,7 +1110,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_EINJ_ACTION_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmEinjActions[Temp8]);
break;
case ACPI_DMT_EINJINST:
@ -1108,7 +1124,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmEinjInstructions[Temp8]);
break;
case ACPI_DMT_ERSTACT:
@ -1121,7 +1138,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_ERST_ACTION_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmErstActions[Temp8]);
break;
case ACPI_DMT_ERSTINST:
@ -1134,7 +1152,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmErstInstructions[Temp8]);
break;
case ACPI_DMT_GTDT:
@ -1147,7 +1166,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_GTDT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmGtdtSubnames[Temp8]);
break;
case ACPI_DMT_HEST:
@ -1160,12 +1180,15 @@ AcpiDmDumpTable (
Temp16 = ACPI_HEST_TYPE_RESERVED;
}
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]);
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
AcpiDmHestSubnames[Temp16]);
break;
case ACPI_DMT_HESTNTFY:
AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure");
AcpiOsPrintf (STRING_FORMAT,
"Hardware Error Notification Structure");
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
AcpiOsPrintf ("\n");
@ -1182,7 +1205,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_HEST_NOTIFY_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmHestNotifySubnames[Temp8]);
break;
case ACPI_DMT_MADT:
@ -1195,7 +1219,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_MADT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmMadtSubnames[Temp8]);
break;
case ACPI_DMT_PCCT:
@ -1208,7 +1233,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_PCCT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmPcctSubnames[Temp8]);
break;
case ACPI_DMT_PMTT:
@ -1221,20 +1247,20 @@ AcpiDmDumpTable (
Temp8 = ACPI_PMTT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmPmttSubnames[Temp8]);
break;
case ACPI_DMT_SLIC:
case ACPI_DMT_RAW_BUFFER:
/*
* Currently only used for SLIC table
*/
AcpiOsPrintf ("/* Proprietary data structure */ ");
/* SLIC subtable types */
Temp8 = *Target;
if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
{
Temp8 = ACPI_SLIC_TYPE_RESERVED;
}
AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmSlicSubnames[Temp8]);
AcpiDmDumpBuffer (Table, sizeof (ACPI_TABLE_HEADER),
ByteLength, sizeof (ACPI_TABLE_HEADER),
"Licensing Data", TRUE);
AcpiOsPrintf ("\n");
break;
case ACPI_DMT_SRAT:
@ -1247,7 +1273,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_SRAT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmSratSubnames[Temp8]);
break;
case ACPI_DMT_FADTPM:
@ -1260,7 +1287,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_FADT_PM_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]);
AcpiOsPrintf (UINT8_FORMAT, *Target,
AcpiDmFadtProfiles[Temp8]);
break;
case ACPI_DMT_IVRS:
@ -1295,26 +1323,14 @@ AcpiDmDumpTable (
/* LPIT subtable types */
Temp8 = *Target;
switch (Temp8)
Temp32 = ACPI_GET32 (Target);
if (Temp32 > ACPI_LPIT_TYPE_RESERVED)
{
case ACPI_LPIT_TYPE_NATIVE_CSTATE:
Name = AcpiDmLpitSubnames[0];
break;
case ACPI_LPIT_TYPE_SIMPLE_IO:
Name = AcpiDmLpitSubnames[1];
break;
default:
Name = AcpiDmLpitSubnames[2];
break;
Temp32 = ACPI_LPIT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT32_FORMAT, *Target, Name);
AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),
AcpiDmLpitSubnames[Temp32]);
break;
case ACPI_DMT_EXIT:
@ -1331,8 +1347,10 @@ AcpiDmDumpTable (
if (TableOffset && !SubtableLength)
{
/* If this table is not the main table, subtable must have valid length */
/*
* If this table is not the main table, the subtable must have a
* valid length
*/
AcpiOsPrintf ("Invalid zero length subtable\n");
return (AE_BAD_DATA);
}

View File

@ -59,14 +59,6 @@ AcpiDmValidateFadtLength (
UINT32 Revision,
UINT32 Length);
static void
AcpiDmDumpBuffer (
void *Table,
UINT32 BufferOffset,
UINT32 Length,
UINT32 AbsoluteOffset,
char *Header);
/*******************************************************************************
*
@ -78,6 +70,7 @@ AcpiDmDumpBuffer (
* AbsoluteOffset - Offset of buffer in the main ACPI table
* Header - Name of the buffer field (printed on the
* first line only.)
* MultiLine - TRUE if a large, multi-line buffer
*
* RETURN: None
*
@ -86,13 +79,14 @@ AcpiDmDumpBuffer (
*
******************************************************************************/
static void
void
AcpiDmDumpBuffer (
void *Table,
UINT32 BufferOffset,
UINT32 Length,
UINT32 AbsoluteOffset,
char *Header)
char *Header,
BOOLEAN MultiLine)
{
UINT8 *Buffer;
UINT32 i;
@ -110,10 +104,19 @@ AcpiDmDumpBuffer (
{
if (!(i % 16))
{
AcpiOsPrintf ("\n");
AcpiDmLineHeader (AbsoluteOffset,
((Length - i) > 16) ? 16 : (Length - i), Header);
Header = NULL;
if (MultiLine)
{
/* Insert a backslash - line continuation character */
AcpiOsPrintf ("\\\n ");
}
else
{
AcpiOsPrintf ("\n");
AcpiDmLineHeader (AbsoluteOffset,
((Length - i) > 16) ? 16 : (Length - i), Header);
Header = NULL;
}
}
AcpiOsPrintf ("%.02X ", *Buffer);
@ -526,7 +529,7 @@ AcpiDmDumpAsf (
DataOffset++;
if (DataOffset > Table->Length)
{
AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n");
return;
}
}
@ -692,7 +695,7 @@ AcpiDmDumpCsrt (
InfoLength = SubSubTable->Length - SubSubOffset;
AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength,
Offset + SubOffset + SubSubOffset, "ResourceInfo");
Offset + SubOffset + SubSubOffset, "ResourceInfo", FALSE);
SubSubOffset += InfoLength;
/* Point to next sub-subtable */
@ -812,7 +815,7 @@ AcpiDmDumpDbg2 (
if (SubTable->OemDataOffset)
{
AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
Offset + SubTable->OemDataOffset, "OEM Data");
Offset + SubTable->OemDataOffset, "OEM Data", FALSE);
}
/* Point to next subtable */
@ -2535,67 +2538,8 @@ void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_SLIC);
ACPI_SLIC_HEADER *SubTable;
ACPI_DMTABLE_INFO *InfoTable;
/* There is no main SLIC table, only subtables */
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
while (Offset < Table->Length)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Length, AcpiDmTableInfoSlicHdr);
if (ACPI_FAILURE (Status))
{
return;
}
switch (SubTable->Type)
{
case ACPI_SLIC_TYPE_PUBLIC_KEY:
InfoTable = AcpiDmTableInfoSlic0;
break;
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
InfoTable = AcpiDmTableInfoSlic1;
break;
default:
AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
if (!SubTable->Length)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
NextSubTable:
/* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
}
AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
}

View File

@ -200,9 +200,7 @@
#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_HEADER,f)
#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f)
#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f)
#define ACPI_SLICH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
#define ACPI_SLIC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_KEY,f)
#define ACPI_SLIC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
#define ACPI_SLIC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIC,f)
#define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
@ -2043,42 +2041,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] =
/*******************************************************************************
*
* SLIC - Software Licensing Description Table. There is no common table, just
* the standard ACPI header and then subtables.
* SLIC - Software Licensing Description Table. This table contains the standard
* ACPI header followed by proprietary data structures
*
******************************************************************************/
/* Common Subtable header (one per Subtable) */
/* Single subtable, a proprietary format, so treat it as a buffer */
ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] =
{
{ACPI_DMT_SLIC, ACPI_SLICH_OFFSET (Type), "Subtable Type", 0},
{ACPI_DMT_UINT32, ACPI_SLICH_OFFSET (Length), "Length", DT_LENGTH},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[] =
{
{ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (KeyType), "Key Type", 0},
{ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (Version), "Version", 0},
{ACPI_DMT_UINT16, ACPI_SLIC0_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Algorithm), "Algorithm", 0},
{ACPI_DMT_NAME4, ACPI_SLIC0_OFFSET (Magic), "Magic", 0},
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (BitLength), "BitLength", 0},
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Exponent), "Exponent", 0},
{ACPI_DMT_BUF128, ACPI_SLIC0_OFFSET (Modulus[0]), "Modulus", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] =
{
{ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (Version), "Version", 0},
{ACPI_DMT_NAME6, ACPI_SLIC1_OFFSET (OemId[0]), "Oem ID", 0},
{ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (OemTableId[0]), "Oem Table ID", 0},
{ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (WindowsFlag[0]), "Windows Flag", 0},
{ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (SlicVersion), "SLIC Version", 0},
{ACPI_DMT_BUF16, ACPI_SLIC1_OFFSET (Reserved[0]), "Reserved", 0},
{ACPI_DMT_BUF128, ACPI_SLIC1_OFFSET (Signature[0]), "Signature", 0},
{ACPI_DMT_RAW_BUFFER, 0, "Software Licensing Structure", 0},
ACPI_DMT_TERMINATOR
};
@ -2091,7 +2063,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[] =
{
{ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0},
{ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0},
ACPI_DMT_TERMINATOR
};

View File

@ -460,7 +460,7 @@ CgWriteTableHeader (
/* Compiler version */
TableHeader.AslCompilerRevision = ASL_REVISION;
TableHeader.AslCompilerRevision = ACPI_CA_VERSION;
/* Table length. Checksum zero for now, will rewrite later */

View File

@ -195,8 +195,16 @@ CmDoCompile (
Event = UtBeginEvent ("Constant folding via AML interpreter");
DbgPrint (ASL_DEBUG_OUTPUT,
"\nInterpreting compile-time constant expressions\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
OpcAmlConstantWalk, NULL, NULL);
if (Gbl_FoldConstants)
{
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
OpcAmlConstantWalk, NULL, NULL);
}
else
{
DbgPrint (ASL_PARSE_OUTPUT, " Optional folding disabled\n");
}
UtEndEvent (Event);
/* Update AML opcodes if necessary, after constant folding */

View File

@ -685,6 +685,10 @@ ACPI_PARSE_OBJECT *
TrAllocateNode (
UINT32 ParseOpcode);
void
TrPrintNodeCompileFlags (
UINT32 Flags);
void
TrReleaseNode (
ACPI_PARSE_OBJECT *Op);
@ -704,6 +708,10 @@ ACPI_PARSE_OBJECT *
TrCreateLeafNode (
UINT32 ParseOpcode);
ACPI_PARSE_OBJECT *
TrCreateNullTarget (
void);
ACPI_PARSE_OBJECT *
TrCreateAssignmentNode (
ACPI_PARSE_OBJECT *Target,

View File

@ -48,7 +48,6 @@
/*
* Compiler versions and names
*/
#define ASL_REVISION ACPI_CA_VERSION
#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
#define ASL_INVOCATION_NAME "iasl"

View File

@ -76,199 +76,20 @@ OpcUpdateIntegerNode (
ACPI_PARSE_OBJECT *Op,
UINT64 Value);
/*******************************************************************************
*
* FUNCTION: OpcAmlEvaluationWalk1
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for AML execution of constant subtrees
*
******************************************************************************/
static ACPI_STATUS
TrTransformToStoreOp (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState);
static ACPI_STATUS
OpcAmlEvaluationWalk1 (
TrSimpleConstantReduction (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
ACPI_STATUS Status;
ACPI_PARSE_OBJECT *OutOp;
ACPI_WALK_STATE *WalkState);
WalkState->Op = Op;
WalkState->Opcode = Op->Common.AmlOpcode;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
/* Copy child pointer to Arg for compatibility with Interpreter */
if (Op->Asl.Child)
{
Op->Common.Value.Arg = Op->Asl.Child;
}
/* Call AML dispatcher */
Status = AcpiDsExecBeginOp (WalkState, &OutOp);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Constant interpretation failed - %s\n",
AcpiFormatException (Status));
}
return (Status);
}
/*******************************************************************************
*
* FUNCTION: OpcAmlEvaluationWalk2
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for AML execution of constant subtrees
*
******************************************************************************/
static ACPI_STATUS
OpcAmlEvaluationWalk2 (
static void
TrInstallReducedConstant (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
ACPI_STATUS Status;
WalkState->Op = Op;
WalkState->Opcode = Op->Common.AmlOpcode;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
/* Copy child pointer to Arg for compatibility with Interpreter */
if (Op->Asl.Child)
{
Op->Common.Value.Arg = Op->Asl.Child;
}
/* Call AML dispatcher */
Status = AcpiDsExecEndOp (WalkState);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Constant interpretation failed - %s\n",
AcpiFormatException (Status));
}
return (Status);
}
/*******************************************************************************
*
* FUNCTION: OpcAmlCheckForConstant
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Check one Op for a type 3/4/5 AML opcode
*
******************************************************************************/
static ACPI_STATUS
OpcAmlCheckForConstant (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
WalkState->Op = Op;
WalkState->Opcode = Op->Common.AmlOpcode;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
DbgPrint (ASL_PARSE_OUTPUT, "[%.4d] Opcode: %12.12s ",
Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName);
/*
* These opcodes do not appear in the OpcodeInfo table, but
* they represent constants, so abort the constant walk now.
*/
if ((WalkState->Opcode == AML_RAW_DATA_BYTE) ||
(WalkState->Opcode == AML_RAW_DATA_WORD) ||
(WalkState->Opcode == AML_RAW_DATA_DWORD) ||
(WalkState->Opcode == AML_RAW_DATA_QWORD))
{
WalkState->WalkType = ACPI_WALK_CONST_OPTIONAL;
return (AE_TYPE);
}
if (!(WalkState->OpInfo->Flags & AML_CONSTANT))
{
/* The opcode is not a Type 3/4/5 opcode */
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
DbgPrint (ASL_PARSE_OUTPUT,
"**** Valid Target, cannot reduce ****\n");
}
else
{
DbgPrint (ASL_PARSE_OUTPUT,
"**** Not a Type 3/4/5 opcode ****\n");
}
if (WalkState->WalkType == ACPI_WALK_CONST_OPTIONAL)
{
/*
* We are looking at at normal expression to see if it can be
* reduced. It can't. No error
*/
return (AE_TYPE);
}
/*
* This is an expression that MUST reduce to a constant, and it
* can't be reduced. This is an error
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
AslError (ASL_ERROR, ASL_MSG_INVALID_TARGET, Op,
Op->Asl.ParseOpName);
}
else
{
AslError (ASL_ERROR, ASL_MSG_INVALID_CONSTANT_OP, Op,
Op->Asl.ParseOpName);
}
return (AE_TYPE);
}
/* Debug output */
DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345");
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
DbgPrint (ASL_PARSE_OUTPUT, " TARGET");
}
if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
{
DbgPrint (ASL_PARSE_OUTPUT, " TERMARG");
}
DbgPrint (ASL_PARSE_OUTPUT, "\n");
return (AE_OK);
}
ACPI_OPERAND_OBJECT *ObjDesc);
/*******************************************************************************
@ -291,12 +112,13 @@ OpcAmlConstantWalk (
{
ACPI_WALK_STATE *WalkState;
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_PARSE_OBJECT *RootOp;
ACPI_PARSE_OBJECT *OriginalParentOp;
UINT8 WalkType;
if (Op->Asl.CompileFlags == 0)
{
return (AE_OK);
}
/*
* Only interested in subtrees that could possibly contain
* expressions that can be evaluated at this time
@ -307,26 +129,6 @@ OpcAmlConstantWalk (
return (AE_OK);
}
/* Set the walk type based on the reduction used for this op */
if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
{
/* Op is a TermArg, constant folding is merely optional */
if (!Gbl_FoldConstants)
{
return (AE_CTRL_DEPTH);
}
WalkType = ACPI_WALK_CONST_OPTIONAL;
}
else
{
/* Op is a DataObject, the expression MUST reduced to a constant */
WalkType = ACPI_WALK_CONST_REQUIRED;
}
/* Create a new walk state */
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
@ -337,8 +139,6 @@ OpcAmlConstantWalk (
WalkState->NextOp = NULL;
WalkState->Params = NULL;
WalkState->WalkType = WalkType;
WalkState->CallerReturnDesc = &ObjDesc;
/*
* Examine the entire subtree -- all nodes must be constants
@ -348,161 +148,481 @@ OpcAmlConstantWalk (
OpcAmlCheckForConstant, NULL, WalkState);
/*
* Did we find an entire subtree that contains all constants and type 3/4/5
* opcodes? (Only AE_OK or AE_TYPE returned from above)
* Did we find an entire subtree that contains all constants
* and type 3/4/5 opcodes?
*/
if (Status == AE_TYPE)
switch (Status)
{
/* Subtree cannot be reduced to a constant */
case AE_OK:
if (WalkState->WalkType == ACPI_WALK_CONST_OPTIONAL)
{
AcpiDsDeleteWalkState (WalkState);
return (AE_OK);
}
/* Simple case, like Add(3,4) -> 7 */
/* Don't descend any further, and use a default "constant" value */
Status = TrSimpleConstantReduction (Op, WalkState);
break;
Status = AE_CTRL_DEPTH;
}
else
{
/* Subtree can be reduced */
case AE_CTRL_RETURN_VALUE:
/* Allocate a new temporary root for this subtree */
/* More complex case, like Add(3,4,Local0) -> Store(7,Local0) */
RootOp = TrAllocateNode (PARSEOP_INTEGER);
if (!RootOp)
{
return (AE_NO_MEMORY);
}
Status = TrTransformToStoreOp (Op, WalkState);
break;
RootOp->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
case AE_TYPE:
OriginalParentOp = Op->Common.Parent;
Op->Common.Parent = RootOp;
AcpiDsDeleteWalkState (WalkState);
return (AE_OK);
/* Hand off the subtree to the AML interpreter */
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
Op->Common.Parent = OriginalParentOp;
/* TBD: we really *should* release the RootOp node */
if (ACPI_SUCCESS (Status))
{
TotalFolds++;
/* Get the final result */
Status = AcpiDsResultPop (&ObjDesc, WalkState);
}
/* Check for error from the ACPICA core */
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status,
"Failure during constant evaluation", FALSE);
}
default:
AcpiDsDeleteWalkState (WalkState);
break;
}
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT, "Cannot resolve, %s\n",
AcpiFormatException (Status));
/* We could not resolve the subtree for some reason */
AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
Op->Asl.ParseOpName);
(char *) AcpiFormatException (Status));
/* Set the subtree value to ZERO anyway. Eliminates further errors */
OpcUpdateIntegerNode (Op, 0);
}
else
/* Abort the walk of this subtree, we are done with it */
return (AE_CTRL_DEPTH);
}
/*******************************************************************************
*
* FUNCTION: OpcAmlCheckForConstant
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Check one Op for a type 3/4/5 AML opcode
*
******************************************************************************/
static ACPI_STATUS
OpcAmlCheckForConstant (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
ACPI_STATUS Status = AE_OK;
WalkState->Op = Op;
WalkState->Opcode = Op->Common.AmlOpcode;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
DbgPrint (ASL_PARSE_OUTPUT, "[%.4d] Opcode: %12.12s ",
Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName);
/*
* TBD: Ignore buffer constants for now. The problem is that these
* constants have been transformed into RAW_DATA at this point, from
* the parse tree transform process which currently happens before
* the constant folding process. We may need to defer this transform
* for buffer until after the constant folding.
*/
if (WalkState->Opcode == AML_BUFFER_OP)
{
AslError (ASL_OPTIMIZATION, ASL_MSG_CONSTANT_FOLDED, Op,
Op->Asl.ParseOpName);
Status = AE_TYPE;
goto CleanupAndExit;
}
/*
* Because we know we executed type 3/4/5 opcodes above, we know that
* the result must be either an Integer, String, or Buffer.
*/
switch (ObjDesc->Common.Type)
/*
* These opcodes do not appear in the OpcodeInfo table, but
* they represent constants, so abort the constant walk now.
*/
if ((WalkState->Opcode == AML_RAW_DATA_BYTE) ||
(WalkState->Opcode == AML_RAW_DATA_WORD) ||
(WalkState->Opcode == AML_RAW_DATA_DWORD) ||
(WalkState->Opcode == AML_RAW_DATA_QWORD))
{
DbgPrint (ASL_PARSE_OUTPUT, "RAW DATA");
Status = AE_TYPE;
goto CleanupAndExit;
}
/* Type 3/4/5 opcodes have the AML_CONSTANT flag set */
if (!(WalkState->OpInfo->Flags & AML_CONSTANT))
{
/* Not 3/4/5 opcode, but maybe can convert to STORE */
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
case ACPI_TYPE_INTEGER:
OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
DbgPrint (ASL_PARSE_OUTPUT,
"Constant expression reduced to (%s) %8.8X%8.8X\n",
Op->Asl.ParseOpName,
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
break;
"**** Valid Target, transform to Store ****\n");
return (AE_CTRL_RETURN_VALUE);
}
case ACPI_TYPE_STRING:
/* Expression cannot be reduced */
Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
Op->Common.AmlOpcode = AML_STRING_OP;
Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
Op->Common.Value.String = ObjDesc->String.Pointer;
DbgPrint (ASL_PARSE_OUTPUT,
"**** Not a Type 3/4/5 opcode (%s) ****",
Op->Asl.ParseOpName);
DbgPrint (ASL_PARSE_OUTPUT,
"Constant expression reduced to (STRING) %s\n",
Op->Common.Value.String);
Status = AE_TYPE;
goto CleanupAndExit;
}
break;
/* Debug output */
case ACPI_TYPE_BUFFER:
DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345");
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
Op->Common.AmlOpcode = AML_BUFFER_OP;
Op->Asl.CompileFlags = NODE_AML_PACKAGE;
UtSetParseOpName (Op);
/* Child node is the buffer length */
RootOp = TrAllocateNode (PARSEOP_INTEGER);
RootOp->Asl.AmlOpcode = AML_DWORD_OP;
RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
RootOp->Asl.Parent = Op;
(void) OpcSetOptimalIntegerSize (RootOp);
Op->Asl.Child = RootOp;
Op = RootOp;
UtSetParseOpName (Op);
/* Peer to the child is the raw buffer data */
RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
RootOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = RootOp;
Op = RootOp;
DbgPrint (ASL_PARSE_OUTPUT,
"Constant expression reduced to (BUFFER) length %X\n",
ObjDesc->Buffer.Length);
break;
default:
printf ("Unsupported return type: %s\n",
AcpiUtGetObjectTypeName (ObjDesc));
break;
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
if (Op->Asl.ParseOpcode == PARSEOP_ZERO)
{
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " NULL TARGET");
}
else
{
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " VALID TARGET");
}
}
if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
{
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " TERMARG");
}
CleanupAndExit:
/* Dump the node compile flags also */
TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
DbgPrint (ASL_PARSE_OUTPUT, "\n");
return (Status);
}
/*******************************************************************************
*
* FUNCTION: TrSimpleConstantReduction
*
* PARAMETERS: Op - Parent operator to be transformed
* WalkState - Current walk state
*
* RETURN: Status
*
* DESCRIPTION: Reduce an entire AML operation to a single constant. The
* operation must not have a target operand.
*
* Add (32,64) --> 96
*
******************************************************************************/
static ACPI_STATUS
TrSimpleConstantReduction (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
ACPI_PARSE_OBJECT *RootOp;
ACPI_PARSE_OBJECT *OriginalParentOp;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
DbgPrint (ASL_PARSE_OUTPUT,
"Simple subtree constant reduction, operator to constant\n");
/* Allocate a new temporary root for this subtree */
RootOp = TrAllocateNode (PARSEOP_INTEGER);
if (!RootOp)
{
return (AE_NO_MEMORY);
}
RootOp->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
OriginalParentOp = Op->Common.Parent;
Op->Common.Parent = RootOp;
/* Hand off the subtree to the AML interpreter */
WalkState->CallerReturnDesc = &ObjDesc;
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
/* Restore original parse tree */
Op->Common.Parent = OriginalParentOp;
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT,
"Constant Subtree evaluation(1), %s\n",
AcpiFormatException (Status));
return (Status);
}
/* Get the final result */
Status = AcpiDsResultPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT,
"Constant Subtree evaluation(2), %s\n",
AcpiFormatException (Status));
return (Status);
}
TrInstallReducedConstant (Op, ObjDesc);
UtSetParseOpName (Op);
Op->Asl.Child = NULL;
return (AE_OK);
}
AcpiDsDeleteWalkState (WalkState);
return (AE_CTRL_DEPTH);
/*******************************************************************************
*
* FUNCTION: TrTransformToStoreOp
*
* PARAMETERS: Op - Parent operator to be transformed
* WalkState - Current walk state
*
* RETURN: Status
*
* DESCRIPTION: Transforms a single AML operation with a constant and target
* to a simple store operation:
*
* Add (32,64,DATA) --> Store (96,DATA)
*
******************************************************************************/
static ACPI_STATUS
TrTransformToStoreOp (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState)
{
ACPI_PARSE_OBJECT *OriginalTarget;
ACPI_PARSE_OBJECT *NewTarget;
ACPI_PARSE_OBJECT *Child1;
ACPI_PARSE_OBJECT *Child2;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_PARSE_OBJECT *NewParent;
ACPI_PARSE_OBJECT *OriginalParent;
ACPI_STATUS Status;
DbgPrint (ASL_PARSE_OUTPUT,
"Reduction/Transform to StoreOp: Store(Constant, Target)\n");
/* Extract the operands */
Child1 = Op->Asl.Child;
Child2 = Child1->Asl.Next;
/*
* Special case for DIVIDE -- it has two targets. The first
* is for the remainder and if present, we will not attempt
* to reduce the expression.
*/
if (Op->Asl.ParseOpcode == PARSEOP_DIVIDE)
{
Child2 = Child2->Asl.Next;
if (Child2->Asl.ParseOpcode != PARSEOP_ZERO)
{
DbgPrint (ASL_PARSE_OUTPUT,
"Cannot reduce DIVIDE - has two targets\n\n");
return (AE_OK);
}
}
/*
* Create a NULL (zero) target so that we can use the
* interpreter to evaluate the expression.
*/
NewTarget = TrCreateNullTarget ();
NewTarget->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
/* Handle one-operand cases (NOT, TOBCD, etc.) */
if (!Child2->Asl.Next)
{
Child2 = Child1;
}
/* Link in new NULL target as the last operand */
OriginalTarget = Child2->Asl.Next;
Child2->Asl.Next = NewTarget;
NewTarget->Asl.Parent = OriginalTarget->Asl.Parent;
NewParent = TrAllocateNode (PARSEOP_INTEGER);
NewParent->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
OriginalParent = Op->Common.Parent;
Op->Common.Parent = NewParent;
/* Hand off the subtree to the AML interpreter */
WalkState->CallerReturnDesc = &ObjDesc;
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT,
"Constant Subtree evaluation(3), %s\n",
AcpiFormatException (Status));
goto EvalError;
}
/* Get the final result */
Status = AcpiDsResultPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT,
"Constant Subtree evaluation(4), %s\n",
AcpiFormatException (Status));
goto EvalError;
}
/* Folded constant is in ObjDesc, store into Child1 */
TrInstallReducedConstant (Child1, ObjDesc);
/* Convert operator to STORE */
Op->Asl.ParseOpcode = PARSEOP_STORE;
Op->Asl.AmlOpcode = AML_STORE_OP;
UtSetParseOpName (Op);
Op->Common.Parent = OriginalParent;
/* Truncate any subtree expressions, they have been evaluated */
Child1->Asl.Child = NULL;
Child2->Asl.Child = NULL;
/* First child is the folded constant */
/* Second child will be the target */
Child1->Asl.Next = OriginalTarget;
return (AE_OK);
EvalError:
/* Restore original links */
Op->Common.Parent = OriginalParent;
Child2->Asl.Next = OriginalTarget;
return (Status);
}
/*******************************************************************************
*
* FUNCTION: TrInstallReducedConstant
*
* PARAMETERS: Op - Parent operator to be transformed
* ObjDesc - Reduced constant to be installed
*
* RETURN: None
*
* DESCRIPTION: Transform the original operator to a simple constant.
* Handles Integers, Strings, and Buffers.
*
******************************************************************************/
static void
TrInstallReducedConstant (
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT *ObjDesc)
{
ACPI_PARSE_OBJECT *RootOp;
TotalFolds++;
AslError (ASL_OPTIMIZATION, ASL_MSG_CONSTANT_FOLDED, Op,
Op->Asl.ParseOpName);
/*
* Because we know we executed type 3/4/5 opcodes above, we know that
* the result must be either an Integer, String, or Buffer.
*/
switch (ObjDesc->Common.Type)
{
case ACPI_TYPE_INTEGER:
OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
DbgPrint (ASL_PARSE_OUTPUT,
"Constant expression reduced to (%s) %8.8X%8.8X\n\n",
Op->Asl.ParseOpName,
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
break;
case ACPI_TYPE_STRING:
Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
Op->Common.AmlOpcode = AML_STRING_OP;
Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
Op->Common.Value.String = ObjDesc->String.Pointer;
DbgPrint (ASL_PARSE_OUTPUT,
"Constant expression reduced to (STRING) %s\n\n",
Op->Common.Value.String);
break;
case ACPI_TYPE_BUFFER:
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
Op->Common.AmlOpcode = AML_BUFFER_OP;
Op->Asl.CompileFlags = NODE_AML_PACKAGE;
UtSetParseOpName (Op);
/* Child node is the buffer length */
RootOp = TrAllocateNode (PARSEOP_INTEGER);
RootOp->Asl.AmlOpcode = AML_DWORD_OP;
RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
RootOp->Asl.Parent = Op;
(void) OpcSetOptimalIntegerSize (RootOp);
Op->Asl.Child = RootOp;
Op = RootOp;
UtSetParseOpName (Op);
/* Peer to the child is the raw buffer data */
RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
RootOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = RootOp;
Op = RootOp;
DbgPrint (ASL_PARSE_OUTPUT,
"Constant expression reduced to (BUFFER) length %X\n\n",
ObjDesc->Buffer.Length);
break;
default:
break;
}
}
@ -511,10 +631,11 @@ OpcAmlConstantWalk (
* FUNCTION: OpcUpdateIntegerNode
*
* PARAMETERS: Op - Current parse object
* Value - Value for the integer op
*
* RETURN: None
*
* DESCRIPTION: Update node to the correct integer type.
* DESCRIPTION: Update node to the correct Integer type and value
*
******************************************************************************/
@ -566,3 +687,98 @@ OpcUpdateIntegerNode (
Op->Asl.AmlLength = 0;
}
/*******************************************************************************
*
* FUNCTION: OpcAmlEvaluationWalk1
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Descending callback for AML execution of constant subtrees
*
******************************************************************************/
static ACPI_STATUS
OpcAmlEvaluationWalk1 (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
ACPI_STATUS Status;
ACPI_PARSE_OBJECT *OutOp;
WalkState->Op = Op;
WalkState->Opcode = Op->Common.AmlOpcode;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
/* Copy child pointer to Arg for compatibility with Interpreter */
if (Op->Asl.Child)
{
Op->Common.Value.Arg = Op->Asl.Child;
}
/* Call AML dispatcher */
Status = AcpiDsExecBeginOp (WalkState, &OutOp);
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT,
"%s Constant interpretation failed (1) - %s\n",
Op->Asl.ParseOpName, AcpiFormatException (Status));
}
return (Status);
}
/*******************************************************************************
*
* FUNCTION: OpcAmlEvaluationWalk2
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Ascending callback for AML execution of constant subtrees
*
******************************************************************************/
static ACPI_STATUS
OpcAmlEvaluationWalk2 (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
ACPI_STATUS Status;
WalkState->Op = Op;
WalkState->Opcode = Op->Common.AmlOpcode;
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
/* Copy child pointer to Arg for compatibility with Interpreter */
if (Op->Asl.Child)
{
Op->Common.Value.Arg = Op->Asl.Child;
}
/* Call AML dispatcher */
Status = AcpiDsExecEndOp (WalkState);
if (ACPI_FAILURE (Status))
{
DbgPrint (ASL_PARSE_OUTPUT,
"%s: Constant interpretation failed (2) - %s\n",
Op->Asl.ParseOpName, AcpiFormatException (Status));
}
return (Status);
}

View File

@ -270,7 +270,10 @@ LsTreeWriteWalk (
UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
DbgPrint (ASL_TREE_OUTPUT, " (%.4X)\n", Op->Asl.ParseOpcode);
DbgPrint (ASL_TREE_OUTPUT, " (%.4X) Flags %8.8X",
Op->Asl.ParseOpcode, Op->Asl.CompileFlags);
TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
DbgPrint (ASL_TREE_OUTPUT, "\n");
return (AE_OK);
}

View File

@ -187,6 +187,7 @@ Usage (
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
ACPI_OPTION ("-df", "Force disassembler to assume table contains valid AML");
ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");

View File

@ -222,7 +222,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* EXTENDEDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EXTENDEDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EXTENDEDSPACE */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER),
/* EXTERNAL */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* EXTERNAL */ OP_TABLE_ENTRY (AML_EXTERNAL_OP, 0, 0, 0),
/* FATAL */ OP_TABLE_ENTRY (AML_FATAL_OP, 0, 0, 0),
/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
/* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER),

View File

@ -216,6 +216,7 @@ MpCreateGpioInfo (
ACPI_GPIO_INFO *Info;
ACPI_GPIO_INFO *NextGpio;
ACPI_GPIO_INFO *PrevGpio;
char *Buffer;
/*
@ -223,8 +224,8 @@ MpCreateGpioInfo (
* sorted by both source device name and then the pin number. There is
* one block per pin.
*/
Info = ACPI_CAST_PTR (ACPI_GPIO_INFO,
UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO)));
Buffer = UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO));
Info = ACPI_CAST_PTR (ACPI_GPIO_INFO, Buffer);
NextGpio = Gbl_GpioList;
PrevGpio = NULL;
@ -293,14 +294,15 @@ MpCreateSerialInfo (
ACPI_SERIAL_INFO *Info;
ACPI_SERIAL_INFO *NextSerial;
ACPI_SERIAL_INFO *PrevSerial;
char *Buffer;
/*
* Allocate a new info block and insert it into the global Serial list
* sorted by both source device name and then the address.
*/
Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO,
UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO)));
Buffer = UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO));
Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO, Buffer);
NextSerial = Gbl_SerialList;
PrevSerial = NULL;

View File

@ -274,6 +274,11 @@ AslDoOptions (
break;
case 'f':
AcpiGbl_ForceAmlDisassembly = TRUE;
break;
case 'l': /* Use legacy ASL code (not ASL+) for disassembly */
Gbl_DoCompile = FALSE;

View File

@ -130,7 +130,7 @@ Expression
: PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
| PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());}
| SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
{$$ = TrLinkChildren ($<n>3,1,$1);}
@ -140,27 +140,27 @@ Expression
/* Binary operators: math and logical */
| TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
@ -198,7 +198,7 @@ EqualsTerm
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
| TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
| TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
@ -247,11 +247,10 @@ TermList
Term
: Object {}
| Expression {}
| Type1Opcode {}
| Type2Opcode {}
| Type2IntegerOpcode {}
| Type2StringOpcode {}
| Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
| Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
| Type2BufferOpcode {}
| Type2BufferOrStringOpcode {}
| error {$$ = AslDoError(); yyclearin;}
@ -332,7 +331,7 @@ NameSpaceModifier
| ScopeTerm {}
;
UserTerm
MethodInvocationTerm
: NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);}
ArgList ')' {$$ = TrLinkChildNode ($1,$4);}
;
@ -355,8 +354,7 @@ Removed from TermArg due to reduce/reduce conflicts
*/
TermArg
: Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
: Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
@ -364,8 +362,8 @@ TermArg
;
Target
: {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
| ',' {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
: {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
| ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
| ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
;
@ -453,7 +451,7 @@ Type2Opcode
| EqualsTerm {}
| TimerTerm {}
| WaitTerm {}
| UserTerm {}
| MethodInvocationTerm {}
;
/*
@ -461,7 +459,8 @@ Type2Opcode
*/
Type2IntegerOpcode /* "Type3" opcodes */
: AddTerm {}
: Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
| AddTerm {}
| AndTerm {}
| DecTerm {}
| DivideTerm {}
@ -507,7 +506,7 @@ Type2BufferOpcode /* "Type5" Opcodes */
;
Type2BufferOrStringOpcode
: ConcatTerm {}
: ConcatTerm {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
| PrintfTerm {}
| FprintfTerm {}
| MidTerm {}
@ -543,7 +542,7 @@ Type6Opcode
: RefOfTerm {}
| DerefOfTerm {}
| IndexTerm {}
| UserTerm {}
| MethodInvocationTerm {}
;
IncludeTerm
@ -1920,7 +1919,7 @@ SuperName
| DebugTerm {}
| Type6Opcode {}
/* For ObjectType: SuperName except for UserTerm (method invocation) */
/* For ObjectType: SuperName except for MethodInvocationTerm */
ObjectTypeName
: NameString {}
@ -1931,7 +1930,7 @@ ObjectTypeName
| DerefOfTerm {}
| IndexTerm {}
/* | UserTerm {} */ /* Caused reduce/reduce with Type6Opcode->UserTerm */
/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */
;
ArgTerm

View File

@ -248,7 +248,7 @@ AslDoDisassembly (
/* This is where the disassembly happens */
AcpiGbl_DbOpt_disasm = TRUE;
AcpiGbl_DbOpt_Disasm = TRUE;
Status = AdAmlDisassemble (AslToFile,
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
&Gbl_Files[ASL_FILE_INPUT].Filename);

View File

@ -55,10 +55,6 @@ static ACPI_PARSE_OBJECT *
TrGetNextNode (
void);
static char *
TrGetNodeFlagName (
UINT32 Flags);
/*******************************************************************************
*
@ -187,7 +183,7 @@ TrUpdateNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
"\nUpdateNode: Old - %s, New - %s\n\n",
"\nUpdateNode: Old - %s, New - %s\n",
UtGetOpName (Op->Asl.ParseOpcode),
UtGetOpName (ParseOpcode));
@ -261,90 +257,140 @@ TrUpdateNode (
/*******************************************************************************
*
* FUNCTION: TrGetNodeFlagName
* FUNCTION: TrPrintNodeCompileFlags
*
* PARAMETERS: Flags - Flags word to be decoded
*
* RETURN: Name string. Always returns a valid string pointer.
* RETURN: None
*
* DESCRIPTION: Decode a flags word
* DESCRIPTION: Decode a flags word to text. Displays all flags that are set.
*
******************************************************************************/
static char *
TrGetNodeFlagName (
void
TrPrintNodeCompileFlags (
UINT32 Flags)
{
UINT32 i;
UINT32 FlagBit = 1;
char *FlagName = NULL;
switch (Flags)
for (i = 0; i < 32; i++)
{
case NODE_VISITED:
switch (Flags & FlagBit)
{
case NODE_VISITED:
return ("NODE_VISITED");
FlagName = "NODE_VISITED";
break;
case NODE_AML_PACKAGE:
case NODE_AML_PACKAGE:
return ("NODE_AML_PACKAGE");
FlagName = "NODE_AML_PACKAGE";
break;
case NODE_IS_TARGET:
case NODE_IS_TARGET:
return ("NODE_IS_TARGET");
FlagName = "NODE_IS_TARGET";
break;
case NODE_IS_RESOURCE_DESC:
case NODE_IS_RESOURCE_DESC:
return ("NODE_IS_RESOURCE_DESC");
FlagName = "NODE_IS_RESOURCE_DESC";
break;
case NODE_IS_RESOURCE_FIELD:
case NODE_IS_RESOURCE_FIELD:
return ("NODE_IS_RESOURCE_FIELD");
FlagName = "NODE_IS_RESOURCE_FIELD";
break;
case NODE_HAS_NO_EXIT:
case NODE_HAS_NO_EXIT:
return ("NODE_HAS_NO_EXIT");
FlagName = "NODE_HAS_NO_EXIT";
break;
case NODE_IF_HAS_NO_EXIT:
case NODE_IF_HAS_NO_EXIT:
return ("NODE_IF_HAS_NO_EXIT");
FlagName = "NODE_IF_HAS_NO_EXIT";
break;
case NODE_NAME_INTERNALIZED:
case NODE_NAME_INTERNALIZED:
return ("NODE_NAME_INTERNALIZED");
FlagName = "NODE_NAME_INTERNALIZED";
break;
case NODE_METHOD_NO_RETVAL:
case NODE_METHOD_NO_RETVAL:
return ("NODE_METHOD_NO_RETVAL");
FlagName = "NODE_METHOD_NO_RETVAL";
break;
case NODE_METHOD_SOME_NO_RETVAL:
case NODE_METHOD_SOME_NO_RETVAL:
return ("NODE_METHOD_SOME_NO_RETVAL");
FlagName = "NODE_METHOD_SOME_NO_RETVAL";
break;
case NODE_RESULT_NOT_USED:
case NODE_RESULT_NOT_USED:
return ("NODE_RESULT_NOT_USED");
FlagName = "NODE_RESULT_NOT_USED";
break;
case NODE_METHOD_TYPED:
case NODE_METHOD_TYPED:
return ("NODE_METHOD_TYPED");
FlagName = "NODE_METHOD_TYPED";
break;
case NODE_COMPILE_TIME_CONST:
case NODE_COMPILE_TIME_CONST:
return ("NODE_COMPILE_TIME_CONST");
FlagName = "NODE_COMPILE_TIME_CONST";
break;
case NODE_IS_TERM_ARG:
case NODE_IS_TERM_ARG:
return ("NODE_IS_TERM_ARG");
FlagName = "NODE_IS_TERM_ARG";
break;
case NODE_WAS_ONES_OP:
case NODE_WAS_ONES_OP:
return ("NODE_WAS_ONES_OP");
FlagName = "NODE_WAS_ONES_OP";
break;
case NODE_IS_NAME_DECLARATION:
case NODE_IS_NAME_DECLARATION:
return ("NODE_IS_NAME_DECLARATION");
FlagName = "NODE_IS_NAME_DECLARATION";
break;
default:
case NODE_COMPILER_EMITTED:
return ("Multiple Flags (or unknown flag) set");
FlagName = "NODE_COMPILER_EMITTED";
break;
case NODE_IS_DUPLICATE:
FlagName = "NODE_IS_DUPLICATE";
break;
case NODE_IS_RESOURCE_DATA:
FlagName = "NODE_IS_RESOURCE_DATA";
break;
case NODE_IS_NULL_RETURN:
FlagName = "NODE_IS_NULL_RETURN";
break;
default:
break;
}
if (FlagName)
{
DbgPrint (ASL_PARSE_OUTPUT, " %s", FlagName);
FlagName = NULL;
}
FlagBit <<= 1;
}
}
@ -368,15 +414,17 @@ TrSetNodeFlags (
UINT32 Flags)
{
DbgPrint (ASL_PARSE_OUTPUT,
"\nSetNodeFlags: Op %p, %8.8X %s\n\n", Op, Flags,
TrGetNodeFlagName (Flags));
if (!Op)
{
return (NULL);
}
DbgPrint (ASL_PARSE_OUTPUT,
"\nSetNodeFlags: %s Op %p, %8.8X", Op->Asl.ParseOpName, Op, Flags);
TrPrintNodeCompileFlags (Flags);
DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
Op->Asl.CompileFlags |= Flags;
return (Op);
}
@ -588,7 +636,40 @@ TrCreateLeafNode (
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode));
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode));
return (Op);
}
/*******************************************************************************
*
* FUNCTION: TrCreateNullTarget
*
* PARAMETERS: None
*
* RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a "null" target node. This is defined by the ACPI
* specification to be a zero AML opcode, and indicates that
* no target has been specified for the parent operation
*
******************************************************************************/
ACPI_PARSE_OBJECT *
TrCreateNullTarget (
void)
{
ACPI_PARSE_OBJECT *Op;
Op = TrAllocateNode (PARSEOP_ZERO);
Op->Asl.CompileFlags |= (NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateNullTarget Ln/Col %u/%u NewNode %p Op %s\n",
Op->Asl.LineNumber, Op->Asl.Column, Op,
UtGetOpName (Op->Asl.ParseOpcode));
return (Op);
}
@ -620,7 +701,6 @@ TrCreateConstantLeafNode (
time_t CurrentTime;
char *StaticTimeString;
char *TimeString;
char *Path;
char *Filename;
@ -647,7 +727,7 @@ TrCreateConstantLeafNode (
/* Get the simple filename from the full path */
FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename);
FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
Op->Asl.Value.String = Filename;
break;
@ -672,7 +752,7 @@ TrCreateConstantLeafNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
"\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X \n",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
return (Op);
@ -813,7 +893,8 @@ TrCreateValuedLeafNode (
case PARSEOP_INTEGER:
DbgPrint (ASL_PARSE_OUTPUT, "INTEGER");
DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X",
ACPI_FORMAT_UINT64 (Value));
break;
default:
@ -948,7 +1029,7 @@ TrCreateNode (
}
va_end(ap);
DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
DbgPrint (ASL_PARSE_OUTPUT, "\n");
return (Op);
}
@ -1104,7 +1185,7 @@ TrLinkPeerNode (
DbgPrint (ASL_PARSE_OUTPUT,
"\nLinkPeerNode: 1=%p (%s), 2=%p (%s)\n\n",
"\nLinkPeerNode: 1=%p (%s), 2=%p (%s)\n",
Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode) : NULL,
Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode) : NULL);
@ -1130,7 +1211,7 @@ TrLinkPeerNode (
if (Op1 == Op2)
{
DbgPrint (ASL_DEBUG_OUTPUT,
"\n\n************* Internal error, linking node to itself %p\n\n\n",
"\n************* Internal error, linking node to itself %p\n",
Op1);
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op1,
"Linking node to itself");
@ -1214,7 +1295,7 @@ TrLinkPeerNodes (
}
va_end (ap);
DbgPrint (ASL_PARSE_OUTPUT,"\n\n");
DbgPrint (ASL_PARSE_OUTPUT,"\n");
return (Start);
}
@ -1241,7 +1322,7 @@ TrLinkChildNode (
DbgPrint (ASL_PARSE_OUTPUT,
"\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n\n",
"\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n",
Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode): NULL,
Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode): NULL);

View File

@ -74,7 +74,7 @@ NoEcho('
%type <n> Term
%type <n> TermArg
%type <n> TermList
%type <n> UserTerm
%type <n> MethodInvocationTerm
/* Type4Opcode is obsolete */

View File

@ -503,8 +503,13 @@ UtDisplaySummary (
if (Gbl_FileType != ASL_INPUT_TYPE_ASCII_DATA)
{
FlPrintFile (FileId,
", %u Optimizations", Gbl_ExceptionCount[ASL_OPTIMIZATION]);
FlPrintFile (FileId, ", %u Optimizations",
Gbl_ExceptionCount[ASL_OPTIMIZATION]);
if (TotalFolds)
{
FlPrintFile (FileId, ", %u Constants Folded", TotalFolds);
}
}
FlPrintFile (FileId, "\n");

View File

@ -252,6 +252,13 @@ AnOperandTypecheckWalkEnd (
}
return (AE_OK);
case AML_EXTERNAL_OP:
/*
* Not really a "runtime" opcode since it used by disassembler only.
* The parser will find any issues with the operands.
*/
return (AE_OK);
default:
break;
@ -388,9 +395,6 @@ AnOperandTypecheckWalkEnd (
break;
case PARSEOP_DEBUG:
break;
case PARSEOP_REFOF:
case PARSEOP_INDEX:
default:

View File

@ -102,13 +102,18 @@ DtDoCompile (
/* Preprocessor */
Event = UtBeginEvent ("Preprocess input file");
PrDoPreprocess ();
UtEndEvent (Event);
if (Gbl_PreprocessOnly)
if (Gbl_PreprocessFlag)
{
return (AE_OK);
/* Preprocessor */
Event = UtBeginEvent ("Preprocess input file");
PrDoPreprocess ();
UtEndEvent (Event);
if (Gbl_PreprocessOnly)
{
return (AE_OK);
}
}
/*

View File

@ -85,15 +85,16 @@
*/
typedef struct dt_field
{
char *Name; /* Field name (from name : value) */
char *Value; /* Field value (from name : value) */
struct dt_field *Next; /* Next field */
struct dt_field *NextLabel; /* If field is a label, next label */
UINT32 Line; /* Line number for this field */
UINT32 ByteOffset; /* Offset in source file for field */
UINT32 NameColumn; /* Start column for field name */
UINT32 Column; /* Start column for field value */
UINT32 TableOffset;/* Binary offset within ACPI table */
char *Name; /* Field name (from name : value) */
char *Value; /* Field value (from name : value) */
UINT32 StringLength;/* Length of Value */
struct dt_field *Next; /* Next field */
struct dt_field *NextLabel; /* If field is a label, next label */
UINT32 Line; /* Line number for this field */
UINT32 ByteOffset; /* Offset in source file for field */
UINT32 NameColumn; /* Start column for field name */
UINT32 Column; /* Start column for field value */
UINT32 TableOffset; /* Binary offset within ACPI table */
UINT8 Flags;
} DT_FIELD;
@ -557,6 +558,7 @@ extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
extern const unsigned char TemplateMpst[];
extern const unsigned char TemplateMsct[];
extern const unsigned char TemplateMsdm[];
extern const unsigned char TemplateMtmr[];
extern const unsigned char TemplatePcct[];
extern const unsigned char TemplatePmtt[];

View File

@ -375,6 +375,7 @@ DtParseLine (
Field->ByteOffset = Offset;
Field->NameColumn = NameColumn;
Field->Column = Column;
Field->StringLength = Length;
DtLinkField (Field);
}
@ -414,6 +415,7 @@ DtGetNextLine (
int c;
ACPI_MEMSET (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize);
for (i = 0; ;)
{
/*
@ -939,11 +941,11 @@ DtDumpFieldList (
DbgPrint (ASL_DEBUG_OUTPUT, "\nField List:\n"
"LineNo ByteOff NameCol Column TableOff "
"Flags %32s : %s\n\n", "Name", "Value");
"Flags %32s : %s\n\n", "Name", "Value");
while (Field)
{
DbgPrint (ASL_DEBUG_OUTPUT,
"%.08X %.08X %.08X %.08X %.08X %.08X %32s : %s\n",
"%.08X %.08X %.08X %.08X %.08X %2.2X %32s : %s\n",
Field->Line, Field->ByteOffset, Field->NameColumn,
Field->Column, Field->TableOffset, Field->Flags,
Field->Name, Field->Value);

View File

@ -2240,15 +2240,11 @@ DtCompileSlic (
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SLIC_HEADER *SlicHeader;
ACPI_DMTABLE_INFO *InfoTable;
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
@ -2258,35 +2254,6 @@ DtCompileSlic (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
switch (SlicHeader->Type)
{
case ACPI_SLIC_TYPE_PUBLIC_KEY:
InfoTable = AcpiDmTableInfoSlic0;
break;
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
InfoTable = AcpiDmTableInfoSlic1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}

View File

@ -662,6 +662,23 @@ const unsigned char TemplateMchi[] =
0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */
};
const unsigned char TemplateMsdm[] =
{
0x4D,0x53,0x44,0x4D,0x64,0x00,0x00,0x00, /* 00000000 "MSDMd..." */
0x01,0x34,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".4Intel." */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x04,0x02,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000028 "........" */
0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23, /* 00000030 ".... !"#" */
0x24,0x25,0x26,0x27,0x10,0x0A,0x15,0x16, /* 00000038 "$%&'...." */
0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E, /* 00000040 "........" */
0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26, /* 00000048 ". !"#$%&" */
0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 00000050 "........" */
0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21, /* 00000058 "...... !" */
0x22,0x23,0x24,0x25 /* 00000060 ""#$%" */
};
const unsigned char TemplateMpst[] =
{
0x4D,0x50,0x53,0x54,0xB6,0x00,0x00,0x00, /* 00000000 "MPST...." */

View File

@ -364,6 +364,7 @@ DtGetFieldType (
break;
case ACPI_DMT_BUFFER:
case ACPI_DMT_RAW_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF10:
case ACPI_DMT_BUF16:
@ -531,7 +532,6 @@ DtGetFieldLength (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
case ACPI_DMT_LPIT:
@ -588,6 +588,7 @@ DtGetFieldLength (
break;
case ACPI_DMT_BUFFER:
case ACPI_DMT_RAW_BUFFER:
Value = DtGetFieldValue (Field);
if (Value)

View File

@ -396,11 +396,11 @@ AcpiDbDisassembleMethod (
/* Now we can disassemble the method */
AcpiGbl_DbOpt_verbose = FALSE;
AcpiGbl_DbOpt_Verbose = FALSE;
#ifdef ACPI_DISASSEMBLER
AcpiDmDisassemble (NULL, Op, 0);
#endif
AcpiGbl_DbOpt_verbose = TRUE;
AcpiGbl_DbOpt_Verbose = TRUE;
AcpiPsDeleteParseTree (Op);

View File

@ -424,13 +424,11 @@ AcpiDbInitialize (
AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
AcpiGbl_DbOpt_tables = FALSE;
AcpiGbl_DbOpt_disasm = FALSE;
AcpiGbl_DbOpt_stats = FALSE;
AcpiGbl_DbOpt_Disasm = FALSE;
#ifdef ACPI_DISASSEMBLER
AcpiGbl_DbOpt_verbose = TRUE;
AcpiGbl_DbOpt_Verbose = TRUE;
#endif
AcpiGbl_DbOpt_ini_methods = TRUE;
AcpiGbl_DbOpt_NoIniMethods = FALSE;
AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
if (!AcpiGbl_DbBuffer)
@ -479,10 +477,9 @@ AcpiDbInitialize (
}
#ifdef ACPI_DISASSEMBLER
if (!AcpiGbl_DbOpt_verbose)
if (!AcpiGbl_DbOpt_Verbose)
{
AcpiGbl_DbOpt_disasm = TRUE;
AcpiGbl_DbOpt_stats = FALSE;
AcpiGbl_DbOpt_Disasm = TRUE;
}
#endif

View File

@ -852,18 +852,6 @@ AcpiDmDisassembleOneOp (
}
break;
case AML_INT_STATICSTRING_OP:
if (Op->Common.Value.String)
{
AcpiOsPrintf ("%s", Op->Common.Value.String);
}
else
{
AcpiOsPrintf ("\"<NULL STATIC STRING PTR>\"");
}
break;
case AML_INT_NAMEPATH_OP:
AcpiDmNamestring (Op->Common.Value.Name);

View File

@ -562,7 +562,7 @@ AcpiDmDescendingOp (
if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP)
{
if (AcpiGbl_DbOpt_verbose)
if (AcpiGbl_DbOpt_Verbose)
{
(void) AcpiPsDisplayObjectPathname (NULL, Op);
}

View File

@ -477,7 +477,7 @@ AcpiDsEvalRegionOperands (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
ObjDesc,
ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length));
/* Now the address and length are valid for this opregion */
@ -579,12 +579,12 @@ AcpiDsEvalTableRegionOperands (
return_ACPI_STATUS (AE_NOT_EXIST);
}
ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (Table);
ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table);
ObjDesc->Region.Length = Table->Length;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
ObjDesc,
ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length));
/* Now the address and length are valid for this opregion */

View File

@ -599,6 +599,15 @@ AcpiDsCreateOperand (
ACPI_OPERAND_OBJECT, AcpiGbl_RootNode);
Status = AE_OK;
}
else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP)
{
/* TBD: May only be temporary */
ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength);
ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength);
Status = AE_OK;
}
else
{
/*

View File

@ -288,7 +288,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
&RegionObj->Region.Handler->AddressSpace, Handler,
ACPI_FORMAT_NATIVE_UINT (Address),
ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
if (!(HandlerDesc->AddressSpace.HandlerFlags &

View File

@ -401,7 +401,8 @@ AcpiGetEventStatus (
if (InByte)
{
LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
LocalEventStatus |=
(ACPI_EVENT_FLAG_ENABLED | ACPI_EVENT_FLAG_ENABLE_SET);
}
/* Fixed event currently active? */
@ -415,7 +416,7 @@ AcpiGetEventStatus (
if (InByte)
{
LocalEventStatus |= ACPI_EVENT_FLAG_SET;
LocalEventStatus |= ACPI_EVENT_FLAG_STATUS_SET;
}
(*EventStatus) = LocalEventStatus;

View File

@ -784,7 +784,7 @@ AcpiExDumpOperand (
else
{
AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length);
}
break;

View File

@ -289,13 +289,13 @@ AcpiExAccessRegion (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_BFIELD,
" Region [%s:%X], Width %X, ByteBase %X, Offset %X at %p\n",
" Region [%s:%X], Width %X, ByteBase %X, Offset %X at %8.8X%8.8X\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId,
ObjDesc->CommonField.AccessByteWidth,
ObjDesc->CommonField.BaseByteOffset,
FieldDatumByteOffset,
ACPI_CAST_PTR (void, (RgnDesc->Region.Address + RegionOffset))));
ACPI_FORMAT_UINT64 (RgnDesc->Region.Address + RegionOffset)));
/* Invoke the appropriate AddressSpace/OpRegion handler */

View File

@ -125,7 +125,18 @@ AcpiExOpcode_3A_0T_0R (
/* Might return while OS is shutting down, just continue */
ACPI_FREE (Fatal);
break;
goto Cleanup;
case AML_EXTERNAL_OP:
/*
* If the interpreter sees this opcode, just ignore it. The External
* op is intended for use by disassemblers in order to properly
* disassemble control method invocations. The opcode or group of
* opcodes should be surrounded by an "if (0)" clause to ensure that
* AML interpreters never see the opcode.
*/
Status = AE_OK;
goto Cleanup;
default:

View File

@ -175,8 +175,8 @@ AcpiExSystemMemorySpaceHandler (
* one page, which is similar to the original code that used a 4k
* maximum window.
*/
PageBoundaryMapLength =
ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address;
PageBoundaryMapLength = (ACPI_SIZE)
(ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address);
if (PageBoundaryMapLength == 0)
{
PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE;
@ -189,13 +189,12 @@ AcpiExSystemMemorySpaceHandler (
/* Create a new mapping starting at the address given */
MemInfo->MappedLogicalAddress = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) Address, MapLength);
MemInfo->MappedLogicalAddress = AcpiOsMapMemory (Address, MapLength);
if (!MemInfo->MappedLogicalAddress)
{
ACPI_ERROR ((AE_INFO,
"Could not map memory at 0x%8.8X%8.8X, size %u",
ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) MapLength));
ACPI_FORMAT_UINT64 (Address), (UINT32) MapLength));
MemInfo->MappedLength = 0;
return_ACPI_STATUS (AE_NO_MEMORY);
}
@ -215,7 +214,7 @@ AcpiExSystemMemorySpaceHandler (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
BitWidth, Function, ACPI_FORMAT_UINT64 (Address)));
/*
* Perform the memory read or write
@ -338,7 +337,7 @@ AcpiExSystemIoSpaceHandler (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"System-IO (width %u) R/W %u Address=%8.8X%8.8X\n",
BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
BitWidth, Function, ACPI_FORMAT_UINT64 (Address)));
/* Decode the function parameter */

View File

@ -280,6 +280,19 @@ AcpiHwGetGpeStatus (
LocalEventStatus |= ACPI_EVENT_FLAG_WAKE_ENABLED;
}
/* GPE currently enabled (enable bit == 1)? */
Status = AcpiHwRead (&InByte, &GpeRegisterInfo->EnableAddress);
if (ACPI_FAILURE (Status))
{
return (Status);
}
if (RegisterBit & InByte)
{
LocalEventStatus |= ACPI_EVENT_FLAG_ENABLE_SET;
}
/* GPE currently active (status bit == 1)? */
Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress);
@ -290,7 +303,7 @@ AcpiHwGetGpeStatus (
if (RegisterBit & InByte)
{
LocalEventStatus |= ACPI_EVENT_FLAG_SET;
LocalEventStatus |= ACPI_EVENT_FLAG_STATUS_SET;
}
/* Set return value */

View File

@ -155,8 +155,8 @@ AcpiHwValidateIoRequest (
ByteWidth = ACPI_DIV_8 (BitWidth);
LastAddress = Address + ByteWidth - 1;
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %p LastAddress %p Length %X",
ACPI_CAST_PTR (void, Address), ACPI_CAST_PTR (void, LastAddress),
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %8.8X%8.8X LastAddress %8.8X%8.8X Length %X",
ACPI_FORMAT_UINT64 (Address), ACPI_FORMAT_UINT64 (LastAddress),
ByteWidth));
/* Maximum 16-bit address in I/O space */
@ -164,8 +164,8 @@ AcpiHwValidateIoRequest (
if (LastAddress > ACPI_UINT16_MAX)
{
ACPI_ERROR ((AE_INFO,
"Illegal I/O port address/length above 64K: %p/0x%X",
ACPI_CAST_PTR (void, Address), ByteWidth));
"Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X",
ACPI_FORMAT_UINT64 (Address), ByteWidth));
return_ACPI_STATUS (AE_LIMIT);
}
@ -196,8 +196,8 @@ AcpiHwValidateIoRequest (
if (AcpiGbl_OsiData >= PortInfo->OsiDependency)
{
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)",
ACPI_CAST_PTR (void, Address), ByteWidth, PortInfo->Name,
"Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)",
ACPI_FORMAT_UINT64 (Address), ByteWidth, PortInfo->Name,
PortInfo->Start, PortInfo->End));
return_ACPI_STATUS (AE_AML_ILLEGAL_ADDRESS);

View File

@ -313,9 +313,9 @@ AcpiNsDumpOneObject (
{
case ACPI_TYPE_PROCESSOR:
AcpiOsPrintf ("ID %02X Len %02X Addr %p\n",
AcpiOsPrintf ("ID %02X Len %02X Addr %8.8X%8.8X\n",
ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
ACPI_FORMAT_UINT64 (ObjDesc->Processor.Address));
break;
case ACPI_TYPE_DEVICE:
@ -388,7 +388,7 @@ AcpiNsDumpOneObject (
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
{
AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length);
}
else

View File

@ -333,7 +333,11 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* ACPI 5.0 opcodes */
/* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0)
/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
/* ACPI 6.0 opcodes */
/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R)
/*! [End] no source code translation !*/
};

View File

@ -226,7 +226,7 @@ const UINT8 AcpiGbl_ShortOpIndex[256] =
/* 8 9 A B C D E F */
/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK,
/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK,
/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK,
/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, 0x81, _UNK, _UNK,
/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,

View File

@ -77,7 +77,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[5] =
* Address Translation Offset
* Address Length
*/
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Granularity),
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Address.Granularity),
AML_OFFSET (Address16.Granularity),
5},
@ -117,7 +117,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[5] =
* Address Translation Offset
* Address Length
*/
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Granularity),
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Address.Granularity),
AML_OFFSET (Address32.Granularity),
5},
@ -157,7 +157,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[5] =
* Address Translation Offset
* Address Length
*/
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Granularity),
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Address.Granularity),
AML_OFFSET (Address64.Granularity),
5},
@ -203,7 +203,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[5] =
* Address Length
* Type-Specific Attribute
*/
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Granularity),
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Address.Granularity),
AML_OFFSET (ExtAddress64.Granularity),
6}
};

View File

@ -1,6 +1,6 @@
/*******************************************************************************
*
* Module Name: rsdump - Functions to display the resource structures.
* Module Name: rsdump - AML debugger support for resource structures.
*
******************************************************************************/
@ -48,8 +48,10 @@
#define _COMPONENT ACPI_RESOURCES
ACPI_MODULE_NAME ("rsdump")
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
/*
* All functions in this module are used by the AML Debugger only
*/
#if defined(ACPI_DEBUGGER)
/* Local prototypes */
@ -89,8 +91,8 @@ AcpiRsDumpByteList (
static void
AcpiRsDumpWordList (
UINT16 Length,
UINT16 *Data);
UINT16 Length,
UINT16 *Data);
static void
AcpiRsDumpDwordList (
@ -99,8 +101,8 @@ AcpiRsDumpDwordList (
static void
AcpiRsDumpShortByteList (
UINT8 Length,
UINT8 *Data);
UINT8 Length,
UINT8 *Data);
static void
AcpiRsDumpResourceSource (
@ -113,7 +115,133 @@ AcpiRsDumpAddressCommon (
static void
AcpiRsDumpDescriptor (
void *Resource,
ACPI_RSDUMP_INFO *Table);
ACPI_RSDUMP_INFO *Table);
/*******************************************************************************
*
* FUNCTION: AcpiRsDumpResourceList
*
* PARAMETERS: ResourceList - Pointer to a resource descriptor list
*
* RETURN: None
*
* DESCRIPTION: Dispatches the structure to the correct dump routine.
*
******************************************************************************/
void
AcpiRsDumpResourceList (
ACPI_RESOURCE *ResourceList)
{
UINT32 Count = 0;
UINT32 Type;
ACPI_FUNCTION_ENTRY ();
/* Check if debug output enabled */
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
{
return;
}
/* Walk list and dump all resource descriptors (END_TAG terminates) */
do
{
AcpiOsPrintf ("\n[%02X] ", Count);
Count++;
/* Validate Type before dispatch */
Type = ResourceList->Type;
if (Type > ACPI_RESOURCE_TYPE_MAX)
{
AcpiOsPrintf (
"Invalid descriptor type (%X) in resource list\n",
ResourceList->Type);
return;
}
/* Sanity check the length. It must not be zero, or we loop forever */
if (!ResourceList->Length)
{
AcpiOsPrintf (
"Invalid zero length descriptor in resource list\n");
return;
}
/* Dump the resource descriptor */
if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
{
AcpiRsDumpDescriptor (&ResourceList->Data,
AcpiGbl_DumpSerialBusDispatch[
ResourceList->Data.CommonSerialBus.Type]);
}
else
{
AcpiRsDumpDescriptor (&ResourceList->Data,
AcpiGbl_DumpResourceDispatch[Type]);
}
/* Point to the next resource structure */
ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
/* Exit when END_TAG descriptor is reached */
} while (Type != ACPI_RESOURCE_TYPE_END_TAG);
}
/*******************************************************************************
*
* FUNCTION: AcpiRsDumpIrqList
*
* PARAMETERS: RouteTable - Pointer to the routing table to dump.
*
* RETURN: None
*
* DESCRIPTION: Print IRQ routing table
*
******************************************************************************/
void
AcpiRsDumpIrqList (
UINT8 *RouteTable)
{
ACPI_PCI_ROUTING_TABLE *PrtElement;
UINT8 Count;
ACPI_FUNCTION_ENTRY ();
/* Check if debug output enabled */
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
{
return;
}
PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
/* Dump all table elements, Exit on zero length element */
for (Count = 0; PrtElement->Length; Count++)
{
AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
PrtElement, PrtElement->Length);
}
}
/*******************************************************************************
@ -288,14 +416,16 @@ AcpiRsDumpDescriptor (
/*
* Common flags for all Address resources
*/
AcpiRsDumpAddressCommon (ACPI_CAST_PTR (ACPI_RESOURCE_DATA, Target));
AcpiRsDumpAddressCommon (ACPI_CAST_PTR (
ACPI_RESOURCE_DATA, Target));
break;
case ACPI_RSD_SOURCE:
/*
* Optional ResourceSource for Address resources
*/
AcpiRsDumpResourceSource (ACPI_CAST_PTR (ACPI_RESOURCE_SOURCE, Target));
AcpiRsDumpResourceSource (ACPI_CAST_PTR (
ACPI_RESOURCE_SOURCE, Target));
break;
default:
@ -397,131 +527,6 @@ AcpiRsDumpAddressCommon (
}
/*******************************************************************************
*
* FUNCTION: AcpiRsDumpResourceList
*
* PARAMETERS: ResourceList - Pointer to a resource descriptor list
*
* RETURN: None
*
* DESCRIPTION: Dispatches the structure to the correct dump routine.
*
******************************************************************************/
void
AcpiRsDumpResourceList (
ACPI_RESOURCE *ResourceList)
{
UINT32 Count = 0;
UINT32 Type;
ACPI_FUNCTION_ENTRY ();
/* Check if debug output enabled */
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
{
return;
}
/* Walk list and dump all resource descriptors (END_TAG terminates) */
do
{
AcpiOsPrintf ("\n[%02X] ", Count);
Count++;
/* Validate Type before dispatch */
Type = ResourceList->Type;
if (Type > ACPI_RESOURCE_TYPE_MAX)
{
AcpiOsPrintf (
"Invalid descriptor type (%X) in resource list\n",
ResourceList->Type);
return;
}
/* Sanity check the length. It must not be zero, or we loop forever */
if (!ResourceList->Length)
{
AcpiOsPrintf (
"Invalid zero length descriptor in resource list\n");
return;
}
/* Dump the resource descriptor */
if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
{
AcpiRsDumpDescriptor (&ResourceList->Data,
AcpiGbl_DumpSerialBusDispatch[ResourceList->Data.CommonSerialBus.Type]);
}
else
{
AcpiRsDumpDescriptor (&ResourceList->Data,
AcpiGbl_DumpResourceDispatch[Type]);
}
/* Point to the next resource structure */
ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
/* Exit when END_TAG descriptor is reached */
} while (Type != ACPI_RESOURCE_TYPE_END_TAG);
}
/*******************************************************************************
*
* FUNCTION: AcpiRsDumpIrqList
*
* PARAMETERS: RouteTable - Pointer to the routing table to dump.
*
* RETURN: None
*
* DESCRIPTION: Print IRQ routing table
*
******************************************************************************/
void
AcpiRsDumpIrqList (
UINT8 *RouteTable)
{
ACPI_PCI_ROUTING_TABLE *PrtElement;
UINT8 Count;
ACPI_FUNCTION_ENTRY ();
/* Check if debug output enabled */
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
{
return;
}
PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
/* Dump all table elements, Exit on zero length element */
for (Count = 0; PrtElement->Length; Count++)
{
AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
PrtElement, PrtElement->Length);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiRsOut*
@ -620,8 +625,8 @@ AcpiRsDumpByteList (
static void
AcpiRsDumpShortByteList (
UINT8 Length,
UINT8 *Data)
UINT8 Length,
UINT8 *Data)
{
UINT8 i;

View File

@ -161,11 +161,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.TranslationOffset),
"Translation Offset", NULL},
{ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.AddressLength), "Address Length", NULL},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL}
};
@ -173,11 +174,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.TranslationOffset),
"Translation Offset", NULL},
{ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.AddressLength), "Address Length", NULL},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL}
};
@ -185,11 +187,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.TranslationOffset),
"Translation Offset", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.AddressLength), "Address Length", NULL},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL}
};
@ -197,11 +200,13 @@ ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Granularity), "Granularity", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Minimum), "Address Minimum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Maximum), "Address Maximum", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.TranslationOffset),
"Translation Offset", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.AddressLength),
"Address Length", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL}
};

View File

@ -61,11 +61,11 @@
ACPI_COPY_FIELD(Out, In, MinAddressFixed); \
ACPI_COPY_FIELD(Out, In, MaxAddressFixed); \
ACPI_COPY_FIELD(Out, In, Info); \
ACPI_COPY_FIELD(Out, In, Granularity); \
ACPI_COPY_FIELD(Out, In, Minimum); \
ACPI_COPY_FIELD(Out, In, Maximum); \
ACPI_COPY_FIELD(Out, In, TranslationOffset); \
ACPI_COPY_FIELD(Out, In, AddressLength); \
ACPI_COPY_FIELD(Out, In, Address.Granularity); \
ACPI_COPY_FIELD(Out, In, Address.Minimum); \
ACPI_COPY_FIELD(Out, In, Address.Maximum); \
ACPI_COPY_FIELD(Out, In, Address.TranslationOffset); \
ACPI_COPY_FIELD(Out, In, Address.AddressLength); \
ACPI_COPY_FIELD(Out, In, ResourceSource);

View File

@ -121,7 +121,8 @@ AcpiTbAcquireTable (
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, TableDesc->Address);
Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
break;
default:
@ -227,7 +228,8 @@ AcpiTbAcquireTempTable (
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, Address);
TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
ACPI_PHYSADDR_TO_PTR (Address));
if (!TableHeader)
{
return (AE_NO_MEMORY);
@ -437,11 +439,11 @@ AcpiTbVerifyTempTable (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
"%4.4s " ACPI_PRINTF_UINT
"%4.4s 0x%8.8X%8.8X"
" Attempted table install failed",
AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
TableDesc->Signature.Ascii : "????",
ACPI_FORMAT_TO_UINT (TableDesc->Address)));
ACPI_FORMAT_UINT64 (TableDesc->Address)));
goto InvalidateAndExit;
}
}
@ -529,21 +531,24 @@ AcpiTbResizeRootTableList (
/*******************************************************************************
*
* FUNCTION: AcpiTbGetNextRootIndex
* FUNCTION: AcpiTbGetNextTableDescriptor
*
* PARAMETERS: TableIndex - Where table index is returned
* TableDesc - Where table descriptor is returned
*
* RETURN: Status and table index.
* RETURN: Status and table index/descriptor.
*
* DESCRIPTION: Allocate a new ACPI table entry to the global table list
*
******************************************************************************/
ACPI_STATUS
AcpiTbGetNextRootIndex (
UINT32 *TableIndex)
AcpiTbGetNextTableDescriptor (
UINT32 *TableIndex,
ACPI_TABLE_DESC **TableDesc)
{
ACPI_STATUS Status;
UINT32 i;
/* Ensure that there is room for the table in the Root Table List */
@ -558,8 +563,18 @@ AcpiTbGetNextRootIndex (
}
}
*TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
i = AcpiGbl_RootTableList.CurrentTableCount;
AcpiGbl_RootTableList.CurrentTableCount++;
if (TableIndex)
{
*TableIndex = i;
}
if (TableDesc)
{
*TableDesc = &AcpiGbl_RootTableList.Tables[i];
}
return (AE_OK);
}

View File

@ -201,8 +201,8 @@ AcpiTbInstallFixedTable (
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
ACPI_CAST_PTR (void, Address)));
ACPI_ERROR ((AE_INFO, "Could not acquire table length at %8.8X%8.8X",
ACPI_FORMAT_UINT64 (Address)));
return_ACPI_STATUS (Status);
}
@ -268,8 +268,8 @@ AcpiTbInstallStandardTable (
Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
ACPI_CAST_PTR (void, Address)));
ACPI_ERROR ((AE_INFO, "Could not acquire table length at %8.8X%8.8X",
ACPI_FORMAT_UINT64 (Address)));
return_ACPI_STATUS (Status);
}
@ -281,8 +281,8 @@ AcpiTbInstallStandardTable (
AcpiGbl_DisableSsdtTableInstall &&
ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
{
ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %p",
NewTableDesc.Signature.Ascii, ACPI_CAST_PTR (void, Address)));
ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %8.8X%8.8X",
NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
goto ReleaseAndExit;
}
@ -368,7 +368,6 @@ AcpiTbInstallStandardTable (
*/
AcpiTbUninstallTable (&NewTableDesc);
*TableIndex = i;
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (AE_OK);
}
}
@ -376,7 +375,7 @@ AcpiTbInstallStandardTable (
/* Add the table to the global root table list */
Status = AcpiTbGetNextRootIndex (&i);
Status = AcpiTbGetNextTableDescriptor (&i, NULL);
if (ACPI_FAILURE (Status))
{
goto ReleaseAndExit;
@ -459,11 +458,11 @@ AcpiTbOverrideTable (
return;
}
ACPI_INFO ((AE_INFO, "%4.4s " ACPI_PRINTF_UINT
" %s table override, new table: " ACPI_PRINTF_UINT,
ACPI_INFO ((AE_INFO, "%4.4s 0x%8.8X%8.8X"
" %s table override, new table: 0x%8.8X%8.8X",
OldTableDesc->Signature.Ascii,
ACPI_FORMAT_TO_UINT (OldTableDesc->Address),
OverrideType, ACPI_FORMAT_TO_UINT (NewTableDesc.Address)));
ACPI_FORMAT_UINT64 (OldTableDesc->Address),
OverrideType, ACPI_FORMAT_UINT64 (NewTableDesc.Address)));
/* We can now uninstall the original table */
@ -483,49 +482,6 @@ AcpiTbOverrideTable (
}
/*******************************************************************************
*
* FUNCTION: AcpiTbStoreTable
*
* PARAMETERS: Address - Table address
* Table - Table header
* Length - Table length
* Flags - Install flags
* TableIndex - Where the table index is returned
*
* RETURN: Status and table index.
*
* DESCRIPTION: Add an ACPI table to the global table list
*
******************************************************************************/
ACPI_STATUS
AcpiTbStoreTable (
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER *Table,
UINT32 Length,
UINT8 Flags,
UINT32 *TableIndex)
{
ACPI_STATUS Status;
ACPI_TABLE_DESC *TableDesc;
Status = AcpiTbGetNextRootIndex (TableIndex);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Initialize added table */
TableDesc = &AcpiGbl_RootTableList.Tables[*TableIndex];
AcpiTbInitTableDescriptor (TableDesc, Address, Flags, Table);
TableDesc->Pointer = Table;
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiTbUninstallTable
@ -558,7 +514,7 @@ AcpiTbUninstallTable (
if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL)
{
ACPI_FREE (ACPI_CAST_PTR (void, TableDesc->Address));
ACPI_FREE (ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
}
TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);

View File

@ -144,18 +144,12 @@ AcpiTbPrintTableHeader (
ACPI_TABLE_HEADER LocalHeader;
/*
* The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to
* support both 32-bit and 64-bit hosts/addresses in a consistent manner.
* The %p specifier does not emit uniform output on all hosts. On some,
* leading zeros are not supported.
*/
if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS))
{
/* FACS only has signature and length fields */
ACPI_INFO ((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X",
Header->Signature, ACPI_FORMAT_TO_UINT (Address),
ACPI_INFO ((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
Header->Signature, ACPI_FORMAT_UINT64 (Address),
Header->Length));
}
else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
@ -166,8 +160,8 @@ AcpiTbPrintTableHeader (
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE);
AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
ACPI_INFO ((AE_INFO, "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)",
ACPI_FORMAT_TO_UINT (Address),
ACPI_INFO ((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
ACPI_FORMAT_UINT64 (Address),
(ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ?
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20,
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision,
@ -180,9 +174,9 @@ AcpiTbPrintTableHeader (
AcpiTbCleanupTableHeader (&LocalHeader, Header);
ACPI_INFO ((AE_INFO,
"%-4.4s " ACPI_PRINTF_UINT
"%-4.4s 0x%8.8X%8.8X"
" %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
LocalHeader.Signature, ACPI_FORMAT_TO_UINT (Address),
LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
LocalHeader.OemTableId, LocalHeader.OemRevision,
LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));

View File

@ -158,7 +158,7 @@ AcpiTbValidateRsdp (
ACPI_STATUS
AcpiFindRootPointer (
ACPI_SIZE *TableAddress)
ACPI_PHYSICAL_ADDRESS *TableAddress)
{
UINT8 *TablePtr;
UINT8 *MemRover;
@ -218,7 +218,7 @@ AcpiFindRootPointer (
PhysicalAddress += (UINT32) ACPI_PTR_DIFF (MemRover, TablePtr);
*TableAddress = PhysicalAddress;
*TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
}
@ -249,7 +249,7 @@ AcpiFindRootPointer (
PhysicalAddress = (UINT32)
(ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (MemRover, TablePtr));
*TableAddress = PhysicalAddress;
*TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}

View File

@ -117,10 +117,10 @@ AcpiUtAddAddressRange (
AcpiGbl_AddressRangeList[SpaceId] = RangeInfo;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"\nAdded [%4.4s] address range: 0x%p-0x%p\n",
"\nAdded [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
AcpiUtGetNodeName (RangeInfo->RegionNode),
ACPI_CAST_PTR (void, Address),
ACPI_CAST_PTR (void, RangeInfo->EndAddress)));
ACPI_FORMAT_UINT64 (Address),
ACPI_FORMAT_UINT64 (RangeInfo->EndAddress)));
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (AE_OK);
@ -179,10 +179,10 @@ AcpiUtRemoveAddressRange (
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"\nRemoved [%4.4s] address range: 0x%p-0x%p\n",
"\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
AcpiUtGetNodeName (RangeInfo->RegionNode),
ACPI_CAST_PTR (void, RangeInfo->StartAddress),
ACPI_CAST_PTR (void, RangeInfo->EndAddress)));
ACPI_FORMAT_UINT64 (RangeInfo->StartAddress),
ACPI_FORMAT_UINT64 (RangeInfo->EndAddress)));
ACPI_FREE (RangeInfo);
return_VOID;
@ -266,12 +266,12 @@ AcpiUtCheckAddressRange (
Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
ACPI_WARNING ((AE_INFO,
"%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)",
"%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
AcpiUtGetRegionName (SpaceId),
ACPI_CAST_PTR (void, Address),
ACPI_CAST_PTR (void, EndAddress),
ACPI_CAST_PTR (void, RangeInfo->StartAddress),
ACPI_CAST_PTR (void, RangeInfo->EndAddress),
ACPI_FORMAT_UINT64 (Address),
ACPI_FORMAT_UINT64 (EndAddress),
ACPI_FORMAT_UINT64 (RangeInfo->StartAddress),
ACPI_FORMAT_UINT64 (RangeInfo->EndAddress),
Pathname));
ACPI_FREE (Pathname);
}

View File

@ -158,6 +158,15 @@ AcpiUtDumpBuffer (
return;
}
/*
* Add comment characters so rest of line is ignored when
* compiled
*/
if (j == 0)
{
AcpiOsPrintf ("// ");
}
BufChar = Buffer[(ACPI_SIZE) i + j];
if (ACPI_IS_PRINT (BufChar))
{

View File

@ -111,12 +111,19 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_DEVICE, NULL},
{"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL},
/*
* March, 2015:
* The _REV object is in the process of being deprecated, because
* other ACPI implementations permanently return 2. Thus, it
* has little or no value. Return 2 for compatibility with
* other ACPI implementations.
*/
{"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR (char, 2)},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, (char *) 1},
{"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR (char, 1)},
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, (char *) 1},
{"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR (char, 1)},
#endif
/* Table terminator */

View File

@ -84,6 +84,7 @@ AcpiUtIsPciRootBridge (
}
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
/*******************************************************************************
*
* FUNCTION: AcpiUtIsAmlTable
@ -114,6 +115,7 @@ AcpiUtIsAmlTable (
return (FALSE);
}
#endif
/*******************************************************************************

View File

@ -105,6 +105,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
{"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
{"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
{"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */
/* Feature Group Strings */

View File

@ -442,11 +442,11 @@ AcpiUtVsnprintf (
const char *Format,
va_list Args)
{
UINT8 Base = 10;
UINT8 Type = 0;
INT32 Width = -1;
INT32 Precision = -1;
char Qualifier = 0;
UINT8 Base;
UINT8 Type;
INT32 Width;
INT32 Precision;
char Qualifier;
UINT64 Number;
char *Pos;
char *End;
@ -468,6 +468,9 @@ AcpiUtVsnprintf (
continue;
}
Type = 0;
Base = 10;
/* Process sign */
do

View File

@ -48,44 +48,6 @@
ACPI_MODULE_NAME ("utstate")
/*******************************************************************************
*
* FUNCTION: AcpiUtCreatePkgStateAndPush
*
* PARAMETERS: Object - Object to be added to the new state
* Action - Increment/Decrement
* StateList - List the state will be added to
*
* RETURN: Status
*
* DESCRIPTION: Create a new state and push it
*
******************************************************************************/
ACPI_STATUS
AcpiUtCreatePkgStateAndPush (
void *InternalObject,
void *ExternalObject,
UINT16 Index,
ACPI_GENERIC_STATE **StateList)
{
ACPI_GENERIC_STATE *State;
ACPI_FUNCTION_ENTRY ();
State = AcpiUtCreatePkgState (InternalObject, ExternalObject, Index);
if (!State)
{
return (AE_NO_MEMORY);
}
AcpiUtPushGenericState (StateList, State);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiUtPushGenericState

View File

@ -48,6 +48,7 @@
ACPI_MODULE_NAME ("utuuid")
#if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
/*
* UUID support functions.
*
@ -99,3 +100,4 @@ AcpiUtConvertStringToUuid (
AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
}
}
#endif

View File

@ -77,7 +77,7 @@ typedef struct acpi_db_execute_walk
#define PARAM_LIST(pl) pl
#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_verbose)
#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_Verbose)
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
AcpiOsPrintf PARAM_LIST(fp);}

View File

@ -129,6 +129,7 @@ typedef enum
/* Types used only for the Data Table Compiler */
ACPI_DMT_BUFFER,
ACPI_DMT_RAW_BUFFER, /* Large, multiple line buffer */
ACPI_DMT_DEVICE_PATH,
ACPI_DMT_LABEL,
ACPI_DMT_PCI_PATH,
@ -351,9 +352,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[];
@ -422,6 +421,15 @@ AcpiDmLineHeader2 (
* dmtbdump
*/
void
AcpiDmDumpBuffer (
void *Table,
UINT32 BufferOffset,
UINT32 Length,
UINT32 AbsoluteOffset,
char *Header,
BOOLEAN MultiLine);
void
AcpiDmDumpAsf (
ACPI_TABLE_HEADER *Table);
@ -996,6 +1004,10 @@ AcpiDmCloseOperator (
*/
void
AdDisassemblerHeader (
char *Filename);
char *Filename,
UINT8 TableType);
#define ACPI_IS_AML_TABLE 0
#define ACPI_IS_DATA_TABLE 1
#endif /* __ACDISASM_H__ */

View File

@ -310,9 +310,10 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_O
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Disasm);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Verbose);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
@ -325,9 +326,7 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_tables);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_stats);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_ini_methods);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);

View File

@ -54,7 +54,7 @@ typedef UINT32 ACPI_MUTEX_HANDLE;
/* Total number of aml opcodes defined */
#define AML_NUM_OPCODES 0x81
#define AML_NUM_OPCODES 0x82
/* Forward declarations */

View File

@ -64,23 +64,12 @@
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
/*
* printf() format helpers. These macros are workarounds for the difficulties
* printf() format helper. This macros is a workaround for the difficulties
* with emitting 64-bit integers and 64-bit pointers with the same code
* for both 32-bit and 64-bit hosts.
*/
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
#else
#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i)
#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i)
#define ACPI_PRINTF_UINT "0x%8.8X"
#endif
/*
* Macros for moving data around to/from buffers that are possibly unaligned.

View File

@ -112,6 +112,7 @@
#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA)
#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
@ -245,6 +246,7 @@
#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
#define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)

View File

@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20150204
#define ACPI_CA_VERSION 0x20150410
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>
@ -503,7 +503,7 @@ AcpiReallocateRootTable (
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiFindRootPointer (
ACPI_SIZE *RsdpAddress))
ACPI_PHYSICAL_ADDRESS *RsdpAddress))
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS

View File

@ -352,8 +352,9 @@ AcpiRsSetResourceLength (
/*
* rsdump
* rsdump - Debugger support
*/
#ifdef ACPI_DEBUGGER
void
AcpiRsDumpResourceList (
ACPI_RESOURCE *Resource);
@ -361,6 +362,7 @@ AcpiRsDumpResourceList (
void
AcpiRsDumpIrqList (
UINT8 *RouteTable);
#endif
/*

View File

@ -345,6 +345,36 @@ typedef struct acpi_resource_source
UINT8 MaxAddressFixed; \
ACPI_RESOURCE_ATTRIBUTE Info;
typedef struct acpi_address16_attribute
{
UINT16 Granularity;
UINT16 Minimum;
UINT16 Maximum;
UINT16 TranslationOffset;
UINT16 AddressLength;
} ACPI_ADDRESS16_ATTRIBUTE;
typedef struct acpi_address32_attribute
{
UINT32 Granularity;
UINT32 Minimum;
UINT32 Maximum;
UINT32 TranslationOffset;
UINT32 AddressLength;
} ACPI_ADDRESS32_ATTRIBUTE;
typedef struct acpi_address64_attribute
{
UINT64 Granularity;
UINT64 Minimum;
UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
} ACPI_ADDRESS64_ATTRIBUTE;
typedef struct acpi_resource_address
{
ACPI_RESOURCE_ADDRESS_COMMON
@ -354,11 +384,7 @@ typedef struct acpi_resource_address
typedef struct acpi_resource_address16
{
ACPI_RESOURCE_ADDRESS_COMMON
UINT16 Granularity;
UINT16 Minimum;
UINT16 Maximum;
UINT16 TranslationOffset;
UINT16 AddressLength;
ACPI_ADDRESS16_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS16;
@ -366,11 +392,7 @@ typedef struct acpi_resource_address16
typedef struct acpi_resource_address32
{
ACPI_RESOURCE_ADDRESS_COMMON
UINT32 Granularity;
UINT32 Minimum;
UINT32 Maximum;
UINT32 TranslationOffset;
UINT32 AddressLength;
ACPI_ADDRESS32_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS32;
@ -378,11 +400,7 @@ typedef struct acpi_resource_address32
typedef struct acpi_resource_address64
{
ACPI_RESOURCE_ADDRESS_COMMON
UINT64 Granularity;
UINT64 Minimum;
UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
ACPI_ADDRESS64_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS64;
@ -391,11 +409,7 @@ typedef struct acpi_resource_extended_address64
{
ACPI_RESOURCE_ADDRESS_COMMON
UINT8 RevisionID;
UINT64 Granularity;
UINT64 Minimum;
UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
ACPI_ADDRESS64_ATTRIBUTE Address;
UINT64 TypeSpecific;
} ACPI_RESOURCE_EXTENDED_ADDRESS64;

View File

@ -69,11 +69,6 @@
#define ACPI_WALK_METHOD 0x01
#define ACPI_WALK_METHOD_RESTART 0x02
/* Flags for iASL compiler only */
#define ACPI_WALK_CONST_REQUIRED 0x10
#define ACPI_WALK_CONST_OPTIONAL 0x20
typedef struct acpi_walk_state
{

View File

@ -70,8 +70,9 @@ AcpiTbScanMemoryForRsdp (
* tbdata - table data structure management
*/
ACPI_STATUS
AcpiTbGetNextRootIndex (
UINT32 *TableIndex);
AcpiTbGetNextTableDescriptor (
UINT32 *TableIndex,
ACPI_TABLE_DESC **TableDesc);
void
AcpiTbInitTableDescriptor (
@ -173,14 +174,6 @@ AcpiTbInstallStandardTable (
BOOLEAN Override,
UINT32 *TableIndex);
ACPI_STATUS
AcpiTbStoreTable (
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER *Table,
UINT32 Length,
UINT8 Flags,
UINT32 *TableIndex);
void
AcpiTbUninstallTable (
ACPI_TABLE_DESC *TableDesc);

View File

@ -75,6 +75,7 @@
#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
@ -980,7 +981,8 @@ typedef struct acpi_lpit_header
enum AcpiLpitType
{
ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
ACPI_LPIT_TYPE_SIMPLE_IO = 0x01,
ACPI_LPIT_TYPE_RESERVED = 0x02 /* 2 and above are reserved */
};
/* Masks for Flags field above */
@ -1083,6 +1085,24 @@ typedef struct acpi_table_mchi
} ACPI_TABLE_MCHI;
/*******************************************************************************
*
* MSDM - Microsoft Data Management table
*
* Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
* November 29, 2011. Copyright 2011 Microsoft
*
******************************************************************************/
/* Basic MSDM table is only the common ACPI header */
typedef struct acpi_table_msdm
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
} ACPI_TABLE_MSDM;
/*******************************************************************************
*
* MTMR - MID Timer Table
@ -1114,10 +1134,9 @@ typedef struct acpi_mtmr_entry
/*******************************************************************************
*
* SLIC - Software Licensing Description Table
* Version 1
*
* Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
* Copyright 2006
* Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
* November 29, 2011. Copyright 2011 Microsoft
*
******************************************************************************/
@ -1130,62 +1149,6 @@ typedef struct acpi_table_slic
} ACPI_TABLE_SLIC;
/* Common SLIC subtable header */
typedef struct acpi_slic_header
{
UINT32 Type;
UINT32 Length;
} ACPI_SLIC_HEADER;
/* Values for Type field above */
enum AcpiSlicType
{
ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
};
/*
* SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
*/
/* 0: Public Key Structure */
typedef struct acpi_slic_key
{
ACPI_SLIC_HEADER Header;
UINT8 KeyType;
UINT8 Version;
UINT16 Reserved;
UINT32 Algorithm;
char Magic[4];
UINT32 BitLength;
UINT32 Exponent;
UINT8 Modulus[128];
} ACPI_SLIC_KEY;
/* 1: Windows Marker Structure */
typedef struct acpi_slic_marker
{
ACPI_SLIC_HEADER Header;
UINT32 Version;
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
char WindowsFlag[8];
UINT32 SlicVersion;
UINT8 Reserved[16];
UINT8 Signature[128];
} ACPI_SLIC_MARKER;
/*******************************************************************************
*
* SPCR - Serial Port Console Redirection table

View File

@ -201,9 +201,29 @@ typedef int INT32;
typedef INT32 ACPI_NATIVE_INT;
typedef UINT32 ACPI_SIZE;
#ifdef ACPI_32BIT_PHYSICAL_ADDRESS
/*
* OSPMs can define this to shrink the size of the structures for 32-bit
* none PAE environment. ASL compiler may always define this to generate
* 32-bit OSPM compliant tables.
*/
typedef UINT32 ACPI_IO_ADDRESS;
typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#else /* ACPI_32BIT_PHYSICAL_ADDRESS */
/*
* It is reported that, after some calculations, the physical addresses can
* wrap over the 32-bit boundary on 32-bit PAE environment.
* https://bugzilla.kernel.org/show_bug.cgi?id=87971
*/
typedef UINT64 ACPI_IO_ADDRESS;
typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
#define ACPI_MAX_PTR ACPI_UINT32_MAX
#define ACPI_SIZE_MAX ACPI_UINT32_MAX
@ -720,23 +740,26 @@ typedef UINT32 ACPI_EVENT_TYPE;
* The encoding of ACPI_EVENT_STATUS is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the event is enabled).
* +-------------+-+-+-+-+
* | Bits 31:4 |3|2|1|0|
* +-------------+-+-+-+-+
* | | | | |
* | | | | +- Enabled?
* | | | +--- Enabled for wake?
* | | +----- Set?
* | +------- Has a handler?
* +------------- <Reserved>
* +-------------+-+-+-+-+-+
* | Bits 31:5 |4|3|2|1|0|
* +-------------+-+-+-+-+-+
* | | | | | |
* | | | | | +- Enabled?
* | | | | +--- Enabled for wake?
* | | | +----- Status bit set?
* | | +------- Enable bit set?
* | +--------- Has a handler?
* +--------------- <Reserved>
*/
typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x08
#define ACPI_EVENT_FLAG_STATUS_SET (ACPI_EVENT_STATUS) 0x04
#define ACPI_EVENT_FLAG_ENABLE_SET (ACPI_EVENT_STATUS) 0x08
#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x10
#define ACPI_EVENT_FLAG_SET ACPI_EVENT_FLAG_STATUS_SET
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
@ -1344,6 +1367,7 @@ typedef struct acpi_memory_list
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
#define ACPI_OSI_WIN_7 0x0B
#define ACPI_OSI_WIN_8 0x0C
#define ACPI_OSI_WIN_10 0x0D
/* Definitions of file IO */

View File

@ -723,6 +723,12 @@ const ACPI_PREDEFINED_INFO *
AcpiUtMatchPredefinedMethod (
char *Name);
void
AcpiUtGetExpectedReturnTypes (
char *Buffer,
UINT32 ExpectedBtypes);
#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
const ACPI_PREDEFINED_INFO *
AcpiUtMatchResourceName (
char *Name);
@ -733,15 +739,11 @@ AcpiUtDisplayPredefinedMethod (
const ACPI_PREDEFINED_INFO *ThisName,
BOOLEAN MultiLine);
void
AcpiUtGetExpectedReturnTypes (
char *Buffer,
UINT32 ExpectedBtypes);
UINT32
AcpiUtGetResourceBitWidth (
char *Buffer,
UINT16 Types);
#endif
/*
@ -782,13 +784,6 @@ AcpiUtCreateUpdateStateAndPush (
UINT16 Action,
ACPI_GENERIC_STATE **StateList);
ACPI_STATUS
AcpiUtCreatePkgStateAndPush (
void *InternalObject,
void *ExternalObject,
UINT16 Index,
ACPI_GENERIC_STATE **StateList);
ACPI_GENERIC_STATE *
AcpiUtCreateControlState (
void);
@ -827,9 +822,11 @@ BOOLEAN
AcpiUtIsPciRootBridge (
char *Id);
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
BOOLEAN
AcpiUtIsAmlTable (
ACPI_TABLE_HEADER *Table);
#endif
ACPI_STATUS
AcpiUtWalkPackageTree (
@ -918,6 +915,7 @@ void
AcpiUtStrupr (
char *SrcString);
#ifdef ACPI_ASL_COMPILER
void
AcpiUtStrlwr (
char *SrcString);
@ -926,6 +924,7 @@ int
AcpiUtStricmp (
char *String1,
char *String2);
#endif
ACPI_STATUS
AcpiUtStrtoul64 (
@ -938,9 +937,11 @@ AcpiUtPrintString (
char *String,
UINT16 MaxLength);
#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
void
UtConvertBackslashes (
char *Pathname);
#endif
BOOLEAN
AcpiUtValidAcpiName (
@ -1189,9 +1190,11 @@ AcpiUtFilePrintf (
/*
* utuuid -- UUID support functions
*/
#if (defined ACPI_ASL_COMPILER || defined ACPI_DISASSEMBLER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
void
AcpiUtConvertStringToUuid (
char *InString,
UINT8 *UuidBuffer);
#endif
#endif /* _ACUTILS_H */

View File

@ -65,6 +65,7 @@
#define AML_PACKAGE_OP (UINT16) 0x12
#define AML_VAR_PACKAGE_OP (UINT16) 0x13 /* ACPI 2.0 */
#define AML_METHOD_OP (UINT16) 0x14
#define AML_EXTERNAL_OP (UINT16) 0x15 /* ACPI 6.0 */
#define AML_DUAL_NAME_PREFIX (UINT16) 0x2e
#define AML_MULTI_NAME_PREFIX_OP (UINT16) 0x2f
#define AML_NAME_CHAR_SUBSEQ (UINT16) 0x30
@ -209,7 +210,6 @@
#define AML_INT_RESERVEDFIELD_OP (UINT16) 0x0031
#define AML_INT_ACCESSFIELD_OP (UINT16) 0x0032
#define AML_INT_BYTELIST_OP (UINT16) 0x0033
#define AML_INT_STATICSTRING_OP (UINT16) 0x0034
#define AML_INT_METHODCALL_OP (UINT16) 0x0035
#define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037

View File

@ -77,6 +77,7 @@
#define ACPI_LARGE_NAMESPACE_NODE
#define ACPI_DATA_TABLE_DISASSEMBLY
#define ACPI_SINGLE_THREADED
#define ACPI_32BIT_PHYSICAL_ADDRESS
#endif
/* AcpiExec configuration. Multithreaded with full AML debugger */

View File

@ -194,27 +194,27 @@ acpi_pcib_producer_handler(ACPI_RESOURCE *res, void *context)
break;
switch (res->Type) {
case ACPI_RESOURCE_TYPE_ADDRESS16:
min = res->Data.Address16.Minimum;
max = res->Data.Address16.Maximum;
length = res->Data.Address16.AddressLength;
min = res->Data.Address16.Address.Minimum;
max = res->Data.Address16.Address.Maximum;
length = res->Data.Address16.Address.AddressLength;
break;
case ACPI_RESOURCE_TYPE_ADDRESS32:
min = res->Data.Address32.Minimum;
max = res->Data.Address32.Maximum;
length = res->Data.Address32.AddressLength;
min = res->Data.Address32.Address.Minimum;
max = res->Data.Address32.Address.Maximum;
length = res->Data.Address32.Address.AddressLength;
break;
case ACPI_RESOURCE_TYPE_ADDRESS64:
min = res->Data.Address64.Minimum;
max = res->Data.Address64.Maximum;
length = res->Data.Address64.AddressLength;
min = res->Data.Address64.Address.Minimum;
max = res->Data.Address64.Address.Maximum;
length = res->Data.Address64.Address.AddressLength;
break;
default:
KASSERT(res->Type ==
ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64,
("should never happen"));
min = res->Data.ExtAddress64.Minimum;
max = res->Data.ExtAddress64.Maximum;
length = res->Data.ExtAddress64.AddressLength;
min = res->Data.ExtAddress64.Address.Minimum;
max = res->Data.ExtAddress64.Address.Maximum;
length = res->Data.ExtAddress64.Address.AddressLength;
break;
}
if (length == 0)

View File

@ -298,28 +298,28 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
switch (res->Type) {
case ACPI_RESOURCE_TYPE_ADDRESS16:
gran = res->Data.Address16.Granularity;
min = res->Data.Address16.Minimum;
max = res->Data.Address16.Maximum;
length = res->Data.Address16.AddressLength;
gran = res->Data.Address16.Address.Granularity;
min = res->Data.Address16.Address.Minimum;
max = res->Data.Address16.Address.Maximum;
length = res->Data.Address16.Address.AddressLength;
#ifdef ACPI_DEBUG
name = "Address16";
#endif
break;
case ACPI_RESOURCE_TYPE_ADDRESS32:
gran = res->Data.Address32.Granularity;
min = res->Data.Address32.Minimum;
max = res->Data.Address32.Maximum;
length = res->Data.Address32.AddressLength;
gran = res->Data.Address32.Address.Granularity;
min = res->Data.Address32.Address.Minimum;
max = res->Data.Address32.Address.Maximum;
length = res->Data.Address32.Address.AddressLength;
#ifdef ACPI_DEBUG
name = "Address32";
#endif
break;
case ACPI_RESOURCE_TYPE_ADDRESS64:
gran = res->Data.Address64.Granularity;
min = res->Data.Address64.Minimum;
max = res->Data.Address64.Maximum;
length = res->Data.Address64.AddressLength;
gran = res->Data.Address64.Address.Granularity;
min = res->Data.Address64.Address.Minimum;
max = res->Data.Address64.Address.Maximum;
length = res->Data.Address64.Address.AddressLength;
#ifdef ACPI_DEBUG
name = "Address64";
#endif
@ -327,10 +327,10 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
default:
KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64,
("should never happen"));
gran = res->Data.ExtAddress64.Granularity;
min = res->Data.ExtAddress64.Minimum;
max = res->Data.ExtAddress64.Maximum;
length = res->Data.ExtAddress64.AddressLength;
gran = res->Data.ExtAddress64.Address.Granularity;
min = res->Data.ExtAddress64.Address.Minimum;
max = res->Data.ExtAddress64.Address.Maximum;
length = res->Data.ExtAddress64.Address.AddressLength;
#ifdef ACPI_DEBUG
name = "ExtAddress64";
#endif