Merge ACPICA 20191018.

This commit is contained in:
Jung-uk Kim 2019-10-19 14:56:44 +00:00
commit a009b7dcab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353764
102 changed files with 1835 additions and 414 deletions

View File

@ -18,12 +18,13 @@ fulldirs="common compiler components include os_specific"
# files to remove
stripdirs="generate libraries parsers preprocessor tests tools"
stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \
acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \
acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \
acwin.h acwin64.h acwinex.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 utprint.c"
stripfiles="Makefile README aslcompiler.y accygwin.h acdragonfly.h \
acdragonflyex.h acefi.h acefiex.h achaiku.h acintel.h aclinux.h \
aclinuxex.h acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h \
acqnx.h acwin.h acwin64.h acwinex.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 \
utprint.c"
# include files to canonify
src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \

View File

@ -1,3 +1,116 @@
----------------------------------------
18 October 2019. Summary of changes for version 20191018:
1) ACPICA kernel-resident subsystem:
Debugger: added a new command: ?Fields [address space ID]?. This command
dumps the contents of all field units that are defined within the
namespace with a particular address space ID.
Modified the external interface AcpiLoadTable() to return a table index.
This table index can be used for unloading a table for debugging.
ACPI_STATUS
AcpiLoadTable (
ACPI_TABLE_HEADER *Table,
UINT32 *TableIndex))
Implemented a new external interface: AcpiUnloadTable() This new function
takes a table index as an argument and unloads the table. Useful for
debugging only.
ACPI_STATUS
AcpiUnloadTable (
UINT32 TableIndex))
Ported the AcpiNames utility to use the new table initialization
sequence. The utility was broken before this change. Also, it was
required to include most of the AML interpreter into the utility in order
to process table initialization (module-level code execution.)
Update for results from running Clang V8.0.1. This fixes all "dead
assignment" warnings. There are still several "Dereference of NULL
pointer" warnings, but these have been found to be false positive
warnings.
2) iASL Compiler/Disassembler and ACPICA tools:
iASL: numerous table compiler changes to ensure that the usage of
yacc/bison syntax is POSIX-compliant.
iASL/disassembler: several simple bug fixes in the data table
disassembler.
Acpiexec: expanded the initialization file (the -fi option) to initialize
strings, buffers, packages, and field units.
----------------------------------------
16 August 2019. Summary of changes for version 20190816:
This release is available at https://acpica.org/downloads
1) ACPICA kernel-resident subsystem:
Modified the OwnerId mechanism to allow for more Owner Ids. The previous
limit was 256 Ids, now it is 4096 Ids. This prevents OWNER_ID_LIMIT
exceptions on machines with a large number of initialization threads,
many CPU cores and nested initialization control methods.
Introduced acpi_dispatch_gpe() as a wrapper around AcpiEvDetectGpe() for
checking if the given GPE (as represented by a GPE device handle and a
GPE number) is currently active and dispatching it (if that's the case)
outside of interrupt context.
Table load: exit the interpreter before initializing objects within the
new table This prevents re-acquiring the interpreter lock when loading
tables
Added the "Windows 2019" string to the _OSI support (version 1903). Jung-
uk Kim
Macros: removed pointer math on a null pointer. Causes warnings on some
compilers and/or tools. Changed ACPI_TO_POINTER to use ACPI_CAST_PTR
instead of using arithmetic.
Fully deployed the ACPI_PRINTF_LIKE macro. This macro was not being used
across all "printf-like" internal functions. Also, cleanup all calls to
such functions (both in 32-bit mode and 64-bit mode) now that they are
analyzed by the gcc compiler via ACPI_PRINTF_LIKE.
2) iASL Compiler/Disassembler and ACPICA tools:
iASL: implemented a new data table compiler flex/bison front-end. This
change is internal and is not intended to result in changes to the
compiled code. This new compiler front-end can be invoked using the -tp
option for now, until the old mechanism is removed.
ASLTS: Implemented a new data table compiler test suite. This test suite
generates all table templates and compile/disassemble/re-compile/binary-
compare each file.
iASL: return -1 if AML files were not generated due to compiler errors
iASL: added a warning on use of the now-legacy ASL Processor () keyword.
iASL: added an error on _UID object declaration that returns a String
within a Processor () declaration. A _UID for a processor must be an
Integer.
iASL: added a null terminator to name strings that consist only of
multiple parent prefixes (^)
iASL: added support to compile both ASL and data table files in a single
command.
Updated the tool generation project files that were recently migrated to
MSVC 2017 to eliminate all new warnings. The new project files appear in
the directory \acpica\generate\msvc2017. This change effectively
deprecates the older project files in \acpica\generate\msvc9.
----------------------------------------
03 July 2019. Summary of changes for version 20190703:

View File

@ -532,7 +532,7 @@ AcpiOsGetLine (
* Ignore the various keys like insert/delete/home/end, etc.
* But we must eat the final character of the ESC sequence.
*/
InputChar = getchar ();
(void) getchar ();
continue;
default:

View File

@ -746,7 +746,6 @@ AdDoExternalFileList (
{
ExternalFileList = ExternalFileList->Next;
GlobalStatus = AE_TYPE;
Status = AE_OK;
continue;
}

View File

@ -480,6 +480,7 @@ AcpiDmDumpDescending (
{
ACPI_OP_WALK_INFO *Info = Context;
char *Path;
ACPI_STATUS Status;
if (!Op)
@ -522,10 +523,18 @@ AcpiDmDumpDescending (
if (Op->Common.Value.String)
{
AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
NULL, &Path);
AcpiOsPrintf ("%s %p", Path, Op->Common.Node);
ACPI_FREE (Path);
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf ("%s %p", Path, Op->Common.Node);
ACPI_FREE (Path);
}
else
{
AcpiOsPrintf ("Could not externalize pathname for node [%4.4s]",
Op->Common.Node->Name.Ascii);
}
}
else
{
@ -592,7 +601,9 @@ AcpiDmFindOrphanDescending (
return (AE_OK);
}
#ifdef ACPI_UNDER_DEVELOPMENT
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
#endif
switch (Op->Common.AmlOpcode)
{
@ -830,9 +841,9 @@ AcpiDmLoadDescendingOp (
* 2) Not the root node
* 3) Not a node created by Scope
*/
if (!PreDefined && Node != AcpiGbl_RootNode &&
Op->Common.AmlOpcode != AML_SCOPE_OP)
if (!PreDefined &&
(Node != AcpiGbl_RootNode) &&
(Op->Common.AmlOpcode != AML_SCOPE_OP))
{
Node->OwnerId = WalkState->OwnerId;
}
@ -1091,7 +1102,7 @@ AcpiDmCommonDescendingOp (
/* Switch/Case conversion */
Status = AcpiDmProcessSwitch (Op);
return (AE_OK);
return (Status);
}

View File

@ -833,8 +833,12 @@ AcpiGetTagPathname (
/* Internalize the namepath to AML format */
AcpiNsInternalizeName (Pathname, &InternalPath);
Status = AcpiNsInternalizeName (Pathname, &InternalPath);
ACPI_FREE (Pathname);
if (ACPI_FAILURE (Status))
{
return (NULL);
}
/* Update the Op with the symbol */

View File

@ -327,7 +327,7 @@ AdCreateTableHeader (
* makes it easier to rename the disassembled ASL file if needed.
*/
AcpiOsPrintf (
"DefinitionBlock (\"\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
"DefinitionBlock (\"\", \"%4.4s\", %u, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
Table->Signature, Table->Revision,
Table->OemId, Table->OemTableId, Table->OemRevision);
}
@ -443,8 +443,8 @@ AdGetLocalTables (
/* Get the DSDT via table override */
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
AcpiOsTableOverride (&TableHeader, &NewTable);
if (!NewTable)
Status = AcpiOsTableOverride (&TableHeader, &NewTable);
if (ACPI_FAILURE (Status) || !NewTable)
{
fprintf (stderr, "Could not obtain DSDT\n");
return (AE_NO_ACPI_TABLES);
@ -601,7 +601,7 @@ AdParseTable (
fprintf (stderr,
"Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
(void) AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
fprintf (stderr, "\n");
/* Process Resource Templates */

View File

@ -474,7 +474,6 @@ AcpiDmDumpCsrt (
{
return;
}
SubSubOffset += InfoLength;
}
/* Point to next sub-subtable */
@ -1401,7 +1400,6 @@ AcpiDmDumpHmat (
while (Offset < Table->Length)
{
AcpiOsPrintf ("\n");
SubtableOffset = 0;
/* Dump HMAT structure header */
@ -1484,6 +1482,11 @@ AcpiDmDumpHmat (
Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
4, AcpiDmTableInfoHmat1a);
if (ACPI_FAILURE (Status))
{
return;
}
SubtableOffset += 4;
}
@ -1500,6 +1503,11 @@ AcpiDmDumpHmat (
Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
4, AcpiDmTableInfoHmat1b);
if (ACPI_FAILURE (Status))
{
return;
}
SubtableOffset += 4;
}
@ -1519,6 +1527,11 @@ AcpiDmDumpHmat (
Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
2, AcpiDmTableInfoHmat1c);
if (ACPI_FAILURE(Status))
{
return;
}
SubtableOffset += 2;
}
}
@ -1542,6 +1555,11 @@ AcpiDmDumpHmat (
Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
2, AcpiDmTableInfoHmat2a);
if (ACPI_FAILURE (Status))
{
return;
}
SubtableOffset += 2;
}
break;

View File

@ -187,6 +187,7 @@ AcpiDmDumpIort (
ACPI_DMTABLE_INFO *InfoTable;
char *String;
UINT32 i;
UINT32 MappingByteLength;
/* Main table */
@ -314,6 +315,11 @@ AcpiDmDumpIort (
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
4, AcpiDmTableInfoIort0a);
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += 4;
}
}
@ -325,8 +331,10 @@ AcpiDmDumpIort (
if (IortNode->Length > NodeOffset)
{
MappingByteLength =
IortNode->MappingCount * sizeof (ACPI_IORT_ID_MAPPING);
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
Table, IortNode->Length - NodeOffset,
Table, IortNode->Length - NodeOffset - MappingByteLength,
AcpiDmTableInfoIort1a);
if (ACPI_FAILURE (Status))
{
@ -410,7 +418,6 @@ AcpiDmDumpIort (
/* Point to next node subtable */
Offset += IortNode->Length;
IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length);
}
}
@ -871,7 +878,7 @@ AcpiDmDumpMcfg (
if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
{
AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
(UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
return;
}
@ -1211,7 +1218,6 @@ AcpiDmDumpNfit (
/* Has a variable number of 32-bit values at the end */
InfoTable = AcpiDmTableInfoNfit2;
Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable);
FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE);
break;
@ -1236,7 +1242,6 @@ AcpiDmDumpNfit (
/* Has a variable number of 64-bit addresses at the end */
InfoTable = AcpiDmTableInfoNfit6;
Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable);
FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64);
break;
@ -1273,6 +1278,7 @@ AcpiDmDumpNfit (
{
case ACPI_NFIT_TYPE_INTERLEAVE:
Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable);
for (i = 0; i < Interleave->LineCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
@ -1308,6 +1314,7 @@ AcpiDmDumpNfit (
case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable);
for (i = 0; i < Hint->HintCount; i++)
{
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
@ -1806,6 +1813,11 @@ AcpiDmDumpPptt (
Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset),
4, AcpiDmTableInfoPptt0a);
if (ACPI_FAILURE (Status))
{
return;
}
SubtableOffset += 4;
}
break;
@ -2063,6 +2075,10 @@ AcpiDmDumpSdev (
Status = AcpiDmDumpTable (Table->Length, 0,
ACPI_ADD_PTR (UINT8, Pcie, VendorDataOffset),
VendorDataLength, AcpiDmTableInfoSdev1b);
if (ACPI_FAILURE (Status))
{
return;
}
}
break;

View File

@ -410,7 +410,7 @@ AcpiDmDumpStao (
Namepath = ACPI_ADD_PTR (char, Table, Offset);
StringLength = strlen (Namepath) + 1;
AcpiDmLineHeader (Offset, StringLength, "Namestring");
AcpiDmLineHeader (Offset, StringLength, "Namepath");
AcpiOsPrintf ("\"%s\"\n", Namepath);
/* Point to next namepath */
@ -526,7 +526,7 @@ AcpiDmDumpTpm2Rev3 (
{
case ACPI_TPM23_ACPI_START_METHOD:
Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
(void) AcpiDmDumpTable (Table->Length, Offset, Subtable,
Table->Length - Offset, AcpiDmTableInfoTpm23a);
break;
@ -591,7 +591,7 @@ AcpiDmDumpTpm2 (
Offset += sizeof (ACPI_TPM2_TRAILER);
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, ArmSubtable,
(void) AcpiDmDumpTable (Table->Length, Offset, ArmSubtable,
Table->Length - Offset, AcpiDmTableInfoTpm211);
break;

View File

@ -569,7 +569,7 @@ ApCheckForGpeNameConflict (
/* Need a null-terminated string version of NameSeg */
ACPI_MOVE_32_TO_32 (Name, &Op->Asl.NameSeg);
ACPI_MOVE_32_TO_32 (Name, Op->Asl.NameSeg);
Name[ACPI_NAMESEG_SIZE] = 0;
/*

View File

@ -474,7 +474,6 @@ AnFormatBtype (
strcat (Buffer, "|");
}
First = FALSE;
strcat (Buffer, "Resource");
}
}

View File

@ -421,7 +421,7 @@ UtDeleteLocalCaches (
DbgPrint (ASL_DEBUG_OUTPUT,
"%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
AslGbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
((UINT32) sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
/* Reset cache globals */
@ -445,7 +445,7 @@ UtDeleteLocalCaches (
DbgPrint (ASL_DEBUG_OUTPUT,
"%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
AslGbl_FieldCount, ASL_FIELD_CACHE_SIZE,
(sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
((UINT32) sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
/* Reset cache globals */
@ -468,7 +468,7 @@ UtDeleteLocalCaches (
DbgPrint (ASL_DEBUG_OUTPUT,
"%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
AslGbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
(sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
((UINT32) sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
/* Reset cache globals */

View File

@ -618,8 +618,8 @@ CgWriteTableHeader (
Op->Asl.AmlSubtreeLength +=
strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3;
CvDbgPrint (" Length: %lu\n",
strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3);
CvDbgPrint (" Length: %u\n",
(UINT32) strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3);
if (Op->Asl.CommentList)
{

View File

@ -853,10 +853,11 @@ CmDumpAllEvents (
*
******************************************************************************/
void
int
CmCleanupAndExit (
void)
{
int Status = 0;
BOOLEAN DeleteAmlFile = FALSE;
ASL_GLOBAL_FILE_NODE *CurrentFileNode = AslGbl_FilesList;
@ -915,20 +916,38 @@ CmCleanupAndExit (
UtDisplaySummary (ASL_FILE_STDOUT);
/*
* We will delete the AML file if there are errors and the
* force AML output option has not been used.
* Delete the AML file if there are errors and the force AML output option
* (-f) has not been used.
*
* Return -1 as a status of the compiler if no AML files are generated. If
* the AML file is generated in the presence of errors, return 0. In the
* latter case, the errors were ignored by the user so the compilation is
* considered successful.
*/
if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) &&
if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly ||
((AslGbl_ExceptionCount[ASL_ERROR] > 0) &&
(!AslGbl_IgnoreErrors) &&
AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle))
{
DeleteAmlFile = TRUE;
Status = -1;
}
/* Close all open files */
while (CurrentFileNode)
{
/*
* Set the program return status based on file errors. If there are any
* errors and during compilation, the command is not considered
* successful.
*/
if (Status != -1 && !AslGbl_IgnoreErrors &&
CurrentFileNode->ParserErrorDetected)
{
Status = -1;
}
switch (FlSwitchFileSet (CurrentFileNode->Files[ASL_FILE_INPUT].Filename))
{
case SWITCH_TO_SAME_FILE:
@ -952,6 +971,8 @@ CmCleanupAndExit (
{
UtDeleteLocalCaches ();
}
return (Status);
}

View File

@ -266,7 +266,7 @@ void
CmDoOutputFiles (
void);
void
int
CmCleanupAndExit (
void);
@ -1052,6 +1052,7 @@ void
FlCloseFile (
UINT32 FileId);
ACPI_PRINTF_LIKE (2)
void
FlPrintFile (
UINT32 FileId,
@ -1195,6 +1196,7 @@ OtXrefWalkPart1 (
/*
* aslutils - common compiler utilities
*/
ACPI_PRINTF_LIKE(2)
void
DbgPrint (
UINT32 Type,
@ -1288,6 +1290,10 @@ UtInternalizeName (
char *ExternalName,
char **ConvertedName);
BOOLEAN
UtNameContainsAllPrefix (
ACPI_PARSE_OBJECT *Op);
void
UtAttachNamepathToOwner (
ACPI_PARSE_OBJECT *Op,
@ -1303,6 +1309,15 @@ UINT64
UtDoConstant (
char *String);
char *
AcpiUtStrdup (
char *String);
char *
AcpiUtStrcat (
char *String1,
char *String2);
/*
* asluuid - UUID support
@ -1604,6 +1619,7 @@ DtCreateTemplates (
/*
* ASL/ASL+ converter debug
*/
ACPI_PRINTF_LIKE (1)
void
CvDbgPrint (
char *Fmt,

View File

@ -239,7 +239,7 @@ UtDumpIntegerOp (
case 8: /* Dword */
DbgPrint (ASL_TREE_OUTPUT,
"%*.*X", IntegerLength, IntegerLength, Op->Asl.Value.Integer);
"%*.*X", IntegerLength, IntegerLength, (UINT32) Op->Asl.Value.Integer);
break;
case 16: /* Qword and Integer */

View File

@ -290,7 +290,7 @@
#define ASL_PARSE_TREE_DEBUG2 \
" %08X %04X %04X %01X %04X %04X %05X %05X "\
"%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d"
"%8p %8p %8p %8p %08X %08X %04X %02d %5d %5d %5d %5d"
/*
* Macros for ASL/ASL+ converter

View File

@ -244,7 +244,6 @@ extern const char *AslGbl_SpecialNamedObjects[MAX_SPECIAL_NAME
#endif
/*
* Parser and other externals
*/
@ -254,6 +253,7 @@ extern int DtParserdebug;
extern int PrParserdebug;
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
extern char *AslCompilertext;
extern char *DtCompilerParsertext;
/*
* Older versions of Bison won't emit this external in the generated header.

View File

@ -246,6 +246,7 @@ Usage (
ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)");
printf ("\nData Table Compiler:\n");
ACPI_OPTION ("-tp", "Compile tables with flex/bison prototype");
ACPI_OPTION ("-G", "Compile custom table that contains generic operators");
ACPI_OPTION ("-T <sig list>|ALL", "Create ACPI table template/example files");
ACPI_OPTION ("-T <count>", "Emit DSDT and <count> SSDTs to same file");

View File

@ -202,7 +202,7 @@ AddressKeyword
;
AddressSpaceKeyword
: ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);}
: ByteConst {$$ = UtCheckIntegerRange ($1, ACPI_NUM_PREDEFINED_REGIONS, 0xFF);}
| RegionSpaceKeyword {}
;

View File

@ -479,12 +479,13 @@ CgGenerateAmlLengths (
Op->Asl.AmlLength = strlen (Buffer);
/*
* Check for single backslash reference to root,
* make it a null terminated string in the AML
* Check for single backslash reference to root or reference to a name
* consisting of only prefix (^) characters. Make it a null terminated
* string in the AML.
*/
if (Op->Asl.AmlLength == 1)
if (Op->Asl.AmlLength == 1 || UtNameContainsAllPrefix(Op))
{
Op->Asl.AmlLength = 2;
Op->Asl.AmlLength++;
}
break;

View File

@ -241,7 +241,7 @@ LsDumpAsciiInComment (
{
/* Insert a space to break the sequence */
FlPrintFile (FileId, ".", BufChar);
FlPrintFile (FileId, " ");
}
FlPrintFile (FileId, "%c", BufChar);

View File

@ -275,7 +275,6 @@ LdLoadFieldElements (
ACPI_STATUS Status;
SourceRegion = UtGetArg (Op, 0);
if (SourceRegion)
{
@ -527,13 +526,12 @@ LdNamespace1Begin (
case AML_INT_CONNECTION_OP:
if (Op->Asl.Child->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
{
break;
}
Arg = Op->Asl.Child;
Arg = Op->Asl.Child;
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Asl.ExternalName,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
WalkState, &Node);
@ -542,15 +540,6 @@ LdNamespace1Begin (
break;
}
if (Node->Type == ACPI_TYPE_BUFFER)
{
Arg->Asl.Node = Node;
Arg = Node->Op->Asl.Child; /* Get namepath */
Arg = Arg->Asl.Next; /* Get actual buffer */
Arg = Arg->Asl.Child; /* Buffer length */
Arg = Arg->Asl.Next; /* RAW_DATA buffer */
}
break;
default:
@ -577,7 +566,6 @@ LdNamespace1Begin (
* These opcodes are guaranteed to have a parent.
* Examine the parent opcode.
*/
Status = AE_OK;
ParentOp = Op->Asl.Parent;
OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Asl.AmlOpcode);
@ -1031,7 +1019,8 @@ LdNamespace1Begin (
* DESCRIPTION: Check if certain named objects are declared in the incorrect
* scope. Special named objects are listed in
* AslGbl_SpecialNamedObjects and can only be declared at the root
* scope.
* scope. _UID inside of a processor declaration must not be a
* string.
*
******************************************************************************/
@ -1052,6 +1041,13 @@ LdCheckSpecialNames (
return;
}
}
if (ACPI_COMPARE_NAMESEG (Node->Name.Ascii, "_UID") &&
Node->Parent->Type == ACPI_TYPE_PROCESSOR &&
Node->Type == ACPI_TYPE_STRING)
{
AslError (ASL_ERROR, ASL_MSG_INVALID_PROCESSOR_UID , Op, "found a string");
}
}

View File

@ -282,7 +282,6 @@ main (
if (ACPI_FAILURE (Status))
{
ReturnStatus = -1;
goto CleanupAndExit;
}
Index2++;
@ -290,9 +289,10 @@ main (
/*
* At this point, compilation of a data table or disassembly is complete.
* However, if there is a parse tree, perform compiler analysis and
* generate AML.
*/
if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag ||
AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || !AslGbl_ParseTreeRoot)
{
goto CleanupAndExit;
}
@ -338,7 +338,6 @@ main (
}
CleanupAndExit:
UtFreeLineBuffers ();
@ -350,7 +349,7 @@ main (
if (!AcpiGbl_DisasmFlag)
{
CmCleanupAndExit ();
ReturnStatus = CmCleanupAndExit ();
}
@ -400,18 +399,21 @@ AslSignalHandler (
* Close all open files
* Note: the .pre file is the same as the input source file
*/
AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL;
for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
if (AslGbl_Files)
{
FlCloseFile (i);
}
AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL;
/* Delete any output files */
for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
{
FlCloseFile (i);
}
for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++)
{
FlDeleteFile (i);
/* Delete any output files */
for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++)
{
FlDeleteFile (i);
}
}
printf (ASL_PREFIX "Terminating\n");

View File

@ -366,7 +366,9 @@ const char *AslCompilerMsgs [] =
/* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed",
/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist",
/* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer",
/* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal"
/* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal",
/* ASL_MSG_INVALID_PROCESSOR_UID */ "_UID inside processor declaration must be an integer",
/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead."
};
/* Table compiler */
@ -385,7 +387,10 @@ const char *AslTableCompilerMsgs [] =
/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero",
/* ASL_MSG_INVALID_LABEL */ "Invalid field label detected",
/* ASL_MSG_BUFFER_LIST */ "Invalid buffer initializer list",
/* ASL_MSG_ENTRY_LIST */ "Invalid entry initializer list"
};
/* Preprocessor */

View File

@ -369,6 +369,8 @@ typedef enum
ASL_MSG_UNDEFINED_EXTERNAL,
ASL_MSG_BUFFER_FIELD_OVERFLOW,
ASL_MSG_INVALID_SPECIAL_NAME,
ASL_MSG_INVALID_PROCESSOR_UID,
ASL_MSG_LEGACY_PROCESSOR_OP,
/* These messages are used by the Data Table compiler only */
@ -385,6 +387,9 @@ typedef enum
ASL_MSG_UNKNOWN_SUBTABLE,
ASL_MSG_UNKNOWN_TABLE,
ASL_MSG_ZERO_VALUE,
ASL_MSG_INVALID_LABEL,
ASL_MSG_BUFFER_LIST,
ASL_MSG_ENTRY_LIST,
/* These messages are used by the Preprocessor only */

View File

@ -199,6 +199,8 @@ MtMethodAnalysisWalkBegin (
ACPI_PARSE_OBJECT *NextType;
ACPI_PARSE_OBJECT *NextParamType;
UINT8 ActualArgs = 0;
BOOLEAN HidExists;
BOOLEAN AdrExists;
/* Build cross-reference output file if requested */
@ -535,12 +537,26 @@ MtMethodAnalysisWalkBegin (
case PARSEOP_DEVICE:
if (!ApFindNameInDeviceTree (METHOD_NAME__HID, Op) &&
!ApFindNameInDeviceTree (METHOD_NAME__ADR, Op))
/* Check usage of _HID and _ADR objects */
HidExists = ApFindNameInDeviceTree (METHOD_NAME__HID, Op);
AdrExists = ApFindNameInDeviceTree (METHOD_NAME__ADR, Op);
if (!HidExists && !AdrExists)
{
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
"Device object requires a _HID or _ADR in same scope");
}
else if (HidExists && AdrExists)
{
/*
* According to the ACPI spec, "A device object must contain
* either an _HID object or an _ADR object, but should not contain
* both".
*/
AslError (ASL_WARNING, ASL_MSG_MULTIPLE_TYPES, Op,
"Device object requires either a _HID or _ADR, but not both");
}
break;
case PARSEOP_EVENT:

View File

@ -234,6 +234,10 @@ NsDisplayNamespace (
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, NsDoOneNamespaceObject, NULL,
NULL, NULL);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Print the full pathname for each namespace node */
@ -276,7 +280,7 @@ NsDoOneNamespaceObject (
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s",
AslGbl_NumNamespaceObjects, Level, (Level * 3), " ",
&Node->Name, AcpiUtGetTypeName (Node->Type));
&Node->Name.Ascii[0], AcpiUtGetTypeName (Node->Type));
Op = Node->Op;
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object);
@ -429,7 +433,7 @@ NsDoOneNamespaceObject (
{
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Initial Length 0x%.2X elements]",
Op->Asl.Value.Integer);
(UINT32) Op->Asl.Value.Integer);
}
break;
@ -452,7 +456,7 @@ NsDoOneNamespaceObject (
{
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
" [Initial Length 0x%.2X bytes]",
Op->Asl.Value.Integer);
(UINT32) Op->Asl.Value.Integer);
}
break;
@ -531,7 +535,8 @@ NsDoOnePathname (
return (Status);
}
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer);
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n",
ACPI_CAST_PTR (char, TargetPath.Pointer));
ACPI_FREE (TargetPath.Pointer);
return (AE_OK);
}

View File

@ -837,6 +837,11 @@ AslDoOptions (
AslGbl_HexOutputFlag = HEX_OUTPUT_C;
break;
case 'p': /* data table flex/bison prototype */
AslGbl_DtLexBisonPrototype = TRUE;
break;
case 's':
AslGbl_HexOutputFlag = HEX_OUTPUT_ASL;

View File

@ -403,22 +403,22 @@ TrCreateValuedLeafOp (
{
case PARSEOP_STRING_LITERAL:
DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Op->Asl.Value.String);
break;
case PARSEOP_NAMESEG:
DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String);
break;
case PARSEOP_NAMESTRING:
DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String);
break;
case PARSEOP_EISAID:
DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Op->Asl.Value.String);
break;
case PARSEOP_METHOD:
@ -693,7 +693,8 @@ TrCreateConstantLeafOp (
time_t CurrentTime;
char *StaticTimeString;
char *TimeString;
char *Filename;
char *Filename = NULL;
ACPI_STATUS Status;
switch (ParseOpcode)
@ -727,7 +728,12 @@ TrCreateConstantLeafOp (
/* Get the simple filename from the full path */
FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
Status = FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
if (ACPI_FAILURE (Status))
{
return (NULL);
}
Op->Asl.Value.String = Filename;
break;

View File

@ -458,7 +458,7 @@ ApCheckPackage (
for (i = 0; i < Package->RetInfo4.Count1; ++i)
{
Status = ApCheckObjectType (Predefined->Info.Name, Op,
ApCheckObjectType (Predefined->Info.Name, Op,
Package->RetInfo4.ObjectType1, i);
Op = Op->Asl.Next;
}

View File

@ -1226,7 +1226,7 @@ RsDoResourceTemplate (
BufferOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
BufferOp->Asl.AmlOpcodeLength = 0;
BufferOp->Asl.AmlLength = CurrentByteOffset;
BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next;
BufferOp->Asl.Value.Buffer = ACPI_CAST_PTR (UINT8, HeadRnode.Next);
BufferOp->Asl.CompileFlags |= OP_IS_RESOURCE_DATA;
UtSetParseOpName (BufferOp);

View File

@ -487,10 +487,7 @@ RsDoInterruptDescriptor (
if (StringLength && ResSourceString)
{
strcpy ((char *) Rover, (char *) ResSourceString);
Rover = ACPI_ADD_PTR (
AML_RESOURCE, &(Rover->ByteItem), StringLength);
Descriptor->ExtendedIrq.ResourceLength = (UINT16)
(Descriptor->ExtendedIrq.ResourceLength + StringLength);

View File

@ -674,7 +674,6 @@ RsDoGpioIoDescriptor (
ResSourceLength = RsGetStringDataLength (InitializerOp);
VendorLength = RsGetBufferDataLength (InitializerOp);
InterruptLength = RsGetInterruptDataLength (InitializerOp, 10);
PinList = InterruptList;
DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
ResSourceLength + VendorLength + InterruptLength;

View File

@ -467,6 +467,7 @@ AslDoOneFile (
/* Determine input file type */
AslGbl_FileType = AslDetectSourceFileType (&AslGbl_Files[ASL_FILE_INPUT]);
FileNode->FileType = AslGbl_FileType;
if (AslGbl_FileType == ASL_INPUT_TYPE_BINARY)
{
return (AE_ERROR);

View File

@ -507,6 +507,12 @@ TrTransformSubtree (
}
break;
case PARSEOP_PROCESSOR:
AslError (ASL_WARNING, ASL_MSG_LEGACY_PROCESSOR_OP, Op, Op->Asl.ExternalName);
break;
default:
/* Nothing to do here for other opcodes */

View File

@ -505,9 +505,12 @@ typedef struct asl_files_node
UINT32 TotalLineCount;
UINT32 OriginalInputFileSize;
UINT32 TotalKeywords;
UINT32 TotalFields;
UINT32 OutputByteLength;
UINT32 TotalNamedObjects;
UINT32 TotalExecutableOpcodes;
BOOLEAN ParserErrorDetected;
UINT8 FileType;
} ASL_GLOBAL_FILE_NODE;

View File

@ -223,6 +223,7 @@ UtQueryForOverwrite (
char *Pathname)
{
struct stat StatInfo;
int InChar;
if (!stat (Pathname, &StatInfo))
@ -230,7 +231,13 @@ UtQueryForOverwrite (
fprintf (stderr, "Target file \"%s\" already exists, overwrite? [y|n] ",
Pathname);
if (getchar () != 'y')
InChar = fgetc (stdin);
if (InChar == '\n')
{
InChar = fgetc (stdin);
}
if ((InChar != 'y') && (InChar != 'Y'))
{
return (FALSE);
}
@ -559,58 +566,54 @@ UtDisplayOneSummary (
/* Summary of main input and output files */
if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
FileNode = FlGetCurrentFileNode ();
if (!FileNode)
{
fprintf (stderr, "Summary could not be generated");
return;
}
if (FileNode->ParserErrorDetected)
{
FlPrintFile (FileId,
"%-14s %s - %u lines, %u bytes, %u fields\n",
"Table Input:",
AslGbl_Files[ASL_FILE_INPUT].Filename, AslGbl_CurrentLineNumber,
AslGbl_InputByteCount, AslGbl_InputFieldCount);
if ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || (AslGbl_IgnoreErrors))
{
FlPrintFile (FileId,
"%-14s %s - %u bytes\n",
"Binary Output:",
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename, AslGbl_TableLength);
}
"%-14s %s - Compilation aborted due to parser-detected syntax error(s)\n",
"Input file:", AslGbl_Files[ASL_FILE_INPUT].Filename);
}
else
else if (FileNode->FileType == ASL_INPUT_TYPE_ASCII_DATA)
{
FileNode = FlGetCurrentFileNode ();
if (!FileNode)
{
fprintf (stderr, "Summary could not be generated");
return;
}
if (FileNode->ParserErrorDetected)
FlPrintFile (FileId,
"%-14s %s - %7u bytes %6u fields %8u source lines\n",
"Table Input:",
AslGbl_Files[ASL_FILE_INPUT].Filename,
FileNode->OriginalInputFileSize, FileNode->TotalFields,
FileNode->TotalLineCount);
FlPrintFile (FileId,
"%-14s %s - %7u bytes\n",
"Binary Output:",
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename, FileNode->OutputByteLength);
}
else if (FileNode->FileType == ASL_INPUT_TYPE_ASCII_ASL)
{
FlPrintFile (FileId,
"%-14s %s - %7u bytes %6u keywords %6u source lines\n",
"ASL Input:",
AslGbl_Files[ASL_FILE_INPUT].Filename,
FileNode->OriginalInputFileSize,
FileNode->TotalKeywords,
FileNode->TotalLineCount);
/* AML summary */
if (DisplayAMLSummary)
{
FlPrintFile (FileId,
"%-14s %s - Compilation aborted due to parser-detected syntax error(s)\n",
"ASL Input:", AslGbl_Files[ASL_FILE_INPUT].Filename);
}
else
{
FlPrintFile (FileId,
"%-14s %s - %7u bytes %6u keywords %6u source lines\n",
"ASL Input:",
AslGbl_Files[ASL_FILE_INPUT].Filename,
FileNode->OriginalInputFileSize,
FileNode->TotalKeywords,
FileNode->TotalLineCount);
/* AML summary */
if (DisplayAMLSummary)
{
FlPrintFile (FileId,
"%-14s %s - %7u bytes %6u opcodes %6u named objects\n",
"AML Output:",
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename,
FlGetFileSize (ASL_FILE_AML_OUTPUT),
FileNode->TotalExecutableOpcodes,
FileNode->TotalNamedObjects);
}
"%-14s %s - %7u bytes %6u opcodes %6u named objects\n",
"AML Output:",
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename,
FlGetFileSize (ASL_FILE_AML_OUTPUT),
FileNode->TotalExecutableOpcodes,
FileNode->TotalNamedObjects);
}
}
@ -992,6 +995,37 @@ UtAttachNamepathToOwner (
}
/*******************************************************************************
*
* FUNCTION: UtNameContainsAllPrefix
*
* PARAMETERS: Op - Op containing NameString
*
* RETURN: NameString consists of all ^ characters
*
* DESCRIPTION: Determine if this Op contains a name segment that consists of
* all '^' characters.
*
******************************************************************************/
BOOLEAN
UtNameContainsAllPrefix (
ACPI_PARSE_OBJECT *Op)
{
UINT32 Length = Op->Asl.AmlLength;
UINT32 i;
for (i = 0; i < Length; i++)
{
if (Op->Asl.Value.String[i] != '^')
{
return (FALSE);
}
}
return (TRUE);
}
/*******************************************************************************
*
* FUNCTION: UtDoConstant
@ -1026,3 +1060,56 @@ UtDoConstant (
return (ConvertedInteger);
}
/******************************************************************************
*
* FUNCTION: AcpiUtStrdup
*
* PARAMETERS: String1 - string to duplicate
*
* RETURN: int that signifies string relationship. Zero means strings
* are equal.
*
* DESCRIPTION: Duplicate the string using UtCacheAlloc to avoid manual memory
* reclamation.
*
******************************************************************************/
char *
AcpiUtStrdup (
char *String)
{
char *NewString = (char *) UtLocalCalloc (strlen (String) + 1);
strcpy (NewString, String);
return (NewString);
}
/******************************************************************************
*
* FUNCTION: AcpiUtStrcat
*
* PARAMETERS: String1
* String2
*
* RETURN: New string with String1 concatenated with String2
*
* DESCRIPTION: Concatenate string1 and string2
*
******************************************************************************/
char *
AcpiUtStrcat (
char *String1,
char *String2)
{
UINT32 String1Length = strlen (String1);
char *NewString = (char *) UtLocalCalloc (strlen (String1) + strlen (String2) + 1);
strcpy (NewString, String1);
strcpy (NewString + String1Length, String2);
return (NewString);
}

View File

@ -799,7 +799,7 @@ OtXrefWalkPart3 (
else
{
FlPrintFile (ASL_FILE_XREF_OUTPUT,
" %u references to this object in this module\n",
" %u references to this object in this module [%s]\n",
XrefInfo->ThisObjectReferences, ParentPath);
}

View File

@ -544,8 +544,11 @@ CvSwitchFiles(
Current = Current->Parent;
}
/* Redirect output to Op->Common.CvFilename */
if (FNode)
{
/* Redirect output to Op->Common.CvFilename */
AcpiOsRedirectOutput (FNode->File);
AcpiGbl_CurrentFilename = FNode->Filename;
AcpiOsRedirectOutput (FNode->File);
AcpiGbl_CurrentFilename = FNode->Filename;
}
}

View File

@ -912,7 +912,6 @@ CvCaptureCommentsOnly (
/* Not a valid comment option. Revert the AML */
Aml -= 2;
goto DefBlock;
} /* End switch statement */

View File

@ -161,7 +161,7 @@ static char VersionString[9];
/* Local prototypes */
static ACPI_STATUS
void
DtInitialize (
void);
@ -196,16 +196,12 @@ DtDoCompile (
ACPI_STATUS Status;
UINT8 Event;
DT_FIELD *FieldList;
ASL_GLOBAL_FILE_NODE *FileNode;
/* Initialize globals */
Status = DtInitialize ();
if (ACPI_FAILURE (Status))
{
printf ("Error during compiler initialization, 0x%X\n", Status);
return (Status);
}
DtInitialize ();
/* Preprocessor */
@ -223,13 +219,29 @@ DtDoCompile (
}
}
/*
* Scan the input file (file is already open) and
* build the parse tree
*/
Event = UtBeginEvent ("Scan and parse input file");
FieldList = DtScanFile (AslGbl_Files[ASL_FILE_INPUT].Handle);
UtEndEvent (Event);
/* Compile the parse tree */
if (AslGbl_DtLexBisonPrototype)
{
Event = UtBeginEvent ("Parse data table in prototype mode");
DtCompilerInitLexer (AslGbl_Files[ASL_FILE_INPUT].Handle);
DtCompilerParserparse ();
FieldList = AslGbl_FieldList;
DtCompilerTerminateLexer ();
UtEndEvent (Event);
}
else
{
/*
* Scan the input file (file is already open) and
* build the parse tree
*/
Event = UtBeginEvent ("Scan and parse input file");
FieldList = DtScanFile (AslGbl_Files[ASL_FILE_INPUT].Handle);
UtEndEvent (Event);
}
/* Did the parse tree get successfully constructed? */
@ -245,14 +257,30 @@ DtDoCompile (
Event = UtBeginEvent ("Compile parse tree");
/*
* Compile the parse tree
*/
Status = DtCompileDataTable (&FieldList);
UtEndEvent (Event);
FileNode = FlGetCurrentFileNode ();
if (!FileNode)
{
fprintf (stderr, "Summary for %s could not be generated",
AslGbl_Files[ASL_FILE_INPUT].Filename);
}
else
{
FileNode->TotalLineCount = AslGbl_CurrentLineNumber;
FileNode->OriginalInputFileSize = AslGbl_InputByteCount;
DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n",
FileNode->TotalLineCount, FileNode->OriginalInputFileSize);
}
if (ACPI_FAILURE (Status))
{
if (FileNode)
{
FileNode->ParserErrorDetected = TRUE;
}
/* TBD: temporary error message. Msgs should come from function above */
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
@ -276,6 +304,14 @@ DtDoCompile (
HxDoHexOutput ();
DtWriteTableToListing ();
/* Save the compile time statistics to the current file node */
if (FileNode)
{
FileNode->TotalFields = AslGbl_InputFieldCount;
FileNode->OutputByteLength = AslGbl_TableLength;
}
return (Status);
}
@ -293,25 +329,12 @@ DtDoCompile (
*
*****************************************************************************/
static ACPI_STATUS
void
DtInitialize (
void)
{
ACPI_STATUS Status;
Status = AcpiOsInitialize ();
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiUtInitGlobals ();
if (ACPI_FAILURE (Status))
{
return (Status);
}
AcpiUtSetIntegerWidth (2); /* Set width to 64 bits */
AslGbl_FieldList = NULL;
@ -319,7 +342,7 @@ DtInitialize (
AslGbl_SubtableStack = NULL;
sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);
return (AE_OK);
return;
}
@ -552,7 +575,7 @@ DtCompileTable (
ACPI_STATUS Status = AE_OK;
if (!Field)
if (!Field || !Info)
{
return (AE_BAD_PARAMETER);
}
@ -623,6 +646,14 @@ DtCompileTable (
FieldType = DtGetFieldType (Info);
AslGbl_InputFieldCount++;
if (FieldType != DT_FIELD_TYPE_INLINE_SUBTABLE &&
strcmp (Info->Name, LocalField->Name))
{
sprintf (AslGbl_MsgBuffer, "found \"%s\" expected \"%s\"",
LocalField->Name, Info->Name);
DtError (ASL_ERROR, ASL_MSG_INVALID_LABEL, LocalField, AslGbl_MsgBuffer);
}
switch (FieldType)
{
case DT_FIELD_TYPE_FLAGS_INTEGER:

View File

@ -194,7 +194,7 @@ typedef struct dt_field
{
char *Name; /* Field name (from name : value) */
char *Value; /* Field value (from name : value) */
UINT32 StringLength;/* Length of 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 */
@ -210,6 +210,17 @@ typedef struct dt_field
#define DT_FIELD_NOT_ALLOCATED 1
/*
* Structure used for each individual key or value
*/
typedef struct dt_table_unit
{
char *Value; /* Field value (from name : value) */
UINT32 Line; /* Line number for this field */
UINT32 Column; /* Start column for field value */
} DT_TABLE_UNIT;
/*
* Structure used for individual subtables within an ACPI table
@ -256,6 +267,10 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_LabelList, NULL);
DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_CurrentTableOffset, 0);
/* Data table compiler Flex/Bison prototype */
DT_EXTERN BOOLEAN DT_INIT_GLOBAL (AslGbl_DtLexBisonPrototype, FALSE);
/* Local caches */
DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_SubtableCount, 0);
@ -425,12 +440,45 @@ DtCompileFlag (
ACPI_DMTABLE_INFO *Info);
/* dtfield - DT_FIELD operations */
void
DtLinkField (
DT_FIELD *Field);
void
DtCreateField (
DT_TABLE_UNIT *FieldKey,
DT_TABLE_UNIT *FieldValue,
UINT32 Offset);
DT_TABLE_UNIT *
DtCreateTableUnit (
char *Data,
UINT32 Line,
UINT32 Column);
/* dtparser - lex/yacc files */
UINT64 DtCompilerParserResult; /* Expression return value */
int
DtCompilerParserparse (
void);
UINT64
DtEvaluateExpression (
char *ExprString);
void
DtCompilerInitLexer (
FILE *inFile);
void
DtCompilerTerminateLexer (
void);
int
DtInitLexer (
char *String);

View File

@ -0,0 +1,294 @@
%{
/******************************************************************************
*
* Module Name: dtcompilerparser.l - Flex input file for table compiler lexer
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "dtcompilerparser.y.h"
YYSTYPE DtCompilerlval;
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("dtcompilerscanner")
/* handle locations */
int DtCompilerParsercolumn = 1;
int DtLabelByteOffset = 0;
int DtCompilerParserByteOffset = 0;
UINT32 DtTokenFirstLine = 0;
UINT32 DtTokenFirstColumn = 0;
#define YY_USER_ACTION \
DtTokenFirstLine = DtCompilerParserlineno; \
DtTokenFirstColumn = DtCompilerParsercolumn; \
DtCompilerParsercolumn += DtCompilerParserleng; \
DtCompilerParserByteOffset += DtCompilerParserleng; \
DbgPrint (ASL_PARSE_OUTPUT,\
"user action occurred. DtCompilerParserlloc.first_line: %u\n",\
DtTokenFirstLine);
%}
%option nounput noinput yylineno
/* Indicates a state used for parsing multiline C comments */
%x ML_COMMENT
%x DATA_STATE
WhiteSpace [ \t\v\r]+
NewLines [\n]+
/* Avoid ", \n, and [] as a part of label name. These are not valid characters of a label name */
LabelName [^ ":\n\[\]]([^":\n\[\]]*[^" :\n\[\]])?
/* Avoid ", \n, \\, and [] as a part of data. These are not valid characters of data */
Data [^ \\":\n\[\]]([^":\n\[\]\\]*[^" :\n\[\]\\])?
Text [^ ":\n][^":\n]*
Comment \[[^\n\[\]]*\]
CommentField {LabelName}{WhiteSpace}*:{WhiteSpace}{Comment}?$
%%
<DATA_STATE>{WhiteSpace}"\\\n" {
DbgPrint(ASL_PARSE_OUTPUT,"Continuation matched\n");
return (DT_PARSEOP_LINE_CONTINUATION);
}
":" {
DbgPrint(ASL_PARSE_OUTPUT, ": Matched\n");
BEGIN (DATA_STATE);
return (':');
}
<INITIAL,DATA_STATE>{WhiteSpace} { DbgPrint(ASL_PARSE_OUTPUT,"Whitespace matched\n"); }
<INITIAL,DATA_STATE>{Comment} { DbgPrint(ASL_PARSE_OUTPUT,"Comment matched\n"); }
"/*" { BEGIN (ML_COMMENT); }
<ML_COMMENT>"*/" { BEGIN (INITIAL); }
<ML_COMMENT>"*/\n" { BEGIN (INITIAL); }
<ML_COMMENT>([^*]|\n)+|. /* Ignore */
"//".* /* Ignore */
<DATA_STATE>{Data} {
char *s;
int size = strlen (DtCompilerParsertext);
s=UtLocalCacheCalloc (size + 1);
AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1);
DtCompilerParserlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "Data: %s\n", s);
return (DT_PARSEOP_DATA);
}
{CommentField} /* ignore */
{LabelName} {
char *s;
int size = strlen (DtCompilerParsertext);
s=UtLocalCacheCalloc (size + 1);
AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1);
DtCompilerParserlval.u = (DT_TABLE_UNIT *) UtLocalCacheCalloc (sizeof (DT_TABLE_UNIT));
DtCompilerParserlval.u->Value = s;
DtCompilerParserlval.u->Line = DtCompilerParserlineno;
DtCompilerParserlval.u->Column = DtCompilerParsercolumn;
DtLabelByteOffset = DtCompilerParserByteOffset;
DbgPrint (ASL_PARSE_OUTPUT, "Label: %s\n", s);
return (DT_PARSEOP_LABEL);
}
<DATA_STATE>\"{Text}?\" { // remove outer quotes from the string, they are unnecessary
char *s;
int size = strlen (DtCompilerParsertext);
s=UtLocalCacheCalloc (size - 1);
AcpiUtSafeStrncpy (s, DtCompilerParsertext + 1, size - 1);
DtCompilerParserlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "String Data: %s\n", s);
BEGIN (INITIAL);
return (DT_PARSEOP_STRING_DATA);
}
<INITIAL,DATA_STATE>{NewLines} {
DbgPrint(ASL_PARSE_OUTPUT,
"Newline matched (data state). Current line number: %u\n",DtCompilerParserlineno);
BEGIN (INITIAL); DtCompilerParsercolumn = 1;
}
%%
/*
* Local support functions
*/
void
DtCompilerInitLexer (
FILE *inFile)
{
yyin = inFile;
}
void
DtCompilerTerminateLexer (
void)
{
/*
* Flex/Bison increments the lineno for the EOF so decrement by 1 to get
* the correct number of lines.
*/
AslGbl_CurrentLineNumber = DtCompilerParserlineno - 1;
AslGbl_InputByteCount = DtCompilerParserByteOffset;
}

View File

@ -0,0 +1,285 @@
%{
/******************************************************************************
*
* Module Name: dtcompilerparser.y - Bison input file for table compiler parser
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT DT_COMPILER
ACPI_MODULE_NAME ("dtcompilerparser")
void * AslLocalAllocate (unsigned int Size);
/* Bison/yacc configuration */
#undef alloca
#define alloca AslLocalAllocate
int DtCompilerParserlex (void);
int DtCompilerParserparse (void);
void DtCompilerParsererror (char const *msg);
extern char *DtCompilerParsertext;
extern DT_FIELD *AslGbl_CurrentField;
extern int DtLabelByteOffset;
extern UINT64 DtCompilerParserResult; /* Expression return value */
extern UINT64 DtCompilerParserlineno; /* Current line number */
extern UINT32 DtTokenFirstLine;
extern UINT32 DtTokenFirstColumn;
/* Bison/yacc configuration */
#define yytname DtCompilerParsername
#define YYDEBUG 1 /* Enable debug output */
#define YYERROR_VERBOSE 1 /* Verbose error messages */
#define YYFLAG -32768
/* Define YYMALLOC/YYFREE to prevent redefinition errors */
#define YYMALLOC malloc
#define YYFREE free
%}
%union {
char *s;
DT_FIELD *f;
DT_TABLE_UNIT *u;
}
%type <f> Table
%token <u> DT_PARSEOP_DATA
%token <u> DT_PARSEOP_LABEL
%token <u> DT_PARSEOP_STRING_DATA
%token <u> DT_PARSEOP_LINE_CONTINUATION
%type <u> Data
%type <u> Datum
%type <u> MultiLineData
%type <u> MultiLineDataList
%%
Table
:
FieldList { }
;
FieldList
: Field FieldList
| Field
;
Field
: DT_PARSEOP_LABEL ':' Data { DtCreateField ($1, $3, DtLabelByteOffset); }
;
Data
: MultiLineDataList { $$ = $1; }
| Datum { $$ = $1; }
| Datum MultiLineDataList { $$ = $1; } /* combine the string with strcat */
;
MultiLineDataList
: MultiLineDataList MultiLineData { $$ = DtCreateTableUnit (AcpiUtStrcat(AcpiUtStrcat($1->Value, " "), $2->Value), $1->Line, $1->Column); } /* combine the strings with strcat */
| MultiLineData { $$ = $1; }
;
MultiLineData
: DT_PARSEOP_LINE_CONTINUATION Datum { DbgPrint (ASL_PARSE_OUTPUT, "line continuation detected\n"); $$ = $2; }
;
Datum
: DT_PARSEOP_DATA {
DbgPrint (ASL_PARSE_OUTPUT, "parser data: [%s]\n", DtCompilerParserlval.s);
$$ = DtCreateTableUnit (AcpiUtStrdup(DtCompilerParserlval.s), DtTokenFirstLine, DtTokenFirstColumn);
}
| DT_PARSEOP_STRING_DATA {
DbgPrint (ASL_PARSE_OUTPUT, "parser string data: [%s]\n", DtCompilerParserlval.s);
$$ = DtCreateTableUnit (AcpiUtStrdup(DtCompilerParserlval.s), DtTokenFirstLine, DtTokenFirstColumn);
}
;
%%
/*
* Local support functions, including parser entry point
*/
/******************************************************************************
*
* FUNCTION: DtCompilerParsererror
*
* PARAMETERS: Message - Parser-generated error message
*
* RETURN: None
*
* DESCRIPTION: Handler for parser errors
*
*****************************************************************************/
void
DtCompilerParsererror (
char const *Message)
{
DtError (ASL_ERROR, ASL_MSG_SYNTAX,
AslGbl_CurrentField, (char *) Message);
}
int
DtCompilerParserwrap(void)
{
return (1);
}

View File

@ -280,7 +280,9 @@ DtCompileString (
if (Length > ByteLength)
{
sprintf (AslGbl_MsgBuffer, "Maximum %u characters", ByteLength);
sprintf (AslGbl_MsgBuffer,
"Maximum %u characters, found %u characters [%s]",
ByteLength, Length, Field->Value);
DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, AslGbl_MsgBuffer);
Length = ByteLength;
}
@ -574,6 +576,14 @@ DtCompileBuffer (
StringValue = DtNormalizeBuffer (StringValue, &Count);
Substring = StringValue;
if (Count != ByteLength)
{
sprintf(AslGbl_MsgBuffer,
"Found %u values, must match expected count: %u",
Count, ByteLength);
DtError (ASL_ERROR, ASL_MSG_BUFFER_LIST, Field, AslGbl_MsgBuffer);
goto Exit;
}
/* Each element of StringValue is now three chars (2 hex + 1 space) */
@ -719,3 +729,122 @@ DtCompileFlag (
*Buffer |= (UINT8) (Value << BitPosition);
}
/******************************************************************************
*
* FUNCTION: DtCreateField
*
* PARAMETERS: Name
* Value
* Line
* Offset
* Column
* NameColumn
*
* RETURN: None
*
* DESCRIPTION: Create a field
*
*****************************************************************************/
void
DtCreateField (
DT_TABLE_UNIT *FieldKey,
DT_TABLE_UNIT *FieldValue,
UINT32 Offset)
{
DT_FIELD *Field = UtFieldCacheCalloc ();
Field->StringLength = 0;
if (FieldKey->Value)
{
Field->Name =
strcpy (UtLocalCacheCalloc (strlen (FieldKey->Value) + 1), FieldKey->Value);
}
if (FieldValue->Value)
{
Field->StringLength = strlen (FieldValue->Value);
Field->Value =
strcpy (UtLocalCacheCalloc (Field->StringLength + 1), FieldValue->Value);
}
Field->Line = FieldValue->Line;
Field->ByteOffset = Offset;
Field->NameColumn = FieldKey->Column;
Field->Column = FieldValue->Column;
DtLinkField (Field);
DtDumpFieldList (AslGbl_FieldList);
}
/******************************************************************************
*
* FUNCTION: DtCreateTableUnit
*
* PARAMETERS: Data
* Line
* Column
*
* RETURN: a table unit
*
* DESCRIPTION: Create a table unit
*
*****************************************************************************/
DT_TABLE_UNIT *
DtCreateTableUnit (
char *Data,
UINT32 Line,
UINT32 Column)
{
DT_TABLE_UNIT *Unit = (DT_TABLE_UNIT *) UtFieldCacheCalloc ();
Unit->Value = Data;
Unit->Line = Line;
Unit->Column = Column;
return (Unit);
}
/******************************************************************************
*
* FUNCTION: DtLinkField
*
* PARAMETERS: Field - New field object to link
*
* RETURN: None
*
* DESCRIPTION: Link one field name and value to the list
*
*****************************************************************************/
void
DtLinkField (
DT_FIELD *Field)
{
DT_FIELD *Prev;
DT_FIELD *Next;
Prev = Next = AslGbl_FieldList;
while (Next)
{
Prev = Next;
Next = Next->Next;
}
if (Prev)
{
Prev->Next = Field;
}
else
{
AslGbl_FieldList = Field;
}
}

View File

@ -162,10 +162,6 @@ static char *
DtTrim (
char *String);
static void
DtLinkField (
DT_FIELD *Field);
static ACPI_STATUS
DtParseLine (
char *LineBuffer,
@ -297,45 +293,6 @@ DtTrim (
}
/******************************************************************************
*
* FUNCTION: DtLinkField
*
* PARAMETERS: Field - New field object to link
*
* RETURN: None
*
* DESCRIPTION: Link one field name and value to the list
*
*****************************************************************************/
static void
DtLinkField (
DT_FIELD *Field)
{
DT_FIELD *Prev;
DT_FIELD *Next;
Prev = Next = AslGbl_FieldList;
while (Next)
{
Prev = Next;
Next = Next->Next;
}
if (Prev)
{
Prev->Next = Field;
}
else
{
AslGbl_FieldList = Field;
}
}
/******************************************************************************
*
* FUNCTION: DtParseLine
@ -787,7 +744,6 @@ DtGetNextLine (
case '\n':
CurrentLineOffset = AslGbl_NextLineOffset;
AslGbl_NextLineOffset = (UINT32) ftell (Handle);
AslGbl_CurrentLineNumber++;
break;
@ -829,7 +785,6 @@ DtGetNextLine (
/* Ignore newline, this will merge the lines */
CurrentLineOffset = AslGbl_NextLineOffset;
AslGbl_NextLineOffset = (UINT32) ftell (Handle);
AslGbl_CurrentLineNumber++;
State = DT_NORMAL_TEXT;
@ -1117,7 +1072,7 @@ DtDumpSubtableInfo (
{
DbgPrint (ASL_DEBUG_OUTPUT,
"[%.04X] %24s %.08X %.08X %.08X %.08X %.08X %p %p %p\n",
"[%.04X] %24s %.08X %.08X %.08X %.08X %p %p %p %p\n",
Subtable->Depth, Subtable->Name, Subtable->Length, Subtable->TotalLength,
Subtable->SizeOfLengthField, Subtable->Flags, Subtable,
Subtable->Parent, Subtable->Child, Subtable->Peer);
@ -1131,7 +1086,7 @@ DtDumpSubtableTree (
{
DbgPrint (ASL_DEBUG_OUTPUT,
"[%.04X] %24s %*s%08X (%.02X) - (%.02X)\n",
"[%.04X] %24s %*s%p (%.02X) - (%.02X)\n",
Subtable->Depth, Subtable->Name, (4 * Subtable->Depth), " ",
Subtable, Subtable->Length, Subtable->TotalLength);
}
@ -1225,7 +1180,7 @@ DtWriteFieldToListing (
if (strlen (Field->Value) > 64)
{
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "...Additional data, length 0x%X\n",
strlen (Field->Value));
(UINT32) strlen (Field->Value));
}
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");

View File

@ -227,7 +227,6 @@ int
DtInitLexer (
char *String)
{
LexBuffer = yy_scan_string (String);
return (LexBuffer == NULL);
}
@ -236,6 +235,5 @@ void
DtTerminateLexer (
void)
{
yy_delete_buffer (LexBuffer);
}

View File

@ -1474,13 +1474,14 @@ DtCompileSdev (
Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
Namesp->VendorDataLength =
(UINT16) Subtable->Length;
/* Final size of entire namespace structure */
SdevHeader->Length = (UINT16)(sizeof(ACPI_SDEV_NAMESPACE) +
Subtable->Length + Namesp->DeviceIdLength);
}
}
/* Final size of entire namespace structure */
SdevHeader->Length = (UINT16) (sizeof (ACPI_SDEV_NAMESPACE) +
Subtable->Length + Namesp->DeviceIdLength);
break;
case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
@ -1620,7 +1621,9 @@ DtCompileSlit (
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *FieldList;
DT_FIELD *EndOfFieldList = NULL;
UINT32 Localities;
UINT32 LocalityListLength;
UINT8 *LocalityBuffer;
@ -1636,6 +1639,7 @@ DtCompileSlit (
Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
LocalityBuffer = UtLocalCalloc (Localities);
LocalityListLength = 0;
/* Compile each locality buffer */
@ -1645,11 +1649,22 @@ DtCompileSlit (
DtCompileBuffer (LocalityBuffer,
FieldList->Value, FieldList, Localities);
LocalityListLength++;
DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
DtInsertSubtable (ParentTable, Subtable);
EndOfFieldList = FieldList;
FieldList = FieldList->Next;
}
if (LocalityListLength != Localities)
{
sprintf(AslGbl_MsgBuffer,
"Found %u entries, must match LocalityCount: %u",
LocalityListLength, Localities);
DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer);
return (AE_LIMIT);
}
ACPI_FREE (LocalityBuffer);
return (AE_OK);
}

View File

@ -509,7 +509,7 @@ DtCreateOneTemplate (
AcpiUtStrlwr (DisasmFilename);
if (!UtQueryForOverwrite (DisasmFilename))
{
return (AE_ERROR);
return (AE_OK);
}
File = fopen (DisasmFilename, "w+");

View File

@ -223,7 +223,7 @@ PrAddDefine (
DefineInfo = PrMatchDefine (Identifier);
if (DefineInfo)
{
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID,
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
"#define: name already exists: %s\n",
AslGbl_CurrentLineNumber, Identifier);

View File

@ -850,7 +850,7 @@ PrDoDirective (
DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
"Start #include file \"%s\"\n", AslGbl_CurrentLineNumber,
Token, AslGbl_CurrentLineNumber);
Token);
PrDoIncludeFile (Token);
break;
@ -1356,7 +1356,7 @@ PrDoIncludeBuffer (
{
if (!(i % 8))
{
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ", c);
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ");
}
FlPrintFile (ASL_FILE_PREPROCESSOR, " 0x%2.2X,", c);
@ -1369,6 +1369,6 @@ PrDoIncludeBuffer (
/* Close the Name() operator */
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n", BufferName);
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n");
fclose (BinaryBufferFile);
}

View File

@ -274,6 +274,10 @@ AcpiDbConvertToBuffer (
ACPI_STATUS Status;
/* Skip all preceding white space*/
AcpiUtRemoveWhitespace (&String);
/* Generate the final buffer length */
for (i = 0, Length = 0; String[i];)

View File

@ -713,7 +713,6 @@ AcpiDbDisplayResults (
return;
}
ObjDesc = WalkState->MethodDesc;
Node = WalkState->MethodNode;
if (WalkState->Results)
@ -773,7 +772,6 @@ AcpiDbDisplayCallingTree (
return;
}
Node = WalkState->MethodNode;
AcpiOsPrintf ("Current Control Method Call Tree\n");
while (WalkState)

View File

@ -253,7 +253,7 @@ AcpiDbLoadTables (
{
Table = TableListHead->Table;
Status = AcpiLoadTable (Table);
Status = AcpiLoadTable (Table, NULL);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)

View File

@ -284,7 +284,7 @@ AcpiDbDisplayHistory (
{
if (AcpiGbl_HistoryBuffer[HistoryIndex].Command)
{
AcpiOsPrintf ("%3ld %s\n",
AcpiOsPrintf ("%3u %s\n",
AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum,
AcpiGbl_HistoryBuffer[HistoryIndex].Command);
}

View File

@ -208,6 +208,7 @@ enum AcpiExDebuggerCommands
CMD_EVALUATE,
CMD_EXECUTE,
CMD_EXIT,
CMD_FIELDS,
CMD_FIND,
CMD_GO,
CMD_HANDLERS,
@ -287,6 +288,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"EVALUATE", 1},
{"EXECUTE", 1},
{"EXIT", 0},
{"FIELDS", 1},
{"FIND", 1},
{"GO", 0},
{"HANDLERS", 0},
@ -360,6 +362,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{1, " Find <AcpiName> (? is wildcard)", "Find ACPI name(s) with wildcards\n"},
{1, " Integrity", "Validate namespace integrity\n"},
{1, " Methods", "Display list of loaded control methods\n"},
{1, " Fields <AddressSpaceId>", "Display list of loaded field units by space ID\n"},
{1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"},
{1, " Notify <Object> <Value>", "Send a notification on Object\n"},
{1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"},
@ -683,6 +686,22 @@ AcpiDbGetNextToken (
}
break;
case '{':
/* This is the start of a field unit, scan until closing brace */
String++;
Start = String;
Type = ACPI_TYPE_FIELD_UNIT;
/* Find end of buffer */
while (*String && (*String != '}'))
{
String++;
}
break;
case '[':
/* This is the start of a package, scan until closing bracket */
@ -785,7 +804,7 @@ AcpiDbGetLine (
{
AcpiOsPrintf (
"Buffer overflow while parsing input line (max %u characters)\n",
sizeof (AcpiGbl_DbParsedBuf));
(UINT32) sizeof (AcpiGbl_DbParsedBuf));
return (0);
}
@ -877,6 +896,7 @@ AcpiDbCommandDispatch (
ACPI_PARSE_OBJECT *Op)
{
UINT32 Temp;
UINT64 Temp64;
UINT32 CommandIndex;
UINT32 ParamCount;
char *CommandLine;
@ -894,7 +914,6 @@ AcpiDbCommandDispatch (
ParamCount = AcpiDbGetLine (InputBuffer);
CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]);
Temp = 0;
/*
* We don't want to add the !! command to the history buffer. It
@ -993,6 +1012,21 @@ AcpiDbCommandDispatch (
Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]);
break;
case CMD_FIELDS:
Status = AcpiUtStrtoul64 (AcpiGbl_DbArgs[1], &Temp64);
if (ACPI_FAILURE (Status) || Temp64 >= ACPI_NUM_PREDEFINED_REGIONS)
{
AcpiOsPrintf (
"Invalid adress space ID: must be between 0 and %u inclusive\n",
ACPI_NUM_PREDEFINED_REGIONS - 1);
return (AE_OK);
}
Status = AcpiDbDisplayFields ((UINT32) Temp64);
break;
case CMD_GO:
AcpiGbl_CmSingleStep = FALSE;
@ -1060,10 +1094,10 @@ AcpiDbCommandDispatch (
if (ParamCount == 0)
{
AcpiOsPrintf (
"Current debug level for file output is: %8.8lX\n",
"Current debug level for file output is: %8.8X\n",
AcpiGbl_DbDebugLevel);
AcpiOsPrintf (
"Current debug level for console output is: %8.8lX\n",
"Current debug level for console output is: %8.8X\n",
AcpiGbl_DbConsoleDebugLevel);
}
else if (ParamCount == 2)
@ -1072,7 +1106,7 @@ AcpiDbCommandDispatch (
AcpiGbl_DbConsoleDebugLevel =
strtoul (AcpiGbl_DbArgs[1], NULL, 16);
AcpiOsPrintf (
"Debug Level for console output was %8.8lX, now %8.8lX\n",
"Debug Level for console output was %8.8X, now %8.8X\n",
Temp, AcpiGbl_DbConsoleDebugLevel);
}
else
@ -1080,7 +1114,7 @@ AcpiDbCommandDispatch (
Temp = AcpiGbl_DbDebugLevel;
AcpiGbl_DbDebugLevel = strtoul (AcpiGbl_DbArgs[1], NULL, 16);
AcpiOsPrintf (
"Debug Level for file output was %8.8lX, now %8.8lX\n",
"Debug Level for file output was %8.8X, now %8.8X\n",
Temp, AcpiGbl_DbDebugLevel);
}
break;

View File

@ -493,6 +493,11 @@ AcpiDbDisassembleMethod (
}
Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
if (ACPI_FAILURE(Status))
{
return (Status);
}
WalkState->OwnerId = ObjDesc->Method.OwnerId;
/* Push start scope on scope stack and make it current */
@ -510,6 +515,11 @@ AcpiDbDisassembleMethod (
WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
Status = AcpiPsParseAml (WalkState);
if (ACPI_FAILURE(Status))
{
return (Status);
}
(void) AcpiDmParseDeferredOps (Op);
/* Now we can disassemble the method */

View File

@ -154,6 +154,7 @@
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdebug.h>
#include <contrib/dev/acpica/include/acpredef.h>
#include <contrib/dev/acpica/include/acinterp.h>
#define _COMPONENT ACPI_CA_DEBUGGER
@ -722,6 +723,91 @@ AcpiDbWalkForObjectCounts (
}
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForFields
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Display short info about objects in the namespace
*
******************************************************************************/
static ACPI_STATUS
AcpiDbWalkForFields (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_OBJECT *RetValue;
ACPI_REGION_WALK_INFO *Info = (ACPI_REGION_WALK_INFO *) Context;
ACPI_BUFFER Buffer;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node = AcpiNsValidateHandle (ObjHandle);
if (!Node)
{
return (AE_OK);
}
if (Node->Object->Field.RegionObj->Region.SpaceId != Info->AddressSpaceId)
{
return (AE_OK);
}
Info->Count++;
/* Get and display the full pathname to this object */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
return (AE_OK);
}
AcpiOsPrintf ("%s ", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
AcpiEvaluateObject (ObjHandle, NULL, NULL, &Buffer);
/*
* Since this is a field unit, surround the output in braces
*/
AcpiOsPrintf ("{");
RetValue = (ACPI_OBJECT *) Buffer.Pointer;
switch (RetValue->Type)
{
case ACPI_TYPE_INTEGER:
AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (RetValue->Integer.Value));
break;
case ACPI_TYPE_BUFFER:
AcpiUtDumpBuffer (RetValue->Buffer.Pointer,
RetValue->Buffer.Length, DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0);
break;
default:
break;
}
AcpiOsPrintf ("}\n");
ACPI_FREE (Buffer.Pointer);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForSpecificObjects
@ -857,6 +943,42 @@ AcpiDbDisplayObjects (
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayFields
*
* PARAMETERS: ObjTypeArg - Type of object to display
* DisplayCountArg - Max depth to display
*
* RETURN: None
*
* DESCRIPTION: Display objects in the namespace of the requested type
*
******************************************************************************/
ACPI_STATUS
AcpiDbDisplayFields (
UINT32 AddressSpaceId)
{
ACPI_REGION_WALK_INFO Info;
Info.Count = 0;
Info.OwnerId = ACPI_OWNER_ID_MAX;
Info.DebugLevel = ACPI_UINT32_MAX;
Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
Info.AddressSpaceId = AddressSpaceId;
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (ACPI_TYPE_LOCAL_REGION_FIELD, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiDbWalkForFields, NULL,
(void *) &Info, NULL);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbIntegrityWalk

View File

@ -567,7 +567,6 @@ AcpiDbDecodeLocals (
Node = WalkState->MethodNode;
ObjDesc = WalkState->MethodDesc;
/* There are no locals for the module-level code case */
@ -650,7 +649,6 @@ AcpiDbDecodeArguments (
Node = WalkState->MethodNode;
ObjDesc = WalkState->MethodDesc;
/* There are no arguments for the module-level code case */

View File

@ -544,14 +544,14 @@ AcpiDbDisplayStatistics (
for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++)
{
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
AcpiOsPrintf ("%16.16s %10u %10u\n", AcpiUtGetTypeName (i),
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
}
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
AcpiOsPrintf ("%16.16s %10u %10u\n", "Misc/Unknown",
AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc);
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
AcpiOsPrintf ("%16.16s %10u %10u\n", "TOTALS:",
AcpiGbl_NumNodes, AcpiGbl_NumObjects);
break;
@ -577,17 +577,15 @@ AcpiDbDisplayStatistics (
case CMD_STAT_MISC:
AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n");
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n",
AcpiOsPrintf ("%-28s: %7u\n", "Calls to AcpiPsFind",
AcpiGbl_PsFindCount);
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n",
AcpiOsPrintf ("%-28s: %7u\n", "Calls to AcpiNsLookup",
AcpiGbl_NsLookupCount);
AcpiOsPrintf ("\n");
AcpiOsPrintf ("Mutex usage:\n\n");
AcpiOsPrintf ("\nMutex usage:\n\n");
for (i = 0; i < ACPI_NUM_MUTEX; i++)
{
AcpiOsPrintf ("%-28s: % 7ld\n",
AcpiOsPrintf ("%-28s: %7u\n",
AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount);
}
break;
@ -596,50 +594,50 @@ AcpiDbDisplayStatistics (
AcpiOsPrintf ("\nInternal object sizes:\n\n");
AcpiOsPrintf ("Common %3d\n", sizeof (ACPI_OBJECT_COMMON));
AcpiOsPrintf ("Number %3d\n", sizeof (ACPI_OBJECT_INTEGER));
AcpiOsPrintf ("String %3d\n", sizeof (ACPI_OBJECT_STRING));
AcpiOsPrintf ("Buffer %3d\n", sizeof (ACPI_OBJECT_BUFFER));
AcpiOsPrintf ("Package %3d\n", sizeof (ACPI_OBJECT_PACKAGE));
AcpiOsPrintf ("BufferField %3d\n", sizeof (ACPI_OBJECT_BUFFER_FIELD));
AcpiOsPrintf ("Device %3d\n", sizeof (ACPI_OBJECT_DEVICE));
AcpiOsPrintf ("Event %3d\n", sizeof (ACPI_OBJECT_EVENT));
AcpiOsPrintf ("Method %3d\n", sizeof (ACPI_OBJECT_METHOD));
AcpiOsPrintf ("Mutex %3d\n", sizeof (ACPI_OBJECT_MUTEX));
AcpiOsPrintf ("Region %3d\n", sizeof (ACPI_OBJECT_REGION));
AcpiOsPrintf ("PowerResource %3d\n", sizeof (ACPI_OBJECT_POWER_RESOURCE));
AcpiOsPrintf ("Processor %3d\n", sizeof (ACPI_OBJECT_PROCESSOR));
AcpiOsPrintf ("ThermalZone %3d\n", sizeof (ACPI_OBJECT_THERMAL_ZONE));
AcpiOsPrintf ("RegionField %3d\n", sizeof (ACPI_OBJECT_REGION_FIELD));
AcpiOsPrintf ("BankField %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD));
AcpiOsPrintf ("IndexField %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD));
AcpiOsPrintf ("Reference %3d\n", sizeof (ACPI_OBJECT_REFERENCE));
AcpiOsPrintf ("Notify %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
AcpiOsPrintf ("AddressSpace %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
AcpiOsPrintf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA));
AcpiOsPrintf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA));
AcpiOsPrintf ("Common %3d\n", (UINT32) sizeof (ACPI_OBJECT_COMMON));
AcpiOsPrintf ("Number %3d\n", (UINT32) sizeof (ACPI_OBJECT_INTEGER));
AcpiOsPrintf ("String %3d\n", (UINT32) sizeof (ACPI_OBJECT_STRING));
AcpiOsPrintf ("Buffer %3d\n", (UINT32) sizeof (ACPI_OBJECT_BUFFER));
AcpiOsPrintf ("Package %3d\n", (UINT32) sizeof (ACPI_OBJECT_PACKAGE));
AcpiOsPrintf ("BufferField %3d\n", (UINT32) sizeof (ACPI_OBJECT_BUFFER_FIELD));
AcpiOsPrintf ("Device %3d\n", (UINT32) sizeof (ACPI_OBJECT_DEVICE));
AcpiOsPrintf ("Event %3d\n", (UINT32) sizeof (ACPI_OBJECT_EVENT));
AcpiOsPrintf ("Method %3d\n", (UINT32) sizeof (ACPI_OBJECT_METHOD));
AcpiOsPrintf ("Mutex %3d\n", (UINT32) sizeof (ACPI_OBJECT_MUTEX));
AcpiOsPrintf ("Region %3d\n", (UINT32) sizeof (ACPI_OBJECT_REGION));
AcpiOsPrintf ("PowerResource %3d\n", (UINT32) sizeof (ACPI_OBJECT_POWER_RESOURCE));
AcpiOsPrintf ("Processor %3d\n", (UINT32) sizeof (ACPI_OBJECT_PROCESSOR));
AcpiOsPrintf ("ThermalZone %3d\n", (UINT32) sizeof (ACPI_OBJECT_THERMAL_ZONE));
AcpiOsPrintf ("RegionField %3d\n", (UINT32) sizeof (ACPI_OBJECT_REGION_FIELD));
AcpiOsPrintf ("BankField %3d\n", (UINT32) sizeof (ACPI_OBJECT_BANK_FIELD));
AcpiOsPrintf ("IndexField %3d\n", (UINT32) sizeof (ACPI_OBJECT_INDEX_FIELD));
AcpiOsPrintf ("Reference %3d\n", (UINT32) sizeof (ACPI_OBJECT_REFERENCE));
AcpiOsPrintf ("Notify %3d\n", (UINT32) sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
AcpiOsPrintf ("AddressSpace %3d\n", (UINT32) sizeof (ACPI_OBJECT_ADDR_HANDLER));
AcpiOsPrintf ("Extra %3d\n", (UINT32) sizeof (ACPI_OBJECT_EXTRA));
AcpiOsPrintf ("Data %3d\n", (UINT32) sizeof (ACPI_OBJECT_DATA));
AcpiOsPrintf ("\n");
AcpiOsPrintf ("ParseObject %3d\n", sizeof (ACPI_PARSE_OBJ_COMMON));
AcpiOsPrintf ("ParseObjectNamed %3d\n", sizeof (ACPI_PARSE_OBJ_NAMED));
AcpiOsPrintf ("ParseObjectAsl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL));
AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT));
AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE));
AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
AcpiOsPrintf ("ParseObject %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_COMMON));
AcpiOsPrintf ("ParseObjectNamed %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_NAMED));
AcpiOsPrintf ("ParseObjectAsl %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_ASL));
AcpiOsPrintf ("OperandObject %3d\n", (UINT32) sizeof (ACPI_OPERAND_OBJECT));
AcpiOsPrintf ("NamespaceNode %3d\n", (UINT32) sizeof (ACPI_NAMESPACE_NODE));
AcpiOsPrintf ("AcpiObject %3d\n", (UINT32) sizeof (ACPI_OBJECT));
AcpiOsPrintf ("\n");
AcpiOsPrintf ("Generic State %3d\n", sizeof (ACPI_GENERIC_STATE));
AcpiOsPrintf ("Common State %3d\n", sizeof (ACPI_COMMON_STATE));
AcpiOsPrintf ("Control State %3d\n", sizeof (ACPI_CONTROL_STATE));
AcpiOsPrintf ("Update State %3d\n", sizeof (ACPI_UPDATE_STATE));
AcpiOsPrintf ("Scope State %3d\n", sizeof (ACPI_SCOPE_STATE));
AcpiOsPrintf ("Parse Scope %3d\n", sizeof (ACPI_PSCOPE_STATE));
AcpiOsPrintf ("Package State %3d\n", sizeof (ACPI_PKG_STATE));
AcpiOsPrintf ("Thread State %3d\n", sizeof (ACPI_THREAD_STATE));
AcpiOsPrintf ("Result Values %3d\n", sizeof (ACPI_RESULT_VALUES));
AcpiOsPrintf ("Notify Info %3d\n", sizeof (ACPI_NOTIFY_INFO));
AcpiOsPrintf ("Generic State %3d\n", (UINT32) sizeof (ACPI_GENERIC_STATE));
AcpiOsPrintf ("Common State %3d\n", (UINT32) sizeof (ACPI_COMMON_STATE));
AcpiOsPrintf ("Control State %3d\n", (UINT32) sizeof (ACPI_CONTROL_STATE));
AcpiOsPrintf ("Update State %3d\n", (UINT32) sizeof (ACPI_UPDATE_STATE));
AcpiOsPrintf ("Scope State %3d\n", (UINT32) sizeof (ACPI_SCOPE_STATE));
AcpiOsPrintf ("Parse Scope %3d\n", (UINT32) sizeof (ACPI_PSCOPE_STATE));
AcpiOsPrintf ("Package State %3d\n", (UINT32) sizeof (ACPI_PKG_STATE));
AcpiOsPrintf ("Thread State %3d\n", (UINT32) sizeof (ACPI_THREAD_STATE));
AcpiOsPrintf ("Result Values %3d\n", (UINT32) sizeof (ACPI_RESULT_VALUES));
AcpiOsPrintf ("Notify Info %3d\n", (UINT32) sizeof (ACPI_NOTIFY_INFO));
break;
case CMD_STAT_STACK:

View File

@ -309,6 +309,10 @@ AcpiDmDeferredParse (
WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
Status = AcpiPsParseAml (WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS(Status);
}
StartOp = (Op->Common.Value.Arg)->Common.Next;
SearchOp = StartOp;

View File

@ -441,7 +441,6 @@ AcpiDmResourceTemplate (
* missing EndDependentDescriptor.
*/
Level--;
DependentFns = FALSE;
/* Go ahead and insert EndDependentFn() */

View File

@ -957,7 +957,6 @@ AcpiDmDescendingOp (
* the buffer size Op. Open up a new block
*/
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
NextOp = NextOp->Common.Next;
ASL_CV_CLOSE_PAREN (Op, Level);
/* Emit description comment for Name() with a predefined ACPI name */

View File

@ -235,7 +235,7 @@ AcpiDsExecBeginControlOp (
ControlState->Control.Opcode =
Op->Common.AmlOpcode;
ControlState->Control.LoopTimeout = AcpiOsGetTimer () +
(UINT64) (AcpiGbl_MaxLoopIterations * ACPI_100NSEC_PER_SEC);
((UINT64) AcpiGbl_MaxLoopIterations * ACPI_100NSEC_PER_SEC);
/* Push the control state on this walk's control stack */

View File

@ -309,7 +309,6 @@ AcpiDsCreateBufferField (
if (WalkState->DeferredNode)
{
Node = WalkState->DeferredNode;
Status = AE_OK;
}
else
{
@ -435,7 +434,6 @@ AcpiDsGetFieldNames (
ACPI_PARSE_OBJECT *Child;
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
UINT64 Value = 0;
ACPI_OPERAND_OBJECT *ResultDesc;
ACPI_OPERAND_OBJECT *ObjDesc;
char *NamePath;
@ -577,14 +575,13 @@ AcpiDsGetFieldNames (
}
#if !defined(ACPI_DB_APP) && defined(ACPI_EXEC_APP)
NamePath = AcpiNsGetExternalPathname (Info->FieldNode);
ObjDesc = AcpiUtCreateIntegerObject (Value);
if (ACPI_SUCCESS (AeLookupInitFileEntry (NamePath, &Value)))
if (ACPI_SUCCESS (AeLookupInitFileEntry (NamePath, &ObjDesc)))
{
AcpiExWriteDataToField (ObjDesc,
AcpiNsGetAttachedObject (Info->FieldNode),
&ResultDesc);
AcpiUtRemoveReference (ObjDesc);
}
AcpiUtRemoveReference (ObjDesc);
ACPI_FREE (NamePath);
#endif
}
@ -813,8 +810,6 @@ AcpiDsInitFieldObjects (
}
/* Name already exists, just ignore this error */
Status = AE_OK;
}
Arg->Common.Node = Node;

View File

@ -848,6 +848,15 @@ AcpiEvDetectGpe (
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
if (!GpeEventInfo)
{
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
goto ErrorExit;
}
}
/* Get the info block for the entire GPE register */
GpeRegisterInfo = GpeEventInfo->RegisterInfo;

View File

@ -272,6 +272,10 @@ AcpiEvDeleteGpeBlock (
/* Disable all GPEs in this block */
Status = AcpiHwDisableGpeBlock (GpeBlock->XruptBlock, GpeBlock, NULL);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
if (!GpeBlock->Previous && !GpeBlock->Next)
{
@ -542,7 +546,7 @@ AcpiEvCreateGpeBlock (
WalkInfo.GpeDevice = GpeDevice;
WalkInfo.ExecuteByOwnerId = FALSE;
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
(void) AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);

View File

@ -302,8 +302,6 @@ AcpiEvGpeInitialize (
* GPE0 and GPE1 do not have to be contiguous in the GPE number
* space. However, GPE0 always starts at GPE number zero.
*/
GpeNumberMax = AcpiGbl_FADT.Gpe1Base +
((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);
}
}
@ -315,7 +313,6 @@ AcpiEvGpeInitialize (
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
"There are no GPE blocks defined in the FADT\n"));
Status = AE_OK;
goto Cleanup;
}

View File

@ -400,11 +400,16 @@ AcpiEvTerminate (
/* Disable all GPEs in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not disable GPEs in GPE block"));
}
Status = AcpiEvRemoveGlobalLockHandler ();
if (ACPI_FAILURE(Status))
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO,
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not remove Global Lock handler"));
}
@ -414,7 +419,7 @@ AcpiEvTerminate (
/* Remove SCI handlers */
Status = AcpiEvRemoveAllSciHandlers ();
if (ACPI_FAILURE(Status))
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO,
"Could not remove SCI handler"));
@ -423,6 +428,12 @@ AcpiEvTerminate (
/* Deallocate all handler objects installed within GPE info structs */
Status = AcpiEvWalkGpeList (AcpiEvDeleteGpeHandlers, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not delete GPE handlers"));
}
/* Return to original mode if necessary */

View File

@ -1037,11 +1037,11 @@ AcpiEvOrphanEcRegMethod (
Objects[1].Type = ACPI_TYPE_INTEGER;
Objects[1].Integer.Value = ACPI_REG_CONNECT;
Status = AcpiEvaluateObject (RegMethod, NULL, &Args, NULL);
(void) AcpiEvaluateObject (RegMethod, NULL, &Args, NULL);
Exit:
/* We ignore all errors from above, don't care */
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
(void) AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
return_VOID;
}

View File

@ -363,7 +363,6 @@ AcpiEvPciConfigRegionSetup (
* root bridge. Still need to return a context object
* for the new PCI_Config operation region, however.
*/
Status = AE_OK;
}
else
{

View File

@ -875,6 +875,33 @@ AcpiGetGpeStatus (
ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
/*******************************************************************************
*
* FUNCTION: AcpiDispatchGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
*
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
*
* DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
* (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
*
******************************************************************************/
UINT32
AcpiDispatchGpe(
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_FUNCTION_TRACE(acpi_dispatch_gpe);
return (AcpiEvDetectGpe (GpeDevice, NULL, GpeNumber));
}
ACPI_EXPORT_SYMBOL (AcpiDispatchGpe)
/*******************************************************************************
*
* FUNCTION: AcpiFinishGpe

View File

@ -255,7 +255,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ParamCount), "Parameter Count"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.SyncLevel), "Sync Level"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.Mutex), "Mutex"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.OwnerId), "Owner Id"},
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Method.OwnerId), "Owner Id"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ThreadCount), "Thread Count"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Method.AmlLength), "Aml Length"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}
@ -422,8 +422,8 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET (Flags), "Flags"},
{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
{ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},

View File

@ -357,6 +357,10 @@ AcpiEnterSleepStateS4bios (
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
do {
AcpiOsStall (ACPI_USEC_PER_MSEC);

View File

@ -767,7 +767,7 @@ AcpiNsLookup (
if (Flags & ACPI_NS_PREFIX_MUST_EXIST)
{
AcpiOsPrintf (ACPI_MSG_BIOS_ERROR
"Object does not exist: %4.4s\n", &SimpleName);
"Object does not exist: %4.4s\n", (char *) &SimpleName);
}
#endif
/* Name not found in ACPI namespace */

View File

@ -423,7 +423,7 @@ AcpiNsInstallNode (
Node->Type = (UINT8) Type;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"%4.4s (%s) [Node %p Owner %X] added to %4.4s (%s) [Node %p]\n",
"%4.4s (%s) [Node %p Owner %3.3X] added to %4.4s (%s) [Node %p]\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), Node, OwnerId,
AcpiUtGetNodeName (ParentNode), AcpiUtGetTypeName (ParentNode->Type),
ParentNode));

View File

@ -670,5 +670,5 @@ AcpiNsConvertToReference (
ErrorExit:
ACPI_FREE (Name);
*ReturnObject = NewObject;
return (AE_OK);
return (Status);
}

View File

@ -381,7 +381,7 @@ AcpiNsDumpOneObject (
/* Now we can print out the pertinent information */
AcpiOsPrintf (" %-12s %p %2.2X ",
AcpiOsPrintf (" %-12s %p %3.3X ",
AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
DbgLevel = AcpiDbgLevel;
@ -478,7 +478,7 @@ AcpiNsDumpOneObject (
AcpiOsPrintf (" =");
for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
{
AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]);
}
}
AcpiOsPrintf ("\n");
@ -575,7 +575,7 @@ AcpiNsDumpOneObject (
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2X\n",
(ObjDesc->CommonField.BaseByteOffset * 8)
+ ObjDesc->CommonField.StartFieldBitOffset,
ObjDesc->CommonField.BitLength,
@ -760,8 +760,6 @@ AcpiNsDumpOneObject (
goto Cleanup;
}
ObjType = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
}
Cleanup:

View File

@ -289,7 +289,7 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
#define ACPI_FDE_FIELD_COUNT 5
#define ACPI_FDE_BYTE_BUFFER_SIZE 5
#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * sizeof (UINT32))
#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * (UINT32) sizeof (UINT32))
/******************************************************************************

View File

@ -611,7 +611,7 @@ AcpiGetObjectInfo (
if (Cls)
{
NextIdString = AcpiNsCopyDeviceId (&Info->ClassCode,
(void) AcpiNsCopyDeviceId (&Info->ClassCode,
Cls, NextIdString);
}

View File

@ -652,7 +652,7 @@ AcpiPsCompleteOp (
WalkState->Opcode = (*Op)->Common.AmlOpcode;
Status = WalkState->AscendingCallback (WalkState);
Status = AcpiPsNextParseState (WalkState, *Op, Status);
(void) AcpiPsNextParseState (WalkState, *Op, Status);
Status2 = AcpiPsCompleteThisOp (WalkState, *Op);
if (ACPI_FAILURE (Status2))
@ -661,7 +661,6 @@ AcpiPsCompleteOp (
}
}
Status = AE_OK;
break;
case AE_CTRL_BREAK:
@ -682,7 +681,7 @@ AcpiPsCompleteOp (
WalkState->Opcode = (*Op)->Common.AmlOpcode;
Status = WalkState->AscendingCallback (WalkState);
Status = AcpiPsNextParseState (WalkState, *Op, Status);
(void) AcpiPsNextParseState (WalkState, *Op, Status);
Status2 = AcpiPsCompleteThisOp (WalkState, *Op);
if (ACPI_FAILURE (Status2))
@ -690,7 +689,6 @@ AcpiPsCompleteOp (
return_ACPI_STATUS (Status2);
}
Status = AE_OK;
break;
case AE_CTRL_TERMINATE:

View File

@ -481,6 +481,10 @@ AcpiRsCreatePciRoutingTable (
Status = AcpiNsHandleToPathname (
(ACPI_HANDLE) Node, &PathBuffer, FALSE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* +1 to include null terminator */

View File

@ -973,6 +973,7 @@ AcpiTbDeleteNamespaceByOwner (
{
return_ACPI_STATUS (Status);
}
AcpiNsDeleteNamespaceByOwner (OwnerId);
AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
return_ACPI_STATUS (Status);
@ -1189,6 +1190,10 @@ AcpiTbLoadTable (
}
Status = AcpiNsLoadTable (TableIndex, ParentNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is

View File

@ -445,6 +445,8 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInstallTable)
*
* PARAMETERS: Table - Pointer to a buffer containing the ACPI
* table to be loaded.
* TableIdx - Pointer to a UINT32 for storing the table
* index, might be NULL
*
* RETURN: Status
*
@ -458,7 +460,8 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInstallTable)
ACPI_STATUS
AcpiLoadTable (
ACPI_TABLE_HEADER *Table)
ACPI_TABLE_HEADER *Table,
UINT32 *TableIdx)
{
ACPI_STATUS Status;
UINT32 TableIndex;
@ -479,6 +482,11 @@ AcpiLoadTable (
ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));
Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex);
if (TableIdx)
{
*TableIdx = TableIndex;
}
if (ACPI_SUCCESS (Status))
{
/* Complete the initialization/resolution of new objects */
@ -582,3 +590,42 @@ AcpiUnloadParentTable (
}
ACPI_EXPORT_SYMBOL (AcpiUnloadParentTable)
/*******************************************************************************
*
* FUNCTION: AcpiUnloadTable
*
* PARAMETERS: TableIndex - Index as returned by AcpiLoadTable
*
* RETURN: Status
*
* DESCRIPTION: Via the TableIndex representing an SSDT or OEMx table, unloads
* the table and deletes all namespace objects associated with
* that table. Unloading of the DSDT is not allowed.
* Note: Mainly intended to support hotplug removal of SSDTs.
*
******************************************************************************/
ACPI_STATUS
AcpiUnloadTable (
UINT32 TableIndex)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiUnloadTable);
if (TableIndex == 1)
{
/* TableIndex==1 means DSDT is the owner. DSDT cannot be unloaded */
return_ACPI_STATUS (AE_TYPE);
}
Status = AcpiTbUnloadTable (TableIndex);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiUnloadTable)

View File

@ -186,8 +186,10 @@ AcpiUtDumpBuffer (
UINT32 j;
UINT32 Temp32;
UINT8 BufChar;
UINT32 DisplayDataOnly = Display & DB_DISPLAY_DATA_ONLY;
Display &= ~DB_DISPLAY_DATA_ONLY;
if (!Buffer)
{
AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n");
@ -205,7 +207,10 @@ AcpiUtDumpBuffer (
{
/* Print current offset */
AcpiOsPrintf ("%8.4X: ", (BaseOffset + i));
if (!DisplayDataOnly)
{
AcpiOsPrintf ("%8.4X: ", (BaseOffset + i));
}
/* Print 16 hex chars */
@ -257,38 +262,41 @@ AcpiUtDumpBuffer (
* Print the ASCII equivalent characters but watch out for the bad
* unprintable ones (printable chars are 0x20 through 0x7E)
*/
AcpiOsPrintf (" ");
for (j = 0; j < 16; j++)
if (!DisplayDataOnly)
{
if (i + j >= Count)
AcpiOsPrintf (" ");
for (j = 0; j < 16; j++)
{
AcpiOsPrintf ("\n");
return;
if (i + j >= Count)
{
AcpiOsPrintf ("\n");
return;
}
/*
* Add comment characters so rest of line is ignored when
* compiled
*/
if (j == 0)
{
AcpiOsPrintf ("// ");
}
BufChar = Buffer[(ACPI_SIZE) i + j];
if (isprint (BufChar))
{
AcpiOsPrintf ("%c", BufChar);
}
else
{
AcpiOsPrintf (".");
}
}
/*
* Add comment characters so rest of line is ignored when
* compiled
*/
if (j == 0)
{
AcpiOsPrintf ("// ");
}
/* Done with that line. */
BufChar = Buffer[(ACPI_SIZE) i + j];
if (isprint (BufChar))
{
AcpiOsPrintf ("%c", BufChar);
}
else
{
AcpiOsPrintf (".");
}
AcpiOsPrintf ("\n");
}
/* Done with that line. */
AcpiOsPrintf ("\n");
i += 16;
}

View File

@ -322,7 +322,7 @@ AcpiDebugPrint (
* Display the module name, current line number, thread ID (if requested),
* current procedure nesting level, and the current procedure name
*/
AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
AcpiOsPrintf ("%9s-%04d ", ModuleName, LineNumber);
#ifdef ACPI_APPLICATION
/*
@ -343,7 +343,7 @@ AcpiDebugPrint (
FillCount = 0;
}
AcpiOsPrintf ("[%02ld] %*s",
AcpiOsPrintf ("[%02d] %*s",
AcpiGbl_NestingLevel, AcpiGbl_NestingLevel + 1, " ");
AcpiOsPrintf ("%s%*s: ",
AcpiUtTrimFunctionName (FunctionName), FillCount, " ");

View File

@ -188,7 +188,7 @@ AcpiUtPredefinedWarning (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
UINT16 NodeFlags,
const char *Format,
...)
{
@ -237,7 +237,7 @@ AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
UINT16 NodeFlags,
const char *Format,
...)
{
@ -286,7 +286,7 @@ AcpiUtPredefinedBiosError (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
UINT16 NodeFlags,
const char *Format,
...)
{

View File

@ -212,13 +212,14 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"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 2013", NULL, 0, ACPI_OSI_WIN_8_1}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
{"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */
{"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */
{"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */
{"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */
{"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */
{"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5}, /* Windows 10 version 1809 - Added 11/2018 */
{"Windows 2019", NULL, 0, ACPI_OSI_WIN_10_19H1}, /* Windows 10 version 1903 - Added 08/2019 */
/* Feature Group Strings */

View File

@ -190,7 +190,7 @@ AcpiUtAllocateOwnerId (
if (*OwnerId)
{
ACPI_ERROR ((AE_INFO,
"Owner ID [0x%2.2X] already exists", *OwnerId));
"Owner ID [0x%3.3X] already exists", *OwnerId));
return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
@ -246,13 +246,13 @@ AcpiUtAllocateOwnerId (
/*
* Construct encoded ID from the index and bit position
*
* Note: Last [j].k (bit 255) is never used and is marked
* Note: Last [j].k (bit 4095) is never used and is marked
* permanently allocated (prevents +1 overflow)
*/
*OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j));
ACPI_DEBUG_PRINT ((ACPI_DB_VALUES,
"Allocated OwnerId: %2.2X\n", (unsigned int) *OwnerId));
"Allocated OwnerId: 0x%3.3X\n", (unsigned int) *OwnerId));
goto Exit;
}
}
@ -272,7 +272,7 @@ AcpiUtAllocateOwnerId (
*/
Status = AE_OWNER_ID_LIMIT;
ACPI_ERROR ((AE_INFO,
"Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT"));
"Could not allocate new OwnerId (4095 max), AE_OWNER_ID_LIMIT"));
Exit:
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
@ -315,7 +315,7 @@ AcpiUtReleaseOwnerId (
if (OwnerId == 0)
{
ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId));
ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%3.3X", OwnerId));
return_VOID;
}
@ -345,7 +345,7 @@ AcpiUtReleaseOwnerId (
else
{
ACPI_ERROR ((AE_INFO,
"Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1));
"Attempted release of non-allocated OwnerId: 0x%3.3X", OwnerId + 1));
}
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);

View File

@ -864,7 +864,7 @@ AcpiUtDumpAllocations (
case ACPI_DESC_TYPE_PARSER:
AcpiOsPrintf ("AmlOpcode 0x%04hX\n",
AcpiOsPrintf ("AmlOpcode 0x%04X\n",
Descriptor->Op.Asl.AmlOpcode);
break;

View File

@ -239,9 +239,9 @@
#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
/* OwnerId tracking. 8 entries allows for 255 OwnerIds */
/* OwnerId tracking. 128 entries allows for 4095 OwnerIds */
#define ACPI_NUM_OWNERID_MASKS 8
#define ACPI_NUM_OWNERID_MASKS 128
/* Size of the root table array is increased by this increment */

View File

@ -392,6 +392,10 @@ void
AcpiDbGetBusInfo (
void);
ACPI_STATUS
AcpiDbDisplayFields (
UINT32 AddressSpaceId);
/*
* dbdisply - debug display commands

View File

@ -295,12 +295,12 @@ typedef struct acpi_namespace_node
union acpi_operand_object *Object; /* Interpreter object */
UINT8 DescriptorType; /* Differentiate object descriptor types */
UINT8 Type; /* ACPI Type associated with this name */
UINT8 Flags; /* Miscellaneous flags */
ACPI_OWNER_ID OwnerId; /* Node creator */
UINT16 Flags; /* Miscellaneous flags */
ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
struct acpi_namespace_node *Parent; /* Parent node */
struct acpi_namespace_node *Child; /* First child */
struct acpi_namespace_node *Peer; /* First peer */
ACPI_OWNER_ID OwnerId; /* Node creator */
/*
* The following fields are used by the ASL compiler and disassembler only

View File

@ -333,8 +333,8 @@ typedef struct acpi_object_method
} Dispatch;
UINT32 AmlLength;
UINT8 ThreadCount;
ACPI_OWNER_ID OwnerId;
UINT8 ThreadCount;
} ACPI_OBJECT_METHOD;

View File

@ -577,6 +577,7 @@ AcpiOsEnterSleep (
* Debug print routines
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
ACPI_PRINTF_LIKE (1)
void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf (
const char *Format,

View File

@ -154,7 +154,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20190703
#define ACPI_CA_VERSION 0x20191018
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>
@ -446,6 +446,9 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
ACPI_EXTERNAL_RETURN_OK(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
ACPI_EXTERNAL_RETURN_UINT32(prototype)
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
ACPI_EXTERNAL_RETURN_VOID(Prototype)
@ -456,6 +459,9 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
static ACPI_INLINE Prototype {return(AE_OK);}
#define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
static ACPI_INLINE prototype {return(0);}
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
static ACPI_INLINE Prototype {return;}
@ -658,7 +664,13 @@ AcpiInstallTable (
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTable (
ACPI_TABLE_HEADER *Table))
ACPI_TABLE_HEADER *Table,
UINT32 *TableIdx))
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadTable (
UINT32 TableIndex))
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
@ -1076,6 +1088,12 @@ AcpiGetGpeStatus (
UINT32 GpeNumber,
ACPI_EVENT_STATUS *EventStatus))
ACPI_HW_DEPENDENT_RETURN_UINT32 (
UINT32
AcpiDispatchGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiDisableAllGpes (

View File

@ -327,9 +327,9 @@ typedef struct acpi_evaluate_info
UINT32 ReturnFlags; /* Used for return value analysis */
UINT32 ReturnBtype; /* Bitmapped type of the returned object */
UINT16 ParamCount; /* Count of the input argument list */
UINT16 NodeFlags; /* Same as Node->Flags */
UINT8 PassNumber; /* Parser pass number */
UINT8 ReturnObjectType; /* Object type of the returned object */
UINT8 NodeFlags; /* Same as Node->Flags */
UINT8 Flags; /* General flags */
} ACPI_EVALUATE_INFO;
@ -357,6 +357,19 @@ typedef struct acpi_device_walk_info
} ACPI_DEVICE_WALK_INFO;
/* Info used by Acpi AcpiDbDisplayFields */
typedef struct acpi_region_walk_info
{
UINT32 DebugLevel;
UINT32 Count;
ACPI_OWNER_ID OwnerId;
UINT8 DisplayType;
UINT32 AddressSpaceId;
} ACPI_REGION_WALK_INFO;
/* TBD: [Restructure] Merge with struct above */
typedef struct acpi_walk_info

View File

@ -591,8 +591,8 @@ typedef void * ACPI_HANDLE; /* Actually a ptr to a N
/* Owner IDs are used to track namespace nodes for selective deletion */
typedef UINT8 ACPI_OWNER_ID;
#define ACPI_OWNER_ID_MAX 0xFF
typedef UINT16 ACPI_OWNER_ID;
#define ACPI_OWNER_ID_MAX 0xFFF /* 4095 possible owner IDs */
#define ACPI_INTEGER_BIT_SIZE 64
@ -657,7 +657,7 @@ typedef UINT64 ACPI_INTEGER;
/* Pointer/Integer type conversions */
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i))
#define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0)
#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
@ -1513,12 +1513,14 @@ typedef enum
#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
#define ACPI_OSI_WIN_10_RS1 0x0E
#define ACPI_OSI_WIN_10_RS2 0x0F
#define ACPI_OSI_WIN_10_RS3 0x10
#define ACPI_OSI_WIN_10_RS4 0x11
#define ACPI_OSI_WIN_10_RS5 0x12
#define ACPI_OSI_WIN_8_1 0x0D
#define ACPI_OSI_WIN_10 0x0E
#define ACPI_OSI_WIN_10_RS1 0x0F
#define ACPI_OSI_WIN_10_RS2 0x10
#define ACPI_OSI_WIN_10_RS3 0x11
#define ACPI_OSI_WIN_10_RS4 0x12
#define ACPI_OSI_WIN_10_RS5 0x13
#define ACPI_OSI_WIN_10_19H1 0x14
/* Definitions of getopt */

Some files were not shown because too many files have changed in this diff Show More