From 732a62191251778cbc6842a01b7fff0eebf4761b Mon Sep 17 00:00:00 2001 From: Al Stone Date: Oct 30 2019 21:08:10 +0000 Subject: Update upstream source from tag 'upstream/20191018' Update to upstream version '20191018' with Debian dir ddab086ef25c43d710ed90311be88d903c340d20 --- diff --git a/changes.txt b/changes.txt index 510a4ca..d7f84e9 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,51 @@ ---------------------------------------- +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 diff --git a/generate/unix/acpinames/Makefile b/generate/unix/acpinames/Makefile index db87d88..90d3afe 100644 --- a/generate/unix/acpinames/Makefile +++ b/generate/unix/acpinames/Makefile @@ -22,7 +22,9 @@ PROG = $(OBJDIR)/acpinames vpath %.c \ $(ACPINAMES)\ $(ACPICA_DISPATCHER)\ + $(ACPICA_EVENTS)\ $(ACPICA_EXECUTER)\ + $(ACPICA_HARDWARE)\ $(ACPICA_NAMESPACE)\ $(ACPICA_PARSER)\ $(ACPICA_TABLES)\ @@ -39,34 +41,69 @@ OBJECTS = \ $(OBJDIR)/anstubs.o\ $(OBJDIR)/antables.o\ $(OBJDIR)/cmfsize.o\ + $(OBJDIR)/dscontrol.o\ + $(OBJDIR)/dsdebug.o\ $(OBJDIR)/dsfield.o\ $(OBJDIR)/dsinit.o\ + $(OBJDIR)/dsmethod.o\ $(OBJDIR)/dsmthdat.o\ $(OBJDIR)/dsobject.o\ + $(OBJDIR)/dsopcode.o\ $(OBJDIR)/dspkginit.o\ $(OBJDIR)/dsutils.o\ + $(OBJDIR)/dswexec.o\ $(OBJDIR)/dswload.o\ $(OBJDIR)/dswload2.o\ $(OBJDIR)/dswscope.o\ $(OBJDIR)/dswstate.o\ + $(OBJDIR)/evhandler.o\ + $(OBJDIR)/evmisc.o\ + $(OBJDIR)/evregion.o\ + $(OBJDIR)/evrgnini.o\ + $(OBJDIR)/evxfregn.o\ + $(OBJDIR)/exconcat.o\ + $(OBJDIR)/exconfig.o\ + $(OBJDIR)/exconvrt.o\ $(OBJDIR)/excreate.o\ $(OBJDIR)/exdump.o\ + $(OBJDIR)/exfield.o\ + $(OBJDIR)/exfldio.o\ + $(OBJDIR)/exmisc.o\ $(OBJDIR)/exmutex.o\ $(OBJDIR)/exnames.o\ + $(OBJDIR)/exoparg1.o\ + $(OBJDIR)/exoparg2.o\ + $(OBJDIR)/exoparg3.o\ + $(OBJDIR)/exoparg6.o\ $(OBJDIR)/exprep.o\ + $(OBJDIR)/exregion.o\ $(OBJDIR)/exresnte.o\ $(OBJDIR)/exresolv.o\ + $(OBJDIR)/exresop.o\ + $(OBJDIR)/exserial.o\ + $(OBJDIR)/exstore.o\ + $(OBJDIR)/exstoren.o\ + $(OBJDIR)/exstorob.o\ $(OBJDIR)/exsystem.o\ $(OBJDIR)/exutils.o\ $(OBJDIR)/getopt.o\ + $(OBJDIR)/hwpci.o\ + $(OBJDIR)/hwvalid.o\ $(OBJDIR)/nsaccess.o\ $(OBJDIR)/nsalloc.o\ + $(OBJDIR)/nsarguments.o\ + $(OBJDIR)/nsconvert.o\ $(OBJDIR)/nsdump.o\ + $(OBJDIR)/nseval.o\ $(OBJDIR)/nsinit.o\ $(OBJDIR)/nsload.o\ $(OBJDIR)/nsnames.o\ $(OBJDIR)/nsobject.o\ $(OBJDIR)/nsparse.o\ + $(OBJDIR)/nspredef.o\ + $(OBJDIR)/nsprepkg.o\ + $(OBJDIR)/nsrepair.o\ + $(OBJDIR)/nsrepair2.o\ $(OBJDIR)/nssearch.o\ $(OBJDIR)/nsutils.o\ $(OBJDIR)/nswalk.o\ @@ -99,6 +136,7 @@ OBJECTS = \ $(OBJDIR)/utascii.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utcache.o\ + $(OBJDIR)/utcopy.o\ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utdecode.o\ $(OBJDIR)/utdelete.o\ @@ -117,8 +155,12 @@ OBJECTS = \ $(OBJDIR)/utobject.o\ $(OBJDIR)/utosi.o\ $(OBJDIR)/utownerid.o\ + $(OBJDIR)/utpredef.o\ + $(OBJDIR)/utresrc.o\ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstring.o\ + $(OBJDIR)/utstrsuppt.o\ + $(OBJDIR)/utstrtoul64.o\ $(OBJDIR)/utxface.o\ $(OBJDIR)/utxferror.o\ $(OBJDIR)/utxfinit.o diff --git a/source/common/acgetline.c b/source/common/acgetline.c index aff7414..8bbca68 100644 --- a/source/common/acgetline.c +++ b/source/common/acgetline.c @@ -424,7 +424,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: diff --git a/source/common/adisasm.c b/source/common/adisasm.c index fbd079f..6a493ae 100644 --- a/source/common/adisasm.c +++ b/source/common/adisasm.c @@ -638,7 +638,6 @@ AdDoExternalFileList ( { ExternalFileList = ExternalFileList->Next; GlobalStatus = AE_TYPE; - Status = AE_OK; continue; } diff --git a/source/common/adwalk.c b/source/common/adwalk.c index 65aabec..fa8e17f 100644 --- a/source/common/adwalk.c +++ b/source/common/adwalk.c @@ -493,7 +493,9 @@ AcpiDmFindOrphanDescending ( return (AE_OK); } +#ifdef ACPI_UNDER_DEVELOPMENT OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); +#endif switch (Op->Common.AmlOpcode) { @@ -992,7 +994,7 @@ AcpiDmCommonDescendingOp ( /* Switch/Case conversion */ Status = AcpiDmProcessSwitch (Op); - return (AE_OK); + return (Status); } diff --git a/source/common/dmtables.c b/source/common/dmtables.c index c18e5f5..4807881 100644 --- a/source/common/dmtables.c +++ b/source/common/dmtables.c @@ -219,7 +219,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); } @@ -493,7 +493,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 */ diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c index 6de7f81..f89021e 100644 --- a/source/common/dmtbdump1.c +++ b/source/common/dmtbdump1.c @@ -366,7 +366,6 @@ AcpiDmDumpCsrt ( { return; } - SubSubOffset += InfoLength; } /* Point to next sub-subtable */ @@ -1293,7 +1292,6 @@ AcpiDmDumpHmat ( while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - SubtableOffset = 0; /* Dump HMAT structure header */ @@ -1376,6 +1374,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; } @@ -1392,6 +1395,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; } @@ -1411,6 +1419,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; } } @@ -1434,6 +1447,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; diff --git a/source/common/dmtbdump2.c b/source/common/dmtbdump2.c index fd1aba8..bcba826 100644 --- a/source/common/dmtbdump2.c +++ b/source/common/dmtbdump2.c @@ -79,6 +79,7 @@ AcpiDmDumpIort ( ACPI_DMTABLE_INFO *InfoTable; char *String; UINT32 i; + UINT32 MappingByteLength; /* Main table */ @@ -206,6 +207,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; } } @@ -217,8 +223,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)) { @@ -302,7 +310,6 @@ NextSubtable: /* Point to next node subtable */ Offset += IortNode->Length; - IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length); } } @@ -1103,7 +1110,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; @@ -1128,7 +1134,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; @@ -1165,6 +1170,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, @@ -1200,6 +1206,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, @@ -1698,6 +1705,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; @@ -1955,6 +1967,10 @@ AcpiDmDumpSdev ( Status = AcpiDmDumpTable (Table->Length, 0, ACPI_ADD_PTR (UINT8, Pcie, VendorDataOffset), VendorDataLength, AcpiDmTableInfoSdev1b); + if (ACPI_FAILURE (Status)) + { + return; + } } break; diff --git a/source/common/dmtbdump3.c b/source/common/dmtbdump3.c index c7c1561..9943389 100644 --- a/source/common/dmtbdump3.c +++ b/source/common/dmtbdump3.c @@ -302,7 +302,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 */ @@ -418,7 +418,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; @@ -483,7 +483,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; diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c index e58f612..3b62244 100644 --- a/source/compiler/aslanalyze.c +++ b/source/compiler/aslanalyze.c @@ -461,7 +461,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; /* diff --git a/source/compiler/aslbtypes.c b/source/compiler/aslbtypes.c index 33b80ff..477d978 100644 --- a/source/compiler/aslbtypes.c +++ b/source/compiler/aslbtypes.c @@ -366,7 +366,6 @@ AnFormatBtype ( strcat (Buffer, "|"); } - First = FALSE; strcat (Buffer, "Resource"); } } diff --git a/source/compiler/aslkeywords.y b/source/compiler/aslkeywords.y index 7f82dd9..7a99671 100644 --- a/source/compiler/aslkeywords.y +++ b/source/compiler/aslkeywords.y @@ -94,7 +94,7 @@ AddressKeyword ; AddressSpaceKeyword - : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} + : ByteConst {$$ = UtCheckIntegerRange ($1, ACPI_NUM_PREDEFINED_REGIONS, 0xFF);} | RegionSpaceKeyword {} ; diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index fa13456..48fcbfe 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -418,13 +418,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); @@ -433,15 +432,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: @@ -468,7 +458,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); diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c index bcce434..886f9da 100644 --- a/source/compiler/aslmessages.c +++ b/source/compiler/aslmessages.c @@ -279,7 +279,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 */ diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index 84912a2..40b3071 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -279,6 +279,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 */ diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c index 322a86a..fb9911e 100644 --- a/source/compiler/aslmethod.c +++ b/source/compiler/aslmethod.c @@ -91,6 +91,8 @@ MtMethodAnalysisWalkBegin ( ACPI_PARSE_OBJECT *NextType; ACPI_PARSE_OBJECT *NextParamType; UINT8 ActualArgs = 0; + BOOLEAN HidExists; + BOOLEAN AdrExists; /* Build cross-reference output file if requested */ @@ -427,12 +429,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: diff --git a/source/compiler/aslnamesp.c b/source/compiler/aslnamesp.c index 7494b1a..73cb857 100644 --- a/source/compiler/aslnamesp.c +++ b/source/compiler/aslnamesp.c @@ -126,6 +126,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 */ diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c index 029fe3a..561604e 100644 --- a/source/compiler/aslprepkg.c +++ b/source/compiler/aslprepkg.c @@ -350,7 +350,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; } diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 4dda771..1cbabfb 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -1118,7 +1118,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); diff --git a/source/compiler/aslrestype2.c b/source/compiler/aslrestype2.c index b670f88..2189939 100644 --- a/source/compiler/aslrestype2.c +++ b/source/compiler/aslrestype2.c @@ -379,10 +379,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); diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c index 456d9f0..5c25ae7 100644 --- a/source/compiler/aslrestype2s.c +++ b/source/compiler/aslrestype2s.c @@ -566,7 +566,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; diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c index bb4ee95..bd89c71 100644 --- a/source/compiler/aslutils.c +++ b/source/compiler/aslutils.c @@ -115,7 +115,7 @@ UtQueryForOverwrite ( char *Pathname) { struct stat StatInfo; - int InChar = 0x34; + int InChar; if (!stat (Pathname, &StatInfo)) diff --git a/source/compiler/cvdisasm.c b/source/compiler/cvdisasm.c index 3fc8ca4..c408681 100644 --- a/source/compiler/cvdisasm.c +++ b/source/compiler/cvdisasm.c @@ -436,8 +436,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; + } } diff --git a/source/compiler/cvparser.c b/source/compiler/cvparser.c index 03148a7..7ca4f17 100644 --- a/source/compiler/cvparser.c +++ b/source/compiler/cvparser.c @@ -804,7 +804,6 @@ CvCaptureCommentsOnly ( /* Not a valid comment option. Revert the AML */ - Aml -= 2; goto DefBlock; } /* End switch statement */ diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c index eee9842..8204aec 100644 --- a/source/compiler/dtcompile.c +++ b/source/compiler/dtcompile.c @@ -168,7 +168,10 @@ DtDoCompile ( if (ACPI_FAILURE (Status)) { - FileNode->ParserErrorDetected = TRUE; + if (FileNode) + { + FileNode->ParserErrorDetected = TRUE; + } /* TBD: temporary error message. Msgs should come from function above */ @@ -464,7 +467,7 @@ DtCompileTable ( ACPI_STATUS Status = AE_OK; - if (!Field) + if (!Field || !Info) { return (AE_BAD_PARAMETER); } @@ -535,6 +538,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: diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h index 964c88f..7b5c493 100644 --- a/source/compiler/dtcompiler.h +++ b/source/compiler/dtcompiler.h @@ -102,6 +102,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 @@ -184,14 +195,6 @@ DtCompilePadding ( UINT32 Length, DT_SUBTABLE **RetSubtable); -void -DtCreateField ( - char *Name, - char *Value, - UINT32 Line, - UINT32 Offset, - UINT32 Column, - UINT32 NameColumn); /* dtio - binary and text input/output */ @@ -329,6 +332,26 @@ 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 */ diff --git a/source/compiler/dtcompilerparser.l b/source/compiler/dtcompilerparser.l index 316bfb2..cf74d7b 100644 --- a/source/compiler/dtcompilerparser.l +++ b/source/compiler/dtcompilerparser.l @@ -53,18 +53,20 @@ YYSTYPE DtCompilerlval; /* handle locations */ int DtCompilerParsercolumn = 1; +int DtLabelByteOffset = 0; int DtCompilerParserByteOffset = 0; +UINT32 DtTokenFirstLine = 0; +UINT32 DtTokenFirstColumn = 0; + #define YY_USER_ACTION \ - DtCompilerParserlloc.first_line = DtCompilerParserlloc.last_line = DtCompilerParserlineno; \ - DtCompilerParserlloc.first_column = DtCompilerParsercolumn; \ - DtCompilerParserlloc.first_byte_offset = DtCompilerParserByteOffset; \ - DtCompilerParserlloc.last_column = DtCompilerParsercolumn + DtCompilerParserleng-1; \ + DtTokenFirstLine = DtCompilerParserlineno; \ + DtTokenFirstColumn = DtCompilerParsercolumn; \ DtCompilerParsercolumn += DtCompilerParserleng; \ DtCompilerParserByteOffset += DtCompilerParserleng; \ DbgPrint (ASL_PARSE_OUTPUT,\ - "user action occurred. DtCompilerParserlloc.first_line: %u offset: %u\n",\ - DtCompilerParserlloc.first_line, DtCompilerParserlloc.first_byte_offset); + "user action occurred. DtCompilerParserlloc.first_line: %u\n",\ + DtTokenFirstLine); %} %option nounput noinput yylineno @@ -128,7 +130,11 @@ CommentField {LabelName}{WhiteSpace}*:{WhiteSpace}{Comment}?$ int size = strlen (DtCompilerParsertext); s=UtLocalCacheCalloc (size + 1); AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1); - DtCompilerParserlval.s = s; + 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); } diff --git a/source/compiler/dtcompilerparser.y b/source/compiler/dtcompilerparser.y index 160b1c9..ce0cb9e 100644 --- a/source/compiler/dtcompilerparser.y +++ b/source/compiler/dtcompilerparser.y @@ -61,9 +61,13 @@ 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 @@ -78,42 +82,30 @@ extern UINT64 DtCompilerParserlineno; /* Current line number */ %} -%code requires { - - typedef struct YYLTYPE { - int first_line; - int last_line; - int first_column; - int last_column; - int first_byte_offset; - } YYLTYPE; - - #define YYLTYPE_IS_DECLARED 1 -} - %union { char *s; DT_FIELD *f; + DT_TABLE_UNIT *u; } %type Table -%token DT_PARSEOP_DATA -%token DT_PARSEOP_LABEL -%token DT_PARSEOP_STRING_DATA -%token DT_PARSEOP_LINE_CONTINUATION -%type Data -%type Datum -%type MultiLineData -%type MultiLineDataList +%token DT_PARSEOP_DATA +%token DT_PARSEOP_LABEL +%token DT_PARSEOP_STRING_DATA +%token DT_PARSEOP_LINE_CONTINUATION +%type Data +%type Datum +%type MultiLineData +%type MultiLineDataList %% Table : - FieldList { DtCompilerParserResult = 5;} + FieldList { } ; FieldList @@ -122,7 +114,7 @@ FieldList ; Field - : DT_PARSEOP_LABEL ':' Data { DtCreateField ($1, $3, (@3).first_line, (@1).first_byte_offset, (@1).first_column, (@3).first_column); } + : DT_PARSEOP_LABEL ':' Data { DtCreateField ($1, $3, DtLabelByteOffset); } ; Data @@ -132,7 +124,7 @@ Data ; MultiLineDataList - : MultiLineDataList MultiLineData { $$ = AcpiUtStrcat(AcpiUtStrcat($1, " "), $2); } /* combine the strings with strcat */ + : MultiLineDataList MultiLineData { $$ = DtCreateTableUnit (AcpiUtStrcat(AcpiUtStrcat($1->Value, " "), $2->Value), $1->Line, $1->Column); } /* combine the strings with strcat */ | MultiLineData { $$ = $1; } ; @@ -141,8 +133,14 @@ MultiLineData ; Datum - : DT_PARSEOP_DATA { DbgPrint (ASL_PARSE_OUTPUT, "parser data: [%s]\n", DtCompilerParserlval.s); $$ = AcpiUtStrdup(DtCompilerParserlval.s); } - | DT_PARSEOP_STRING_DATA { DbgPrint (ASL_PARSE_OUTPUT, "parser string data: [%s]\n", DtCompilerParserlval.s); $$ = AcpiUtStrdup(DtCompilerParserlval.s); } + : 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); + } ; diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c index 69ee8ad..175cd70 100644 --- a/source/compiler/dtfield.c +++ b/source/compiler/dtfield.c @@ -468,6 +468,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) */ @@ -613,3 +621,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; + } +} diff --git a/source/compiler/dtio.c b/source/compiler/dtio.c index 6786572..737d769 100644 --- a/source/compiler/dtio.c +++ b/source/compiler/dtio.c @@ -54,10 +54,6 @@ static char * DtTrim ( char *String); -static void -DtLinkField ( - DT_FIELD *Field); - static ACPI_STATUS DtParseLine ( char *LineBuffer, @@ -191,45 +187,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 * * PARAMETERS: LineBuffer - Current source code line @@ -387,59 +344,6 @@ DtParseLine ( /****************************************************************************** * - * FUNCTION: DtCreateField - * - * PARAMETERS: Name - * Value - * Line - * Offset - * Column - * NameColumn - * - * RETURN: None - * - * DESCRIPTION: Create a field - * - *****************************************************************************/ - -void -DtCreateField ( - char *Name, - char *Value, - UINT32 Line, - UINT32 Offset, - UINT32 Column, - UINT32 NameColumn) -{ - DT_FIELD *Field = UtFieldCacheCalloc (); - - - Field->StringLength = 0; - if (Name) - { - Field->Name = - strcpy (UtLocalCacheCalloc (strlen (Name) + 1), Name); - } - - if (Value) - { - Field->StringLength = strlen (Value); - Field->Value = - strcpy (UtLocalCacheCalloc (Field->StringLength + 1), Value); - } - - Field->Line = Line; - Field->ByteOffset = Offset; - Field->NameColumn = NameColumn; - Field->Column = Column; - DtLinkField (Field); - - DtDumpFieldList (AslGbl_FieldList); -} - - -/****************************************************************************** - * * FUNCTION: DtGetNextLine * * PARAMETERS: Handle - Open file handle for the source file @@ -732,7 +636,6 @@ DtGetNextLine ( case '\n': - CurrentLineOffset = AslGbl_NextLineOffset; AslGbl_NextLineOffset = (UINT32) ftell (Handle); AslGbl_CurrentLineNumber++; break; @@ -774,7 +677,6 @@ DtGetNextLine ( /* Ignore newline, this will merge the lines */ - CurrentLineOffset = AslGbl_NextLineOffset; AslGbl_NextLineOffset = (UINT32) ftell (Handle); AslGbl_CurrentLineNumber++; State = DT_NORMAL_TEXT; diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index c24bcbe..1165b3a 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -1366,13 +1366,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: @@ -1512,7 +1513,9 @@ DtCompileSlit ( DT_SUBTABLE *ParentTable; DT_FIELD **PFieldList = (DT_FIELD **) List; DT_FIELD *FieldList; + DT_FIELD *EndOfFieldList = NULL; UINT32 Localities; + UINT32 LocalityListLength; UINT8 *LocalityBuffer; @@ -1528,6 +1531,7 @@ DtCompileSlit ( Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer); LocalityBuffer = UtLocalCalloc (Localities); + LocalityListLength = 0; /* Compile each locality buffer */ @@ -1537,11 +1541,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); } diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c index 6a7ffc2..b55d638 100644 --- a/source/components/debugger/dbconvert.c +++ b/source/components/debugger/dbconvert.c @@ -166,6 +166,10 @@ AcpiDbConvertToBuffer ( ACPI_STATUS Status; + /* Skip all preceding white space*/ + + AcpiUtRemoveWhitespace (&String); + /* Generate the final buffer length */ for (i = 0, Length = 0; String[i];) diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index da1214c..d90c8bc 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -605,7 +605,6 @@ AcpiDbDisplayResults ( return; } - ObjDesc = WalkState->MethodDesc; Node = WalkState->MethodNode; if (WalkState->Results) @@ -665,7 +664,6 @@ AcpiDbDisplayCallingTree ( return; } - Node = WalkState->MethodNode; AcpiOsPrintf ("Current Control Method Call Tree\n"); while (WalkState) diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index 2e6a645..8fb856d 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -145,7 +145,7 @@ AcpiDbLoadTables ( { Table = TableListHead->Table; - Status = AcpiLoadTable (Table); + Status = AcpiLoadTable (Table, NULL); if (ACPI_FAILURE (Status)) { if (Status == AE_ALREADY_EXISTS) diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index c934fac..c2de7b7 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -100,6 +100,7 @@ enum AcpiExDebuggerCommands CMD_EVALUATE, CMD_EXECUTE, CMD_EXIT, + CMD_FIELDS, CMD_FIND, CMD_GO, CMD_HANDLERS, @@ -179,6 +180,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"EVALUATE", 1}, {"EXECUTE", 1}, {"EXIT", 0}, + {"FIELDS", 1}, {"FIND", 1}, {"GO", 0}, {"HANDLERS", 0}, @@ -252,6 +254,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Find (? 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 ", "Display list of loaded field units by space ID\n"}, {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, {1, " Notify ", "Send a notification on Object\n"}, {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, @@ -575,6 +578,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 */ @@ -769,6 +788,7 @@ AcpiDbCommandDispatch ( ACPI_PARSE_OBJECT *Op) { UINT32 Temp; + UINT64 Temp64; UINT32 CommandIndex; UINT32 ParamCount; char *CommandLine; @@ -786,7 +806,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 @@ -885,6 +904,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; diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index 153c38e..6f1d553 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -407,6 +407,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 */ diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index 5a5ab6f..a3b0382 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -46,6 +46,7 @@ #include "acnamesp.h" #include "acdebug.h" #include "acpredef.h" +#include "acinterp.h" #define _COMPONENT ACPI_CA_DEBUGGER @@ -616,6 +617,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 * * PARAMETERS: Callback from WalkNamespace @@ -751,6 +837,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 * * PARAMETERS: Callback from WalkNamespace diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c index 502d5a9..a0c4da0 100644 --- a/source/components/debugger/dbobject.c +++ b/source/components/debugger/dbobject.c @@ -541,7 +541,6 @@ AcpiDbDecodeArguments ( Node = WalkState->MethodNode; - ObjDesc = WalkState->MethodDesc; /* There are no arguments for the module-level code case */ diff --git a/source/components/disassembler/dmdeferred.c b/source/components/disassembler/dmdeferred.c index 1901fd1..e984eca 100644 --- a/source/components/disassembler/dmdeferred.c +++ b/source/components/disassembler/dmdeferred.c @@ -201,6 +201,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; diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index 82fa618..8ceef5d 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -333,7 +333,6 @@ AcpiDmResourceTemplate ( * missing EndDependentDescriptor. */ Level--; - DependentFns = FALSE; /* Go ahead and insert EndDependentFn() */ diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 4a7ebc4..886bcea 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -849,7 +849,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 */ diff --git a/source/components/dispatcher/dscontrol.c b/source/components/dispatcher/dscontrol.c index b2bec50..d78f765 100644 --- a/source/components/dispatcher/dscontrol.c +++ b/source/components/dispatcher/dscontrol.c @@ -127,7 +127,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 */ diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c index 43c1fe4..4c3c7ff 100644 --- a/source/components/dispatcher/dsfield.c +++ b/source/components/dispatcher/dsfield.c @@ -201,7 +201,6 @@ AcpiDsCreateBufferField ( if (WalkState->DeferredNode) { Node = WalkState->DeferredNode; - Status = AE_OK; } else { @@ -327,7 +326,6 @@ AcpiDsGetFieldNames ( ACPI_PARSE_OBJECT *Child; #ifdef ACPI_EXEC_APP - UINT64 Value = 0; ACPI_OPERAND_OBJECT *ResultDesc; ACPI_OPERAND_OBJECT *ObjDesc; char *NamePath; @@ -469,14 +467,13 @@ AcpiDsGetFieldNames ( } #ifdef 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 } @@ -705,8 +702,6 @@ AcpiDsInitFieldObjects ( } /* Name already exists, just ignore this error */ - - Status = AE_OK; } Arg->Common.Node = Node; diff --git a/source/components/events/evgpeblk.c b/source/components/events/evgpeblk.c index b523bbf..283b5ff 100644 --- a/source/components/events/evgpeblk.c +++ b/source/components/events/evgpeblk.c @@ -164,6 +164,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) { @@ -434,7 +438,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); diff --git a/source/components/events/evgpeinit.c b/source/components/events/evgpeinit.c index 9b2d5ce..82d3e0c 100644 --- a/source/components/events/evgpeinit.c +++ b/source/components/events/evgpeinit.c @@ -194,8 +194,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); } } @@ -207,7 +205,6 @@ AcpiEvGpeInitialize ( ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "There are no GPE blocks defined in the FADT\n")); - Status = AE_OK; goto Cleanup; } diff --git a/source/components/events/evmisc.c b/source/components/events/evmisc.c index 37132d4..b9bf22e 100644 --- a/source/components/events/evmisc.c +++ b/source/components/events/evmisc.c @@ -292,11 +292,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")); } @@ -306,7 +311,7 @@ AcpiEvTerminate ( /* Remove SCI handlers */ Status = AcpiEvRemoveAllSciHandlers (); - if (ACPI_FAILURE(Status)) + if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Could not remove SCI handler")); @@ -315,6 +320,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 */ diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c index ea774e2..209bde7 100644 --- a/source/components/events/evregion.c +++ b/source/components/events/evregion.c @@ -929,11 +929,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; } diff --git a/source/components/events/evrgnini.c b/source/components/events/evrgnini.c index 063afaa..5210a71 100644 --- a/source/components/events/evrgnini.c +++ b/source/components/events/evrgnini.c @@ -255,7 +255,6 @@ AcpiEvPciConfigRegionSetup ( * root bridge. Still need to return a context object * for the new PCI_Config operation region, however. */ - Status = AE_OK; } else { diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index 6531d01..d1c35c5 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -249,6 +249,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); diff --git a/source/components/namespace/nsconvert.c b/source/components/namespace/nsconvert.c index a96ff5b..fe85474 100644 --- a/source/components/namespace/nsconvert.c +++ b/source/components/namespace/nsconvert.c @@ -562,5 +562,5 @@ AcpiNsConvertToReference ( ErrorExit: ACPI_FREE (Name); *ReturnObject = NewObject; - return (AE_OK); + return (Status); } diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c index 67ff936..085630c 100644 --- a/source/components/namespace/nsdump.c +++ b/source/components/namespace/nsdump.c @@ -369,7 +369,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"); @@ -466,7 +466,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, @@ -651,8 +651,6 @@ AcpiNsDumpOneObject ( goto Cleanup; } - - ObjType = ACPI_TYPE_INVALID; /* Terminate loop after next pass */ } Cleanup: diff --git a/source/components/namespace/nsxfname.c b/source/components/namespace/nsxfname.c index 1d44670..8c7e371 100644 --- a/source/components/namespace/nsxfname.c +++ b/source/components/namespace/nsxfname.c @@ -503,7 +503,7 @@ AcpiGetObjectInfo ( if (Cls) { - NextIdString = AcpiNsCopyDeviceId (&Info->ClassCode, + (void) AcpiNsCopyDeviceId (&Info->ClassCode, Cls, NextIdString); } diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index fb9652e..252c13f 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -544,7 +544,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)) @@ -553,7 +553,6 @@ AcpiPsCompleteOp ( } } - Status = AE_OK; break; case AE_CTRL_BREAK: @@ -574,7 +573,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)) @@ -582,7 +581,6 @@ AcpiPsCompleteOp ( return_ACPI_STATUS (Status2); } - Status = AE_OK; break; case AE_CTRL_TERMINATE: diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c index 5f8d535..67ae548 100644 --- a/source/components/resources/rscreate.c +++ b/source/components/resources/rscreate.c @@ -373,6 +373,10 @@ AcpiRsCreatePciRoutingTable ( Status = AcpiNsHandleToPathname ( (ACPI_HANDLE) Node, &PathBuffer, FALSE); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } /* +1 to include null terminator */ diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c index e6ac5bb..b4b6bb8 100644 --- a/source/components/tables/tbdata.c +++ b/source/components/tables/tbdata.c @@ -1082,6 +1082,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 diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c index 4db4f52..bca66fe 100644 --- a/source/components/tables/tbxfload.c +++ b/source/components/tables/tbxfload.c @@ -337,6 +337,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 * @@ -350,7 +352,8 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInstallTable) ACPI_STATUS AcpiLoadTable ( - ACPI_TABLE_HEADER *Table) + ACPI_TABLE_HEADER *Table, + UINT32 *TableIdx) { ACPI_STATUS Status; UINT32 TableIndex; @@ -371,6 +374,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 */ @@ -474,3 +482,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) diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c index e1fdc01..09d4bbe 100644 --- a/source/components/utilities/utbuffer.c +++ b/source/components/utilities/utbuffer.c @@ -78,8 +78,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"); @@ -97,7 +99,10 @@ AcpiUtDumpBuffer ( { /* Print current offset */ - AcpiOsPrintf ("%8.4X: ", (BaseOffset + i)); + if (!DisplayDataOnly) + { + AcpiOsPrintf ("%8.4X: ", (BaseOffset + i)); + } /* Print 16 hex chars */ @@ -149,38 +154,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; } diff --git a/source/components/utilities/utids.c b/source/components/utilities/utids.c index ac2d1a6..a82f701 100644 --- a/source/components/utilities/utids.c +++ b/source/components/utilities/utids.c @@ -358,7 +358,8 @@ AcpiUtExecute_CID ( { /* Copy the String CID from the returned object */ - strcpy (NextIdString, CidObjects[i]->String.Pointer); + AcpiUtSafeStrcpy (NextIdString, CidObjects[i]->String.Length + 1, + CidObjects[i]->String.Pointer); Length = CidObjects[i]->String.Length + 1; } diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c index a3e50a1..998b3d1 100644 --- a/source/components/utilities/uttrack.c +++ b/source/components/utilities/uttrack.c @@ -756,7 +756,7 @@ AcpiUtDumpAllocations ( case ACPI_DESC_TYPE_PARSER: - AcpiOsPrintf ("AmlOpcode 0x%04hX\n", + AcpiOsPrintf ("AmlOpcode 0x%04X\n", Descriptor->Op.Asl.AmlOpcode); break; diff --git a/source/include/acdebug.h b/source/include/acdebug.h index 6db3e36..c8bdf77 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -284,6 +284,10 @@ void AcpiDbGetBusInfo ( void); +ACPI_STATUS +AcpiDbDisplayFields ( + UINT32 AddressSpaceId); + /* * dbdisply - debug display commands diff --git a/source/include/acpixf.h b/source/include/acpixf.h index d84c008..bf88d56 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190816 +#define ACPI_CA_VERSION 0x20191018 #include "acconfig.h" #include "actypes.h" @@ -556,7 +556,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 diff --git a/source/include/acstruct.h b/source/include/acstruct.h index ae168d7..755df60 100644 --- a/source/include/acstruct.h +++ b/source/include/acstruct.h @@ -249,6 +249,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 diff --git a/source/include/acutils.h b/source/include/acutils.h index 7e4922f..1bf5fd1 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -182,10 +182,11 @@ typedef struct acpi_pkg_info /* AcpiUtDumpBuffer */ -#define DB_BYTE_DISPLAY 1 -#define DB_WORD_DISPLAY 2 -#define DB_DWORD_DISPLAY 4 -#define DB_QWORD_DISPLAY 8 +#define DB_BYTE_DISPLAY 0x01 +#define DB_WORD_DISPLAY 0x02 +#define DB_DWORD_DISPLAY 0x04 +#define DB_QWORD_DISPLAY 0x08 +#define DB_DISPLAY_DATA_ONLY 0x10 /* diff --git a/source/include/platform/acfreebsd.h b/source/include/platform/acfreebsd.h index 40da5b0..d493938 100644 --- a/source/include/platform/acfreebsd.h +++ b/source/include/platform/acfreebsd.h @@ -95,6 +95,10 @@ #define DEBUGGER_THREADING 0 /* integrated with DDB */ +#ifdef INVARIANTS +#define ACPI_MUTEX_DEBUG +#endif + #else /* _KERNEL */ #if __STDC_HOSTED__ diff --git a/source/os_specific/service_layers/oswinxf.c b/source/os_specific/service_layers/oswinxf.c index 636c1b8..24dd682 100644 --- a/source/os_specific/service_layers/oswinxf.c +++ b/source/os_specific/service_layers/oswinxf.c @@ -350,7 +350,7 @@ AcpiOsGetTimer ( { /* Convert milliseconds to 100 nanosecond ticks */ - return ((UINT64) GetTickCount() * ACPI_100NSEC_PER_MSEC); + return (GetTickCount64() * ACPI_100NSEC_PER_MSEC); } } diff --git a/source/tools/acpiexec/aecommon.h b/source/tools/acpiexec/aecommon.h index 7394a58..eb6010e 100644 --- a/source/tools/acpiexec/aecommon.h +++ b/source/tools/acpiexec/aecommon.h @@ -87,7 +87,8 @@ typedef struct ae_debug_regions typedef struct init_file_entry { char *Name; - UINT64 Value; + ACPI_OPERAND_OBJECT *ObjDesc; + } INIT_FILE_ENTRY; extern BOOLEAN AcpiGbl_UseLocalFaultHandler; @@ -248,7 +249,7 @@ AeSetupConfiguration ( ACPI_STATUS AeLookupInitFileEntry ( char *Pathname, - UINT64 *Value); + ACPI_OPERAND_OBJECT **ObjDesc); /* aeexec */ diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index a5d14d4..3377e6b 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -575,20 +575,27 @@ AeInstallLateHandlers ( { Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567)); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF)); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler1); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); + Status = AcpiRemoveNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler2); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF)); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567)); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); } Status = AcpiGetHandle (NULL, "\\_PR.CPU0", &Handle); @@ -596,9 +603,11 @@ AeInstallLateHandlers ( { Status = AcpiInstallNotifyHandler (Handle, ACPI_ALL_NOTIFY, AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567)); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY, AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF)); + ACPI_CHECK_OK (AcpiInstallNotifyHandler, Status); } #if (!ACPI_REDUCED_HARDWARE) @@ -747,13 +756,15 @@ AeInstallEarlyHandlers ( Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY, AeNotifyHandler1, ACPI_CAST_PTR (void, 0x01234567)); + ACPI_CHECK_OK(AcpiInstallNotifyHandler, Status); Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY, AeNotifyHandler2, ACPI_CAST_PTR (void, 0x89ABCDEF)); + ACPI_CHECK_OK(AcpiInstallNotifyHandler, Status); /* Attempt duplicate handler installation, should fail */ - Status = AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY, + (void) AcpiInstallNotifyHandler (Handle, ACPI_SYSTEM_NOTIFY, AeNotifyHandler1, ACPI_CAST_PTR (void, 0x77777777)); Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle); diff --git a/source/tools/acpiexec/aeinitfile.c b/source/tools/acpiexec/aeinitfile.c index 2f1295d..d65ba88 100644 --- a/source/tools/acpiexec/aeinitfile.c +++ b/source/tools/acpiexec/aeinitfile.c @@ -116,9 +116,13 @@ AeProcessInitFile( void) { ACPI_WALK_STATE *WalkState; - int i; UINT64 idx; ACPI_STATUS Status; + char *Token; + char *ObjectBuffer; + char *TempNameBuffer; + ACPI_OBJECT_TYPE Type; + ACPI_OBJECT TempObject; if (!InitFile) @@ -141,26 +145,44 @@ AeProcessInitFile( AcpiOsAllocate (sizeof (INIT_FILE_ENTRY) * AcpiGbl_InitFileLineCount); for (idx = 0; fgets (LineBuffer, AE_FILE_BUFFER_SIZE, InitFile); ++idx) { - if (sscanf (LineBuffer, "%s %s\n", - &NameBuffer[1], ValueBuffer) != 2) + + TempNameBuffer = AcpiDbGetNextToken (LineBuffer, &Token, &Type); + if (LineBuffer[0] == '\\') { - goto CleanupAndExit; + strcpy (NameBuffer, TempNameBuffer); + } + else + { + /* Add a root prefix if not present in the string */ + + strcpy (NameBuffer + 1, TempNameBuffer); } - /* Add a root prefix if not present in the string */ + AcpiGbl_InitEntries[idx].Name = + AcpiOsAllocateZeroed (strnlen (NameBuffer, AE_FILE_BUFFER_SIZE) + 1); + + strcpy (AcpiGbl_InitEntries[idx].Name, NameBuffer); + + ObjectBuffer = AcpiDbGetNextToken (Token, &Token, &Type); - i = 0; - if (NameBuffer[1] == '\\') + if (Type == ACPI_TYPE_FIELD_UNIT) + { + Status = AcpiDbConvertToObject (ACPI_TYPE_BUFFER, ObjectBuffer, + &TempObject); + } + else { - i = 1; + Status = AcpiDbConvertToObject (Type, ObjectBuffer, &TempObject); } - AcpiGbl_InitEntries[idx].Name = - AcpiOsAllocateZeroed (strnlen (NameBuffer + i, AE_FILE_BUFFER_SIZE) + 1); + Status = AcpiUtCopyEobjectToIobject (&TempObject, + &AcpiGbl_InitEntries[idx].ObjDesc); - strcpy (AcpiGbl_InitEntries[idx].Name, NameBuffer + i); + if (Type == ACPI_TYPE_BUFFER || Type == ACPI_TYPE_FIELD_UNIT) + { + ACPI_FREE (TempObject.Buffer.Pointer); + } - Status = AcpiUtStrtoul64 (ValueBuffer, &AcpiGbl_InitEntries[idx].Value); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("%s %s\n", ValueBuffer, @@ -168,7 +190,16 @@ AeProcessInitFile( goto CleanupAndExit; } - AeEnterInitFileEntry (AcpiGbl_InitEntries[idx], WalkState); + /* + * Special case for field units. Field units are dependent on the + * parent region. This parent region has yet to be created so defer the + * initialization until the dispatcher. For all other types, initialize + * the namespace node with the value found in the init file. + */ + if (Type != ACPI_TYPE_FIELD_UNIT) + { + AeEnterInitFileEntry (AcpiGbl_InitEntries[idx], WalkState); + } } /* Cleanup */ @@ -201,14 +232,12 @@ AeEnterInitFileEntry ( ACPI_WALK_STATE *WalkState) { char *Pathname = InitEntry.Name; - UINT64 Value = InitEntry.Value; - ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *ObjDesc = InitEntry.ObjDesc; ACPI_NAMESPACE_NODE *NewNode; ACPI_STATUS Status; - AcpiOsPrintf ("Initializing namespace element: %s\n", Pathname); - Status = AcpiNsLookup (NULL, Pathname, ACPI_TYPE_INTEGER, + Status = AcpiNsLookup (NULL, Pathname, ObjDesc->Common.Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_ERROR_IF_FOUND | ACPI_NS_NO_UPSEARCH | ACPI_NS_EARLY_INIT, NULL, &NewNode); if (ACPI_FAILURE (Status)) @@ -219,15 +248,17 @@ AeEnterInitFileEntry ( return; } - ObjDesc = AcpiUtCreateIntegerObject (Value); - - AcpiOsPrintf ("New value: 0x%8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (Value)); - /* Store pointer to value descriptor in the Node */ Status = AcpiNsAttachObject (NewNode, ObjDesc, - ACPI_TYPE_INTEGER); + ObjDesc->Common.Type); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "While attaching object to node from namespace initialization file: %s", + Pathname)); + return; + } /* Remove local reference to the object */ @@ -251,7 +282,7 @@ AeEnterInitFileEntry ( ACPI_STATUS AeLookupInitFileEntry ( char *Pathname, - UINT64 *Value) + ACPI_OPERAND_OBJECT **ObjDesc) { UINT32 i; @@ -264,7 +295,7 @@ AeLookupInitFileEntry ( { if (!strcmp(AcpiGbl_InitEntries[i].Name, Pathname)) { - *Value = AcpiGbl_InitEntries[i].Value; + *ObjDesc = AcpiGbl_InitEntries[i].ObjDesc; return AE_OK; } } diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 58640dd..040d121 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -733,8 +733,8 @@ NormalExit: ErrorExit: AeLateTest (); + AcpiOsFree (AcpiGbl_InitEntries); (void) AcpiTerminate (); AcDeleteTableList (ListHead); - AcpiOsFree (AcpiGbl_InitEntries); return (ExitCode); } diff --git a/source/tools/acpiexec/aetests.c b/source/tools/acpiexec/aetests.c index 28d91fc..c3c87a7 100644 --- a/source/tools/acpiexec/aetests.c +++ b/source/tools/acpiexec/aetests.c @@ -82,6 +82,7 @@ AeMiscellaneousTests ( ACPI_STATUS Status; ACPI_STATISTICS Stats; ACPI_HANDLE Handle; + UINT32 TableIndex; #if (!ACPI_REDUCED_HARDWARE) UINT32 Temp; @@ -110,18 +111,15 @@ AeMiscellaneousTests ( /* Load and unload SSDT4 */ - Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code); + Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code, &TableIndex); ACPI_CHECK_OK (AcpiLoadTable, Status); - Status = AcpiGetHandle (NULL, "\\_T96", &Handle); - ACPI_CHECK_OK (AcpiGetHandle, Status); - - Status = AcpiUnloadParentTable (Handle); - ACPI_CHECK_OK (AcpiUnloadParentTable, Status); + Status = AcpiUnloadTable (TableIndex); + ACPI_CHECK_OK (AcpiUnloadTable, Status); /* Re-load SSDT4 */ - Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code); + Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt4Code, NULL); ACPI_CHECK_OK (AcpiLoadTable, Status); /* Unload and re-load SSDT2 (SSDT2 is in the XSDT) */ @@ -132,12 +130,12 @@ AeMiscellaneousTests ( Status = AcpiUnloadParentTable (Handle); ACPI_CHECK_OK (AcpiUnloadParentTable, Status); - Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt2Code); + Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt2Code, NULL); ACPI_CHECK_OK (AcpiLoadTable, Status); /* Load OEM9 table (causes table override) */ - Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt3Code); + Status = AcpiLoadTable ((ACPI_TABLE_HEADER *) Ssdt3Code, NULL); ACPI_CHECK_OK (AcpiLoadTable, Status); } diff --git a/source/tools/acpihelp/ahdecode.c b/source/tools/acpihelp/ahdecode.c index 3b5a03b..0ce521f 100644 --- a/source/tools/acpihelp/ahdecode.c +++ b/source/tools/acpihelp/ahdecode.c @@ -194,7 +194,7 @@ AhFindPredefinedNames ( if (!NamePrefix || (*NamePrefix == '*')) { - Found = AhDisplayPredefinedName (NULL, 0); + (void) AhDisplayPredefinedName (NULL, 0); return; } diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c index c140025..84db618 100644 --- a/source/tools/acpinames/anstubs.c +++ b/source/tools/acpinames/anstubs.c @@ -60,6 +60,8 @@ /* Utilities */ +#ifdef ACPI_OBSOLETE_FUNCTIONS + ACPI_STATUS AcpiUtCopyIobjectToEobject ( ACPI_OPERAND_OBJECT *Obj, @@ -93,6 +95,7 @@ AcpiUtCopyIobjectToIobject ( return (AE_NOT_IMPLEMENTED); } +#endif /* Hardware */ @@ -105,6 +108,8 @@ AcpiHwGetMode ( /* Event manager */ +#ifdef ACPI_OBSOLETE_FUNCTIONS + ACPI_STATUS AcpiEvInstallRegionHandlers ( void) @@ -125,6 +130,7 @@ AcpiEvInitializeRegion ( { return (AE_OK); } +#endif ACPI_STATUS AcpiEvInstallXruptHandlers ( @@ -143,6 +149,8 @@ AcpiEvInitializeEvents ( /* AML Interpreter */ +#ifdef ACPI_OBSOLETE_FUNCTIONS + ACPI_STATUS AcpiExReadDataFromField ( ACPI_WALK_STATE *WalkState, @@ -180,7 +188,6 @@ AcpiExStoreObjectToNode ( return (AE_NOT_IMPLEMENTED); } - /* Namespace manager */ ACPI_STATUS @@ -192,6 +199,7 @@ AcpiNsEvaluate ( return (AE_NOT_IMPLEMENTED); } +#endif void AcpiExDoDebugObject ( @@ -250,6 +258,8 @@ AcpiExTracePoint ( /* Dispatcher */ +#ifdef ACPI_OBSOLETE_FUNCTIONS + ACPI_STATUS AcpiDsAutoSerializeMethod ( ACPI_NAMESPACE_NODE *Node, @@ -328,6 +338,7 @@ AcpiDsGetPredicateValue ( return (AE_NOT_IMPLEMENTED); } +#endif ACPI_STATUS AcpiDsGetBufferFieldArguments ( @@ -364,6 +375,8 @@ AcpiDsGetPackageArguments ( return (AE_OK); } +#ifdef ACPI_OBSOLETE_FUNCTIONS + ACPI_STATUS AcpiDsExecBeginOp ( ACPI_WALK_STATE *WalkState, @@ -384,3 +397,5 @@ AcpiDsExecEndOp ( return (AE_NOT_IMPLEMENTED); } +#endif + diff --git a/source/tools/acpisrc/asfile.c b/source/tools/acpisrc/asfile.c index 7353987..82d22c3 100644 --- a/source/tools/acpisrc/asfile.c +++ b/source/tools/acpisrc/asfile.c @@ -438,7 +438,7 @@ AsConvertFile ( { /* Decode the function bitmap */ - switch ((1 << i) & Functions) + switch (((UINT32) 1 << i) & Functions) { case 0: diff --git a/source/tools/acpisrc/asremove.c b/source/tools/acpisrc/asremove.c index ec4eba5..712f3fa 100644 --- a/source/tools/acpisrc/asremove.c +++ b/source/tools/acpisrc/asremove.c @@ -156,7 +156,6 @@ AsRemoveConditionalCompile ( KeywordLength = strlen (Keyword); - SubBuffer = Buffer; SubString = Buffer; while (SubString) @@ -293,7 +292,7 @@ AsRemoveConditionalCompile ( /* Remove the lines */ - SubBuffer = AsRemoveData (SubString, SubBuffer); + (void) AsRemoveData (SubString, SubBuffer); } } @@ -483,7 +482,7 @@ AsReduceTypedefs ( /* Remove the typedef itself */ SubBuffer = SubString + strlen ("typedef") + 1; - SubBuffer = AsRemoveData (SubString, SubBuffer); + (void) AsRemoveData (SubString, SubBuffer); /* Find the opening brace of the struct or union */ diff --git a/tests/aslts.sh b/tests/aslts.sh index 7a478da..0e6071c 100755 --- a/tests/aslts.sh +++ b/tests/aslts.sh @@ -13,6 +13,7 @@ TEST_CASES= TEST_MODES= REBUILD_TOOLS=yes BINCOMPONLY=no +DATATABLEONLY=no EXECONLY=no usage() { @@ -25,6 +26,7 @@ usage() { echo " -u: Do not force rebuilding of ACPICA utilities (acpiexec, iasl)" echo " -e: Perform the execution of aml files and omit binary comparison of regular aml and disassembled aml file." echo " -b: Only perform binary comparison of regular aml and disasssembled aml file" + echo " -d: Only execute data table compiler/disassembler test" echo "" echo "Available test modes:" @@ -129,7 +131,7 @@ run_compiler_template_test() rm -f *.asl *.aml *.dsl - iasl -T all 2> /dev/null + $ASL -T all 2> /dev/null for filename in *.asl do make -s NAME=$(basename "$filename" .asl) @@ -151,6 +153,10 @@ run_aslts() { run_compiler_template_test + if [ "x$DATATABLEONLY" = "xyes" ]; then + return 0 + fi; + if [ "x$TEST_MODES" = "x" ]; then TEST_MODES="n32 n64 o32 o64" fi @@ -189,7 +195,7 @@ RESET_SETTINGS INIT_ALL_AVAILABLE_CASES INIT_ALL_AVAILABLE_MODES -while getopts "c:m:ueb" opt +while getopts "c:m:uebd" opt do case $opt in b) @@ -205,6 +211,10 @@ do TEST_CASES="$OPTARG $TEST_CASES" fi ;; + d) + DATATABLEONLY=yes + echo "Running only data table test" + ;; e) EXECONLY=yes echo "Running tests without binary comparisons" diff --git a/tests/misc/grammar.aml b/tests/misc/grammar.aml new file mode 100755 index 0000000..4acb2d9 Binary files /dev/null and b/tests/misc/grammar.aml differ diff --git a/tests/misc/grammar.dsl b/tests/misc/grammar.dsl index 503683e..4cff0ef 100755 --- a/tests/misc/grammar.dsl +++ b/tests/misc/grammar.dsl @@ -1,24 +1,24 @@ /* * Intel ACPI Component Architecture - * AML/ASL+ Disassembler version 20190703 (32-bit version) + * AML/ASL+ Disassembler version 20190816 (32-bit version) * Copyright (c) 2000 - 2019 Intel Corporation * * Disassembling to symbolic ASL+ operators * - * Disassembly of grammar.aml, Fri Aug 2 09:06:27 2019 + * Disassembly of grammar.aml, Wed Aug 21 07:49:43 2019 * * Original Table Header: * Signature "DSDT" * Length 0x0000AAEE (43758) * Revision 0x01 **** 32-bit table (V1), no 64-bit math support - * Checksum 0xAE + * Checksum 0x9A * OEM ID "Intel" * OEM Table ID "GRMTEST" * OEM Revision 0x20090511 (537462033) * Compiler ID "INTL" - * Compiler Version 0x20190703 (538511107) + * Compiler Version 0x20190816 (538511382) */ -DefinitionBlock ("", "DSDT", 1, "Intel", "GRMTEST", 0x20090511) +DefinitionBlock("", "DSDT", 1, "Intel", "GRMTEST", 0x20090511) { External (ABCD, UnknownObj) diff --git a/tests/templates/Makefile b/tests/templates/Makefile index bc08d63..88c7824 100644 --- a/tests/templates/Makefile +++ b/tests/templates/Makefile @@ -1,5 +1,5 @@ # Before running this file, we assume we have generated all tables by running -# the command `iasl -T ALL` +# the command `$(ASL) -T ALL` # # Note: the NAME flag is required when running the test @@ -12,17 +12,17 @@ all: $(aml_obj2) # recompile and binary compare $(aml_obj2): %_recomp.aml: %.dsl - iasl -p `basename $@` $< > /dev/null 2> /dev/null - acpibin -c $@ $(patsubst %_recomp.aml,%.aml,$@) > /dev/null 2> /dev/null + $(ASL) -p `basename $@` $< > /dev/null 2> /dev/null + $(acpibin) -c $@ $(patsubst %_recomp.aml,%.aml,$@) > /dev/null 2> /dev/null printf "Data table %s PASS\n" $(basename $< .dsl) # disassemble $(dsl_obj): %.dsl: %.aml - iasl -d $< > /dev/null 2> /dev/null + $(ASL) -d $< > /dev/null 2> /dev/null # initial compile $(aml_obj): %.aml: %.asl - iasl $< > /dev/null 2> /dev/null + $(ASL) $< > /dev/null 2> /dev/null templates :