summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/conf/files2
-rw-r--r--sys/contrib/dev/acpica/changes.txt282
-rw-r--r--sys/contrib/dev/acpica/common/acfileio.c32
-rw-r--r--sys/contrib/dev/acpica/common/adfile.c10
-rw-r--r--sys/contrib/dev/acpica/common/adisasm.c14
-rw-r--r--sys/contrib/dev/acpica/common/adwalk.c113
-rw-r--r--sys/contrib/dev/acpica/common/ahids.c1
-rw-r--r--sys/contrib/dev/acpica/common/ahpredef.c15
-rw-r--r--sys/contrib/dev/acpica/common/ahtable.c4
-rw-r--r--sys/contrib/dev/acpica/common/ahuuids.c4
-rw-r--r--sys/contrib/dev/acpica/common/dmextern.c520
-rw-r--r--sys/contrib/dev/acpica/common/dmrestag.c36
-rw-r--r--sys/contrib/dev/acpica/common/dmswitch.c679
-rw-r--r--sys/contrib/dev/acpica/common/dmtable.c80
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump.c350
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo.c340
-rw-r--r--sys/contrib/dev/acpica/compiler/aslanalyze.c4
-rw-r--r--sys/contrib/dev/acpica/compiler/aslascii.c5
-rw-r--r--sys/contrib/dev/acpica/compiler/aslbtypes.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcodegen.c4
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompile.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.h133
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.l7
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcstyle.y166
-rw-r--r--sys/contrib/dev/acpica/compiler/asldefine.h6
-rw-r--r--sys/contrib/dev/acpica/compiler/aslerror.c165
-rw-r--r--sys/contrib/dev/acpica/compiler/aslexternal.c23
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfold.c40
-rw-r--r--sys/contrib/dev/acpica/compiler/aslglobal.h38
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhelp.c14
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhelpers.y43
-rw-r--r--sys/contrib/dev/acpica/compiler/aslkeywords.y348
-rw-r--r--sys/contrib/dev/acpica/compiler/asllength.c6
-rw-r--r--sys/contrib/dev/acpica/compiler/asllisting.c10
-rw-r--r--sys/contrib/dev/acpica/compiler/aslload.c108
-rw-r--r--sys/contrib/dev/acpica/compiler/asllookup.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmain.c41
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmap.c47
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapoutput.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.h1
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmethod.c30
-rw-r--r--sys/contrib/dev/acpica/compiler/asloffset.c5
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopcodes.c12
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopt.c4
-rw-r--r--sys/contrib/dev/acpica/compiler/asloptions.c21
-rw-r--r--sys/contrib/dev/acpica/compiler/aslparseop.c953
-rw-r--r--sys/contrib/dev/acpica/compiler/aslparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpld.c6
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprimaries.y548
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprintf.c14
-rw-r--r--sys/contrib/dev/acpica/compiler/aslresource.c41
-rw-r--r--sys/contrib/dev/acpica/compiler/aslresources.y252
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2s.c917
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrules.y231
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstartup.c13
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.l15
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/asltokens.y6
-rw-r--r--sys/contrib/dev/acpica/compiler/asltransform.c84
-rw-r--r--sys/contrib/dev/acpica/compiler/asltree.c1162
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.h53
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.y6
-rw-r--r--sys/contrib/dev/acpica/compiler/aslutils.c73
-rw-r--r--sys/contrib/dev/acpica/compiler/aslwalks.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslxref.c19
-rw-r--r--sys/contrib/dev/acpica/compiler/cvcompiler.c203
-rw-r--r--sys/contrib/dev/acpica/compiler/cvdisasm.c62
-rw-r--r--sys/contrib/dev/acpica/compiler/cvparser.c183
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompile.c21
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompiler.h12
-rw-r--r--sys/contrib/dev/acpica/compiler/dtfield.c30
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable1.c228
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable2.c134
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.h184
-rw-r--r--sys/contrib/dev/acpica/compiler/dtutils.c14
-rw-r--r--sys/contrib/dev/acpica/compiler/prmacros.c2
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbdisply.c33
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbexec.c12
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbobject.c6
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbxface.c2
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmbuffer.c4
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmdeferred.c6
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmopcode.c443
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrc.c17
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c466
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmwalk.c25
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsargs.c5
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsdebug.c1
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsfield.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmethod.c14
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsobject.c392
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsopcode.c17
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dspkginit.c635
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsutils.c6
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswexec.c3
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload.c38
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload2.c18
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfevnt.c21
-rw-r--r--sys/contrib/dev/acpica/components/executer/excreate.c59
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdebug.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdump.c68
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmisc.c9
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg1.c26
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg2.c2
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresolv.c24
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwregs.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxfsleep.c15
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsaccess.c53
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsarguments.c22
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsinit.c14
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsnames.c13
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsprepkg.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsutils.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfeval.c41
-rw-r--r--sys/contrib/dev/acpica/components/parser/psloop.c10
-rw-r--r--sys/contrib/dev/acpica/components/parser/psobject.c40
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopcode.c2
-rw-r--r--sys/contrib/dev/acpica/components/parser/psparse.c14
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscalc.c112
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdump.c47
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdumpinfo.c68
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsinfo.c28
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmisc.c5
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsserial.c347
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsxface.c7
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbdata.c261
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfadt.c4
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbinstal.c174
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbutils.c44
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxface.c40
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfload.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdecode.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uthex.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmath.c261
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmisc.c13
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utobject.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utownerid.c12
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utresdecode.c461
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utresrc.c323
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstate.c2
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstrtoul64.c8
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uttrack.c10
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfmutex.c4
-rw-r--r--sys/contrib/dev/acpica/include/acapps.h6
-rw-r--r--sys/contrib/dev/acpica/include/acdisasm.h107
-rw-r--r--sys/contrib/dev/acpica/include/acdispat.h17
-rw-r--r--sys/contrib/dev/acpica/include/acglobal.h3
-rw-r--r--sys/contrib/dev/acpica/include/aclocal.h33
-rw-r--r--sys/contrib/dev/acpica/include/acnames.h1
-rw-r--r--sys/contrib/dev/acpica/include/acobject.h14
-rw-r--r--sys/contrib/dev/acpica/include/acopcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/acpi.h4
-rw-r--r--sys/contrib/dev/acpica/include/acpixf.h15
-rw-r--r--sys/contrib/dev/acpica/include/acpredef.h14
-rw-r--r--sys/contrib/dev/acpica/include/acresrc.h14
-rw-r--r--sys/contrib/dev/acpica/include/acrestyp.h103
-rw-r--r--sys/contrib/dev/acpica/include/actables.h8
-rw-r--r--sys/contrib/dev/acpica/include/actbl.h15
-rw-r--r--sys/contrib/dev/acpica/include/actbl1.h292
-rw-r--r--sys/contrib/dev/acpica/include/actbl2.h99
-rw-r--r--sys/contrib/dev/acpica/include/actbl3.h91
-rw-r--r--sys/contrib/dev/acpica/include/actypes.h75
-rw-r--r--sys/contrib/dev/acpica/include/acutils.h21
-rw-r--r--sys/contrib/dev/acpica/include/acuuid.h5
-rw-r--r--sys/contrib/dev/acpica/include/amlcode.h61
-rw-r--r--sys/contrib/dev/acpica/include/amlresrc.h118
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenv.h5
-rw-r--r--sys/contrib/dev/acpica/include/platform/acfreebsd.h1
-rw-r--r--sys/contrib/dev/acpica/include/platform/acgcc.h14
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c12
-rw-r--r--sys/dev/acpica/acpi.c17
-rw-r--r--usr.sbin/acpi/acpidb/Makefile11
-rw-r--r--usr.sbin/acpi/iasl/Makefile37
175 files changed, 11239 insertions, 4063 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 7e878af..1251b37 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -340,6 +340,7 @@ contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi
contrib/dev/acpica/components/dispatcher/dsmthdat.c optional acpi
contrib/dev/acpica/components/dispatcher/dsobject.c optional acpi
contrib/dev/acpica/components/dispatcher/dsopcode.c optional acpi
+contrib/dev/acpica/components/dispatcher/dspkginit.c optional acpi
contrib/dev/acpica/components/dispatcher/dsutils.c optional acpi
contrib/dev/acpica/components/dispatcher/dswexec.c optional acpi
contrib/dev/acpica/components/dispatcher/dswload.c optional acpi
@@ -477,6 +478,7 @@ contrib/dev/acpica/components/utilities/utobject.c optional acpi
contrib/dev/acpica/components/utilities/utosi.c optional acpi
contrib/dev/acpica/components/utilities/utownerid.c optional acpi
contrib/dev/acpica/components/utilities/utpredef.c optional acpi
+contrib/dev/acpica/components/utilities/utresdecode.c optional acpi acpi_debug
contrib/dev/acpica/components/utilities/utresrc.c optional acpi
contrib/dev/acpica/components/utilities/utstate.c optional acpi
contrib/dev/acpica/components/utilities/utstring.c optional acpi
diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt
index 18b43b8..d0fe928 100644
--- a/sys/contrib/dev/acpica/changes.txt
+++ b/sys/contrib/dev/acpica/changes.txt
@@ -1,4 +1,286 @@
----------------------------------------
+28 July 2017. Summary of changes for version 20170728:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a regression seen with small resource descriptors that could cause
+an inadvertent AE_AML_NO_RESOURCE_END_TAG exception.
+
+AML interpreter: Implemented a new feature that allows forward references
+from individual named references within package objects that are
+contained within blocks of "module-level code". This provides
+compatibility with other ACPI implementations and supports existing
+firmware that depends on this feature. Example:
+
+ Name (ABCD, 1)
+ If (ABCD) /* An If() at module-level */
+ {
+ Name (PKG1, Package()
+ {
+ INT1 /* Forward reference to object INT1
+*/
+ })
+ Name (INT1, 0x1234)
+ }
+
+AML Interpreter: Fixed a problem with the Alias() operator where aliases
+to some ASL objects were not handled properly. Objects affected are:
+Mutex, Event, and OperationRegion.
+
+AML Debugger: Enhanced to properly handle AML Alias objects. These
+objects have one level of indirection which was not fully supported by
+the debugger.
+
+Table Manager: Added support to detect and ignore duplicate SSDTs within
+the XSDT/RSDT. This error in the XSDT has been seen in the field.
+
+EFI and EDK2 support:
+ Enabled /WX flag for MSVC builds
+ Added support for AcpiOsStall, AcpiOsSleep, and AcpiOsGetTimer
+ Added local support for 64-bit multiply and shift operations
+ Added support to compile acpidump.efi on Windows
+ Added OSL function stubs for interfaces not used under EFI
+
+Added additional support for the _DMA predefined name. _DMA returns a
+buffer containing a resource template. This change add support within the
+resource manager (AcpiWalkResourceBuffer) to walk and parse this list of
+resource descriptors. Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a problem where the internal input line buffer(s) could
+overflow if there are very long lines in the input ASL source code file.
+Implemented buffer management that automatically increases the size of
+the buffers as necessary.
+
+iASL: Added an option (-vx) to "expect" particular remarks, warnings and
+errors. If the specified exception is not raised during compilation, the
+compiler emits an error. This is intended to support the ASL test suite,
+but may be useful in other contexts.
+
+iASL: Implemented a new predefined macro, __METHOD__, which returns a
+string containing the name of the current control method that is being
+compiled.
+
+iASL: Implemented debugger and table compiler support for the SDEI ACPI
+table (Software Delegated Exception Interface). James Morse
+<james.morse@arm.com>
+
+Unix/Linux makefiles: Added an option to disable compile optimizations.
+The disable occurs when the NOOPT flag is set to TRUE.
+theracermaster@gmail.com
+
+Acpidump: Added support for multiple DSDT and FACS tables. This can occur
+when there are different tables for 32-bit versus 64-bit.
+
+Enhanced error reporting for the ASL test suite (ASLTS) by removing
+unnecessary/verbose text, and emit the actual line number where an error
+has occurred. These changes are intended to improve the usefulness of the
+test suite.
+
+----------------------------------------
+29 June 2017. Summary of changes for version 20170629:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Tables: Implemented a deferred ACPI table verification. This is useful
+for operating systems where the tables cannot be verified in the early
+initialization stage due to early memory mapping limitations on some
+architectures. Lv Zheng.
+
+Tables: Removed the signature validation for dynamically loaded tables.
+Provides compatibility with other ACPI implementations. Previously, only
+SSDT tables were allowed, as per the ACPI specification. Now, any table
+signature can be used via the Load() operator. Lv Zheng.
+
+Tables: Fixed several mutex issues that could cause errors during table
+acquisition. Lv Zheng.
+
+Tables: Fixed a problem where an ACPI warning could be generated if a
+null pointer was passed to the AcpiPutTable interface. Lv Zheng.
+
+Tables: Added a mechanism to handle imbalances for the AcpiGetTable and
+AcpiPutTable interfaces. This applies to the "late stage" table loading
+when the use of AcpiPutTable is no longer required (since the system
+memory manager is fully running and available). Lv Zheng.
+
+Fixed/Reverted a regression during processing of resource descriptors
+that contain only a single EndTag. Fixes an AE_AML_NO_RESOURCE_END_TAG
+exception in this case.
+
+Headers: IORT/SMMU support: Updated the SMMU models for Revision C of the
+I/O Remapping specification. Robin Murphy <robin.murphy@arm.com>
+
+Interpreter: Fixed a possible fault if an Alias operator with an invalid
+or duplicate target is encountered during Alias creation in
+AcpiExCreateAlias. Alex James <theracermaster@gmail.com>
+
+Added an option to use designated initializers for function pointers.
+Kees Cook <keescook@google.com>
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Allow compilation of External declarations with target pathnames
+that refer to existing named objects within the table. Erik Schmauss.
+
+iASL: Fixed a regression when compiling FieldUnits. Fixes an error if a
+FieldUnit name also is declared via External in the same table. Erik
+Schmauss.
+
+iASL: Allow existing scope names within pathnames used in External
+statements. For example:
+ External (ABCD.EFGH) // ABCD exists, but EFGH is truly external
+ Device (ABCD)
+
+iASL: IORT ACPI table: Implemented changes required to decode the new
+Proximity Domain for the SMMUv3 IORT. Disassembler and Data Table
+compiler. Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
+
+Disassembler: Don't abort disassembly on errors from External()
+statements. Erik Schmauss.
+
+Disassembler: fixed a possible fault when one of the Create*Field
+operators references a Resource Template. ACPICA Bugzilla 1396.
+
+iASL: In the source code, resolved some naming inconsistences across the
+parsing support. Fixes confusion between "Parse Op" and "Parse Node".
+Adds a new file, aslparseop.c
+
+----------------------------------------
+31 May 2017. Summary of changes for version 20170531:
+
+
+0) ACPI 6.2 support:
+
+The ACPI specification version 6.2 has been released and is available at
+http://uefi.org/specifications
+
+This version of ACPICA fully supports the ACPI 6.2 specification. Changes
+are summarized below.
+
+New ACPI tables (Table Compiler/Disassembler/Templates):
+ HMAT (Heterogeneous Memory Attributes Table)
+ WSMT (Windows SMM Security Mitigation Table)
+ PPTT (Processor Properties Topology Table)
+
+New subtables for existing ACPI tables:
+ HEST (New subtable, Arch-deferred machine check)
+ SRAT (New subtable, Arch-specific affinity structure)
+ PCCT (New subtables, Extended PCC subspaces (types 3 and 4))
+
+Simple updates for existing ACPI tables:
+ BGRT (two new flag bits)
+ HEST (New bit defined for several subtables, GHES_ASSIST)
+
+New Resource Descriptors and Resource macros (Compiler/Disassembler):
+ PinConfig()
+ PinFunction()
+ PinGroup()
+ PinGroupConfig()
+ PinGroupFunction()
+ New type for hardware error notification (section 18.3.2.9)
+
+New predefined names/methods (Compiler/Interpreter):
+ _HMA (Heterogeneous Memory Attributes)
+ _LSI (Label Storage Information)
+ _LSR (Label Storage Read)
+ _LSW (Label Storage Write)
+
+ASL grammar/macro changes (Compiler):
+ For() ASL macro, implemented with the AML while operator
+ Extensions to Concatenate operator
+ Support for multiple definition blocks in same ASL file
+ Clarification for Buffer operator
+ Allow executable AML code underneath all scopes (Devices, etc.)
+ Clarification/change for the _OSI return value
+ ASL grammar update for reference operators
+ Allow a zero-length string for AML filename in DefinitionBlock
+
+Miscellaneous:
+ New device object notification value
+ Remove a notify value (0x0C) for graceful shutdown
+ New UUIDs for processor/cache properties and
+ physical package property
+ New _HID, ACPI0014 (Wireless Power Calibration Device)
+
+
+1) ACPICA kernel-resident subsystem:
+
+Added support to disable ACPI events on hardware-reduced platforms.
+Eliminates error messages of the form "Could not enable fixed event". Lv
+Zheng
+
+Fixed a problem using Device/Thermal objects with the ObjectType and
+DerefOf ASL operators. This support had not been fully/properly
+implemented.
+
+Fixed a problem where if a Buffer object containing a resource template
+was longer than the actual resource template, an error was generated --
+even though the AML is legal. This case has been seen in the field.
+
+Fixed a problem with the header definition of the MADT PCAT_COMPAT flag.
+The values for DUAL_PIC and MULTIPLE_APIC were reversed.
+
+Added header file changes for the TPM2 ACPI table. Update to new version
+of the TCG specification. Adds a new TPM2 subtable for ARM SMC.
+
+Exported the external interfaces AcpiAcquireMutex and AcpiReleaseMutex.
+These interfaces are intended to be used only in conjunction with the
+predefined _DLM method (Device Lock Method). "This object appears in a
+device scope when AML access to the device must be synchronized with the
+OS environment".
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 143.1K Code, 60.0K Data, 203.1K Total
+ Debug Version: 204.0K Code, 84.3K Data, 288.3K Total
+ Previous Release:
+ Non-Debug Version: 141.7K Code, 58.5K Data, 200.2K Total
+ Debug Version: 207.5K Code, 82.7K Data, 290.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a problem where an External() declaration could not refer to
+a Field Unit. Erik Schmauss.
+
+Disassembler: Improved support for the Switch/Case operators. This
+feature will disassemble AML code back to the original Switch operators
+when possible, instead of an If..Else sequence. David Box
+
+iASL and disassembler: Improved the handling of multiple extraneous
+parentheses for both ASL input and disassembled ASL output.
+
+Improved the behavior of the iASL compiler and disassembler to detect
+improper use of external declarations
+
+Disassembler: Now aborts immediately upon detection of an unknown AML
+opcode. The AML parser has no real way to recover from this, and can
+result in the creation of an ill-formed parse tree that causes errors
+later during the disassembly.
+
+All tools: Fixed a problem where the Unix application OSL did not handle
+control-c correctly. For example, a control-c could incorrectly wake the
+debugger.
+
+AcpiExec: Improved the Control-C handling and added a handler for
+segmentation faults (SIGSEGV). Supports both Windows and Unix-like
+environments.
+
+Reduced the verbosity of the generic unix makefiles. Previously, each
+compilation displayed the full set of compiler options. This has been
+eliminated as the options are easily inspected within the makefiles. Each
+compilation now results in a single line of output.
+
+----------------------------------------
03 March 2017. Summary of changes for version 20170303:
diff --git a/sys/contrib/dev/acpica/common/acfileio.c b/sys/contrib/dev/acpica/common/acfileio.c
index 0c1b9b5..83c1e8b5 100644
--- a/sys/contrib/dev/acpica/common/acfileio.c
+++ b/sys/contrib/dev/acpica/common/acfileio.c
@@ -175,6 +175,36 @@ AcCheckTextModeCorruption (
/*******************************************************************************
*
+ * FUNCTION: AcDeleteTableList
+ *
+ * PARAMETERS: ListHead - List to delete
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Delete a list of tables. This is useful for removing memory
+ * allocated by AcGetAllTablesFromFile
+ *
+ ******************************************************************************/
+
+void
+AcDeleteTableList (
+ ACPI_NEW_TABLE_DESC *ListHead)
+{
+ ACPI_NEW_TABLE_DESC *Current = ListHead;
+ ACPI_NEW_TABLE_DESC *Previous = Current;
+
+
+ while (Current)
+ {
+ Current = Current->Next;
+ AcpiOsFree (Previous);
+ Previous = Current;
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcGetAllTablesFromFile
*
* PARAMETERS: Filename - Table filename
@@ -531,8 +561,6 @@ AcValidateTableHeader (
if (!AcpiUtValidNameseg (TableHeader.Signature))
{
- fprintf (stderr, "Invalid table signature: 0x%8.8X\n",
- *ACPI_CAST_PTR (UINT32, TableHeader.Signature));
return (AE_BAD_SIGNATURE);
}
diff --git a/sys/contrib/dev/acpica/common/adfile.c b/sys/contrib/dev/acpica/common/adfile.c
index 729f39c..115a185 100644
--- a/sys/contrib/dev/acpica/common/adfile.c
+++ b/sys/contrib/dev/acpica/common/adfile.c
@@ -316,11 +316,6 @@ FlGenerateFilename (
*/
NewFilename = UtStringCacheCalloc ((ACPI_SIZE)
strlen (InputFilename) + strlen (Suffix) + 2);
- if (!NewFilename)
- {
- return (NULL);
- }
-
strcpy (NewFilename, InputFilename);
/* Try to find the last dot in the filename */
@@ -364,11 +359,6 @@ FlStrdup (
NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
- if (!NewString)
- {
- return (NULL);
- }
-
strcpy (NewString, String);
return (NewString);
}
diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c
index 1f2c1b7..4ee6b99 100644
--- a/sys/contrib/dev/acpica/common/adisasm.c
+++ b/sys/contrib/dev/acpica/common/adisasm.c
@@ -408,6 +408,8 @@ Cleanup:
ACPI_FREE (Table);
}
+ AcDeleteTableList (ListHead);
+
if (File)
{
fclose (File);
@@ -537,7 +539,7 @@ AdDisassembleOneTable (
* the entire tree with the new information (namely, the
* number of arguments per method)
*/
- if (AcpiDmGetExternalMethodCount ())
+ if (AcpiDmGetUnresolvedExternalMethodCount ())
{
Status = AdReparseOneTable (Table, File, OwnerId);
if (ACPI_FAILURE (Status))
@@ -553,7 +555,7 @@ AdDisassembleOneTable (
* 1) Convert fixed-offset references to resource descriptors
* to symbolic references (Note: modifies namespace)
*/
- AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
+ AcpiDmConvertParseObjects (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
/* Optional displays */
@@ -616,7 +618,7 @@ AdReparseOneTable (
fprintf (stderr,
"\nFound %u external control methods, "
"reparsing with new information\n",
- AcpiDmGetExternalMethodCount ());
+ AcpiDmGetUnresolvedExternalMethodCount ());
/* Reparse, rebuild namespace */
@@ -642,7 +644,7 @@ AdReparseOneTable (
/* New namespace, add the external definitions first */
- AcpiDmAddExternalsToNamespace ();
+ AcpiDmAddExternalListToNamespace ();
/* For -ca option: clear the list of comment addresses. */
@@ -748,6 +750,7 @@ AdDoExternalFileList (
continue;
}
+ AcDeleteTableList (ExternalListHead);
return (Status);
}
@@ -761,6 +764,7 @@ AdDoExternalFileList (
{
AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
AcpiFormatException (Status));
+ AcDeleteTableList (ExternalListHead);
return (Status);
}
@@ -780,6 +784,8 @@ AdDoExternalFileList (
ExternalFileList = ExternalFileList->Next;
}
+ AcDeleteTableList (ExternalListHead);
+
if (ACPI_FAILURE (GlobalStatus))
{
return (GlobalStatus);
diff --git a/sys/contrib/dev/acpica/common/adwalk.c b/sys/contrib/dev/acpica/common/adwalk.c
index 35d42ba..2cd328d 100644
--- a/sys/contrib/dev/acpica/common/adwalk.c
+++ b/sys/contrib/dev/acpica/common/adwalk.c
@@ -208,11 +208,16 @@ AcpiDmInspectPossibleArgs (
ACPI_PARSE_OBJECT *Op);
static ACPI_STATUS
-AcpiDmResourceDescendingOp (
+AcpiDmCommonDescendingOp (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
+static ACPI_STATUS
+AcpiDmProcessResourceDescriptors (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context);
/*******************************************************************************
*
@@ -395,21 +400,21 @@ AcpiDmCrossReferenceNamespace (
/*******************************************************************************
*
- * FUNCTION: AcpiDmConvertResourceIndexes
+ * FUNCTION: AcpiDmConvertParseObjects
*
* PARAMETERS: ParseTreeRoot - Root of the parse tree
* NamespaceRoot - Root of the internal namespace
*
* RETURN: None
*
- * DESCRIPTION: Convert fixed-offset references to resource descriptors to
- * symbolic references. Should only be called after namespace has
- * been cross referenced.
+ * DESCRIPTION: Begin parse tree walk to perform conversions needed for
+ * disassembly. These include resource descriptors and switch/case
+ * operations.
*
******************************************************************************/
void
-AcpiDmConvertResourceIndexes (
+AcpiDmConvertParseObjects (
ACPI_PARSE_OBJECT *ParseTreeRoot,
ACPI_NAMESPACE_NODE *NamespaceRoot)
{
@@ -443,9 +448,14 @@ AcpiDmConvertResourceIndexes (
Info.Level = 0;
Info.WalkState = WalkState;
- AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmResourceDescendingOp,
+ AcpiDmWalkParseTree (ParseTreeRoot, AcpiDmCommonDescendingOp,
AcpiDmCommonAscendingOp, &Info);
ACPI_FREE (WalkState);
+
+ if (AcpiGbl_TempListHead) {
+ AcpiDmClearTempList();
+ }
+
return;
}
@@ -526,11 +536,20 @@ AcpiDmDumpDescending (
case AML_NAME_OP:
case AML_METHOD_OP:
case AML_DEVICE_OP:
+
+ AcpiOsPrintf ("%4.4s",
+ ACPI_CAST_PTR (char, &Op->Named.Name));
+ break;
+
case AML_INT_NAMEDFIELD_OP:
- AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name));
+ AcpiOsPrintf ("%4.4s Length: (bits) %8.8X%8.8X (bytes) %8.8X%8.8X",
+ ACPI_CAST_PTR (char, &Op->Named.Name),
+ ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),
+ ACPI_FORMAT_UINT64 (Op->Common.Value.Integer / 8));
break;
+
default:
break;
@@ -737,7 +756,6 @@ AcpiDmLoadDescendingOp (
WalkState = Info->WalkState;
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
- ObjectType = OpInfo->ObjectType;
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
/* Only interested in operators that create new names */
@@ -754,7 +772,7 @@ AcpiDmLoadDescendingOp (
{
/* For all named operators, get the new name */
- Path = (char *) Op->Named.Path;
+ Path = Op->Named.Path;
if (!Path && Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
{
@@ -875,7 +893,6 @@ AcpiDmXrefDescendingOp (
WalkState = Info->WalkState;
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
- ObjectType = OpInfo->ObjectType;
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
if ((!(OpInfo->Flags & AML_NAMED)) &&
@@ -885,25 +902,6 @@ AcpiDmXrefDescendingOp (
{
goto Exit;
}
- else if (Op->Common.Parent &&
- Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP)
- {
- /* External() NamePath */
-
- Path = Op->Common.Value.String;
- ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer;
- if (ObjectType == ACPI_TYPE_METHOD)
- {
- ParamCount = (UINT32)
- Op->Common.Next->Common.Next->Common.Value.Integer;
- }
-
- Flags |= ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_OPCODE;
- AcpiDmAddOpToExternalList (Op, Path,
- (UINT8) ObjectType, ParamCount, Flags);
-
- goto Exit;
- }
/* Get the NamePath from the appropriate place */
@@ -924,9 +922,10 @@ AcpiDmXrefDescendingOp (
Path = NextOp->Common.Value.String;
}
}
- else if (Op->Common.AmlOpcode == AML_SCOPE_OP)
+ else if (Op->Common.AmlOpcode == AML_SCOPE_OP ||
+ Op->Common.AmlOpcode == AML_EXTERNAL_OP)
{
- Path = (char *) Op->Named.Path;
+ Path = Op->Named.Path;
}
}
else if (OpInfo->Flags & AML_CREATE)
@@ -1060,21 +1059,58 @@ Exit:
return (AE_OK);
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmCommonDescendingOp
+ *
+ * PARAMETERS: ASL_WALK_CALLBACK
+ *
+ * RETURN: ACPI_STATUS
+ *
+ * DESCRIPTION: Perform parse tree preprocessing before main disassembly walk.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDmCommonDescendingOp (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context)
+{
+ ACPI_STATUS Status;
+
+
+ /* Resource descriptor conversion */
+
+ Status = AcpiDmProcessResourceDescriptors (Op, Level, Context);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Switch/Case conversion */
+
+ Status = AcpiDmProcessSwitch (Op);
+ return (AE_OK);
+}
+
/*******************************************************************************
*
- * FUNCTION: AcpiDmResourceDescendingOp
+ * FUNCTION: AcpiDmProcessResourceDescriptors
*
* PARAMETERS: ASL_WALK_CALLBACK
*
- * RETURN: None
+ * RETURN: ACPI_STATUS
*
- * DESCRIPTION: Process one parse op during symbolic resource index conversion.
+ * DESCRIPTION: Convert fixed-offset references to resource descriptors to
+ * symbolic references. Should only be called after namespace has
+ * been cross referenced.
*
******************************************************************************/
static ACPI_STATUS
-AcpiDmResourceDescendingOp (
+AcpiDmProcessResourceDescriptors (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
@@ -1114,7 +1150,6 @@ AcpiDmResourceDescendingOp (
return (AE_OK);
}
-
/*******************************************************************************
*
* FUNCTION: AcpiDmCommonAscendingOp
@@ -1135,14 +1170,11 @@ AcpiDmCommonAscendingOp (
void *Context)
{
ACPI_OP_WALK_INFO *Info = Context;
- const ACPI_OPCODE_INFO *OpInfo;
ACPI_OBJECT_TYPE ObjectType;
/* Close scope if necessary */
- OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
- ObjectType = OpInfo->ObjectType;
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
if (AcpiNsOpensScope (ObjectType))
@@ -1153,7 +1185,6 @@ AcpiDmCommonAscendingOp (
return (AE_OK);
}
-
/*******************************************************************************
*
* FUNCTION: AcpiDmInspectPossibleArgs
diff --git a/sys/contrib/dev/acpica/common/ahids.c b/sys/contrib/dev/acpica/common/ahids.c
index dad6c57..957a4fc 100644
--- a/sys/contrib/dev/acpica/common/ahids.c
+++ b/sys/contrib/dev/acpica/common/ahids.c
@@ -187,6 +187,7 @@ const AH_DEVICE_ID AslDeviceIds[] =
{"ACPI0011", "Generic Buttons Device"},
{"ACPI0012", "NVDIMM Root Device"},
{"ACPI0013", "Generic Event Device"},
+ {"ACPI0014", "Wireless Power Calibration Device"},
{"ADMA0F28", "Intel Audio DMA"},
{"AMCR0F28", "Intel Audio Machine Driver"},
{"ATK4001", "Asus Radio Control Button"},
diff --git a/sys/contrib/dev/acpica/common/ahpredef.c b/sys/contrib/dev/acpica/common/ahpredef.c
index 75c7b95..7892eec 100644
--- a/sys/contrib/dev/acpica/common/ahpredef.c
+++ b/sys/contrib/dev/acpica/common/ahpredef.c
@@ -254,6 +254,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"),
AH_PREDEF ("_FSL", "Fan Set Level", "Control method that sets the fan device's speed level (performance state)"),
AH_PREDEF ("_FST", "Fan Status", "Returns current status information for a fan device"),
+ AH_PREDEF ("_FUN", "Function Number", "Resource descriptor field"),
AH_PREDEF ("_GAI", "Get Averaging Interval", "Returns the power meter averaging interval"),
AH_PREDEF ("_GCP", "Get Capabilities", "Get device time capabilities"),
AH_PREDEF ("_GHL", "Get Hardware Limit", "Returns the hardware limit enforced by the power meter"),
@@ -270,6 +271,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_GWS", "Get Wake Status", "Return status of wake alarms"),
AH_PREDEF ("_HE_", "High-Edge", "Interrupt triggering, Resource Descriptor field"),
AH_PREDEF ("_HID", "Hardware ID", "Returns a device's Plug and Play Hardware ID"),
+ AH_PREDEF ("_HMA", "Heterogeneous Memory Attributes", "Returns a list of HMAT structures."),
AH_PREDEF ("_HOT", "Hot Temperature", "Returns the critical temperature for sleep (entry to S4)"),
AH_PREDEF ("_HPP", "Hot Plug Parameters", "Returns a list of hot-plug information for a PCI device"),
AH_PREDEF ("_HPX", "Hot Plug Parameter Extensions", "Returns a list of hot-plug information for a PCI device. Supersedes _HPP"),
@@ -287,6 +289,9 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"),
AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"),
AH_PREDEF ("_LPI", "Low Power Idle States", "Returns a list of supported low power idle states"),
+ AH_PREDEF ("_LSI", "Label Storage Information", "Returns information about the Label Storage Area associated with the NVDIMM object."),
+ AH_PREDEF ("_LSR", "Label Storage Read", "Returns label data from the Label Storage Area of the NVDIMM object."),
+ AH_PREDEF ("_LSW", "Label Storage Write", "Writes label data in to the Label Storage Area of the NVDIMM object."),
AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"),
AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"),
AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"),
@@ -439,6 +444,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_UPC", "USB Port Capabilities", "Returns a list of USB port capabilities"),
AH_PREDEF ("_UPD", "User Presence Detect", "Returns user detection information"),
AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"),
+ AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"),
AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"),
AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"),
AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"),
@@ -468,6 +474,15 @@ AcpiAhMatchPredefinedName (
const AH_PREDEFINED_NAME *Info;
+ /* Nameseg must start with an underscore */
+
+ if (*Nameseg != '_')
+ {
+ return (NULL);
+ }
+
+ /* Search for a match in the predefined name table */
+
for (Info = AslPredefinedInfo; Info->Name; Info++)
{
if (ACPI_COMPARE_NAME (Nameseg, Info->Name))
diff --git a/sys/contrib/dev/acpica/common/ahtable.c b/sys/contrib/dev/acpica/common/ahtable.c
index fdc84c5..c288edf 100644
--- a/sys/contrib/dev/acpica/common/ahtable.c
+++ b/sys/contrib/dev/acpica/common/ahtable.c
@@ -218,6 +218,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] =
{ACPI_SIG_FPDT, "Firmware Performance Data Table"},
{ACPI_SIG_GTDT, "Generic Timer Description Table"},
{ACPI_SIG_HEST, "Hardware Error Source Table"},
+ {ACPI_SIG_HMAT, "Heterogeneous Memory Attributes Table"},
{ACPI_SIG_HPET, "High Precision Event Timer table"},
{ACPI_SIG_IORT, "IO Remapping Table"},
{ACPI_SIG_IVRS, "I/O Virtualization Reporting Structure"},
@@ -232,11 +233,13 @@ const AH_TABLE Gbl_AcpiSupportedTables[] =
{ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"},
{ACPI_SIG_PCCT, "Platform Communications Channel Table"},
{ACPI_SIG_PMTT, "Platform Memory Topology Table"},
+ {ACPI_SIG_PPTT, "Processor Properties Topology Table"},
{ACPI_SIG_RASF, "RAS Features Table"},
{ACPI_RSDP_NAME,"Root System Description Pointer"},
{ACPI_SIG_RSDT, "Root System Description Table"},
{ACPI_SIG_S3PT, "S3 Performance Table"},
{ACPI_SIG_SBST, "Smart Battery Specification Table"},
+ {ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"},
{ACPI_SIG_SLIC, "Software Licensing Description Table"},
{ACPI_SIG_SLIT, "System Locality Information Table"},
{ACPI_SIG_SPCR, "Serial Port Console Redirection table"},
@@ -253,6 +256,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] =
{ACPI_SIG_WDDT, "Watchdog Description Table"},
{ACPI_SIG_WDRT, "Watchdog Resource Table"},
{ACPI_SIG_WPBT, "Windows Platform Binary Table"},
+ {ACPI_SIG_WSMT, "Windows SMM Security Migrations Table"},
{ACPI_SIG_XENV, "Xen Environment table"},
{ACPI_SIG_XSDT, "Extended System Description Table"},
{NULL, NULL}
diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c
index f73520f..a0b4508 100644
--- a/sys/contrib/dev/acpica/common/ahuuids.c
+++ b/sys/contrib/dev/acpica/common/ahuuids.c
@@ -186,6 +186,10 @@ const AH_UUID Gbl_AcpiUuids[] =
{"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK},
{"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD},
+ {"[Processor Properties]", NULL},
+ {"Cache Properties", UUID_CACHE_PROPERTIES},
+ {"Physical Package Property", UUID_PHYSICAL_PROPERTY},
+
{"[Miscellaneous]", NULL},
{"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES},
{"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION},
diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c
index a8aecf8..e303674 100644
--- a/sys/contrib/dev/acpica/common/dmextern.c
+++ b/sys/contrib/dev/acpica/common/dmextern.c
@@ -199,6 +199,9 @@ static const char *AcpiGbl_DmTypeNames[] =
#define METHOD_SEPARATORS " \t,()\n"
+static const char *ExternalConflictMessage =
+ " // Conflicts with a later declaration";
+
/* Local prototypes */
@@ -211,6 +214,16 @@ AcpiDmNormalizeParentPrefix (
ACPI_PARSE_OBJECT *Op,
char *Path);
+static ACPI_STATUS
+AcpiDmGetExternalAndInternalPath (
+ ACPI_NAMESPACE_NODE *Node,
+ char **ExternalPath,
+ char **InternalPath);
+
+static ACPI_STATUS
+AcpiDmRemoveRootPrefix (
+ char **Path);
+
static void
AcpiDmAddPathToExternalList (
char *Path,
@@ -226,6 +239,21 @@ AcpiDmCreateNewExternal (
UINT32 Value,
UINT16 Flags);
+static void
+AcpiDmCheckForExternalConflict (
+ char *Path);
+
+static ACPI_STATUS
+AcpiDmResolveExternal (
+ char *Path,
+ UINT8 Type,
+ ACPI_NAMESPACE_NODE **Node);
+
+
+static void
+AcpiDmConflictingDeclaration (
+ char *Path);
+
/*******************************************************************************
*
@@ -582,7 +610,7 @@ AcpiDmGetExternalsFromFile (
{
/* Add the external(s) to the namespace */
- AcpiDmAddExternalsToNamespace ();
+ AcpiDmAddExternalListToNamespace ();
AcpiOsPrintf ("%s: Imported %u external method definitions\n",
Gbl_ExternalRefFilename, ImportCount);
@@ -698,6 +726,86 @@ AcpiDmAddOpToExternalList (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmGetExternalAndInternalPath
+ *
+ * PARAMETERS: Node - Namespace node for object to be added
+ * ExternalPath - Will contain the external path of the node
+ * InternalPath - Will contain the internal path of the node
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Get the External and Internal path from the given node.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDmGetExternalAndInternalPath (
+ ACPI_NAMESPACE_NODE *Node,
+ char **ExternalPath,
+ char **InternalPath)
+{
+ ACPI_STATUS Status;
+
+
+ if (!Node)
+ {
+ return (AE_BAD_PARAMETER);
+ }
+
+ /* Get the full external and internal pathnames to the node */
+
+ *ExternalPath = AcpiNsGetExternalPathname (Node);
+ if (!*ExternalPath)
+ {
+ return (AE_BAD_PATHNAME);
+ }
+
+ Status = AcpiNsInternalizeName (*ExternalPath, InternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (*ExternalPath);
+ return (Status);
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmRemoveRootPrefix
+ *
+ * PARAMETERS: Path - Remove Root prefix from this Path
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Remove the root prefix character '\' from Path.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDmRemoveRootPrefix (
+ char **Path)
+{
+ char *InputPath = *Path;
+
+
+ if ((*InputPath == AML_ROOT_PREFIX) && (InputPath[1]))
+ {
+ if (!memmove(InputPath, InputPath+1, strlen(InputPath)))
+ {
+ return (AE_ERROR);
+ }
+
+ *Path = InputPath;
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmAddNodeToExternalList
*
* PARAMETERS: Node - Namespace node for object to be added
@@ -727,46 +835,27 @@ AcpiDmAddNodeToExternalList (
{
char *ExternalPath;
char *InternalPath;
- char *Temp;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (DmAddNodeToExternalList);
-
- if (!Node)
- {
- return_VOID;
- }
-
/* Get the full external and internal pathnames to the node */
- ExternalPath = AcpiNsGetExternalPathname (Node);
- if (!ExternalPath)
- {
- return_VOID;
- }
-
- Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
+ Status = AcpiDmGetExternalAndInternalPath (Node, &ExternalPath, &InternalPath);
if (ACPI_FAILURE (Status))
{
- ACPI_FREE (ExternalPath);
return_VOID;
}
/* Remove the root backslash */
- if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1]))
+ Status = AcpiDmRemoveRootPrefix (&ExternalPath);
+ if (ACPI_FAILURE (Status))
{
- Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1);
- if (!Temp)
- {
- return_VOID;
- }
-
- strcpy (Temp, &ExternalPath[1]);
ACPI_FREE (ExternalPath);
- ExternalPath = Temp;
+ ACPI_FREE (InternalPath);
+ return_VOID;
}
/* Create the new External() declaration node */
@@ -1013,68 +1102,171 @@ AcpiDmCreateNewExternal (
/*******************************************************************************
*
- * FUNCTION: AcpiDmAddExternalsToNamespace
+ * FUNCTION: AcpiDmResolveExternal
*
- * PARAMETERS: None
+ * PARAMETERS: Path - Path of the external
+ * Type - Type of the external
+ * Node - Input node for AcpiNsLookup
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Resolve the external within the namespace by AcpiNsLookup.
+ * If the returned node is an external and has the same type
+ * we assume that it was either an existing external or a
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDmResolveExternal (
+ char *Path,
+ UINT8 Type,
+ ACPI_NAMESPACE_NODE **Node)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsLookup (NULL, Path, Type,
+ ACPI_IMODE_LOAD_PASS1,
+ ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
+ NULL, Node);
+
+ if (!Node)
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "while adding external to namespace [%s]", Path));
+ }
+
+ /* Note the asl code "external(a) external(a)" is acceptable ASL */
+
+ else if ((*Node)->Type == Type &&
+ (*Node)->Flags & ANOBJ_IS_EXTERNAL)
+ {
+ return (AE_OK);
+ }
+ else
+ {
+ ACPI_EXCEPTION ((AE_INFO, AE_ERROR,
+ "[%s] has conflicting declarations", Path));
+ }
+
+ return (AE_ERROR);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmCreateSubobjectForExternal
+ *
+ * PARAMETERS: Type - Type of the external
+ * Node - Namespace node from AcpiNsLookup
+ * ParamCount - Value to be used for Method
*
* RETURN: None
*
- * DESCRIPTION: Add all externals to the namespace. Allows externals to be
+ * DESCRIPTION: Add one external to the namespace. Allows external to be
* "resolved".
*
******************************************************************************/
void
-AcpiDmAddExternalsToNamespace (
- void)
+AcpiDmCreateSubobjectForExternal (
+ UINT8 Type,
+ ACPI_NAMESPACE_NODE **Node,
+ UINT32 ParamCount)
{
- ACPI_STATUS Status;
- ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
- while (External)
+ switch (Type)
{
- /* Add the external name (object) into the namespace */
+ case ACPI_TYPE_METHOD:
- Status = AcpiNsLookup (NULL, External->InternalPath, External->Type,
- ACPI_IMODE_LOAD_PASS1,
- ACPI_NS_ERROR_IF_FOUND | ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
- NULL, &Node);
+ /* For methods, we need to save the argument count */
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status,
- "while adding external to namespace [%s]",
- External->Path));
- }
+ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
+ ObjDesc->Method.ParamCount = (UINT8) ParamCount;
+ (*Node)->Object = ObjDesc;
+ break;
- else switch (External->Type)
- {
- case ACPI_TYPE_METHOD:
+ case ACPI_TYPE_REGION:
- /* For methods, we need to save the argument count */
+ /* Regions require a region sub-object */
- ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
- ObjDesc->Method.ParamCount = (UINT8) External->Value;
- Node->Object = ObjDesc;
- break;
+ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
+ ObjDesc->Region.Node = *Node;
+ (*Node)->Object = ObjDesc;
+ break;
- case ACPI_TYPE_REGION:
+ default:
- /* Regions require a region sub-object */
+ break;
+ }
+}
- ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
- ObjDesc->Region.Node = Node;
- Node->Object = ObjDesc;
- break;
- default:
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmAddOneExternalToNamespace
+ *
+ * PARAMETERS: Path - External parse object
+ * Type - Type of parse object
+ * ParamCount - External method parameter count
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Add one external to the namespace by resolvign the external
+ * (by performing a namespace lookup) and annotating the resulting
+ * namespace node with the approperiate information if the type
+ * is ACPI_TYPE_REGION or ACPI_TYPE_METHOD.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmAddOneExternalToNamespace (
+ char *Path,
+ UINT8 Type,
+ UINT32 ParamCount)
+{
+ ACPI_STATUS Status;
+ ACPI_NAMESPACE_NODE *Node;
- break;
- }
+ Status = AcpiDmResolveExternal (Path, Type, &Node);
+
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ AcpiDmCreateSubobjectForExternal (Type, &Node, ParamCount);
+
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmAddExternalListToNamespace
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Add all externals within AcpiGbl_ExternalList to the namespace.
+ * Allows externals to be "resolved".
+ *
+ ******************************************************************************/
+
+void
+AcpiDmAddExternalListToNamespace (
+ void)
+{
+ ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
+
+
+ while (External)
+ {
+ AcpiDmAddOneExternalToNamespace (External->InternalPath,
+ External->Type, External->Value);
External = External->Next;
}
}
@@ -1082,23 +1274,28 @@ AcpiDmAddExternalsToNamespace (
/*******************************************************************************
*
- * FUNCTION: AcpiDmGetExternalMethodCount
+ * FUNCTION: AcpiDmGetUnresolvedExternalMethodCount
*
* PARAMETERS: None
*
- * RETURN: The number of control method externals in the external list
+ * RETURN: The number of unresolved control method externals in the
+ * external list
*
- * DESCRIPTION: Return the number of method externals that have been generated.
- * If any control method externals have been found, we must
- * re-parse the entire definition block with the new information
- * (number of arguments for the methods.) This is limitation of
- * AML, we don't know the number of arguments from the control
- * method invocation itself.
+ * DESCRIPTION: Return the number of unresolved external methods that have been
+ * generated. If any unresolved control method externals have been
+ * found, we must re-parse the entire definition block with the new
+ * information (number of arguments for the methods.)
+ * This is limitation of AML, we don't know the number of arguments
+ * from the control method invocation itself.
+ *
+ * Note: resolved external control methods are external control
+ * methods encoded with the AML_EXTERNAL_OP bytecode within the
+ * AML being disassembled.
*
******************************************************************************/
UINT32
-AcpiDmGetExternalMethodCount (
+AcpiDmGetUnresolvedExternalMethodCount (
void)
{
ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
@@ -1107,7 +1304,8 @@ AcpiDmGetExternalMethodCount (
while (External)
{
- if (External->Type == ACPI_TYPE_METHOD)
+ if (External->Type == ACPI_TYPE_METHOD &&
+ !(External->Flags & ACPI_EXT_ORIGIN_FROM_OPCODE))
{
Count++;
}
@@ -1251,6 +1449,11 @@ AcpiDmEmitExternals (
}
}
+ if (AcpiGbl_ExternalList->Flags &= ACPI_EXT_CONFLICTING_DECLARATION)
+ {
+ AcpiOsPrintf ("%s", ExternalConflictMessage);
+ AcpiDmConflictingDeclaration (AcpiGbl_ExternalList->Path);
+ }
AcpiOsPrintf ("\n");
}
@@ -1273,6 +1476,106 @@ AcpiDmEmitExternals (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmMarkExternalConflict
+ *
+ * PARAMETERS: Path - Namepath to search
+ *
+ * RETURN: ExternalList
+ *
+ * DESCRIPTION: Search the AcpiGbl_ExternalList for a matching path
+ *
+ ******************************************************************************/
+
+void
+AcpiDmMarkExternalConflict (
+ ACPI_NAMESPACE_NODE *Node)
+{
+ ACPI_EXTERNAL_LIST *ExternalList = AcpiGbl_ExternalList;
+ char *ExternalPath;
+ char *InternalPath;
+ char *Temp;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (DmMarkExternalConflict);
+
+
+ if (Node->Flags & ANOBJ_IS_EXTERNAL)
+ {
+ return_VOID;
+ }
+
+ /* Get the full external and internal pathnames to the node */
+
+ Status = AcpiDmGetExternalAndInternalPath (Node,
+ &ExternalPath, &InternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ return_VOID;
+ }
+
+ /* Remove the root backslash */
+
+ Status = AcpiDmRemoveRootPrefix (&InternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (InternalPath);
+ ACPI_FREE (ExternalPath);
+ return_VOID;
+ }
+
+ while (ExternalList)
+ {
+ Temp = ExternalList->InternalPath;
+ if ((*ExternalList->InternalPath == AML_ROOT_PREFIX) &&
+ (ExternalList->InternalPath[1]))
+ {
+ Temp++;
+ }
+
+ if (!strcmp (ExternalList->InternalPath, InternalPath))
+ {
+ ExternalList->Flags |= ACPI_EXT_CONFLICTING_DECLARATION;
+ }
+ ExternalList = ExternalList->Next;
+ }
+
+ ACPI_FREE (InternalPath);
+ ACPI_FREE (ExternalPath);
+
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmConflictingDeclaration
+ *
+ * PARAMETERS: Path - Path with conflicting declaration
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit a warning when printing conflicting ASL external
+ * declarations.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmConflictingDeclaration (
+ char *Path)
+{
+ fprintf (stderr,
+ " Warning - Emitting ASL code \"External (%s)\"\n"
+ " This is a conflicting declaration with some "
+ "other declaration within the ASL code.\n"
+ " This external declaration may need to be "
+ "deleted in order to recompile the dsl file.\n\n",
+ Path);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmEmitExternal
*
* PARAMETERS: Op External Parse Object
@@ -1280,7 +1583,8 @@ AcpiDmEmitExternals (
* RETURN: None
*
* DESCRIPTION: Emit an External() ASL statement for the current External
- * parse object
+ * parse object. Note: External Ops are named types so the
+ * namepath is contained within NameOp->Name.Path.
*
******************************************************************************/
@@ -1290,14 +1594,76 @@ AcpiDmEmitExternal (
ACPI_PARSE_OBJECT *TypeOp)
{
AcpiOsPrintf ("External (");
- AcpiDmNamestring (NameOp->Common.Value.Name);
- AcpiOsPrintf ("%s)\n",
+ AcpiDmNamestring (NameOp->Named.Path);
+ AcpiOsPrintf ("%s)",
AcpiDmGetObjectTypeName ((ACPI_OBJECT_TYPE) TypeOp->Common.Value.Integer));
+ AcpiDmCheckForExternalConflict (NameOp->Named.Path);
+ AcpiOsPrintf ("\n");
}
/*******************************************************************************
*
+ * FUNCTION: AcpiDmCheckForExternalConflict
+ *
+ * PARAMETERS: Path - Path to check
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Search the External List to see if the input Path has a
+ * conflicting declaration.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmCheckForExternalConflict (
+ char *Path)
+{
+ ACPI_EXTERNAL_LIST *ExternalList = AcpiGbl_ExternalList;
+ char *ListItemPath;
+ char *InputPath;
+
+
+ if (!Path)
+ {
+ return;
+ }
+
+ /* Move past the root prefix '\' */
+
+ InputPath = Path;
+ if ((*InputPath == AML_ROOT_PREFIX) && InputPath[1])
+ {
+ InputPath++;
+ }
+
+ while (ExternalList)
+ {
+ ListItemPath = ExternalList->Path;
+ if (ListItemPath)
+ {
+ /* Move past the root prefix '\' */
+
+ if ((*ListItemPath == AML_ROOT_PREFIX) &&
+ ListItemPath[1])
+ {
+ ListItemPath++;
+ }
+
+ if (!strcmp (ListItemPath, InputPath) &&
+ (ExternalList->Flags & ACPI_EXT_CONFLICTING_DECLARATION))
+ {
+ AcpiOsPrintf ("%s", ExternalConflictMessage);
+ AcpiDmConflictingDeclaration (Path);
+
+ return;
+ }
+ }
+ ExternalList = ExternalList->Next;
+ }
+}
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmUnresolvedWarning
*
* PARAMETERS: Type - Where to output the warning.
@@ -1311,7 +1677,7 @@ AcpiDmEmitExternal (
*
******************************************************************************/
-#if 0
+/*
Summary of the external control method problem:
When the -e option is used with disassembly, the various SSDTs are simply
@@ -1380,7 +1746,7 @@ disassembler, otherwise it does not know how to handle the method invocations.
In other words, if ABCD and EFGH are actually external control methods
appearing in an SSDT, the disassembler does not know what to do unless
the owning SSDT has been loaded via the -e option.
-#endif
+*/
static char ExternalWarningPart1[600];
static char ExternalWarningPart2[400];
diff --git a/sys/contrib/dev/acpica/common/dmrestag.c b/sys/contrib/dev/acpica/common/dmrestag.c
index c2c5d62..85c2eff 100644
--- a/sys/contrib/dev/acpica/common/dmrestag.c
+++ b/sys/contrib/dev/acpica/common/dmrestag.c
@@ -424,6 +424,34 @@ static const ACPI_RESOURCE_TAG AcpiDmUartSerialBusTags[] =
{0, NULL}
};
+/* Subtype tables for PinFunction descriptor */
+
+static const ACPI_RESOURCE_TAG AcpiDmPinFunctionTags[] =
+{
+ {( 4 * 8), ACPI_RESTAG_INTERRUPTSHARE},
+ {( 6 * 8), ACPI_RESTAG_PINCONFIG},
+ {( 7 * 8), ACPI_RESTAG_FUNCTION},
+ {0, NULL}
+};
+
+/* Subtype tables for PinConfig descriptor */
+
+static const ACPI_RESOURCE_TAG AcpiDmPinConfigTags[] =
+{
+ {( 4 * 8), ACPI_RESTAG_INTERRUPTSHARE},
+ {( 6 * 8), ACPI_RESTAG_PINCONFIG_TYPE},
+ {( 7 * 8), ACPI_RESTAG_PINCONFIG_VALUE},
+ {0, NULL}
+};
+
+/* Subtype tables for PinGroupFunction descriptor */
+
+static const ACPI_RESOURCE_TAG AcpiDmPinGroupFunctionTags[] =
+{
+ {( 6 * 8), ACPI_RESTAG_FUNCTION},
+ {0, NULL}
+};
+
/* Subtype tables for Address descriptor type-specific flags */
static const ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] =
@@ -488,8 +516,12 @@ static const ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags[] =
AcpiDmAddress64Tags, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
AcpiDmExtendedAddressTags, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
NULL, /* 0x0C, ACPI_RESOURCE_NAME_GPIO - Use Subtype table below */
- NULL, /* 0x0D, Reserved */
- NULL /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */
+ AcpiDmPinFunctionTags, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
+ NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */
+ AcpiDmPinConfigTags, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
+ NULL, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
+ AcpiDmPinGroupFunctionTags, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
+ AcpiDmPinConfigTags, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG - Same as PinConfig */
};
/* GPIO Subtypes */
diff --git a/sys/contrib/dev/acpica/common/dmswitch.c b/sys/contrib/dev/acpica/common/dmswitch.c
new file mode 100644
index 0000000..a0bf68f
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/dmswitch.c
@@ -0,0 +1,679 @@
+/******************************************************************************
+ *
+ * Module Name: adwalk - Disassembler routines for switch statements
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2017, 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/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acdisasm.h>
+#include <contrib/dev/acpica/include/acdispat.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/acapps.h>
+
+
+#define _COMPONENT ACPI_CA_DISASSEMBLER
+ ACPI_MODULE_NAME ("dmswitch")
+
+static BOOLEAN
+AcpiDmIsSwitchBlock (
+ ACPI_PARSE_OBJECT *Op,
+ char **Temp);
+
+static BOOLEAN
+AcpiDmIsCaseBlock (
+ ACPI_PARSE_OBJECT *Op);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmProcessSwitch
+ *
+ * PARAMETERS: Op - Object to be examined
+ *
+ * RETURN: ACPI_STATUS
+ *
+ * DESCRIPTION: Walk function to create a list of all temporary (_T_) objects.
+ * If a While loop is found that can be converted to a Switch, do
+ * the conversion, remove the temporary name from the list, and
+ * mark the parse op with an IGNORE flag.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDmProcessSwitch (
+ ACPI_PARSE_OBJECT *Op)
+{
+ char *Temp = NULL;
+ ACPI_PARSE_OBJECT_LIST *NewTemp;
+ ACPI_PARSE_OBJECT_LIST *Current;
+ ACPI_PARSE_OBJECT_LIST *Previous;
+ BOOLEAN FoundTemp = FALSE;
+
+
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_NAME_OP:
+
+ Temp = (char *) (&Op->Named.Name);
+
+ if (!strncmp(Temp, "_T_", 3))
+ {
+ /* Allocate and init a new Temp List node */
+
+ NewTemp = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PARSE_OBJECT_LIST));
+ if (!NewTemp)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ if (AcpiGbl_TempListHead)
+ {
+ Current = AcpiGbl_TempListHead;
+ AcpiGbl_TempListHead = NewTemp;
+ AcpiGbl_TempListHead->Op = Op;
+ AcpiGbl_TempListHead->Next = Current;
+ }
+ else
+ {
+ AcpiGbl_TempListHead = NewTemp;
+ AcpiGbl_TempListHead->Op = Op;
+ AcpiGbl_TempListHead->Next = NULL;
+ }
+ }
+ break;
+
+ case AML_WHILE_OP:
+
+ if (!AcpiDmIsSwitchBlock (Op, &Temp))
+ {
+ break;
+ }
+
+ /* Found a Switch */
+
+ Op->Common.DisasmOpcode = ACPI_DASM_SWITCH;
+
+ Previous = Current = AcpiGbl_TempListHead;
+ while (Current)
+ {
+ /* Note, if we get here Temp is not NULL */
+
+ if (!strncmp(Temp, (char *) (&Current->Op->Named.Name), 4))
+ {
+ /* Match found. Ignore disassembly */
+
+ Current->Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+
+ /* Remove from list */
+
+ if (Current == AcpiGbl_TempListHead)
+ {
+ AcpiGbl_TempListHead = Current->Next;
+ }
+ else
+ {
+ Previous->Next = Current->Next;
+ }
+
+ Current->Op = NULL;
+ Current->Next = NULL;
+ ACPI_FREE (Current);
+ FoundTemp = TRUE;
+ break;
+ }
+
+ Previous = Current;
+ Current = Current->Next;
+ }
+
+ if (!FoundTemp)
+ {
+ fprintf (stderr,
+ "Warning: Declaration for temp name %.4s not found\n", Temp);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmClearTempList
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Removes any remaining temporary objects from global list and
+ * frees
+ *
+ ******************************************************************************/
+
+void
+AcpiDmClearTempList (
+ void)
+{
+ ACPI_PARSE_OBJECT_LIST *Current;
+
+
+ while (AcpiGbl_TempListHead)
+ {
+ Current = AcpiGbl_TempListHead;
+ AcpiGbl_TempListHead = AcpiGbl_TempListHead->Next;
+ Current->Op = NULL;
+ Current->Next = NULL;
+ ACPI_FREE (Current);
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmIsSwitchBlock
+ *
+ * PARAMETERS: Op - While Object
+ *
+ * RETURN: TRUE if While block can be converted to a Switch/Case block
+ *
+ * DESCRIPTION: Determines if While block is a Switch/Case statement. Modifies
+ * parse tree to allow for Switch/Case disassembly during walk.
+ *
+ * EXAMPLE: Example of parse tree to be converted
+ *
+ * While
+ * One
+ * Store
+ * ByteConst
+ * -NamePath-
+ * If
+ * LEqual
+ * -NamePath-
+ * Zero
+ * Return
+ * One
+ * Else
+ * Return
+ * WordConst
+ * Break
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmIsSwitchBlock (
+ ACPI_PARSE_OBJECT *Op,
+ char **Temp)
+{
+ ACPI_PARSE_OBJECT *OneOp;
+ ACPI_PARSE_OBJECT *StoreOp;
+ ACPI_PARSE_OBJECT *NamePathOp;
+ ACPI_PARSE_OBJECT *PredicateOp;
+ ACPI_PARSE_OBJECT *CurrentOp;
+ ACPI_PARSE_OBJECT *TempOp;
+
+
+ /* Check for One Op Predicate */
+
+ OneOp = AcpiPsGetArg (Op, 0);
+ if (!OneOp || (OneOp->Common.AmlOpcode != AML_ONE_OP))
+ {
+ return (FALSE);
+ }
+
+ /* Check for Store Op */
+
+ StoreOp = OneOp->Common.Next;
+ if (!StoreOp || (StoreOp->Common.AmlOpcode != AML_STORE_OP))
+ {
+ return (FALSE);
+ }
+
+ /* Check for Name Op with _T_ string */
+
+ NamePathOp = AcpiPsGetArg (StoreOp, 1);
+ if (!NamePathOp ||
+ (NamePathOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
+ {
+ return (FALSE);
+ }
+
+ if (strncmp ((char *) (NamePathOp->Common.Value.Name), "_T_", 3))
+ {
+ return (FALSE);
+ }
+
+ *Temp = (char *) (NamePathOp->Common.Value.Name);
+
+ /* This is a Switch/Case control block */
+
+ /* Ignore the One Op Predicate */
+
+ OneOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+
+ /* Ignore the Store Op, but not the children */
+
+ StoreOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE;
+
+ /*
+ * First arg of Store Op is the Switch condition.
+ * Mark it as a Switch predicate and as a parameter list for paren
+ * closing and correct indentation.
+ */
+ PredicateOp = AcpiPsGetArg (StoreOp, 0);
+ PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE;
+ PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
+
+ /* Ignore the Name Op */
+
+ NamePathOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE;
+
+ /* Remaining opcodes are the Case statements (If/ElseIf's) */
+
+ CurrentOp = StoreOp->Common.Next;
+ while (AcpiDmIsCaseBlock (CurrentOp))
+ {
+ /* Block is a Case structure */
+
+ if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
+ {
+ /* ElseIf */
+
+ CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE;
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ }
+
+ /* If */
+
+ CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE;
+
+ /*
+ * Mark the parse tree for Case disassembly. There are two
+ * types of Case statements. The first type of statement begins with
+ * an LEqual. The second starts with an LNot and uses a Match statement
+ * on a Package of constants.
+ */
+ TempOp = AcpiPsGetArg (CurrentOp, 0);
+ switch (TempOp->Common.AmlOpcode)
+ {
+ case (AML_LOGICAL_EQUAL_OP):
+
+ /* Ignore just the LEqual Op */
+
+ TempOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE;
+
+ /* Ignore the NamePath Op */
+
+ TempOp = AcpiPsGetArg (TempOp, 0);
+ TempOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE;
+
+ /*
+ * Second arg of LEqual will be the Case predicate.
+ * Mark it as a predicate and also as a parameter list for paren
+ * closing and correct indentation.
+ */
+ PredicateOp = TempOp->Common.Next;
+ PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE;
+ PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
+ break;
+
+ case (AML_LOGICAL_NOT_OP):
+
+ /*
+ * The Package will be the predicate of the Case statement.
+ * It's under:
+ * LNOT
+ * LEQUAL
+ * MATCH
+ * PACKAGE
+ */
+
+ /* Get the LEqual Op from LNot */
+
+ TempOp = AcpiPsGetArg (TempOp, 0);
+
+ /* Get the Match Op from LEqual */
+
+ TempOp = AcpiPsGetArg (TempOp, 0);
+
+ /* Get the Package Op from Match */
+
+ PredicateOp = AcpiPsGetArg (TempOp, 0);
+
+ /* Mark as parameter list for paren closing */
+
+ PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
+
+ /*
+ * The Package list would be too deeply indented if we
+ * chose to simply ignore the all the parent opcodes, so
+ * we rearrange the parse tree instead.
+ */
+
+ /*
+ * Save the second arg of the If/Else Op which is the
+ * block code of code for this Case statement.
+ */
+ TempOp = AcpiPsGetArg (CurrentOp, 1);
+
+ /*
+ * Move the Package Op to the child (predicate) of the
+ * Case statement.
+ */
+ CurrentOp->Common.Value.Arg = PredicateOp;
+ PredicateOp->Common.Parent = CurrentOp;
+
+ /* Add the block code */
+
+ PredicateOp->Common.Next = TempOp;
+ break;
+
+ default:
+
+ /* Should never get here */
+ break;
+ }
+
+ /* Advance to next Case block */
+
+ CurrentOp = CurrentOp->Common.Next;
+ }
+
+ /* If CurrentOp is now an Else, then this is a Default block */
+
+ if (CurrentOp && CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
+ {
+ CurrentOp->Common.DisasmOpcode = ACPI_DASM_DEFAULT;
+ }
+
+ /*
+ * From the first If advance to the Break op. It's possible to
+ * have an Else (Default) op here when there is only one Case
+ * statement, so check for it.
+ */
+ CurrentOp = StoreOp->Common.Next->Common.Next;
+ if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
+ {
+ CurrentOp = CurrentOp->Common.Next;
+ }
+
+ /* Ignore the Break Op */
+
+ CurrentOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmIsCaseBlock
+ *
+ * PARAMETERS: Op - Object to test
+ *
+ * RETURN: TRUE if Object is beginning of a Case block.
+ *
+ * DESCRIPTION: Determines if an Object is the beginning of a Case block for a
+ * Switch/Case statement. Parse tree must be one of the following
+ * forms:
+ *
+ * Else (Optional)
+ * If
+ * LEqual
+ * -NamePath- _T_x
+ *
+ * Else (Optional)
+ * If
+ * LNot
+ * LEqual
+ * Match
+ * Package
+ * ByteConst
+ * -NamePath- _T_x
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+AcpiDmIsCaseBlock (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *CurrentOp;
+
+
+ if (!Op)
+ {
+ return (FALSE);
+ }
+
+ /* Look for an If or ElseIf */
+
+ CurrentOp = Op;
+ if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
+ {
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ if (!CurrentOp)
+ {
+ return (FALSE);
+ }
+ }
+
+ if (!CurrentOp || CurrentOp->Common.AmlOpcode != AML_IF_OP)
+ {
+ return (FALSE);
+ }
+
+ /* Child must be LEqual or LNot */
+
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ if (!CurrentOp)
+ {
+ return (FALSE);
+ }
+
+ switch (CurrentOp->Common.AmlOpcode)
+ {
+ case (AML_LOGICAL_EQUAL_OP):
+
+ /* Next child must be NamePath with string _T_ */
+
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ if (!CurrentOp || !CurrentOp->Common.Value.Name ||
+ strncmp(CurrentOp->Common.Value.Name, "_T_", 3))
+ {
+ return (FALSE);
+ }
+ break;
+
+ case (AML_LOGICAL_NOT_OP):
+
+ /* Child of LNot must be LEqual op */
+
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_LOGICAL_EQUAL_OP))
+ {
+ return (FALSE);
+ }
+
+ /* Child of LNot must be Match op */
+
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_MATCH_OP))
+ {
+ return (FALSE);
+ }
+
+ /* First child of Match must be Package op */
+
+ CurrentOp = AcpiPsGetArg (CurrentOp, 0);
+ if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_PACKAGE_OP))
+ {
+ return (FALSE);
+ }
+
+ /* Third child of Match must be NamePath with string _T_ */
+
+ CurrentOp = AcpiPsGetArg (CurrentOp->Common.Parent, 2);
+ if (!CurrentOp || !CurrentOp->Common.Value.Name ||
+ strncmp(CurrentOp->Common.Value.Name, "_T_", 3))
+ {
+ return (FALSE);
+ }
+ break;
+
+ default:
+
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c
index 83083a0..4356d42 100644
--- a/sys/contrib/dev/acpica/common/dmtable.c
+++ b/sys/contrib/dev/acpica/common/dmtable.c
@@ -298,6 +298,7 @@ static const char *AcpiDmHestSubnames[] =
"PCI Express/PCI-X Bridge AER",
"Generic Hardware Error Source",
"Generic Hardware Error Source V2",
+ "IA-32 Deferred Machine Check",
"Unknown Subtable Type" /* Reserved */
};
@@ -314,9 +315,18 @@ static const char *AcpiDmHestNotifySubnames[] =
"SEA", /* ACPI 6.1 */
"SEI", /* ACPI 6.1 */
"GSIV", /* ACPI 6.1 */
+ "Software Delegated Exception", /* ACPI 6.2 */
"Unknown Notify Type" /* Reserved */
};
+static const char *AcpiDmHmatSubnames[] =
+{
+ "Memory Subystem Address Range",
+ "System Locality Latency and Bandwidth Information",
+ "Memory Side Cache Information",
+ "Unknown Structure Type" /* Reserved */
+};
+
static const char *AcpiDmMadtSubnames[] =
{
"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
@@ -355,6 +365,8 @@ static const char *AcpiDmPcctSubnames[] =
"Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
"HW-Reduced Comm Subspace", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE */
"HW-Reduced Comm Subspace Type2", /* ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 */
+ "Extended PCC Master Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE */
+ "Extended PCC Slave Subspace", /* ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE */
"Unknown Subtable Type" /* Reserved */
};
@@ -366,12 +378,21 @@ static const char *AcpiDmPmttSubnames[] =
"Unknown Subtable Type" /* Reserved */
};
+static const char *AcpiDmPpttSubnames[] =
+{
+ "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */
+ "Cache Type", /* ACPI_PPTT_TYPE_CACHE */
+ "ID", /* ACPI_PMTT_TYPE_ID */
+ "Unknown Subtable Type" /* Reserved */
+};
+
static const char *AcpiDmSratSubnames[] =
{
"Processor Local APIC/SAPIC Affinity",
"Memory Affinity",
"Processor Local x2APIC Affinity",
"GICC Affinity",
+ "GIC ITS Affinity", /* Acpi 6.2 */
"Unknown Subtable Type" /* Reserved */
};
@@ -452,6 +473,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt},
{ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt},
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest},
+ {ACPI_SIG_HMAT, NULL, AcpiDmDumpHmat, DtCompileHmat, TemplateHmat},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet},
{ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs},
@@ -466,10 +488,12 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit},
{ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct},
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt},
+ {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt},
{ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf},
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt},
{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt},
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst},
+ {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei},
{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic},
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit},
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr},
@@ -485,6 +509,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt},
{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt},
{ACPI_SIG_WPBT, NULL, AcpiDmDumpWpbt, DtCompileWpbt, TemplateWpbt},
+ {ACPI_SIG_WSMT, AcpiDmTableInfoWsmt, NULL, NULL, TemplateWsmt},
{ACPI_SIG_XENV, AcpiDmTableInfoXenv, NULL, NULL, TemplateXenv},
{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt},
{NULL, NULL, NULL, NULL, NULL}
@@ -891,6 +916,7 @@ AcpiDmDumpTable (
case ACPI_DMT_MADT:
case ACPI_DMT_PCCT:
case ACPI_DMT_PMTT:
+ case ACPI_DMT_PPTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
case ACPI_DMT_HESTNTYP:
@@ -907,6 +933,7 @@ AcpiDmDumpTable (
case ACPI_DMT_UINT16:
case ACPI_DMT_DMAR:
case ACPI_DMT_HEST:
+ case ACPI_DMT_HMAT:
case ACPI_DMT_NFIT:
ByteLength = 2;
@@ -1088,6 +1115,31 @@ AcpiDmDumpTable (
AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);
break;
+ case ACPI_DMT_FLAGS4_0:
+
+ AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target) & 0x0F);
+ break;
+
+ case ACPI_DMT_FLAGS4_4:
+
+ AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 4) & 0x0F);
+ break;
+
+ case ACPI_DMT_FLAGS4_8:
+
+ AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 8) & 0x0F);
+ break;
+
+ case ACPI_DMT_FLAGS4_12:
+
+ AcpiOsPrintf ("%1.1X\n", (*(UINT32 *)Target >> 12) & 0x0F);
+ break;
+
+ case ACPI_DMT_FLAGS16_16:
+
+ AcpiOsPrintf ("%4.4X\n", (*(UINT32 *)Target >> 16) & 0xFFFF);
+ break;
+
/* Integer Data Types */
case ACPI_DMT_UINT8:
@@ -1409,6 +1461,20 @@ AcpiDmDumpTable (
AcpiDmHestNotifySubnames[Temp8]);
break;
+ case ACPI_DMT_HMAT:
+
+ /* HMAT subtable types */
+
+ Temp16 = *Target;
+ if (Temp16 > ACPI_HMAT_TYPE_RESERVED)
+ {
+ Temp16 = ACPI_HMAT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT16_FORMAT, *Target,
+ AcpiDmHmatSubnames[Temp16]);
+ break;
+
case ACPI_DMT_IORTMEM:
AcpiOsPrintf (STRING_FORMAT,
@@ -1480,6 +1546,20 @@ AcpiDmDumpTable (
AcpiDmPmttSubnames[Temp8]);
break;
+ case ACPI_DMT_PPTT:
+
+ /* PPTT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_PPTT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_PPTT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmPpttSubnames[Temp8]);
+ break;
+
case ACPI_DMT_UNICODE:
if (ByteLength == 0)
diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c
index b059779..5510e36 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump.c
@@ -1730,6 +1730,14 @@ AcpiDmDumpHest (
SubTableLength = sizeof (ACPI_HEST_GENERIC_V2);
break;
+ case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
+
+ InfoTable = AcpiDmTableInfoHest11;
+ SubTableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
+ BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
+ SubTable))->NumHardwareBanks;
+ break;
+
default:
/* Cannot continue on unknown type - no length */
@@ -1784,6 +1792,203 @@ AcpiDmDumpHest (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpHmat
+ *
+ * PARAMETERS: Table - A HMAT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a HMAT.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpHmat (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_HMAT_STRUCTURE *HmatStruct;
+ ACPI_HMAT_LOCALITY *HmatLocality;
+ ACPI_HMAT_CACHE *HmatCache;
+ UINT32 Offset;
+ UINT32 SubTableOffset;
+ UINT32 Length;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 i, j;
+
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ Offset = sizeof (ACPI_TABLE_HMAT);
+
+ while (Offset < Table->Length)
+ {
+ AcpiOsPrintf ("\n");
+ SubTableOffset = 0;
+
+ /* Dump HMAT structure header */
+
+ HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
+ if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
+ {
+ AcpiOsPrintf ("Invalid HMAT structure length\n");
+ return;
+ }
+ Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
+ HmatStruct->Length, AcpiDmTableInfoHmatHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ switch (HmatStruct->Type)
+ {
+ case ACPI_HMAT_TYPE_ADDRESS_RANGE:
+
+ InfoTable = AcpiDmTableInfoHmat0;
+ Length = sizeof (ACPI_HMAT_ADDRESS_RANGE);
+ break;
+
+ case ACPI_HMAT_TYPE_LOCALITY:
+
+ InfoTable = AcpiDmTableInfoHmat1;
+ Length = sizeof (ACPI_HMAT_LOCALITY);
+ break;
+
+ case ACPI_HMAT_TYPE_CACHE:
+
+ InfoTable = AcpiDmTableInfoHmat2;
+ Length = sizeof (ACPI_HMAT_CACHE);
+ break;
+
+ default:
+
+ AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
+ HmatStruct->Type);
+
+ /* Attempt to continue */
+
+ goto NextSubTable;
+ }
+
+ /* Dump HMAT structure body */
+
+ if (HmatStruct->Length < Length)
+ {
+ AcpiOsPrintf ("Invalid HMAT structure length\n");
+ return;
+ }
+ Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
+ HmatStruct->Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Dump HMAT structure additionals */
+
+ switch (HmatStruct->Type)
+ {
+ case ACPI_HMAT_TYPE_LOCALITY:
+
+ HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
+ SubTableOffset = sizeof (ACPI_HMAT_LOCALITY);
+
+ /* Dump initiator proximity domains */
+
+ if ((UINT32)(HmatStruct->Length - SubTableOffset) <
+ (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
+ {
+ AcpiOsPrintf ("Invalid initiator proximity domain number\n");
+ return;
+ }
+ for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
+ {
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset,
+ ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset),
+ 4, AcpiDmTableInfoHmat1a);
+ SubTableOffset += 4;
+ }
+
+ /* Dump target proximity domains */
+
+ if ((UINT32)(HmatStruct->Length - SubTableOffset) <
+ (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
+ {
+ AcpiOsPrintf ("Invalid target proximity domain number\n");
+ return;
+ }
+ for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
+ {
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset,
+ ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset),
+ 4, AcpiDmTableInfoHmat1b);
+ SubTableOffset += 4;
+ }
+
+ /* Dump latency/bandwidth entris */
+
+ if ((UINT32)(HmatStruct->Length - SubTableOffset) <
+ (UINT32)(HmatLocality->NumberOfInitiatorPDs *
+ HmatLocality->NumberOfTargetPDs * 2))
+ {
+ AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
+ return;
+ }
+ for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
+ {
+ for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
+ {
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset,
+ ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset),
+ 2, AcpiDmTableInfoHmat1c);
+ SubTableOffset += 2;
+ }
+ }
+ break;
+
+ case ACPI_HMAT_TYPE_CACHE:
+
+ HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
+ SubTableOffset = sizeof (ACPI_HMAT_CACHE);
+
+ /* Dump SMBIOS handles */
+
+ if ((UINT32)(HmatStruct->Length - SubTableOffset) <
+ (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
+ {
+ AcpiOsPrintf ("Invalid SMBIOS handle number\n");
+ return;
+ }
+ for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
+ {
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset,
+ ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubTableOffset),
+ 2, AcpiDmTableInfoHmat2a);
+ SubTableOffset += 2;
+ }
+ break;
+
+ default:
+
+ break;
+ }
+
+NextSubTable:
+ /* Point to next HMAT structure subtable */
+
+ Offset += (HmatStruct->Length);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpIort
*
* PARAMETERS: Table - A IORT table
@@ -3010,6 +3215,16 @@ AcpiDmDumpPcct (
InfoTable = AcpiDmTableInfoPcct2;
break;
+ case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct3;
+ break;
+
+ case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct4;
+ break;
+
default:
AcpiOsPrintf (
@@ -3242,6 +3457,136 @@ AcpiDmDumpPmtt (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpPptt
+ *
+ * PARAMETERS: Table - A PMTT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a PPTT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpPptt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_SUBTABLE_HEADER *SubTable;
+ ACPI_PPTT_PROCESSOR *PpttProcessor;
+ UINT8 Length;
+ UINT8 SubTableOffset;
+ UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 i;
+
+
+ /* There is no main table (other than the standard ACPI header) */
+
+ /* Subtables */
+
+ Offset = sizeof (ACPI_TABLE_HEADER);
+ while (Offset < Table->Length)
+ {
+ AcpiOsPrintf ("\n");
+
+ /* Common subtable header */
+
+ SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
+ if (SubTable->Length < sizeof (ACPI_SUBTABLE_HEADER))
+ {
+ AcpiOsPrintf ("Invalid subtable length\n");
+ return;
+ }
+ Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+ SubTable->Length, AcpiDmTableInfoPpttHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ switch (SubTable->Type)
+ {
+ case ACPI_PPTT_TYPE_PROCESSOR:
+
+ InfoTable = AcpiDmTableInfoPptt0;
+ Length = sizeof (ACPI_PPTT_PROCESSOR);
+ break;
+
+ case ACPI_PPTT_TYPE_CACHE:
+
+ InfoTable = AcpiDmTableInfoPptt1;
+ Length = sizeof (ACPI_PPTT_CACHE);
+ break;
+
+ case ACPI_PPTT_TYPE_ID:
+
+ InfoTable = AcpiDmTableInfoPptt2;
+ Length = sizeof (ACPI_PPTT_ID);
+ break;
+
+ default:
+
+ AcpiOsPrintf ("\n**** Unknown PPTT subtable type 0x%X\n\n",
+ SubTable->Type);
+
+ /* Attempt to continue */
+
+ goto NextSubTable;
+ }
+
+ if (SubTable->Length < Length)
+ {
+ AcpiOsPrintf ("Invalid subtable length\n");
+ return;
+ }
+ Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
+ SubTable->Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ SubTableOffset = Length;
+
+ switch (SubTable->Type)
+ {
+ case ACPI_PPTT_TYPE_PROCESSOR:
+
+ PpttProcessor = ACPI_CAST_PTR (ACPI_PPTT_PROCESSOR, SubTable);
+
+ /* Dump SMBIOS handles */
+
+ if ((UINT8)(SubTable->Length - SubTableOffset) <
+ (UINT8)(PpttProcessor->NumberOfPrivResources * 4))
+ {
+ AcpiOsPrintf ("Invalid private resource number\n");
+ return;
+ }
+ for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++)
+ {
+ Status = AcpiDmDumpTable (Table->Length, Offset + SubTableOffset,
+ ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTableOffset),
+ 4, AcpiDmTableInfoPptt0a);
+ SubTableOffset += 4;
+ }
+ break;
+
+ default:
+
+ break;
+ }
+
+NextSubTable:
+ /* Point to next subtable */
+
+ Offset += SubTable->Length;
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpS3pt
*
* PARAMETERS: Table - A S3PT table
@@ -3498,6 +3843,11 @@ AcpiDmDumpSrat (
InfoTable = AcpiDmTableInfoSrat3;
break;
+ case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat4;
+ break;
+
default:
AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",
SubTable->Type);
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c
index 6355988..c487fcf 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo.c
@@ -204,6 +204,7 @@
#define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f)
#define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f)
#define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f)
+#define ACPI_HMAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HMAT,f)
#define ACPI_IORT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IORT,f)
#define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f)
#define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f)
@@ -217,6 +218,7 @@
#define ACPI_RASF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RASF,f)
#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f)
#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f)
+#define ACPI_SDEI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEI,f)
#define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f)
#define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f)
#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
@@ -230,6 +232,7 @@
#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
#define ACPI_WPBT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WPBT,f)
+#define ACPI_WSMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WSMT,f)
#define ACPI_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f)
/* Subtables */
@@ -273,8 +276,13 @@
#define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f)
#define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
#define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f)
+#define ACPI_HEST11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f)
#define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
#define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f)
+#define ACPI_HMAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_ADDRESS_RANGE,f)
+#define ACPI_HMAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_LOCALITY,f)
+#define ACPI_HMAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_CACHE,f)
+#define ACPI_HMATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_STRUCTURE,f)
#define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f)
#define ACPI_IORT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT,f)
#define ACPI_IORT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ROOT_COMPLEX,f)
@@ -329,11 +337,17 @@
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
#define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
#define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f)
+#define ACPI_PCCT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f)
+#define ACPI_PCCT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,f)
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
#define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f)
#define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f)
+#define ACPI_PPTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
+#define ACPI_PPTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_PROCESSOR,f)
+#define ACPI_PPTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_CACHE,f)
+#define ACPI_PPTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_ID,f)
#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f)
#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f)
@@ -343,6 +357,7 @@
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
+#define ACPI_SRAT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GIC_ITS_AFFINITY,f)
#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f)
#define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
@@ -355,11 +370,14 @@
/* Flags */
+#define ACPI_BGRT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_BGRT,f,o)
#define ACPI_DRTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_DRTM,f,o)
#define ACPI_DRTM1a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_DRTM_RESOURCE,f,o)
#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FADT,f,o)
#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FACS,f,o)
#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_HPET,f,o)
+#define ACPI_PPTT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_PROCESSOR,f,o)
+#define ACPI_PPTT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_CACHE,f,o)
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
@@ -367,6 +385,9 @@
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
+#define ACPI_HMAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_ADDRESS_RANGE,f,o)
+#define ACPI_HMAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_LOCALITY,f,o)
+#define ACPI_HMAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_CACHE,f,o)
#define ACPI_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o)
#define ACPI_IORT3a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_GSI,f,o)
#define ACPI_IORT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o)
@@ -392,13 +413,17 @@
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
#define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
#define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o)
+#define ACPI_PCCT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f,o)
+#define ACPI_PCCT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,f,o)
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
+#define ACPI_WSMT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WSMT,f,o)
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
#define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
#define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o)
#define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o)
#define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o)
+#define ACPI_HEST11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f,o)
/*
* Required terminator for all tables below
@@ -780,7 +805,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBert[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[] =
{
{ACPI_DMT_UINT16, ACPI_BGRT_OFFSET (Version), "Version", 0},
- {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (Status), "Status", 0},
+ {ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (Status), "Status (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_BGRT_FLAG_OFFSET (Status, 0), "Displayed", 0},
+ {ACPI_DMT_FLAGS1, ACPI_BGRT_FLAG_OFFSET (Status, 0), "Orientation Offset", 0},
+
{ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (ImageType), "Image Type", 0},
{ACPI_DMT_UINT64, ACPI_BGRT_OFFSET (ImageAddress), "Image Address", 0},
{ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetX), "Image OffsetX", 0},
@@ -1349,6 +1377,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved", 0}, \
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags (decoded below)", DT_FLAG}, \
{ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Firmware First", 0}, \
+ {ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Global", 0}, \
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled", 0}, \
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate", 0}, \
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record", 0}, \
@@ -1373,6 +1402,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved1", 0},
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_HEST0_FLAG_OFFSET (Flags,0), "Firmware First", 0},
+ {ACPI_DMT_FLAG2, ACPI_HEST0_FLAG_OFFSET (Flags,0), "GHES Assist", 0},
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0},
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
@@ -1392,6 +1422,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] =
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved1", 0},
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_HEST1_FLAG_OFFSET (Flags,0), "Firmware First", 0},
+ {ACPI_DMT_FLAG2, ACPI_HEST1_FLAG_OFFSET (Flags,0), "GHES Assist", 0},
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0},
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
@@ -1482,6 +1513,27 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[] =
ACPI_DMT_TERMINATOR
};
+/* 11: IA32 Deferred Machine Check */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHest11[] =
+{
+ ACPI_DM_HEST_HEADER,
+ {ACPI_DMT_UINT16, ACPI_HEST11_OFFSET (Reserved1), "Reserved1", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_HEST11_FLAG_OFFSET (Flags,0), "Firmware First", 0},
+ {ACPI_DMT_FLAG2, ACPI_HEST11_FLAG_OFFSET (Flags,0), "GHES Assist", 0},
+
+ {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (Enabled), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST11_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST11_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
+ {ACPI_DMT_HESTNTFY, ACPI_HEST11_OFFSET (Notify), "Notify", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST11_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
+ {ACPI_DMT_UINT24, ACPI_HEST11_OFFSET (Reserved2[0]), "Reserved2", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Notification Structure */
+
ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] =
{
{ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0},
@@ -1537,6 +1589,105 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] =
/*******************************************************************************
*
+ * HMAT - Heterogeneous Memory Attributes Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat[] =
+{
+ {ACPI_DMT_UINT32, ACPI_HMAT_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Common HMAT structure header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[] =
+{
+ {ACPI_DMT_HMAT, ACPI_HMATH_OFFSET (Type), "Structure Type", 0},
+ {ACPI_DMT_UINT16, ACPI_HMATH_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_HMATH_OFFSET (Length), "Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* HMAT subtables */
+
+/* 0x00: Memory Subsystem Address Range */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[] =
+{
+ {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Flags), "Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Processor Proximity Domain Valid", 0},
+ {ACPI_DMT_FLAG1, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Memory Proximity Domain Valid", 0},
+ {ACPI_DMT_FLAG2, ACPI_HMAT0_FLAG_OFFSET (Flags,0), "Reservation Hint", 0},
+ {ACPI_DMT_UINT16, ACPI_HMAT0_OFFSET (Reserved1), "Reserved1", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (ProcessorPD), "Processor Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (MemoryPD), "Memory Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT0_OFFSET (Reserved2), "Reserved2", 0},
+ {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressBase), "Physical Address Range Base", 0},
+ {ACPI_DMT_UINT64, ACPI_HMAT0_OFFSET (PhysicalAddressLength), "Physical Address Range Size", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 0x01: System Locality Latency and Bandwidth Information */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1[] =
+{
+ {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (Flags), "Flags (decoded below)", 0},
+ {ACPI_DMT_FLAGS4_0, ACPI_HMAT1_FLAG_OFFSET (Flags,0), "Memory Hierarchy", 0},
+ {ACPI_DMT_UINT8, ACPI_HMAT1_OFFSET (DataType), "Data Type", 0},
+ {ACPI_DMT_UINT16, ACPI_HMAT1_OFFSET (Reserved1), "Reserved1", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (NumberOfInitiatorPDs), "Initiator Proximity Domains #", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (NumberOfTargetPDs), "Target Proximity Domains #", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT1_OFFSET (Reserved2), "Reserved2", 0},
+ {ACPI_DMT_UINT64, ACPI_HMAT1_OFFSET (EntryBaseUnit), "Entry Base Unit", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1a[] =
+{
+ {ACPI_DMT_UINT32, 0, "Initiator Proximity Domain List", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1b[] =
+{
+ {ACPI_DMT_UINT32, 0, "Target Proximity Domain List", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1c[] =
+{
+ {ACPI_DMT_UINT16, 0, "Entry", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 0x02: Memory Side Cache Information */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[] =
+{
+ {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (MemoryPD), "Memory Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (Reserved1), "Reserved1", 0},
+ {ACPI_DMT_UINT64, ACPI_HMAT2_OFFSET (CacheSize), "Memory Side Cache Size", 0},
+ {ACPI_DMT_UINT32, ACPI_HMAT2_OFFSET (CacheAttributes), "Cache Attributes (decoded below)", 0},
+ {ACPI_DMT_FLAGS4_0, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Total Cache Levels", 0},
+ {ACPI_DMT_FLAGS4_4, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Level", 0},
+ {ACPI_DMT_FLAGS4_8, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Associativity", 0},
+ {ACPI_DMT_FLAGS4_12, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Write Policy", 0},
+ {ACPI_DMT_FLAGS16_16, ACPI_HMAT2_FLAG_OFFSET (CacheAttributes,0), "Cache Line Size", 0},
+ {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (Reserved2), "Reserved2", 0},
+ {ACPI_DMT_UINT16, ACPI_HMAT2_OFFSET (NumberOfSMBIOSHandles), "SMBIOS Handle #", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2a[] =
+{
+ {ACPI_DMT_UINT16, 0, "SMBIOS Handle", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* IORT - IO Remapping Table
*
******************************************************************************/
@@ -1688,6 +1839,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] =
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags (decoded below)", 0},
{ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC Override", 0},
{ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU Override", 0},
+ {ACPI_DMT_FLAG3, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "Proximity Domain Valid", 0},
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS Address", 0},
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0},
@@ -1695,6 +1847,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] =
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0},
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERR GSIV", 0},
{ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync GSIV", 0},
+ {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0},
+ {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
@@ -2406,7 +2561,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[] =
{
{ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Doorbell", 0},
+ {ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Platform", 0},
{ACPI_DMT_UINT64, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
@@ -2440,7 +2595,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] =
{
- {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (PlatformInterrupt), "Platform Interrupt", 0},
{ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0},
{ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0},
@@ -2460,7 +2615,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[] =
{
- {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (PlatformInterrupt), "Platform Interrupt", 0},
{ACPI_DMT_UINT8, ACPI_PCCT2_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_PCCT2_FLAG_OFFSET (Flags,0), "Polarity", 0},
{ACPI_DMT_FLAG1, ACPI_PCCT2_FLAG_OFFSET (Flags,0), "Mode", 0},
@@ -2473,12 +2628,73 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[] =
{ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (Latency), "Command Latency", 0},
{ACPI_DMT_UINT32, ACPI_PCCT2_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
{ACPI_DMT_UINT16, ACPI_PCCT2_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
- {ACPI_DMT_GAS, ACPI_PCCT2_OFFSET (DoorbellAckRegister), "Doorbell ACK Register", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT2_OFFSET (PlatformAckRegister), "Platform ACK Register", 0},
{ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0},
{ACPI_DMT_UINT64, ACPI_PCCT2_OFFSET (AckWriteMask), "ACK Write Mask", 0},
ACPI_DMT_TERMINATOR
};
+/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPcct3[] =
+{
+ {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (PlatformInterrupt), "Platform Interrupt", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT3_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_PCCT3_FLAG_OFFSET (Flags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG1, ACPI_PCCT3_FLAG_OFFSET (Flags,0), "Mode", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT3_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (Length), "Address Length", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (DoorbellRegister), "Doorbell Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (PreserveMask), "Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (WriteMask), "Write Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (Latency), "Command Latency", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT3_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (PlatformAckRegister), "Platform ACK Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (AckSetMask), "ACK Set Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (CmdCompleteRegister), "Command Complete Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (CmdUpdateRegister), "Command Update Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdUpdatePreserveMask), "Command Update Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (CmdUpdateSetMask), "Command Update Set Mask", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT3_OFFSET (ErrorStatusRegister), "Error Status Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT3_OFFSET (ErrorStatusMask), "Error Status Mask", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPcct4[] =
+{
+ {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (PlatformInterrupt), "Platform Interrupt", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT4_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_PCCT4_FLAG_OFFSET (Flags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG1, ACPI_PCCT4_FLAG_OFFSET (Flags,0), "Mode", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT4_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (Length), "Address Length", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (DoorbellRegister), "Doorbell Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (PreserveMask), "Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (WriteMask), "Write Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (Latency), "Command Latency", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT4_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (PlatformAckRegister), "Platform ACK Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (AckPreserveMask), "ACK Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (AckSetMask), "ACK Set Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (CmdCompleteRegister), "Command Complete Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdCompleteMask), "Command Complete Check Mask", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (CmdUpdateRegister), "Command Update Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdUpdatePreserveMask), "Command Update Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (CmdUpdateSetMask), "Command Update Set Mask", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT4_OFFSET (ErrorStatusRegister), "Error Status Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT4_OFFSET (ErrorStatusMask), "Error Status Mask", 0},
+ ACPI_DMT_TERMINATOR
+};
/*******************************************************************************
*
@@ -2552,6 +2768,92 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] =
ACPI_DMT_TERMINATOR
};
+/*******************************************************************************
+ *
+ * SDEI - Software Delegated Execption Interface Descriptor Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[] =
+{
+ ACPI_DMT_TERMINATOR
+};
+
+/*******************************************************************************
+ *
+ * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ *
+ ******************************************************************************/
+
+/* Main table consists of only the standard ACPI header - subtables follow */
+
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPpttHdr[] =
+{
+ {ACPI_DMT_PPTT, ACPI_PPTTH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_PPTTH_OFFSET (Length), "Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 0: Processor hierarchy node */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[] =
+{
+ {ACPI_DMT_UINT16, ACPI_PPTT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_FLAG0, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "Physical package", 0},
+ {ACPI_DMT_FLAG1, ACPI_PPTT0_FLAG_OFFSET (Flags,0), "ACPI Processor ID valid", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (Parent), "Parent", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (AcpiProcessorId), "ACPI Processor ID", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT0_OFFSET (NumberOfPrivResources), "Private Resource Number", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0a[] =
+{
+ {ACPI_DMT_UINT32, 0, "Private Resource", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: Cache type */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[] =
+{
+ {ACPI_DMT_UINT16, ACPI_PPTT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_FLAG0, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Size valid", 0},
+ {ACPI_DMT_FLAG1, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Number of Sets valid", 0},
+ {ACPI_DMT_FLAG2, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Associativity valid", 0},
+ {ACPI_DMT_FLAG3, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Allocation Type valid", 0},
+ {ACPI_DMT_FLAG4, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Cache Type valid", 0},
+ {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Write Policy valid", 0},
+ {ACPI_DMT_FLAG5, ACPI_PPTT1_FLAG_OFFSET (Flags,0), "Line Size valid", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NextLevelOfCache), "Next Level of Cache", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (Size), "Size", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT1_OFFSET (NumberOfSets), "Number of Sets", 0},
+ {ACPI_DMT_UINT8, ACPI_PPTT1_OFFSET (Associativity), "Associativity", 0},
+ {ACPI_DMT_UINT8, ACPI_PPTT1_OFFSET (Attributes), "Attributes", 0},
+ {ACPI_DMT_FLAGS0, ACPI_PPTT1_OFFSET (Attributes), "Allocation Type", 0},
+ {ACPI_DMT_FLAGS2, ACPI_PPTT1_OFFSET (Attributes), "Cache Type", 0},
+ {ACPI_DMT_FLAG4, ACPI_PPTT1_OFFSET (Attributes), "Write Policy", 0},
+ {ACPI_DMT_UINT16, ACPI_PPTT1_OFFSET (LineSize), "Line Size", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 2: ID */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[] =
+{
+ {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_PPTT2_OFFSET (VendorId), "VENDOR_ID", 0},
+ {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level1Id), "LEVEL_1_ID", 0},
+ {ACPI_DMT_UINT64, ACPI_PPTT2_OFFSET (Level2Id), "LEVEL_2_ID", 0},
+ {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MajorRev), "MAJOR_REV", 0},
+ {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (MinorRev), "MINOR_REV", 0},
+ {ACPI_DMT_UINT16, ACPI_PPTT2_OFFSET (SpinRev), "SPIN_REV", 0},
+ ACPI_DMT_TERMINATOR
+};
/*******************************************************************************
*
@@ -2779,7 +3081,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMT_TERMINATOR
};
-/* : GICC Affinity (ACPI 5.1) */
+/* 3: GICC Affinity (ACPI 5.1) */
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
{
@@ -2791,6 +3093,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
ACPI_DMT_TERMINATOR
};
+/* 4: GCC ITS Affinity (ACPI 6.2) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[] =
+{
+ {ACPI_DMT_UINT32, ACPI_SRAT4_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT16, ACPI_SRAT4_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT4_OFFSET (ItsId), "ITS ID", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -3058,6 +3370,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[] =
/*******************************************************************************
*
+ * WSMT - Windows SMM Security Migrations Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoWsmt[] =
+{
+ {ACPI_DMT_UINT32, ACPI_WSMT_OFFSET (ProtectionFlags), "Protection Flags", 0},
+ {ACPI_DMT_FLAG0, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "FIXED_COMM_BUFFERS", 0},
+ {ACPI_DMT_FLAG1, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "COMM_BUFFER_NESTED_PTR_PROTECTION", 0},
+ {ACPI_DMT_FLAG2, ACPI_WSMT_FLAG_OFFSET (ProtectionFlags,0), "SYSTEM_RESOURCE_PROTECTION", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* XENV - Xen Environment table (ACPI 6.0)
*
******************************************************************************/
diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c
index 9ef917d..67856d4 100644
--- a/sys/contrib/dev/acpica/compiler/aslanalyze.c
+++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c
@@ -435,13 +435,13 @@ AnCheckMethodReturnValue (
/* Examine the parent op of this method */
OwningOp = Node->Op;
- if (OwningOp->Asl.CompileFlags & NODE_METHOD_NO_RETVAL)
+ if (OwningOp->Asl.CompileFlags & OP_METHOD_NO_RETVAL)
{
/* Method NEVER returns a value */
AslError (ASL_ERROR, ASL_MSG_NO_RETVAL, Op, Op->Asl.ExternalName);
}
- else if (OwningOp->Asl.CompileFlags & NODE_METHOD_SOME_NO_RETVAL)
+ else if (OwningOp->Asl.CompileFlags & OP_METHOD_SOME_NO_RETVAL)
{
/* Method SOMETIMES returns a value, SOMETIMES not */
diff --git a/sys/contrib/dev/acpica/compiler/aslascii.c b/sys/contrib/dev/acpica/compiler/aslascii.c
index 706df87..23e8920 100644
--- a/sys/contrib/dev/acpica/compiler/aslascii.c
+++ b/sys/contrib/dev/acpica/compiler/aslascii.c
@@ -194,7 +194,7 @@ FlIsFileAsciiSource (
BOOLEAN DisplayErrors)
{
UINT8 Byte;
- ACPI_SIZE BadBytes = 0;
+ UINT32 BadBytes = 0;
BOOLEAN OpeningComment = FALSE;
ASL_FILE_STATUS Status;
FILE *Handle;
@@ -285,6 +285,9 @@ FlIsFileAsciiSource (
if (BadBytes)
{
+ fprintf (stderr,
+ "File appears to be binary: found %u non-ASCII characters, disassembling\n",
+ BadBytes);
if (DisplayErrors)
{
AcpiOsPrintf (
diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c
index 31b0d8f..6e4ff5c 100644
--- a/sys/contrib/dev/acpica/compiler/aslbtypes.c
+++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c
@@ -560,7 +560,7 @@ AnGetBtype (
return (ACPI_UINT32_MAX);
}
- if (ReferencedNode->Asl.CompileFlags & NODE_METHOD_TYPED)
+ if (ReferencedNode->Asl.CompileFlags & OP_METHOD_TYPED)
{
ThisNodeBtype = ReferencedNode->Asl.AcpiBtype;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c
index 36737e0..d875f5e 100644
--- a/sys/contrib/dev/acpica/compiler/aslcodegen.c
+++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c
@@ -291,6 +291,8 @@ CgAmlWriteWalk (
/* 19 */ Op->Asl.LogicalLineNumber,
/* 20 */ Op->Asl.EndLogicalLine);
+ TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT);
+ DbgPrint (ASL_TREE_OUTPUT, "\n");
return (AE_OK);
}
@@ -438,7 +440,7 @@ CgWriteAmlOpcode (
/* Does this opcode have an associated "PackageLength" field? */
- if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
+ if (Op->Asl.CompileFlags & OP_AML_PACKAGE)
{
if (Op->Asl.AmlPkgLenBytes == 1)
{
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c
index 87f02dc..5bd460d 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompile.c
+++ b/sys/contrib/dev/acpica/compiler/aslcompile.c
@@ -568,7 +568,7 @@ AslCompilerSignon (
/* Running compiler or disassembler? */
- if (Gbl_DisasmFlag)
+ if (AcpiGbl_DisasmFlag)
{
UtilityName = AML_DISASSEMBLER_NAME;
}
@@ -815,6 +815,7 @@ CmCleanupAndExit (
BOOLEAN DeleteAmlFile = FALSE;
+ AslCheckExpectedExceptions ();
AePrintErrorLog (ASL_FILE_STDERR);
if (Gbl_DebugFlag)
{
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h
index 1b3a91b..05069ec 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h
@@ -413,12 +413,20 @@ AslError (
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage);
+void
+AslCheckExpectedExceptions (
+ void);
+
+ACPI_STATUS
+AslExpectException (
+ char *MessageIdString);
+
ACPI_STATUS
AslDisableException (
char *MessageIdString);
BOOLEAN
-AslIsExceptionDisabled (
+AslIsExceptionIgnored (
UINT8 Level,
UINT16 MessageId);
@@ -790,17 +798,6 @@ TrAmlTransformWalkEnd (
/*
- * asltree - parse tree support
- */
-ACPI_STATUS
-TrWalkParseTree (
- ACPI_PARSE_OBJECT *Op,
- UINT32 Visitation,
- ASL_WALK_CALLBACK DescendingCallback,
- ASL_WALK_CALLBACK AscendingCallback,
- void *Context);
-
-/*
* aslexternal - External opcode support
*/
ACPI_STATUS
@@ -826,104 +823,112 @@ ExDoExternal (
#define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD)
-void
-TrSetParent (
- ACPI_PARSE_OBJECT *Op,
- ACPI_PARSE_OBJECT *ParentOp);
-
-ACPI_PARSE_OBJECT *
-TrAllocateNode (
- UINT32 ParseOpcode);
-
-void
-TrPrintNodeCompileFlags (
- UINT32 Flags);
-
-void
-TrReleaseNode (
- ACPI_PARSE_OBJECT *Op);
-
-ACPI_PARSE_OBJECT *
-TrUpdateNode (
- UINT32 ParseOpcode,
- ACPI_PARSE_OBJECT *Op);
-
+/*
+ * aslparseop.c - Parse op create/allocate/cache
+ */
ACPI_PARSE_OBJECT *
-TrCreateNode (
+TrCreateOp (
UINT32 ParseOpcode,
UINT32 NumChildren,
...);
ACPI_PARSE_OBJECT *
-TrCreateLeafNode (
+TrCreateLeafOp (
UINT32 ParseOpcode);
ACPI_PARSE_OBJECT *
-TrCreateNullTarget (
+TrCreateNullTargetOp (
void);
ACPI_PARSE_OBJECT *
-TrCreateAssignmentNode (
+TrCreateAssignmentOp (
ACPI_PARSE_OBJECT *Target,
ACPI_PARSE_OBJECT *Source);
ACPI_PARSE_OBJECT *
-TrCreateTargetOperand (
+TrCreateTargetOp (
ACPI_PARSE_OBJECT *OriginalOp,
ACPI_PARSE_OBJECT *ParentOp);
ACPI_PARSE_OBJECT *
-TrCreateValuedLeafNode (
+TrCreateValuedLeafOp (
UINT32 ParseOpcode,
UINT64 Value);
ACPI_PARSE_OBJECT *
-TrCreateConstantLeafNode (
+TrCreateConstantLeafOp (
UINT32 ParseOpcode);
ACPI_PARSE_OBJECT *
-TrLinkChildren (
- ACPI_PARSE_OBJECT *Op,
- UINT32 NumChildren,
- ...);
+TrAllocateOp (
+ UINT32 ParseOpcode);
+
+void
+TrPrintOpFlags (
+ UINT32 Flags,
+ UINT32 OutputLevel);
+
+/*
+ * asltree.c - Parse tree management
+ */
void
-TrSetEndLineNumber (
+TrSetOpParent (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *ParentOp);
+
+ACPI_PARSE_OBJECT *
+TrSetOpIntegerValue (
+ UINT32 ParseOpcode,
ACPI_PARSE_OBJECT *Op);
void
-TrSetCurrentFilename (
+TrSetOpEndLineNumber (
ACPI_PARSE_OBJECT *Op);
void
-TrWalkTree (
- void);
+TrSetOpCurrentFilename (
+ ACPI_PARSE_OBJECT *Op);
+
+ACPI_PARSE_OBJECT *
+TrLinkOpChildren (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 NumChildren,
+ ...);
ACPI_PARSE_OBJECT *
-TrLinkPeerNode (
+TrLinkPeerOp (
ACPI_PARSE_OBJECT *Op1,
ACPI_PARSE_OBJECT *Op2);
ACPI_PARSE_OBJECT *
-TrLinkChildNode (
+TrLinkChildOp (
ACPI_PARSE_OBJECT *Op1,
ACPI_PARSE_OBJECT *Op2);
ACPI_PARSE_OBJECT *
-TrSetNodeFlags (
+TrSetOpFlags (
ACPI_PARSE_OBJECT *Op,
UINT32 Flags);
ACPI_PARSE_OBJECT *
-TrSetNodeAmlLength (
+TrSetOpAmlLength (
ACPI_PARSE_OBJECT *Op,
UINT32 Length);
ACPI_PARSE_OBJECT *
-TrLinkPeerNodes (
+TrLinkPeerOps (
UINT32 NumPeers,
...);
+ACPI_STATUS
+TrWalkParseTree (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Visitation,
+ ASL_WALK_CALLBACK DescendingCallback,
+ ASL_WALK_CALLBACK AscendingCallback,
+ void *Context);
+
/*
* aslfiles - File I/O support
@@ -1398,6 +1403,26 @@ ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
ASL_RESOURCE_INFO *Info);
+ASL_RESOURCE_NODE *
+RsDoPinFunctionDescriptor (
+ ASL_RESOURCE_INFO *Info);
+
+ASL_RESOURCE_NODE *
+RsDoPinConfigDescriptor (
+ ASL_RESOURCE_INFO *Info);
+
+ASL_RESOURCE_NODE *
+RsDoPinGroupDescriptor (
+ ASL_RESOURCE_INFO *Info);
+
+ASL_RESOURCE_NODE *
+RsDoPinGroupFunctionDescriptor (
+ ASL_RESOURCE_INFO *Info);
+
+ASL_RESOURCE_NODE *
+RsDoPinGroupConfigDescriptor (
+ ASL_RESOURCE_INFO *Info);
+
/*
* aslrestype2d - DWord address descriptors
*/
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l
index cfe8e97..d65968e 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.l
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l
@@ -455,6 +455,11 @@ NamePathTail [.]{NameSeg}
"Memory24" { count (1); return (PARSEOP_MEMORY24); }
"Memory32" { count (1); return (PARSEOP_MEMORY32); }
"Memory32Fixed" { count (1); return (PARSEOP_MEMORY32FIXED); }
+"PinConfig" { count (1); return (PARSEOP_PINCONFIG); }
+"PinFunction" { count (1); return (PARSEOP_PINFUNCTION); }
+"PinGroup" { count (1); return (PARSEOP_PINGROUP); }
+"PinGroupConfig" { count (1); return (PARSEOP_PINGROUPCONFIG); }
+"PinGroupFunction" { count (1); return (PARSEOP_PINGROUPFUNCTION); }
"QWordIO" { count (1); return (PARSEOP_QWORDIO); }
"QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); }
"QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); }
@@ -804,7 +809,7 @@ NamePathTail [.]{NameSeg}
"__FILE__" { count (0); return (PARSEOP___FILE__); }
"__LINE__" { count (0); return (PARSEOP___LINE__); }
"__PATH__" { count (0); return (PARSEOP___PATH__); }
-
+"__METHOD__" { count (0); return (PARSEOP___METHOD__); }
{NameSeg} { char *s;
count (0);
diff --git a/sys/contrib/dev/acpica/compiler/aslcstyle.y b/sys/contrib/dev/acpica/compiler/aslcstyle.y
index 031a382..928e3a4 100644
--- a/sys/contrib/dev/acpica/compiler/aslcstyle.y
+++ b/sys/contrib/dev/acpica/compiler/aslcstyle.y
@@ -201,59 +201,59 @@ Expression
/* Unary operators */
- : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
- TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
- | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
- TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());}
+ : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafOp (PARSEOP_LNOT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>2,1,$3);}
+ | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafOp (PARSEOP_NOT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>2,2,$3,TrCreateNullTargetOp ());}
- | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
- {$$ = TrLinkChildren ($<n>3,1,$1);}
- | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
- {$$ = TrLinkChildren ($<n>3,1,$1);}
+ | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafOp (PARSEOP_INCREMENT);}
+ {$$ = TrLinkOpChildren ($<n>3,1,$1);}
+ | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafOp (PARSEOP_DECREMENT);}
+ {$$ = TrLinkOpChildren ($<n>3,1,$1);}
/* Binary operators: math and logical */
- | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
- TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
- TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
-
- | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
- | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
-
- | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
- | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
- | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
- | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
-
- | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
- | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
-
- | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
- | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
- TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,4,$1,$4,TrCreateNullTargetOp (),
+ TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+
+ | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafOp (PARSEOP_AND);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafOp (PARSEOP_OR);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+ | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,TrCreateNullTargetOp ());}
+
+ | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATEREQUAL);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LLESSEQUAL);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+
+ | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafOp (PARSEOP_LNOTEQUAL);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+
+ | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafOp (PARSEOP_LAND);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafOp (PARSEOP_LOR);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,2,$1,$4);}
/* Parentheses */
@@ -280,8 +280,8 @@ IndexExpTerm
: SuperName
PARSEOP_EXP_INDEX_LEFT
TermArg
- PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX);
- TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());}
+ PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafOp (PARSEOP_INDEX);
+ TrLinkOpChildren ($$,3,$1,$3,TrCreateNullTargetOp ());}
;
@@ -304,7 +304,7 @@ EqualsTerm
| SuperName
PARSEOP_EXP_EQUALS
- TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
+ TermArg {$$ = TrCreateAssignmentOp ($1, $3);}
/* Chained equals: (a=RefOf)=b, a=b=c=d etc. */
@@ -312,47 +312,47 @@ EqualsTerm
EqualsTerm
PARSEOP_CLOSE_PAREN
PARSEOP_EXP_EQUALS
- TermArg {$$ = TrCreateAssignmentNode ($2, $5);}
+ TermArg {$$ = TrCreateAssignmentOp ($2, $5);}
/* Compound assignments -- Add (operand, operand, target) */
- | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
- TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,4,$1,$4,TrCreateNullTargetOp (),
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_AND);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_OR);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
- | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
- TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);}
+ TermArg {$$ = TrLinkOpChildren ($<n>3,3,$1,$4,
+ TrSetOpFlags (TrCreateTargetOp ($1, NULL), OP_IS_TARGET));}
;
diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h
index 3333562..a7d1a28 100644
--- a/sys/contrib/dev/acpica/compiler/asldefine.h
+++ b/sys/contrib/dev/acpica/compiler/asldefine.h
@@ -161,8 +161,8 @@
#define ASL_INVOCATION_NAME "iasl"
#define ASL_CREATOR_ID "INTL"
#define ASL_DEFINE "__IASL__"
-
-#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.1"
+#define ASL_PREFIX "iASL: "
+#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2"
/* Configuration constants */
@@ -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\n"
+ "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d"
/*
* Macros for ASL/ASL+ converter
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index 4efde35..43696d9 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -160,6 +160,16 @@ static void
AeAddToErrorLog (
ASL_ERROR_MSG *Enode);
+static BOOLEAN
+AslIsExceptionExpected (
+ UINT8 Level,
+ UINT16 MessageId);
+
+static BOOLEAN
+AslIsExceptionDisabled (
+ UINT8 Level,
+ UINT16 MessageId);
+
/*******************************************************************************
*
@@ -806,6 +816,115 @@ AslCommonError (
return;
}
+/*******************************************************************************
+ *
+ * FUNCTION: AslIsExceptionIgnored
+ *
+ * PARAMETERS: Level - Seriousness (Warning/error, etc.)
+ * MessageId - Index into global message buffer
+ *
+ * RETURN: BOOLEAN
+ *
+ * DESCRIPTION: Check if a particular exception is ignored. In this case it
+ * means that the exception is (expected or disabled.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AslIsExceptionIgnored (
+ UINT8 Level,
+ UINT16 MessageId)
+{
+ BOOLEAN ExceptionIgnored;
+
+
+ /* Note: this allows exception to be disabled and expected */
+
+ ExceptionIgnored = AslIsExceptionDisabled (Level, MessageId);
+ ExceptionIgnored |= AslIsExceptionExpected (Level, MessageId);
+
+ return (Gbl_AllExceptionsDisabled || ExceptionIgnored);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslCheckExpectException
+ *
+ * PARAMETERS: none
+ *
+ * RETURN: none
+ *
+ * DESCRIPTION: Check the global expected messages table and raise an error
+ * for each message that has not been received.
+ *
+ ******************************************************************************/
+
+void
+AslCheckExpectedExceptions (
+ void)
+{
+ UINT8 i;
+
+ for (i = 0; i < Gbl_ExpectedMessagesIndex; ++i)
+ {
+ if (!Gbl_ExpectedMessages[i].MessageReceived)
+ {
+ AslError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED, NULL,
+ Gbl_ExpectedMessages[i].MessageIdStr);
+ }
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslExpectException
+ *
+ * PARAMETERS: MessageIdString - ID of excepted exception during compile
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Enter a message ID into the global expected messages table
+ * If these messages are not raised during the compilation, throw
+ * an error.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AslExpectException (
+ char *MessageIdString)
+{
+ UINT32 MessageId;
+
+
+ /* Convert argument to an integer and validate it */
+
+ MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
+
+ if (MessageId > 6999)
+ {
+ printf ("\"%s\" is not a valid warning/remark/erro ID\n",
+ MessageIdString);
+ return (AE_BAD_PARAMETER);
+ }
+
+ /* Insert value into the global expected message array */
+
+ if (Gbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES)
+ {
+ printf ("Too many messages have been registered as expected (max %u)\n",
+ ASL_MAX_DISABLED_MESSAGES);
+ return (AE_LIMIT);
+ }
+
+ Gbl_ExpectedMessages[Gbl_ExpectedMessagesIndex].MessageId = MessageId;
+ Gbl_ExpectedMessages[Gbl_ExpectedMessagesIndex].MessageIdStr = MessageIdString;
+ Gbl_ExpectedMessages[Gbl_ExpectedMessagesIndex].MessageReceived = FALSE;
+ Gbl_ExpectedMessagesIndex++;
+ return (AE_OK);
+}
+
/*******************************************************************************
*
@@ -866,7 +985,48 @@ AslDisableException (
*
******************************************************************************/
-BOOLEAN
+static BOOLEAN
+AslIsExceptionExpected (
+ UINT8 Level,
+ UINT16 MessageId)
+{
+ UINT32 EncodedMessageId;
+ UINT32 i;
+
+
+ /*
+ * Mark this exception as received
+ */
+ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
+ for (i = 0; i < Gbl_ExpectedMessagesIndex; i++)
+ {
+ /* Simple implementation via fixed array */
+
+ if (EncodedMessageId == Gbl_ExpectedMessages[i].MessageId)
+ {
+ return (Gbl_ExpectedMessages[i].MessageReceived = TRUE);
+ }
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslIsExceptionDisabled
+ *
+ * PARAMETERS: Level - Seriousness (Warning/error, etc.)
+ * MessageId - Index into global message buffer
+ *
+ * RETURN: TRUE if exception/message should be ignored
+ *
+ * DESCRIPTION: Check if the user has specified options such that this
+ * exception should be ignored
+ *
+ ******************************************************************************/
+
+static BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
UINT16 MessageId)
@@ -940,8 +1100,7 @@ AslError (
/* Check if user wants to ignore this exception */
- if (Gbl_AllExceptionsDisabled ||
- AslIsExceptionDisabled (Level, MessageId))
+ if (AslIsExceptionIgnored (Level, MessageId))
{
return;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslexternal.c b/sys/contrib/dev/acpica/compiler/aslexternal.c
index a009729..dd0b869 100644
--- a/sys/contrib/dev/acpica/compiler/aslexternal.c
+++ b/sys/contrib/dev/acpica/compiler/aslexternal.c
@@ -202,7 +202,7 @@ ExDoExternal (
/* Create new list node of arbitrary type */
- ListOp = TrAllocateNode (PARSEOP_DEFAULT_ARG);
+ ListOp = TrAllocateOp (PARSEOP_DEFAULT_ARG);
/* Store External node as child */
@@ -266,7 +266,7 @@ ExInsertArgCount (
/* Skip if External node already handled */
- if (Next->Asl.Child->Asl.CompileFlags & NODE_VISITED)
+ if (Next->Asl.Child->Asl.CompileFlags & OP_VISITED)
{
Next = Next->Asl.Next;
continue;
@@ -282,7 +282,7 @@ ExInsertArgCount (
continue;
}
- Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED;
+ Next->Asl.Child->Asl.CompileFlags |= OP_VISITED;
/*
* Since we will reposition Externals to the Root, set Namepath
@@ -435,6 +435,7 @@ ExMoveExternals (
ACPI_PARSE_OBJECT *Next;
char *ExternalName;
ACPI_OBJECT_TYPE ObjType;
+ ACPI_STATUS Status;
UINT32 i;
@@ -473,8 +474,16 @@ ExMoveExternals (
{
Next->Asl.ParseOpcode = PARSEOP_NAMESTRING;
}
+
Next->Asl.ExternalName = ExternalName;
- UtInternalizeName (ExternalName, &Next->Asl.Value.String);
+ Status = UtInternalizeName (ExternalName, &Next->Asl.Value.String);
+ if (ACPI_FAILURE (Status))
+ {
+ AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
+ Next, "Could not internalize namestring");
+ return;
+ }
+
Next->Asl.AmlLength = strlen (Next->Asl.Value.String);
Next = Next->Asl.Next;
@@ -535,7 +544,7 @@ ExMoveExternals (
Next->Asl.Child->Asl.Next->Asl.Value.Integer;
if (ObjType == ACPI_TYPE_METHOD &&
- !(Next->Asl.CompileFlags & NODE_VISITED))
+ !(Next->Asl.CompileFlags & OP_VISITED))
{
if (Next == Prev)
{
@@ -569,12 +578,12 @@ ExMoveExternals (
Gbl_ExternalsListHead->Asl.ParseOpcode = PARSEOP_IF;
Gbl_ExternalsListHead->Asl.AmlOpcode = AML_IF_OP;
- Gbl_ExternalsListHead->Asl.CompileFlags = NODE_AML_PACKAGE;
+ Gbl_ExternalsListHead->Asl.CompileFlags = OP_AML_PACKAGE;
UtSetParseOpName (Gbl_ExternalsListHead);
/* Create a Zero op for the If predicate */
- PredicateOp = TrAllocateNode (PARSEOP_ZERO);
+ PredicateOp = TrAllocateOp (PARSEOP_ZERO);
PredicateOp->Asl.AmlOpcode = AML_ZERO_OP;
PredicateOp->Asl.Parent = Gbl_ExternalsListHead;
diff --git a/sys/contrib/dev/acpica/compiler/aslfold.c b/sys/contrib/dev/acpica/compiler/aslfold.c
index 283e2d2..fa828c3 100644
--- a/sys/contrib/dev/acpica/compiler/aslfold.c
+++ b/sys/contrib/dev/acpica/compiler/aslfold.c
@@ -232,8 +232,8 @@ OpcAmlConstantWalk (
* Only interested in subtrees that could possibly contain
* expressions that can be evaluated at this time
*/
- if ((!(Op->Asl.CompileFlags & NODE_COMPILE_TIME_CONST)) ||
- (Op->Asl.CompileFlags & NODE_IS_TARGET))
+ if ((!(Op->Asl.CompileFlags & OP_COMPILE_TIME_CONST)) ||
+ (Op->Asl.CompileFlags & OP_IS_TARGET))
{
return (AE_OK);
}
@@ -412,7 +412,7 @@ OpcAmlCheckForConstant (
{
/* Error if there is a target operand */
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
AslError (ASL_ERROR, ASL_MSG_INVALID_TARGET, Op, NULL);
Status = AE_TYPE;
@@ -420,11 +420,11 @@ OpcAmlCheckForConstant (
/* Error if expression cannot be reduced (folded) */
- if (!(NextOp->Asl.CompileFlags & NODE_COULD_NOT_REDUCE))
+ if (!(NextOp->Asl.CompileFlags & OP_COULD_NOT_REDUCE))
{
/* Ensure only one error message per statement */
- NextOp->Asl.CompileFlags |= NODE_COULD_NOT_REDUCE;
+ NextOp->Asl.CompileFlags |= OP_COULD_NOT_REDUCE;
DbgPrint (ASL_PARSE_OUTPUT,
"**** Could not reduce operands for NAME opcode ****\n");
@@ -441,7 +441,7 @@ OpcAmlCheckForConstant (
/* This is not a 3/4/5 opcode, but maybe can convert to STORE */
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
DbgPrint (ASL_PARSE_OUTPUT,
"**** Valid Target, transform to Store ****\n");
@@ -484,7 +484,7 @@ OpcAmlCheckForConstant (
DbgPrint (ASL_PARSE_OUTPUT, "TYPE_345");
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
if (Op->Asl.ParseOpcode == PARSEOP_ZERO)
{
@@ -496,7 +496,7 @@ OpcAmlCheckForConstant (
}
}
- if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
+ if (Op->Asl.CompileFlags & OP_IS_TERM_ARG)
{
DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " TERMARG");
}
@@ -505,7 +505,7 @@ CleanupAndExit:
/* Dump the node compile flags also */
- TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
+ TrPrintOpFlags (Op->Asl.CompileFlags, ASL_PARSE_OUTPUT);
DbgPrint (ASL_PARSE_OUTPUT, "\n");
return (Status);
}
@@ -543,7 +543,7 @@ TrSimpleConstantReduction (
/* Allocate a new temporary root for this subtree */
- RootOp = TrAllocateNode (PARSEOP_INTEGER);
+ RootOp = TrAllocateOp (PARSEOP_INTEGER);
if (!RootOp)
{
return (AE_NO_MEMORY);
@@ -654,7 +654,7 @@ TrTransformToStoreOp (
* Create a NULL (zero) target so that we can use the
* interpreter to evaluate the expression.
*/
- NewTarget = TrCreateNullTarget ();
+ NewTarget = TrCreateNullTargetOp ();
NewTarget->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
/* Handle one-operand cases (NOT, TOBCD, etc.) */
@@ -670,7 +670,7 @@ TrTransformToStoreOp (
Child2->Asl.Next = NewTarget;
NewTarget->Asl.Parent = OriginalTarget->Asl.Parent;
- NewParent = TrAllocateNode (PARSEOP_INTEGER);
+ NewParent = TrAllocateOp (PARSEOP_INTEGER);
NewParent->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
OriginalParent = Op->Common.Parent;
@@ -799,12 +799,12 @@ TrInstallReducedConstant (
*/
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
Op->Common.AmlOpcode = AML_BUFFER_OP;
- Op->Asl.CompileFlags = NODE_AML_PACKAGE;
+ Op->Asl.CompileFlags = OP_AML_PACKAGE;
UtSetParseOpName (Op);
/* Child node is the buffer length */
- LengthOp = TrAllocateNode (PARSEOP_INTEGER);
+ LengthOp = TrAllocateOp (PARSEOP_INTEGER);
LengthOp->Asl.AmlOpcode = AML_DWORD_OP;
LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
@@ -815,7 +815,7 @@ TrInstallReducedConstant (
/* Next child is the raw buffer data */
- DataOp = TrAllocateNode (PARSEOP_RAW_DATA);
+ DataOp = TrAllocateOp (PARSEOP_RAW_DATA);
DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
DataOp->Asl.AmlLength = ObjDesc->Buffer.Length;
DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
@@ -863,25 +863,25 @@ OpcUpdateIntegerNode (
{
case 1:
- TrUpdateNode (PARSEOP_BYTECONST, Op);
+ TrSetOpIntegerValue (PARSEOP_BYTECONST, Op);
Op->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
break;
case 2:
- TrUpdateNode (PARSEOP_WORDCONST, Op);
+ TrSetOpIntegerValue (PARSEOP_WORDCONST, Op);
Op->Asl.AmlOpcode = AML_RAW_DATA_WORD;
break;
case 4:
- TrUpdateNode (PARSEOP_DWORDCONST, Op);
+ TrSetOpIntegerValue (PARSEOP_DWORDCONST, Op);
Op->Asl.AmlOpcode = AML_RAW_DATA_DWORD;
break;
case 8:
- TrUpdateNode (PARSEOP_QWORDCONST, Op);
+ TrSetOpIntegerValue (PARSEOP_QWORDCONST, Op);
Op->Asl.AmlOpcode = AML_RAW_DATA_QWORD;
break;
@@ -889,7 +889,7 @@ OpcUpdateIntegerNode (
default:
OpcSetOptimalIntegerSize (Op);
- TrUpdateNode (PARSEOP_INTEGER, Op);
+ TrSetOpIntegerValue (PARSEOP_INTEGER, Op);
break;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h
index a495552..169b25e 100644
--- a/sys/contrib/dev/acpica/compiler/aslglobal.h
+++ b/sys/contrib/dev/acpica/compiler/aslglobal.h
@@ -196,9 +196,37 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
{NULL, NULL, "Converter db :", "Converter debug Output"}
};
+/* Table below must match the defines with the same names in actypes.h */
+
+const char *Gbl_OpFlagNames[ACPI_NUM_OP_FLAGS] =
+{
+ "OP_VISITED",
+ "OP_AML_PACKAGE",
+ "OP_IS_TARGET",
+ "OP_IS_RESOURCE_DESC",
+ "OP_IS_RESOURCE_FIELD",
+ "OP_HAS_NO_EXIT",
+ "OP_IF_HAS_NO_EXIT",
+ "OP_NAME_INTERNALIZED",
+ "OP_METHOD_NO_RETVAL",
+ "OP_METHOD_SOME_NO_RETVAL",
+ "OP_RESULT_NOT_USED",
+ "OP_METHOD_TYPED",
+ "OP_COULD_NOT_REDUCE",
+ "OP_COMPILE_TIME_CONST",
+ "OP_IS_TERM_ARG",
+ "OP_WAS_ONES_OP",
+ "OP_IS_NAME_DECLARATION",
+ "OP_COMPILER_EMITTED",
+ "OP_IS_DUPLICATE",
+ "OP_IS_RESOURCE_DATA",
+ "OP_IS_NULL_RETURN"
+};
+
#else
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
+extern const char *Gbl_OpFlagNames[ACPI_NUM_OP_FLAGS];
#endif
@@ -224,6 +252,7 @@ extern int AslCompilerdebug;
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
#define ASL_MSG_BUFFER_SIZE (1024 * 32) /* 32k */
#define ASL_MAX_DISABLED_MESSAGES 32
+#define ASL_MAX_EXPECTED_MESSAGES 32
#define HEX_TABLE_LINE_SIZE 8
#define HEX_LISTING_LINE_SIZE 8
@@ -275,7 +304,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE);
-ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
@@ -369,6 +397,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLine, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_DisabledMessagesIndex, 0);
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ExpectedMessagesIndex, 0);
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_HexBytesWereWritten, FALSE);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
@@ -388,9 +417,9 @@ ASL_EXTERN ASL_COMMENT_STATE Gbl_CommentState;
* Determines if an inline comment should be saved in the InlineComment or NodeEndComment
* field of ACPI_PARSE_OBJECT.
*/
-ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_Comment_List_Head, NULL);
-ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_Comment_List_Tail, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Inline_Comment_Buffer, NULL);
+ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_CommentListHead, NULL);
+ASL_EXTERN ACPI_COMMENT_NODE ASL_INIT_GLOBAL (*Gbl_CommentListTail, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_InlineCommentBuffer, NULL);
/* Static structures */
@@ -411,6 +440,7 @@ ASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE];
ASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE];
ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE];
ASL_EXTERN UINT32 Gbl_DisabledMessages[ASL_MAX_DISABLED_MESSAGES];
+ASL_EXTERN ASL_EXPECTED_MESSAGE Gbl_ExpectedMessages[ASL_MAX_EXPECTED_MESSAGES];
#endif /* __ASLGLOBAL_H */
diff --git a/sys/contrib/dev/acpica/compiler/aslhelp.c b/sys/contrib/dev/acpica/compiler/aslhelp.c
index 947cda0..38e2345 100644
--- a/sys/contrib/dev/acpica/compiler/aslhelp.c
+++ b/sys/contrib/dev/acpica/compiler/aslhelp.c
@@ -180,7 +180,6 @@ Usage (
ACPI_OPTION ("-@ <file>", "Specify command file");
ACPI_OPTION ("-I <dir>", "Specify additional include directory");
ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
- ACPI_OPTION ("-ca <file>", "convert a given ASL file to ASL+ (retains comments)");
ACPI_OPTION ("-v", "Display compiler version");
ACPI_OPTION ("-vo", "Enable optimization comments");
ACPI_OPTION ("-vs", "Disable signon");
@@ -205,10 +204,11 @@ Usage (
ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs");
ACPI_OPTION ("-vr", "Disable remarks");
ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
+ ACPI_OPTION ("-vx <messageid>", "Expect a specific warning, remark, or error");
ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level");
ACPI_OPTION ("-we", "Report warnings as errors");
- printf ("\nAML Code Generation (*.aml):\n");
+ printf ("\nAML Bytecode Generation (*.aml):\n");
ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)");
ACPI_OPTION ("-of", "Disable constant folding");
ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones");
@@ -225,20 +225,24 @@ Usage (
ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
ACPI_OPTION ("-lx", "Create cross-reference file (*.xrf)");
- printf ("\nFirmware Support - C Output:\n");
+ printf ("\nFirmware Support - C Text Output:\n");
ACPI_OPTION ("-tc", "Create hex AML table in C (*.hex)");
ACPI_OPTION ("-sc", "Create named hex AML arrays in C (*.c)");
ACPI_OPTION ("-ic", "Create include file in C for -sc symbols (*.h)");
ACPI_OPTION ("-so", "Create namespace AML offset table in C (*.offset.h)");
- printf ("\nFirmware Support - Assembler Output:\n");
+ printf ("\nFirmware Support - Assembler Text Output:\n");
ACPI_OPTION ("-ta", "Create hex AML table in assembler (*.hex)");
ACPI_OPTION ("-sa", "Create named hex AML arrays in assembler (*.asm)");
ACPI_OPTION ("-ia", "Create include file in assembler for -sa symbols (*.inc)");
- printf ("\nFirmware Support - ASL Output:\n");
+ printf ("\nFirmware Support - ASL Text Output:\n");
ACPI_OPTION ("-ts", "Create hex AML table in ASL (Buffer object) (*.hex)");
+ printf ("\nLegacy-ASL to ASL+ Converter:\n");
+ ACPI_OPTION ("-ca <file>", "Convert legacy-ASL source file to new ASL+ file");
+ ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)");
+
printf ("\nData Table Compiler:\n");
ACPI_OPTION ("-G", "Compile custom table that contains generic operators");
ACPI_OPTION ("-T <sig list>|ALL", "Create ACPI table template/example files");
diff --git a/sys/contrib/dev/acpica/compiler/aslhelpers.y b/sys/contrib/dev/acpica/compiler/aslhelpers.y
index f996506..cd898b1 100644
--- a/sys/contrib/dev/acpica/compiler/aslhelpers.y
+++ b/sys/contrib/dev/acpica/compiler/aslhelpers.y
@@ -160,11 +160,11 @@ NoEcho('
******************************************************************************/
OptionalBusMasterKeyword
- : ',' {$$ = TrCreateLeafNode (
+ : ',' {$$ = TrCreateLeafOp (
PARSEOP_BUSMASTERTYPE_MASTER);}
- | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (
+ | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafOp (
PARSEOP_BUSMASTERTYPE_MASTER);}
- | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (
+ | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafOp (
PARSEOP_BUSMASTERTYPE_NOTMASTER);}
;
@@ -176,9 +176,9 @@ OptionalAccessAttribTerm
;
OptionalAccessSize
- : {$$ = TrCreateValuedLeafNode (
+ : {$$ = TrCreateValuedLeafOp (
PARSEOP_BYTECONST, 0);}
- | ',' {$$ = TrCreateValuedLeafNode (
+ | ',' {$$ = TrCreateValuedLeafOp (
PARSEOP_BYTECONST, 0);}
| ',' ByteConstExpr {$$ = $2;}
;
@@ -243,10 +243,10 @@ OptionalIoRestriction
;
OptionalListString
- : {$$ = TrCreateValuedLeafNode (
+ : {$$ = TrCreateValuedLeafOp (
PARSEOP_STRING_LITERAL,
ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
- | ',' {$$ = TrCreateValuedLeafNode (
+ | ',' {$$ = TrCreateValuedLeafOp (
PARSEOP_STRING_LITERAL,
ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
| ',' TermArg {$$ = $2;}
@@ -280,13 +280,13 @@ OptionalNameString_Last
;
OptionalNameString_First
- : {$$ = TrCreateLeafNode (
+ : {$$ = TrCreateLeafOp (
PARSEOP_ZERO);}
| NameString {$$ = $1;}
;
OptionalObjectTypeKeyword
- : {$$ = TrCreateLeafNode (
+ : {$$ = TrCreateLeafOp (
PARSEOP_OBJECTTYPE_UNK);}
| ',' ObjectTypeKeyword {$$ = $2;}
;
@@ -308,28 +308,37 @@ OptionalRangeType
;
OptionalReadWriteKeyword
- : {$$ = TrCreateLeafNode (
+ : {$$ = TrCreateLeafOp (
PARSEOP_READWRITETYPE_BOTH);}
- | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (
+ | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafOp (
PARSEOP_READWRITETYPE_BOTH);}
- | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (
+ | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafOp (
PARSEOP_READWRITETYPE_READONLY);}
;
OptionalResourceType_First
- : {$$ = TrCreateLeafNode (
+ : {$$ = TrCreateLeafOp (
PARSEOP_RESOURCETYPE_CONSUMER);}
| ResourceTypeKeyword {$$ = $1;}
;
OptionalResourceType
- : {$$ = TrCreateLeafNode (
+ : {$$ = TrCreateLeafOp (
PARSEOP_RESOURCETYPE_CONSUMER);}
- | ',' {$$ = TrCreateLeafNode (
+ | ',' {$$ = TrCreateLeafOp (
PARSEOP_RESOURCETYPE_CONSUMER);}
| ',' ResourceTypeKeyword {$$ = $2;}
;
+/* Same as above except default is producer */
+OptionalProducerResourceType
+ : {$$ = TrCreateLeafOp (
+ PARSEOP_RESOURCETYPE_PRODUCER);}
+ | ',' {$$ = TrCreateLeafOp (
+ PARSEOP_RESOURCETYPE_PRODUCER);}
+ | ',' ResourceTypeKeyword {$$ = $2;}
+ ;
+
OptionalSlaveMode
: ',' {$$ = NULL;}
| ',' SlaveModeKeyword {$$ = $2;}
@@ -386,9 +395,9 @@ OptionalWordConstExpr
;
OptionalXferSize
- : {$$ = TrCreateValuedLeafNode (
+ : {$$ = TrCreateValuedLeafOp (
PARSEOP_XFERSIZE_32, 2);}
- | ',' {$$ = TrCreateValuedLeafNode (
+ | ',' {$$ = TrCreateValuedLeafOp (
PARSEOP_XFERSIZE_32, 2);}
| ',' XferSizeKeyword {$$ = $2;}
;
diff --git a/sys/contrib/dev/acpica/compiler/aslkeywords.y b/sys/contrib/dev/acpica/compiler/aslkeywords.y
index 08fbfc7..e259d84 100644
--- a/sys/contrib/dev/acpica/compiler/aslkeywords.y
+++ b/sys/contrib/dev/acpica/compiler/aslkeywords.y
@@ -159,46 +159,46 @@ NoEcho('
******************************************************************************/
AccessAttribKeyword
- : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);}
- | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);}
- | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);}
- | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );}
- | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);}
- | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);}
- | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);}
+ : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BLOCK);}
+ | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BLOCK_CALL);}
+ | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_BYTE);}
+ | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_QUICK );}
+ | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_SND_RCV);}
+ | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_WORD);}
+ | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_WORD_CALL);}
| PARSEOP_ACCESSATTRIB_MULTIBYTE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_MULTIBYTE);}
ByteConst
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_ACCESSATTRIB_RAW_BYTES
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_RAW_BYTES);}
ByteConst
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_ACCESSATTRIB_RAW_PROCESS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ACCESSATTRIB_RAW_PROCESS);}
ByteConst
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
;
AccessTypeKeyword
- : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);}
- | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);}
- | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);}
- | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);}
- | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);}
- | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);}
+ : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_ANY);}
+ | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_BYTE);}
+ | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_WORD);}
+ | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_DWORD);}
+ | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_QWORD);}
+ | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafOp (PARSEOP_ACCESSTYPE_BUF);}
;
AddressingModeKeyword
- : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);}
- | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);}
+ : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafOp (PARSEOP_ADDRESSINGMODE_7BIT);}
+ | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafOp (PARSEOP_ADDRESSINGMODE_10BIT);}
;
AddressKeyword
- : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);}
- | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);}
- | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);}
- | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);}
+ : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_MEMORY);}
+ | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_RESERVED);}
+ | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_NVS);}
+ | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafOp (PARSEOP_ADDRESSTYPE_ACPI);}
;
AddressSpaceKeyword
@@ -207,130 +207,130 @@ AddressSpaceKeyword
;
BitsPerByteKeyword
- : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);}
- | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);}
- | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);}
- | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);}
- | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);}
+ : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_FIVE);}
+ | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_SIX);}
+ | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_SEVEN);}
+ | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_EIGHT);}
+ | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafOp (PARSEOP_BITSPERBYTE_NINE);}
;
ClockPhaseKeyword
- : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);}
- | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);}
+ : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafOp (PARSEOP_CLOCKPHASE_FIRST);}
+ | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafOp (PARSEOP_CLOCKPHASE_SECOND);}
;
ClockPolarityKeyword
- : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);}
- | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);}
+ : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafOp (PARSEOP_CLOCKPOLARITY_LOW);}
+ | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafOp (PARSEOP_CLOCKPOLARITY_HIGH);}
;
DecodeKeyword
- : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);}
- | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);}
+ : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafOp (PARSEOP_DECODETYPE_POS);}
+ | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafOp (PARSEOP_DECODETYPE_SUB);}
;
DevicePolarityKeyword
- : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);}
- | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);}
+ : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafOp (PARSEOP_DEVICEPOLARITY_LOW);}
+ | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafOp (PARSEOP_DEVICEPOLARITY_HIGH);}
;
DMATypeKeyword
- : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);}
- | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);}
- | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);}
- | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);}
+ : PARSEOP_DMATYPE_A {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_A);}
+ | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_COMPATIBILITY);}
+ | PARSEOP_DMATYPE_B {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_B);}
+ | PARSEOP_DMATYPE_F {$$ = TrCreateLeafOp (PARSEOP_DMATYPE_F);}
;
EndianKeyword
- : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);}
- | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);}
+ : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafOp (PARSEOP_ENDIAN_LITTLE);}
+ | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafOp (PARSEOP_ENDIAN_BIG);}
;
FlowControlKeyword
- : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);}
- | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);}
- | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);}
+ : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_HW);}
+ | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_NONE);}
+ | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafOp (PARSEOP_FLOWCONTROL_SW);}
;
InterruptLevel
- : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);}
- | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);}
- | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);}
+ : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVEBOTH);}
+ | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVEHIGH);}
+ | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafOp (PARSEOP_INTLEVEL_ACTIVELOW);}
;
InterruptTypeKeyword
- : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);}
- | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);}
+ : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafOp (PARSEOP_INTTYPE_EDGE);}
+ | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafOp (PARSEOP_INTTYPE_LEVEL);}
;
IODecodeKeyword
- : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);}
- | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);}
+ : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafOp (PARSEOP_IODECODETYPE_16);}
+ | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafOp (PARSEOP_IODECODETYPE_10);}
;
IoRestrictionKeyword
- : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);}
- | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);}
- | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);}
- | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);}
+ : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_IN);}
+ | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_OUT);}
+ | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_NONE);}
+ | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafOp (PARSEOP_IORESTRICT_PRESERVE);}
;
LockRuleKeyword
- : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);}
- | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);}
+ : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafOp (PARSEOP_LOCKRULE_LOCK);}
+ | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafOp (PARSEOP_LOCKRULE_NOLOCK);}
;
MatchOpKeyword
- : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);}
- | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);}
- | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);}
- | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);}
- | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);}
- | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);}
+ : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MTR);}
+ | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MEQ);}
+ | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MLE);}
+ | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MLT);}
+ | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MGE);}
+ | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafOp (PARSEOP_MATCHTYPE_MGT);}
;
MaxKeyword
- : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);}
- | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);}
+ : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafOp (PARSEOP_MAXTYPE_FIXED);}
+ | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafOp (PARSEOP_MAXTYPE_NOTFIXED);}
;
MemTypeKeyword
- : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);}
- | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);}
- | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);}
- | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);}
+ : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_CACHEABLE);}
+ | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_WRITECOMBINING);}
+ | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_PREFETCHABLE);}
+ | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafOp (PARSEOP_MEMTYPE_NONCACHEABLE);}
;
MinKeyword
- : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);}
- | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);}
+ : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafOp (PARSEOP_MINTYPE_FIXED);}
+ | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafOp (PARSEOP_MINTYPE_NOTFIXED);}
;
ObjectTypeKeyword
- : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);}
- | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);}
- | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);}
- | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);}
- | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);}
- | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);}
- | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);}
- | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);}
- | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);}
- | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);}
- | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);}
- | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);}
- | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);}
- | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);}
- | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);}
- | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);}
+ : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_UNK);}
+ | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_INT);}
+ | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_STR);}
+ | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_BUF);}
+ | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_PKG);}
+ | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_FLD);}
+ | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_DEV);}
+ | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_EVT);}
+ | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_MTH);}
+ | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_MTX);}
+ | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_OPR);}
+ | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_POW);}
+ | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_PRO);}
+ | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_THZ);}
+ | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_BFF);}
+ | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE_DDB);}
;
ParityTypeKeyword
- : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);}
- | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);}
- | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);}
- | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);}
- | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);}
+ : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_SPACE);}
+ | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_MARK);}
+ | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_ODD);}
+ | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_EVEN);}
+ | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafOp (PARSEOP_PARITYTYPE_NONE);}
;
PinConfigByte
@@ -339,125 +339,125 @@ PinConfigByte
;
PinConfigKeyword
- : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);}
- | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);}
- | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);}
- | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);}
+ : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafOp (PARSEOP_PIN_NOPULL);}
+ | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLDOWN);}
+ | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLUP);}
+ | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafOp (PARSEOP_PIN_PULLDEFAULT);}
;
PldKeyword
- : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);}
- | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);}
- | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);}
- | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);}
- | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);}
- | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);}
- | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);}
- | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);}
- | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);}
- | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);}
- | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);}
- | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);}
- | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);}
- | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);}
- | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);}
- | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);}
- | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);}
- | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);}
- | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);}
- | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);}
- | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);}
- | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);}
- | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);}
- | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);}
- | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);}
- | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);}
- | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);}
- | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);}
+ : PARSEOP_PLD_REVISION {$$ = TrCreateLeafOp (PARSEOP_PLD_REVISION);}
+ | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafOp (PARSEOP_PLD_IGNORECOLOR);}
+ | PARSEOP_PLD_RED {$$ = TrCreateLeafOp (PARSEOP_PLD_RED);}
+ | PARSEOP_PLD_GREEN {$$ = TrCreateLeafOp (PARSEOP_PLD_GREEN);}
+ | PARSEOP_PLD_BLUE {$$ = TrCreateLeafOp (PARSEOP_PLD_BLUE);}
+ | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafOp (PARSEOP_PLD_WIDTH);}
+ | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafOp (PARSEOP_PLD_HEIGHT);}
+ | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafOp (PARSEOP_PLD_USERVISIBLE);}
+ | PARSEOP_PLD_DOCK {$$ = TrCreateLeafOp (PARSEOP_PLD_DOCK);}
+ | PARSEOP_PLD_LID {$$ = TrCreateLeafOp (PARSEOP_PLD_LID);}
+ | PARSEOP_PLD_PANEL {$$ = TrCreateLeafOp (PARSEOP_PLD_PANEL);}
+ | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_VERTICALPOSITION);}
+ | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_HORIZONTALPOSITION);}
+ | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafOp (PARSEOP_PLD_SHAPE);}
+ | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPORIENTATION);}
+ | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPTOKEN);}
+ | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafOp (PARSEOP_PLD_GROUPPOSITION);}
+ | PARSEOP_PLD_BAY {$$ = TrCreateLeafOp (PARSEOP_PLD_BAY);}
+ | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafOp (PARSEOP_PLD_EJECTABLE);}
+ | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafOp (PARSEOP_PLD_EJECTREQUIRED);}
+ | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafOp (PARSEOP_PLD_CABINETNUMBER);}
+ | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafOp (PARSEOP_PLD_CARDCAGENUMBER);}
+ | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafOp (PARSEOP_PLD_REFERENCE);}
+ | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafOp (PARSEOP_PLD_ROTATION);}
+ | PARSEOP_PLD_ORDER {$$ = TrCreateLeafOp (PARSEOP_PLD_ORDER);}
+ | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafOp (PARSEOP_PLD_RESERVED);}
+ | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafOp (PARSEOP_PLD_VERTICALOFFSET);}
+ | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafOp (PARSEOP_PLD_HORIZONTALOFFSET);}
;
RangeTypeKeyword
- : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);}
- | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);}
- | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);}
+ : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_ISAONLY);}
+ | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_NONISAONLY);}
+ | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafOp (PARSEOP_RANGETYPE_ENTIRE);}
;
RegionSpaceKeyword
- : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);}
- | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);}
- | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);}
- | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);}
- | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);}
- | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);}
- | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);}
- | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);}
- | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);}
- | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);}
- | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);}
- | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);}
+ : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_IO);}
+ | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_MEM);}
+ | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCI);}
+ | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_EC);}
+ | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_SMBUS);}
+ | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_CMOS);}
+ | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCIBAR);}
+ | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_IPMI);}
+ | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GPIO);}
+ | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GSBUS);}
+ | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCC);}
+ | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_FFIXEDHW);}
;
ResourceTypeKeyword
- : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
- | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);}
+ : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafOp (PARSEOP_RESOURCETYPE_CONSUMER);}
+ | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafOp (PARSEOP_RESOURCETYPE_PRODUCER);}
;
SerializeRuleKeyword
- : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);}
- | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);}
+ : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafOp (PARSEOP_SERIALIZERULE_SERIAL);}
+ | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafOp (PARSEOP_SERIALIZERULE_NOTSERIAL);}
;
ShareTypeKeyword
- : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);}
- | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);}
- | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);}
- | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);}
+ : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_SHARED);}
+ | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_EXCLUSIVE);}
+ | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_SHAREDWAKE);}
+ | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafOp (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);}
;
SlaveModeKeyword
- : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);}
- | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);}
+ : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafOp (PARSEOP_SLAVEMODE_CONTROLLERINIT);}
+ | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafOp (PARSEOP_SLAVEMODE_DEVICEINIT);}
;
StopBitsKeyword
- : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);}
- | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);}
- | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);}
- | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);}
+ : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_TWO);}
+ | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ONEPLUSHALF);}
+ | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ONE);}
+ | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafOp (PARSEOP_STOPBITS_ZERO);}
;
TranslationKeyword
- : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);}
- | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);}
+ : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafOp (PARSEOP_TRANSLATIONTYPE_SPARSE);}
+ | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafOp (PARSEOP_TRANSLATIONTYPE_DENSE);}
;
TypeKeyword
- : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);}
- | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);}
+ : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafOp (PARSEOP_TYPE_TRANSLATION);}
+ | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafOp (PARSEOP_TYPE_STATIC);}
;
UpdateRuleKeyword
- : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);}
- | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);}
- | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);}
+ : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_PRESERVE);}
+ | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_ONES);}
+ | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafOp (PARSEOP_UPDATERULE_ZEROS);}
;
WireModeKeyword
- : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);}
- | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);}
+ : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafOp (PARSEOP_WIREMODE_FOUR);}
+ | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafOp (PARSEOP_WIREMODE_THREE);}
;
XferSizeKeyword
- : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);}
- | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);}
- | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
- | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);}
- | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);}
- | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);}
+ : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_8, 0);}
+ | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_16, 1);}
+ | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_32, 2);}
+ | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_64, 3);}
+ | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_128, 4);}
+ | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafOp (PARSEOP_XFERSIZE_256, 5);}
;
XferTypeKeyword
- : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);}
- | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);}
- | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);}
+ : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8);}
+ | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8_16);}
+ | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_16);}
;
diff --git a/sys/contrib/dev/acpica/compiler/asllength.c b/sys/contrib/dev/acpica/compiler/asllength.c
index b1c9555..2e180b0 100644
--- a/sys/contrib/dev/acpica/compiler/asllength.c
+++ b/sys/contrib/dev/acpica/compiler/asllength.c
@@ -338,7 +338,7 @@ CgGenerateAmlOpcodeLength (
/* Does this opcode have an associated "PackageLength" field? */
Op->Asl.AmlPkgLenBytes = 0;
- if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
+ if (Op->Asl.CompileFlags & OP_AML_PACKAGE)
{
Op->Asl.AmlPkgLenBytes = CgGetPackageLenByteCount (
Op, Op->Asl.AmlSubtreeLength);
@@ -459,7 +459,7 @@ CgGenerateAmlLengths (
case PARSEOP_NAMESTRING:
case PARSEOP_METHODCALL:
- if (Op->Asl.CompileFlags & NODE_NAME_INTERNALIZED)
+ if (Op->Asl.CompileFlags & OP_NAME_INTERNALIZED)
{
break;
}
@@ -475,7 +475,7 @@ CgGenerateAmlLengths (
Op->Asl.ExternalName = Op->Asl.Value.String;
Op->Asl.Value.String = Buffer;
- Op->Asl.CompileFlags |= NODE_NAME_INTERNALIZED;
+ Op->Asl.CompileFlags |= OP_NAME_INTERNALIZED;
Op->Asl.AmlLength = strlen (Buffer);
/*
diff --git a/sys/contrib/dev/acpica/compiler/asllisting.c b/sys/contrib/dev/acpica/compiler/asllisting.c
index 9e3178c..300c767 100644
--- a/sys/contrib/dev/acpica/compiler/asllisting.c
+++ b/sys/contrib/dev/acpica/compiler/asllisting.c
@@ -313,7 +313,7 @@ LsAmlListingWalk (
LsWriteNodeToListing (Op, FileId);
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DATA)
{
/* Buffer is a resource template, don't dump the data all at once */
@@ -445,7 +445,7 @@ LsTreeWriteWalk (
Op->Asl.LineNumber, Op->Asl.EndLine,
Op->Asl.LogicalLineNumber, Op->Asl.EndLogicalLine);
- TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
+ TrPrintOpFlags (Op->Asl.CompileFlags, ASL_TREE_OUTPUT);
DbgPrint (ASL_TREE_OUTPUT, "\n");
return (AE_OK);
}
@@ -616,7 +616,7 @@ LsWriteNodeToListing (
case PARSEOP_DEFAULT_ARG:
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
{
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.EndLogicalLine,
FileId);
@@ -660,7 +660,7 @@ LsWriteNodeToListing (
case AML_NAME_OP:
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
{
LsWriteSourceLines (Op->Asl.LineNumber, Op->Asl.LogicalLineNumber,
FileId);
@@ -779,7 +779,7 @@ LsWriteNodeToListing (
default:
if ((Op->Asl.ParseOpcode == PARSEOP_BUFFER) &&
- (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
+ (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC))
{
return;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslload.c b/sys/contrib/dev/acpica/compiler/aslload.c
index c304f30..7480f23 100644
--- a/sys/contrib/dev/acpica/compiler/aslload.c
+++ b/sys/contrib/dev/acpica/compiler/aslload.c
@@ -315,13 +315,21 @@ LdLoadFieldElements (
Child->Asl.Value.String);
return (Status);
}
-
- /*
- * The name already exists in this scope
- * But continue processing the elements
- */
- AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child,
- Child->Asl.Value.String);
+ else if (Status == AE_ALREADY_EXISTS &&
+ (Node->Flags & ANOBJ_IS_EXTERNAL) &&
+ Node->OwnerId != WalkState->OwnerId)
+ {
+ Node->Type = (UINT8) ACPI_TYPE_LOCAL_REGION_FIELD;
+ }
+ else
+ {
+ /*
+ * The name already exists in this scope
+ * But continue processing the elements
+ */
+ AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Child,
+ Child->Asl.Value.String);
+ }
}
else
{
@@ -458,12 +466,30 @@ LdNamespace1Begin (
ACPI_PARSE_OBJECT *Arg;
UINT32 i;
BOOLEAN ForceNewScope = FALSE;
+ ACPI_OWNER_ID OwnerId = 0;
ACPI_FUNCTION_NAME (LdNamespace1Begin);
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
Op, Op->Asl.ParseOpName));
+ if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
+ {
+ /*
+ * Allocate an OwnerId for this block. This helps identify the owners
+ * of each namespace node. This is used in determining whether if
+ * certain external declarations cause redefinition errors.
+ */
+ Status = AcpiUtAllocateOwnerId (&OwnerId);
+ WalkState->OwnerId = OwnerId;
+ if (ACPI_FAILURE (Status))
+ {
+ AslCoreSubsystemError (Op, Status,
+ "Failure to allocate owner ID to this definition block.", FALSE);
+ return_ACPI_STATUS (Status);
+ }
+ }
+
/*
* We are only interested in opcodes that have an associated name
* (or multiple names)
@@ -539,7 +565,7 @@ LdNamespace1Begin (
* a new scope so that the resource subfield names can be entered into
* the namespace underneath this name
*/
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
{
ForceNewScope = TRUE;
}
@@ -589,7 +615,7 @@ LdNamespace1Begin (
case PARSEOP_DEFAULT_ARG:
- if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)
+ if (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC)
{
Status = LdLoadResourceElements (Op, WalkState);
return_ACPI_STATUS (Status);
@@ -778,7 +804,9 @@ LdNamespace1Begin (
{
/*
* Allow one create on an object or segment that was
- * previously declared External
+ * previously declared External only if WalkState->OwnerId and
+ * Node->OwnerId are found in different tables (meaning that
+ * they have differnt OwnerIds).
*/
Node->Flags &= ~ANOBJ_IS_EXTERNAL;
Node->Type = (UINT8) ObjectType;
@@ -795,6 +823,17 @@ LdNamespace1Begin (
}
Status = AE_OK;
+
+ if (Node->OwnerId == WalkState->OwnerId &&
+ !(Node->Flags & IMPLICIT_EXTERNAL))
+ {
+ AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op,
+ Op->Asl.ExternalName);
+ }
+ if (Node->Flags & IMPLICIT_EXTERNAL)
+ {
+ Node->Flags &= ~IMPLICIT_EXTERNAL;
+ }
}
else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) &&
(Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
@@ -802,15 +841,52 @@ LdNamespace1Begin (
/*
* Allow externals in same scope as the definition of the
* actual object. Similar to C. Allows multiple definition
- * blocks that refer to each other in the same file.
+ * blocks that refer to each other in the same file. However,
+ * do not allow name declaration and an external declaration
+ * within the same table. This is considered a re-declaration.
*/
Status = AE_OK;
+
+ if (Node->OwnerId == WalkState->OwnerId)
+ {
+ AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op,
+ Op->Asl.ExternalName);
+ }
}
else if ((Node->Flags & ANOBJ_IS_EXTERNAL) &&
(Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) &&
(ObjectType == ACPI_TYPE_ANY))
{
- /* Allow update of externals of unknown type. */
+ /*
+ * Allow update of externals of unknown type.
+ * In the case that multiple definition blocks are being
+ * parsed, updating the OwnerId allows enables subsequent calls
+ * of this method to understand which table the most recent
+ * external declaration was seen. Without this OwnerId update,
+ * code like the following is allowed to compile:
+ *
+ * DefinitionBlock("externtest.aml", "DSDT", 0x02, "Intel", "Many", 0x00000001)
+ * {
+ * External(ERRS,methodobj)
+ * Method (MAIN)
+ * {
+ * Name(NUM2, 0)
+ * ERRS(1,2,3)
+ * }
+ * }
+ *
+ * DefinitionBlock("externtest.aml", "SSDT", 0x02, "Intel", "Many", 0x00000001)
+ * {
+ * if (0)
+ * {
+ * External(ERRS,methodobj)
+ * }
+ * Method (ERRS,3)
+ * {}
+ *
+ * }
+ */
+ Node->OwnerId = WalkState->OwnerId;
if (AcpiNsOpensScope (ActualObjectType))
{
@@ -930,7 +1006,7 @@ LdNamespace2Begin (
/* Get the type to determine if we should push the scope */
if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) &&
- (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC))
+ (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC))
{
ObjectType = ACPI_TYPE_LOCAL_RESOURCE;
}
@@ -943,7 +1019,7 @@ LdNamespace2Begin (
if (Op->Asl.ParseOpcode == PARSEOP_NAME)
{
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
{
ForceNewScope = TRUE;
}
@@ -1054,7 +1130,7 @@ LdCommonNamespaceEnd (
/* Get the type to determine if we should pop the scope */
if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) &&
- (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC))
+ (Op->Asl.CompileFlags == OP_IS_RESOURCE_DESC))
{
/* TBD: Merge into AcpiDsMapNamedOpcodeToDataType */
@@ -1069,7 +1145,7 @@ LdCommonNamespaceEnd (
if (Op->Asl.ParseOpcode == PARSEOP_NAME)
{
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC)
{
ForceNewScope = TRUE;
}
diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c
index 61bde60..8748fc8 100644
--- a/sys/contrib/dev/acpica/compiler/asllookup.c
+++ b/sys/contrib/dev/acpica/compiler/asllookup.c
@@ -413,7 +413,7 @@ LkGetNameOp (
/* Name must appear as the last parameter */
NameOp = Op->Asl.Child;
- while (!(NameOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
+ while (!(NameOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
{
NameOp = NameOp->Asl.Next;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c
index c5649ae..9c73aee 100644
--- a/sys/contrib/dev/acpica/compiler/aslmain.c
+++ b/sys/contrib/dev/acpica/compiler/aslmain.c
@@ -207,6 +207,9 @@ main (
int ReturnStatus = 0;
+ signal (SIGINT, AslSignalHandler);
+ signal (SIGSEGV, AslSignalHandler);
+
/*
* Big-endian machines are not currently supported. ACPI tables must
* be little-endian, and support for big-endian machines needs to
@@ -224,7 +227,6 @@ main (
/* Initialize preprocessor and compiler before command line processing */
- signal (SIGINT, AslSignalHandler);
AcpiGbl_ExternalFileList = NULL;
AcpiDbgLevel = 0;
PrInitializePreprocessor ();
@@ -254,6 +256,7 @@ main (
}
}
+
/* Process each pathname/filename in the list, with possible wildcards */
while (argv[Index2])
@@ -301,8 +304,10 @@ CleanupAndExit:
*
* RETURN: None
*
- * DESCRIPTION: Control-C handler. Delete any intermediate files and any
- * output files that may be left in an indeterminate state.
+ * DESCRIPTION: Signal interrupt handler. Delete any intermediate files and
+ * any output files that may be left in an indeterminate state.
+ * Currently handles SIGINT (control-c) and SIGSEGV (segmentation
+ * fault).
*
*****************************************************************************/
@@ -314,11 +319,34 @@ AslSignalHandler (
signal (Sig, SIG_IGN);
- printf ("Aborting\n\n");
+ fflush (stdout);
+ fflush (stderr);
+
+ switch (Sig)
+ {
+ case SIGINT:
+
+ printf ("\n" ASL_PREFIX "<Control-C>\n");
+ break;
- /* Close all open files */
+ case SIGSEGV:
- Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */
+ /* Even on a seg fault, we will try to delete any partial files */
+
+ printf (ASL_PREFIX "Segmentation Fault\n");
+ break;
+
+ default:
+
+ printf (ASL_PREFIX "Unknown interrupt signal (%u), ignoring\n", Sig);
+ return;
+ }
+
+ /*
+ * Close all open files
+ * Note: the .pre file is the same as the input source file
+ */
+ Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL;
for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
{
@@ -332,6 +360,7 @@ AslSignalHandler (
FlDeleteFile (i);
}
+ printf (ASL_PREFIX "Terminating\n");
exit (0);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c
index c15ef80..5d41acb 100644
--- a/sys/contrib/dev/acpica/compiler/aslmap.c
+++ b/sys/contrib/dev/acpica/compiler/aslmap.c
@@ -267,7 +267,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* ARG4 */ OP_TABLE_ENTRY (AML_ARG4, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
/* ARG5 */ OP_TABLE_ENTRY (AML_ARG5, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
/* ARG6 */ OP_TABLE_ENTRY (AML_ARG6, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
-/* BANKFIELD */ OP_TABLE_ENTRY (AML_BANK_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
+/* BANKFIELD */ OP_TABLE_ENTRY (AML_BANK_FIELD_OP, 0, OP_AML_PACKAGE, 0),
/* BITSPERBYTE_EIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
/* BITSPERBYTE_FIVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* BITSPERBYTE_NINE */ OP_TABLE_ENTRY (AML_BYTE_OP, 4, 0, 0),
@@ -275,7 +275,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* BITSPERBYTE_SIX */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* BREAK */ OP_TABLE_ENTRY (AML_BREAK_OP, 0, 0, 0),
/* BREAKPOINT */ OP_TABLE_ENTRY (AML_BREAKPOINT_OP, 0, 0, 0),
-/* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_BUFFER),
+/* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_BUFFER),
/* BUSMASTERTYPE_MASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* BUSMASTERTYPE_NOTMASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* BYTECONST */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, 0, 0, ACPI_BTYPE_INTEGER),
@@ -306,7 +306,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* DEFAULT_ARG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* DEFINITIONBLOCK */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* DEREFOF */ OP_TABLE_ENTRY (AML_DEREF_OF_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE | ACPI_BTYPE_STRING),
-/* DEVICE */ OP_TABLE_ENTRY (AML_DEVICE_OP, 0, NODE_AML_PACKAGE, 0),
+/* DEVICE */ OP_TABLE_ENTRY (AML_DEVICE_OP, 0, OP_AML_PACKAGE, 0),
/* DEVICEPOLARITY_HIGH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* DEVICEPOLARITY_LOW */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* DIVIDE */ OP_TABLE_ENTRY (AML_DIVIDE_OP, 0, 0, ACPI_BTYPE_INTEGER),
@@ -320,8 +320,8 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* DWORDMEMORY */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* DWORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EISAID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, 0, ACPI_BTYPE_INTEGER),
-/* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, NODE_AML_PACKAGE, 0),
-/* ELSEIF */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, NODE_AML_PACKAGE, 0),
+/* ELSE */ OP_TABLE_ENTRY (AML_ELSE_OP, 0, OP_AML_PACKAGE, 0),
+/* ELSEIF */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, OP_AML_PACKAGE, 0),
/* ENDDEPENDENTFN */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* ENDIAN_BIG */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* ENDIAN_LITTLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
@@ -333,7 +333,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* EXTENDEDSPACE */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER),
/* EXTERNAL */ OP_TABLE_ENTRY (AML_EXTERNAL_OP, 0, 0, 0),
/* FATAL */ OP_TABLE_ENTRY (AML_FATAL_OP, 0, 0, 0),
-/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
+/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, OP_AML_PACKAGE, 0),
/* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* FINDSETRIGHTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_RIGHT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* FIXEDDMA */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
@@ -342,17 +342,17 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* FLOWCONTROL_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* FLOWCONTROL_SW */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
/* FROMBCD */ OP_TABLE_ENTRY (AML_FROM_BCD_OP, 0, 0, ACPI_BTYPE_INTEGER),
-/* FUNCTION */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, NODE_AML_PACKAGE, 0),
+/* FUNCTION */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, OP_AML_PACKAGE, 0),
/* GPIOINT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* GPIOIO */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* I2CSERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* I2CSERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
-/* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, NODE_AML_PACKAGE, 0),
+/* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, OP_AML_PACKAGE, 0),
/* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* INCLUDE_END */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* INCREMENT */ OP_TABLE_ENTRY (AML_INCREMENT_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* INDEX */ OP_TABLE_ENTRY (AML_INDEX_OP, 0, 0, ACPI_BTYPE_REFERENCE_OBJECT),
-/* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
+/* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, OP_AML_PACKAGE, 0),
/* INTEGER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* INTERRUPT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* INTLEVEL_ACTIVEBOTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
@@ -406,7 +406,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* MEMTYPE_NONCACHEABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* MEMTYPE_PREFETCHABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
/* MEMTYPE_WRITECOMBINING */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
-/* METHOD */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, NODE_AML_PACKAGE, 0),
+/* METHOD */ OP_TABLE_ENTRY (AML_METHOD_OP, 0, OP_AML_PACKAGE, 0),
/* METHODCALL */ OP_TABLE_ENTRY (AML_INT_METHODCALL_OP, 0, 0, ACPI_BTYPE_OBJECTS_AND_REFS),
/* MID */ OP_TABLE_ENTRY (AML_MID_OP, 0, 0, ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER),
/* MINTYPE_FIXED */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
@@ -444,19 +444,24 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* ONES */ OP_TABLE_ENTRY (AML_ONES_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* OPERATIONREGION */ OP_TABLE_ENTRY (AML_REGION_OP, 0, 0, 0),
/* OR */ OP_TABLE_ENTRY (AML_BIT_OR_OP, 0, 0, ACPI_BTYPE_INTEGER),
-/* PACKAGE */ OP_TABLE_ENTRY (AML_PACKAGE_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
-/* PACKAGEP_LENGTH */ OP_TABLE_ENTRY (AML_PACKAGE_LENGTH, 0, NODE_AML_PACKAGE, 0),
+/* PACKAGE */ OP_TABLE_ENTRY (AML_PACKAGE_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
+/* PACKAGEP_LENGTH */ OP_TABLE_ENTRY (AML_PACKAGE_LENGTH, 0, OP_AML_PACKAGE, 0),
/* PARITYTYPE_EVEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* PARITYTYPE_MARK */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
/* PARITYTYPE_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* PARITYTYPE_ODD */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
/* PARITYTYPE_SPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 4, 0, 0),
+/* PINCONFIG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
+/* PINFUNCTION */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
+/* PINGROUP */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
+/* PINGROUPCONFIG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
+/* PINGROUPFUNCTION */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* PIN_NOPULL */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0),
/* PIN_PULLDEFAULT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* PIN_PULLDOWN */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
/* PIN_PULLUP */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
-/* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, NODE_AML_PACKAGE, 0),
-/* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, NODE_AML_PACKAGE, 0),
+/* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, OP_AML_PACKAGE, 0),
+/* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, OP_AML_PACKAGE, 0),
/* QWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER),
/* QWORDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* QWORDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
@@ -489,7 +494,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* RESOURCETYPE_PRODUCER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* RETURN */ OP_TABLE_ENTRY (AML_RETURN_OP, 0, 0, 0),
/* REVISION */ OP_TABLE_ENTRY (AML_REVISION_OP, 0, 0, ACPI_BTYPE_INTEGER),
-/* SCOPE */ OP_TABLE_ENTRY (AML_SCOPE_OP, 0, NODE_AML_PACKAGE, 0),
+/* SCOPE */ OP_TABLE_ENTRY (AML_SCOPE_OP, 0, OP_AML_PACKAGE, 0),
/* SERIALIZERULE_NOTSERIAL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* SERIALIZERULE_SERIAL */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* SHARETYPE_EXCLUSIVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
@@ -516,7 +521,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* STRING_LITERAL */ OP_TABLE_ENTRY (AML_STRING_OP, 0, 0, ACPI_BTYPE_STRING),
/* SUBTRACT */ OP_TABLE_ENTRY (AML_SUBTRACT_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* SWITCH */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
-/* THERMALZONE */ OP_TABLE_ENTRY (AML_THERMAL_ZONE_OP, 0, NODE_AML_PACKAGE, 0),
+/* THERMALZONE */ OP_TABLE_ENTRY (AML_THERMAL_ZONE_OP, 0, OP_AML_PACKAGE, 0),
/* TIMER */ OP_TABLE_ENTRY (AML_TIMER_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* TOBCD */ OP_TABLE_ENTRY (AML_TO_BCD_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* TOBUFFER */ OP_TABLE_ENTRY (AML_TO_BUFFER_OP, 0, 0, ACPI_BTYPE_BUFFER),
@@ -524,23 +529,23 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* TOHEXSTRING */ OP_TABLE_ENTRY (AML_TO_HEX_STRING_OP, 0, 0, ACPI_BTYPE_STRING),
/* TOINTEGER */ OP_TABLE_ENTRY (AML_TO_INTEGER_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* TOSTRING */ OP_TABLE_ENTRY (AML_TO_STRING_OP, 0, 0, ACPI_BTYPE_STRING),
-/* TOUUID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
+/* TOUUID */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_INTEGER),
/* TRANSLATIONTYPE_DENSE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* TRANSLATIONTYPE_SPARSE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* TYPE_STATIC */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* TYPE_TRANSLATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* UART_SERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
/* UART_SERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
-/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, 0),
+/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, 0),
/* UNLOAD */ OP_TABLE_ENTRY (AML_UNLOAD_OP, 0, 0, 0),
/* UPDATERULE_ONES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ONES, 0, 0),
/* UPDATERULE_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_PRESERVE, 0, 0),
/* UPDATERULE_ZEROS */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ZEROS,0, 0),
-/* VARIABLE_PACKAGE */ OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
+/* VARIABLE_PACKAGE */ OP_TABLE_ENTRY (AML_VARIABLE_PACKAGE_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_PACKAGE),
/* VENDORLONG */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* VENDORSHORT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* WAIT */ OP_TABLE_ENTRY (AML_WAIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
-/* WHILE */ OP_TABLE_ENTRY (AML_WHILE_OP, 0, NODE_AML_PACKAGE, 0),
+/* WHILE */ OP_TABLE_ENTRY (AML_WHILE_OP, 0, OP_AML_PACKAGE, 0),
/* WIREMODE_FOUR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* WIREMODE_THREE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0),
/* WORDBUSNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
@@ -558,7 +563,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
/* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER),
-/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
+/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_INTEGER),
/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
diff --git a/sys/contrib/dev/acpica/compiler/aslmapoutput.c b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
index f8d0a4e..58a89f8 100644
--- a/sys/contrib/dev/acpica/compiler/aslmapoutput.c
+++ b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
@@ -685,7 +685,7 @@ MpNamespaceXrefBegin (
* are references to other objects within the namespace and the
* parent objects of name declarations
*/
- if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
+ if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION)
{
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.c b/sys/contrib/dev/acpica/compiler/aslmessages.c
index 0585677..d3d28c8 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.c
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.c
@@ -348,7 +348,8 @@ const char *AslCompilerMsgs [] =
/* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used",
/* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used",
/* ASL_MSG_CONSTANT_REQUIRED */ "Non-reducible expression",
-/* ASL_MSG_CROSS_TABLE_SCOPE */ "Illegal open scope on external object from within DSDT"
+/* ASL_MSG_CROSS_TABLE_SCOPE */ "Illegal open scope on external object from within DSDT",
+/* ASL_MSG_EXCEPTION_NOT_RECEIVED */ "Expected remark, warning, or error did not occur. Message ID:"
};
/* Table compiler */
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.h b/sys/contrib/dev/acpica/compiler/aslmessages.h
index 86fb163..68216e5 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.h
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.h
@@ -351,6 +351,7 @@ typedef enum
ASL_MSG_ARG_NOT_USED,
ASL_MSG_CONSTANT_REQUIRED,
ASL_MSG_CROSS_TABLE_SCOPE,
+ ASL_MSG_EXCEPTION_NOT_RECEIVED,
/* These messages are used by the Data Table compiler only */
diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c
index dce12a5..a4b1c6f 100644
--- a/sys/contrib/dev/acpica/compiler/aslmethod.c
+++ b/sys/contrib/dev/acpica/compiler/aslmethod.c
@@ -380,7 +380,7 @@ MtMethodAnalysisWalkBegin (
* If the local is being used as a target, mark the local
* initialized
*/
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
MethodInfo->LocalInitialized[RegisterNumber] = TRUE;
}
@@ -425,7 +425,7 @@ MtMethodAnalysisWalkBegin (
* If the Arg is being used as a target, mark the local
* initialized
*/
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
MethodInfo->ArgInitialized[RegisterNumber] = TRUE;
}
@@ -464,7 +464,7 @@ MtMethodAnalysisWalkBegin (
/*
* A child indicates a possible return value. A simple Return or
- * Return() is marked with NODE_IS_NULL_RETURN by the parser so
+ * Return() is marked with OP_IS_NULL_RETURN by the parser so
* that it is not counted as a "real" return-with-value, although
* the AML code that is actually emitted is Return(0). The AML
* definition of Return has a required parameter, so we are
@@ -472,7 +472,7 @@ MtMethodAnalysisWalkBegin (
*/
if ((Op->Asl.Child) &&
(Op->Asl.Child->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) &&
- (!(Op->Asl.Child->Asl.CompileFlags & NODE_IS_NULL_RETURN)))
+ (!(Op->Asl.Child->Asl.CompileFlags & OP_IS_NULL_RETURN)))
{
MethodInfo->NumReturnWithValue++;
}
@@ -704,7 +704,7 @@ MtMethodAnalysisWalkEnd (
* of the method can possibly terminate without a return statement.
*/
if ((!AnLastStatementIsReturn (Op)) &&
- (!(Op->Asl.CompileFlags & NODE_HAS_NO_EXIT)))
+ (!(Op->Asl.CompileFlags & OP_HAS_NO_EXIT)))
{
/*
* No return statement, and execution can possibly exit
@@ -736,11 +736,11 @@ MtMethodAnalysisWalkEnd (
{
if (MethodInfo->NumReturnWithValue)
{
- Op->Asl.CompileFlags |= NODE_METHOD_SOME_NO_RETVAL;
+ Op->Asl.CompileFlags |= OP_METHOD_SOME_NO_RETVAL;
}
else
{
- Op->Asl.CompileFlags |= NODE_METHOD_NO_RETVAL;
+ Op->Asl.CompileFlags |= OP_METHOD_NO_RETVAL;
}
}
@@ -784,7 +784,7 @@ MtMethodAnalysisWalkEnd (
* The parent block does not "exit" and continue execution -- the
* method is terminated here with the Return() statement.
*/
- Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
+ Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT;
/* Used in the "typing" pass later */
@@ -804,7 +804,7 @@ MtMethodAnalysisWalkEnd (
case PARSEOP_IF:
- if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
+ if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) &&
(Op->Asl.Next) &&
(Op->Asl.Next->Asl.ParseOpcode == PARSEOP_ELSE))
{
@@ -813,32 +813,32 @@ MtMethodAnalysisWalkEnd (
* (it contains an unconditional Return)
* mark the ELSE block to remember this fact.
*/
- Op->Asl.Next->Asl.CompileFlags |= NODE_IF_HAS_NO_EXIT;
+ Op->Asl.Next->Asl.CompileFlags |= OP_IF_HAS_NO_EXIT;
}
break;
case PARSEOP_ELSE:
- if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
- (Op->Asl.CompileFlags & NODE_IF_HAS_NO_EXIT))
+ if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) &&
+ (Op->Asl.CompileFlags & OP_IF_HAS_NO_EXIT))
{
/*
* This ELSE block has no exit and the corresponding IF block
* has no exit either. Therefore, the parent node has no exit.
*/
- Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
+ Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT;
}
break;
default:
- if ((Op->Asl.CompileFlags & NODE_HAS_NO_EXIT) &&
+ if ((Op->Asl.CompileFlags & OP_HAS_NO_EXIT) &&
(Op->Asl.Parent))
{
/* If this node has no exit, then the parent has no exit either */
- Op->Asl.Parent->Asl.CompileFlags |= NODE_HAS_NO_EXIT;
+ Op->Asl.Parent->Asl.CompileFlags |= OP_HAS_NO_EXIT;
}
break;
}
diff --git a/sys/contrib/dev/acpica/compiler/asloffset.c b/sys/contrib/dev/acpica/compiler/asloffset.c
index bc2c0b0..2288017 100644
--- a/sys/contrib/dev/acpica/compiler/asloffset.c
+++ b/sys/contrib/dev/acpica/compiler/asloffset.c
@@ -211,7 +211,7 @@ LsAmlOffsetWalk (
/* Ignore actual data blocks for resource descriptors */
- if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
+ if (Op->Asl.CompileFlags & OP_IS_RESOURCE_DATA)
{
return (AE_OK); /* Do NOT update the global AML offset */
}
@@ -228,7 +228,7 @@ LsAmlOffsetWalk (
/* Named resource descriptor (has a descriptor tag) */
if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) &&
- (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
+ (Op->Asl.CompileFlags & OP_IS_RESOURCE_DESC))
{
LsEmitOffsetTableEntry (FileId, Node, 0, Gbl_CurrentAmlOffset,
Op->Asl.ParseOpName, 0, Op->Asl.Extra, AML_BUFFER_OP);
@@ -250,7 +250,6 @@ LsAmlOffsetWalk (
}
Length = Op->Asl.FinalAmlLength;
- NamepathOffset = Gbl_CurrentAmlOffset + Length;
/* Get to the NameSeg/NamePath Op (and length of the name) */
diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c
index 52efa29..30b5e24 100644
--- a/sys/contrib/dev/acpica/compiler/aslopcodes.c
+++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c
@@ -550,7 +550,7 @@ OpcDoConnection (
*/
BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER;
BufferOp->Asl.AmlOpcode = AML_BUFFER_OP;
- BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
+ BufferOp->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC;
UtSetParseOpName (BufferOp);
BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
@@ -598,7 +598,7 @@ OpcDoUnicode (
/* Change op into a buffer object */
- Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
UtSetParseOpName (Op);
@@ -756,7 +756,7 @@ OpcDoEisaId (
*/
Op->Asl.Value.Integer = EisaId;
- Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
Op->Asl.ParseOpcode = PARSEOP_INTEGER;
(void) OpcSetOptimalIntegerSize (Op);
@@ -808,12 +808,12 @@ OpcDoUuId (
/* Disable further optimization */
- Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
UtSetParseOpName (Op);
/* Child node is the buffer length */
- NewOp = TrAllocateNode (PARSEOP_INTEGER);
+ NewOp = TrAllocateOp (PARSEOP_INTEGER);
NewOp->Asl.AmlOpcode = AML_BYTE_OP;
NewOp->Asl.Value.Integer = 16;
@@ -824,7 +824,7 @@ OpcDoUuId (
/* Peer to the child is the raw buffer data */
- NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
+ NewOp = TrAllocateOp (PARSEOP_RAW_DATA);
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
NewOp->Asl.AmlLength = 16;
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
diff --git a/sys/contrib/dev/acpica/compiler/aslopt.c b/sys/contrib/dev/acpica/compiler/aslopt.c
index 193a8c4..0019a07 100644
--- a/sys/contrib/dev/acpica/compiler/aslopt.c
+++ b/sys/contrib/dev/acpica/compiler/aslopt.c
@@ -699,7 +699,7 @@ OptOptimizeNamePath (
if (!(Flags & (AML_NAMED | AML_CREATE)))
{
- if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
+ if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION)
{
/* We don't want to fuss with actual name declaration nodes here */
@@ -893,7 +893,7 @@ OptOptimizeNamePath (
/* Name must appear as the last parameter */
NextOp = Op->Asl.Child;
- while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
+ while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
{
NextOp = NextOp->Asl.Next;
}
diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c
index c2922b0..a22949b 100644
--- a/sys/contrib/dev/acpica/compiler/asloptions.c
+++ b/sys/contrib/dev/acpica/compiler/asloptions.c
@@ -226,7 +226,7 @@ AslCommandLine (
/* Next parameter must be the input filename */
if (!argv[AcpiGbl_Optind] &&
- !Gbl_DisasmFlag)
+ !AcpiGbl_DisasmFlag)
{
printf ("Missing input filename\n");
BadCommandLine = TRUE;
@@ -466,7 +466,7 @@ AslDoOptions (
return (-1);
}
- Gbl_DisasmFlag = TRUE;
+ AcpiGbl_DisasmFlag = TRUE;
break;
case 'D': /* Define a symbol */
@@ -538,6 +538,7 @@ AslDoOptions (
{
case '^':
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
Usage ();
exit (0);
@@ -944,6 +945,22 @@ AslDoOptions (
}
break;
+ case 'x':
+
+ /* Get the required argument */
+
+ if (AcpiGetoptArgument (argc, argv))
+ {
+ return (-1);
+ }
+
+ Status = AslExpectException (AcpiGbl_Optarg);
+ if (ACPI_FAILURE (Status))
+ {
+ return (-1);
+ }
+ break;
+
default:
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
diff --git a/sys/contrib/dev/acpica/compiler/aslparseop.c b/sys/contrib/dev/acpica/compiler/aslparseop.c
new file mode 100644
index 0000000..f23091b
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslparseop.c
@@ -0,0 +1,953 @@
+/******************************************************************************
+ *
+ * Module Name: aslparseop - Parse op create/allocate/cache interfaces
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2017, 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 "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/include/acconvert.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslparseop")
+
+
+/* Local prototypes */
+
+static ACPI_PARSE_OBJECT *
+TrGetOpFromCache (
+ void);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateOp
+ *
+ * PARAMETERS: ParseOpcode - Opcode to be assigned to the op
+ * NumChildren - Number of children to follow
+ * ... - A list of child ops to link to the new
+ * op. NumChildren long.
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Create a new parse op and link together a list of child
+ * ops underneath the new op.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateOp (
+ UINT32 ParseOpcode,
+ UINT32 NumChildren,
+ ...)
+{
+ ACPI_PARSE_OBJECT *Op;
+ ACPI_PARSE_OBJECT *Child;
+ ACPI_PARSE_OBJECT *PrevChild;
+ va_list ap;
+ UINT32 i;
+ BOOLEAN FirstChild;
+
+
+ va_start (ap, NumChildren);
+
+ /* Allocate one new op */
+
+ Op = TrAllocateOp (ParseOpcode);
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nCreateOp Ln/Col %u/%u NewParent %p Child %u Op %s ",
+ Op->Asl.LineNumber, Op->Asl.Column, Op,
+ NumChildren, UtGetOpName(ParseOpcode));
+
+ /* Some extra debug output based on the parse opcode */
+
+ switch (ParseOpcode)
+ {
+ case PARSEOP_ASL_CODE:
+
+ Gbl_ParseTreeRoot = Op;
+ Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
+ break;
+
+ case PARSEOP_DEFINITION_BLOCK:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
+ break;
+
+ case PARSEOP_OPERATIONREGION:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "OPREGION->");
+ break;
+
+ case PARSEOP_OR:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "OR->");
+ break;
+
+ default:
+
+ /* Nothing to do for other opcodes */
+
+ break;
+ }
+
+ /* Link the new op to its children */
+
+ PrevChild = NULL;
+ FirstChild = TRUE;
+ for (i = 0; i < NumChildren; i++)
+ {
+ /* Get the next child */
+
+ Child = va_arg (ap, ACPI_PARSE_OBJECT *);
+ DbgPrint (ASL_PARSE_OUTPUT, "%p, ", Child);
+
+ /*
+ * If child is NULL, this means that an optional argument
+ * was omitted. We must create a placeholder with a special
+ * opcode (DEFAULT_ARG) so that the code generator will know
+ * that it must emit the correct default for this argument
+ */
+ if (!Child)
+ {
+ Child = TrAllocateOp (PARSEOP_DEFAULT_ARG);
+ }
+
+ /* Link first child to parent */
+
+ if (FirstChild)
+ {
+ FirstChild = FALSE;
+ Op->Asl.Child = Child;
+
+ /*
+ * For the ASL-/ASL+ converter: if the ParseOp is a Connection,
+ * External, Offset or AccessAs, it means that the comments in the
+ * FirstChild belongs to their parent due to the parsing order in
+ * the .y files. To correct this, take the comments in the
+ * FirstChild place it in the parent. This also means that
+ * legitimate comments for the child gets put to the parent.
+ */
+ if (Gbl_CaptureComments &&
+ ((ParseOpcode == PARSEOP_CONNECTION) ||
+ (ParseOpcode == PARSEOP_EXTERNAL) ||
+ (ParseOpcode == PARSEOP_OFFSET) ||
+ (ParseOpcode == PARSEOP_ACCESSAS)))
+ {
+ Op->Asl.CommentList = Child->Asl.CommentList;
+ Op->Asl.EndBlkComment = Child->Asl.EndBlkComment;
+ Op->Asl.InlineComment = Child->Asl.InlineComment;
+ Op->Asl.FileChanged = Child->Asl.FileChanged;
+
+ Child->Asl.CommentList = NULL;
+ Child->Asl.EndBlkComment = NULL;
+ Child->Asl.InlineComment = NULL;
+ Child->Asl.FileChanged = FALSE;
+
+ /*
+ * These do not need to be "passed off". They can be copied
+ * because the code for these opcodes should be printed in the
+ * same file.
+ */
+ Op->Asl.Filename = Child->Asl.Filename;
+ Op->Asl.ParentFilename = Child->Asl.ParentFilename;
+ }
+ }
+
+ /* Point all children to parent */
+
+ Child->Asl.Parent = Op;
+
+ /* Link children in a peer list */
+
+ if (PrevChild)
+ {
+ PrevChild->Asl.Next = Child;
+ };
+
+ /* Get the comment from last child in the resource template call */
+
+ if (Gbl_CaptureComments &&
+ (Op->Asl.ParseOpcode == PARSEOP_RESOURCETEMPLATE))
+ {
+ CvDbgPrint ("Transferred current comment list to this op.\n");
+ Op->Asl.CommentList = Child->Asl.CommentList;
+ Child->Asl.CommentList = NULL;
+
+ Op->Asl.InlineComment = Child->Asl.InlineComment;
+ Child->Asl.InlineComment = NULL;
+ }
+
+ /*
+ * This child might be a list, point all ops in the list
+ * to the same parent
+ */
+ while (Child->Asl.Next)
+ {
+ Child = Child->Asl.Next;
+ Child->Asl.Parent = Op;
+ }
+
+ PrevChild = Child;
+ }
+
+ va_end(ap);
+ DbgPrint (ASL_PARSE_OUTPUT, "\n");
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateLeafOp
+ *
+ * PARAMETERS: ParseOpcode - New opcode to be assigned to the op
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Create a simple leaf op (no children or peers, and no value
+ * assigned to the op)
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateLeafOp (
+ UINT32 ParseOpcode)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ Op = TrAllocateOp (ParseOpcode);
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nCreateLeafOp Ln/Col %u/%u NewOp %p Op %s\n\n",
+ Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode));
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateValuedLeafOp
+ *
+ * PARAMETERS: ParseOpcode - New opcode to be assigned to the op
+ * Value - Value to be assigned to the op
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Create a leaf op (no children or peers) with a value
+ * assigned to it
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateValuedLeafOp (
+ UINT32 ParseOpcode,
+ UINT64 Value)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ Op = TrAllocateOp (ParseOpcode);
+ Op->Asl.Value.Integer = Value;
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nCreateValuedLeafOp Ln/Col %u/%u NewOp %p "
+ "Op %s Value %8.8X%8.8X ",
+ Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
+ ACPI_FORMAT_UINT64 (Value));
+
+ switch (ParseOpcode)
+ {
+ case PARSEOP_STRING_LITERAL:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
+ break;
+
+ case PARSEOP_NAMESEG:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
+ break;
+
+ case PARSEOP_NAMESTRING:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
+ break;
+
+ case PARSEOP_EISAID:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
+ break;
+
+ case PARSEOP_METHOD:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "METHOD");
+ break;
+
+ case PARSEOP_INTEGER:
+
+ DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Value));
+ break;
+
+ default:
+ break;
+ }
+
+ DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateTargetOp
+ *
+ * PARAMETERS: OriginalOp - Op to be copied
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Copy an existing op (and subtree). Used in ASL+ (C-style)
+ * expressions where the target is the same as one of the
+ * operands. A new op and subtree must be created from the
+ * original so that the parse tree can be linked properly.
+ *
+ * NOTE: This code is specific to target operands that are the last
+ * operand in an ASL/AML operator. Meaning that the top-level
+ * parse Op in a possible subtree has a NULL Next pointer.
+ * This simplifies the recursion.
+ *
+ * Subtree example:
+ * DeRefOf (Local1) += 32
+ *
+ * This gets converted to:
+ * Add (DeRefOf (Local1), 32, DeRefOf (Local1))
+ *
+ * Each DeRefOf has a single child, Local1. Even more complex
+ * subtrees can be created via the Index and DeRefOf operators.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateTargetOp (
+ ACPI_PARSE_OBJECT *OriginalOp,
+ ACPI_PARSE_OBJECT *ParentOp)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ if (!OriginalOp)
+ {
+ return (NULL);
+ }
+
+ Op = TrGetOpFromCache ();
+
+ /* Copy the pertinent values (omit link pointer fields) */
+
+ Op->Asl.Value = OriginalOp->Asl.Value;
+ Op->Asl.Filename = OriginalOp->Asl.Filename;
+ Op->Asl.LineNumber = OriginalOp->Asl.LineNumber;
+ Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber;
+ Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset;
+ Op->Asl.Column = OriginalOp->Asl.Column;
+ Op->Asl.Flags = OriginalOp->Asl.Flags;
+ Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags;
+ Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode;
+ Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode;
+ Op->Asl.Parent = ParentOp;
+
+ UtSetParseOpName (Op);
+
+ /* Copy a possible subtree below this op */
+
+ if (OriginalOp->Asl.Child)
+ {
+ Op->Asl.Child = TrCreateTargetOp (OriginalOp->Asl.Child, Op);
+ }
+
+ if (OriginalOp->Asl.Next) /* Null for top-level op */
+ {
+ Op->Asl.Next = TrCreateTargetOp (OriginalOp->Asl.Next, ParentOp);
+ }
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateAssignmentOp
+ *
+ * PARAMETERS: Target - Assignment target
+ * Source - Assignment source
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Implements the C-style '=' operator. It changes the parse
+ * tree if possible to utilize the last argument of the math
+ * operators which is a target operand -- thus saving invocation
+ * of and additional Store() operator. An optimization.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateAssignmentOp (
+ ACPI_PARSE_OBJECT *Target,
+ ACPI_PARSE_OBJECT *Source)
+{
+ ACPI_PARSE_OBJECT *TargetOp;
+ ACPI_PARSE_OBJECT *SourceOp1;
+ ACPI_PARSE_OBJECT *SourceOp2;
+ ACPI_PARSE_OBJECT *Operator;
+
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nTrCreateAssignmentOp Line [%u to %u] Source %s Target %s\n",
+ Source->Asl.LineNumber, Source->Asl.EndLine,
+ UtGetOpName (Source->Asl.ParseOpcode),
+ UtGetOpName (Target->Asl.ParseOpcode));
+
+ TrSetOpFlags (Target, OP_IS_TARGET);
+
+ switch (Source->Asl.ParseOpcode)
+ {
+ /*
+ * Only these operators can be optimized because they have
+ * a target operand
+ */
+ case PARSEOP_ADD:
+ case PARSEOP_AND:
+ case PARSEOP_DIVIDE:
+ case PARSEOP_INDEX:
+ case PARSEOP_MOD:
+ case PARSEOP_MULTIPLY:
+ case PARSEOP_NOT:
+ case PARSEOP_OR:
+ case PARSEOP_SHIFTLEFT:
+ case PARSEOP_SHIFTRIGHT:
+ case PARSEOP_SUBTRACT:
+ case PARSEOP_XOR:
+
+ break;
+
+ /* Otherwise, just create a normal Store operator */
+
+ default:
+ goto CannotOptimize;
+ }
+
+ /*
+ * Transform the parse tree such that the target is moved to the
+ * last operand of the operator
+ */
+ SourceOp1 = Source->Asl.Child;
+ SourceOp2 = SourceOp1->Asl.Next;
+
+ /* NOT only has one operand, but has a target */
+
+ if (Source->Asl.ParseOpcode == PARSEOP_NOT)
+ {
+ SourceOp2 = SourceOp1;
+ }
+
+ /* DIVIDE has an extra target operand (remainder) */
+
+ if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE)
+ {
+ SourceOp2 = SourceOp2->Asl.Next;
+ }
+
+ TargetOp = SourceOp2->Asl.Next;
+
+ /*
+ * Can't perform this optimization if there already is a target
+ * for the operator (ZERO is a "no target" placeholder).
+ */
+ if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO)
+ {
+ goto CannotOptimize;
+ }
+
+ /* Link in the target as the final operand */
+
+ SourceOp2->Asl.Next = Target;
+ Target->Asl.Parent = Source;
+ return (Source);
+
+
+CannotOptimize:
+
+ Operator = TrAllocateOp (PARSEOP_STORE);
+ TrLinkOpChildren (Operator, 2, Source, Target);
+
+ /* Set the appropriate line numbers for the new op */
+
+ Operator->Asl.LineNumber = Target->Asl.LineNumber;
+ Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber;
+ Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset;
+ Operator->Asl.Column = Target->Asl.Column;
+
+ return (Operator);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateNullTargetOp
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Create a "null" target op. This is defined by the ACPI
+ * specification to be a zero AML opcode, and indicates that
+ * no target has been specified for the parent operation
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateNullTargetOp (
+ void)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ Op = TrAllocateOp (PARSEOP_ZERO);
+ Op->Asl.CompileFlags |= (OP_IS_TARGET | OP_COMPILE_TIME_CONST);
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nCreateNullTargetOp Ln/Col %u/%u NewOp %p Op %s\n",
+ Op->Asl.LineNumber, Op->Asl.Column, Op,
+ UtGetOpName (Op->Asl.ParseOpcode));
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateConstantLeafOp
+ *
+ * PARAMETERS: ParseOpcode - The constant opcode
+ *
+ * RETURN: Pointer to the new op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Create a leaf op (no children or peers) for one of the
+ * special constants - __LINE__, __FILE__, and __DATE__.
+ *
+ * Note: The fullimplemenation of __METHOD__ cannot happen here because we
+ * don't have a full parse tree at this time and cannot find the parent
+ * control method. __METHOD__ must be implemented later, after the parse
+ * tree has been fully constructed.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateConstantLeafOp (
+ UINT32 ParseOpcode)
+{
+ ACPI_PARSE_OBJECT *Op = NULL;
+ time_t CurrentTime;
+ char *StaticTimeString;
+ char *TimeString;
+ char *Filename;
+
+
+ switch (ParseOpcode)
+ {
+ case PARSEOP___LINE__:
+
+ Op = TrAllocateOp (PARSEOP_INTEGER);
+ Op->Asl.Value.Integer = Op->Asl.LineNumber;
+ break;
+
+ case PARSEOP___METHOD__:
+
+ /* Will become a string literal later */
+
+ Op = TrAllocateOp (PARSEOP___METHOD__);
+ Op->Asl.Value.String = NULL;
+ break;
+
+ case PARSEOP___PATH__:
+
+ Op = TrAllocateOp (PARSEOP_STRING_LITERAL);
+
+ /* Op.Asl.Filename contains the full pathname to the file */
+
+ Op->Asl.Value.String = Op->Asl.Filename;
+ break;
+
+ case PARSEOP___FILE__:
+
+ Op = TrAllocateOp (PARSEOP_STRING_LITERAL);
+
+ /* Get the simple filename from the full path */
+
+ FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
+ Op->Asl.Value.String = Filename;
+ break;
+
+ case PARSEOP___DATE__:
+
+ Op = TrAllocateOp (PARSEOP_STRING_LITERAL);
+
+ /* Get a copy of the current time */
+
+ CurrentTime = time (NULL);
+ StaticTimeString = ctime (&CurrentTime);
+ TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1);
+ strcpy (TimeString, StaticTimeString);
+
+ TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */
+ Op->Asl.Value.String = TimeString;
+ break;
+
+ default: /* This would be an internal error */
+
+ return (NULL);
+ }
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nCreateConstantLeafOp Ln/Col %u/%u NewOp %p "
+ "Op %s Value %8.8X%8.8X \n",
+ Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
+ ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrAllocateOp
+ *
+ * PARAMETERS: ParseOpcode - Opcode to be assigned to the op
+ *
+ * RETURN: New parse op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate and initialize a new parse op for the parse tree
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrAllocateOp (
+ UINT32 ParseOpcode)
+{
+ ACPI_PARSE_OBJECT *Op;
+ ACPI_PARSE_OBJECT *LatestOp;
+
+
+ Op = TrGetOpFromCache ();
+
+ Op->Asl.ParseOpcode = (UINT16) ParseOpcode;
+ Op->Asl.Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
+ Op->Asl.LineNumber = Gbl_CurrentLineNumber;
+ Op->Asl.LogicalLineNumber = Gbl_LogicalLineNumber;
+ Op->Asl.LogicalByteOffset = Gbl_CurrentLineOffset;
+ Op->Asl.Column = Gbl_CurrentColumn;
+
+ UtSetParseOpName (Op);
+
+ /* The following is for capturing comments */
+
+ if(Gbl_CaptureComments)
+ {
+ LatestOp = Gbl_CommentState.LatestParseOp;
+ Op->Asl.InlineComment = NULL;
+ Op->Asl.EndNodeComment = NULL;
+ Op->Asl.CommentList = NULL;
+ Op->Asl.FileChanged = FALSE;
+
+ /*
+ * Check to see if the file name has changed before resetting the
+ * latest parse op.
+ */
+ if (LatestOp &&
+ (ParseOpcode != PARSEOP_INCLUDE) &&
+ (ParseOpcode != PARSEOP_INCLUDE_END) &&
+ strcmp (LatestOp->Asl.Filename, Op->Asl.Filename))
+ {
+ CvDbgPrint ("latest op: %s\n", LatestOp->Asl.ParseOpName);
+ Op->Asl.FileChanged = TRUE;
+ if (Gbl_IncludeFileStack)
+ {
+ Op->Asl.ParentFilename = Gbl_IncludeFileStack->Filename;
+ }
+ else
+ {
+ Op->Asl.ParentFilename = NULL;
+ }
+ }
+
+ Gbl_CommentState.LatestParseOp = Op;
+ CvDbgPrint ("TrAllocateOp=Set latest parse op to this op.\n");
+ CvDbgPrint (" Op->Asl.ParseOpName = %s\n",
+ Gbl_CommentState.LatestParseOp->Asl.ParseOpName);
+ CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode);
+
+ if (Op->Asl.FileChanged)
+ {
+ CvDbgPrint(" file has been changed!\n");
+ }
+
+ /*
+ * if this parse op's syntax uses () and {} (i.e. Package(1){0x00}) then
+ * set a flag in the comment state. This facilitates paring comments for
+ * these types of opcodes.
+ */
+ if ((CvParseOpBlockType(Op) == (BLOCK_PAREN | BLOCK_BRACE)) &&
+ (ParseOpcode != PARSEOP_DEFINITION_BLOCK))
+ {
+ CvDbgPrint ("Parsing paren/Brace op now!\n");
+ Gbl_CommentState.ParsingParenBraceNode = Op;
+ }
+
+ if (Gbl_CommentListHead)
+ {
+ CvDbgPrint ("Transferring...\n");
+ Op->Asl.CommentList = Gbl_CommentListHead;
+ Gbl_CommentListHead = NULL;
+ Gbl_CommentListTail = NULL;
+ CvDbgPrint (" Transferred current comment list to this op.\n");
+ CvDbgPrint (" %s\n", Op->Asl.CommentList->Comment);
+ }
+
+ if (Gbl_InlineCommentBuffer)
+ {
+ Op->Asl.InlineComment = Gbl_InlineCommentBuffer;
+ Gbl_InlineCommentBuffer = NULL;
+ CvDbgPrint ("Transferred current inline comment list to this op.\n");
+ }
+ }
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrGetOpFromCache
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: New parse op. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate a new parse op for the parse tree. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+static ACPI_PARSE_OBJECT *
+TrGetOpFromCache (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_ParseOpCacheList;
+ Gbl_ParseOpCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
+ Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
+ }
+
+ Gbl_ParseOpCount++;
+ return (Gbl_ParseOpCacheNext++);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrPrintOpFlags
+ *
+ * PARAMETERS: Flags - Flags word to be decoded
+ * OutputLevel - Debug output level: ASL_TREE_OUTPUT etc.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a flags word to text. Displays all flags that are set.
+ *
+ ******************************************************************************/
+
+void
+TrPrintOpFlags (
+ UINT32 Flags,
+ UINT32 OutputLevel)
+{
+ UINT32 FlagBit = 1;
+ UINT32 i;
+
+
+ for (i = 0; i < ACPI_NUM_OP_FLAGS; i++)
+ {
+ if (Flags & FlagBit)
+ {
+ DbgPrint (OutputLevel, " %s", Gbl_OpFlagNames[i]);
+ }
+
+ FlagBit <<= 1;
+ }
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslparser.y b/sys/contrib/dev/acpica/compiler/aslparser.y
index a2e75d8..3ad50ab 100644
--- a/sys/contrib/dev/acpica/compiler/aslparser.y
+++ b/sys/contrib/dev/acpica/compiler/aslparser.y
@@ -208,7 +208,7 @@ AslLocalAllocate (
* These shift/reduce conflicts are expected. There should be zero
* reduce/reduce conflicts.
*/
-%expect 102
+%expect 118
/*! [Begin] no source code translation */
diff --git a/sys/contrib/dev/acpica/compiler/aslpld.c b/sys/contrib/dev/acpica/compiler/aslpld.c
index 1d56cdb..d0c8808 100644
--- a/sys/contrib/dev/acpica/compiler/aslpld.c
+++ b/sys/contrib/dev/acpica/compiler/aslpld.c
@@ -682,12 +682,12 @@ OpcDoPld (
/* Disable further optimization */
- Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
UtSetParseOpName (Op);
/* Child node is the buffer length */
- NewOp = TrAllocateNode (PARSEOP_INTEGER);
+ NewOp = TrAllocateOp (PARSEOP_INTEGER);
NewOp->Asl.AmlOpcode = AML_BYTE_OP;
NewOp->Asl.Value.Integer = 20;
@@ -698,7 +698,7 @@ OpcDoPld (
/* Peer to the child is the raw buffer data */
- NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
+ NewOp = TrAllocateOp (PARSEOP_RAW_DATA);
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
NewOp->Asl.AmlLength = 20;
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index 1ee04f8..ba436ff 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -666,7 +666,7 @@ ApCheckForSpecialName (
{
/* Ignore if actually emitted by the compiler */
- if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED)
+ if (Op->Asl.CompileFlags & OP_COMPILER_EMITTED)
{
return (ACPI_NOT_RESERVED_NAME);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslprimaries.y b/sys/contrib/dev/acpica/compiler/aslprimaries.y
index 3d0fa48..3c8ced1 100644
--- a/sys/contrib/dev/acpica/compiler/aslprimaries.y
+++ b/sys/contrib/dev/acpica/compiler/aslprimaries.y
@@ -166,7 +166,7 @@ AccessAsTerm
PARSEOP_OPEN_PAREN
AccessTypeKeyword
OptionalAccessAttribTerm
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_ACCESSAS,2,$3,$4);}
| PARSEOP_ACCESSAS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -174,10 +174,10 @@ AccessAsTerm
AcquireTerm
: PARSEOP_ACQUIRE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp(PARSEOP_ACQUIRE);}
SuperName
',' WordConstExpr
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$6);}
| PARSEOP_ACQUIRE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -185,11 +185,11 @@ AcquireTerm
AddTerm
: PARSEOP_ADD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ADD);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_ADD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -197,11 +197,11 @@ AddTerm
AliasTerm
: PARSEOP_ALIAS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ALIAS);}
NameString
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,
- TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,
+ TrSetOpFlags ($5, OP_IS_NAME_DECLARATION));}
| PARSEOP_ALIAS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -209,29 +209,29 @@ AliasTerm
AndTerm
: PARSEOP_AND
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_AND);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_AND
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
ArgTerm
- : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);}
- | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);}
- | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);}
- | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);}
- | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);}
- | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);}
- | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);}
+ : PARSEOP_ARG0 {$$ = TrCreateLeafOp (PARSEOP_ARG0);}
+ | PARSEOP_ARG1 {$$ = TrCreateLeafOp (PARSEOP_ARG1);}
+ | PARSEOP_ARG2 {$$ = TrCreateLeafOp (PARSEOP_ARG2);}
+ | PARSEOP_ARG3 {$$ = TrCreateLeafOp (PARSEOP_ARG3);}
+ | PARSEOP_ARG4 {$$ = TrCreateLeafOp (PARSEOP_ARG4);}
+ | PARSEOP_ARG5 {$$ = TrCreateLeafOp (PARSEOP_ARG5);}
+ | PARSEOP_ARG6 {$$ = TrCreateLeafOp (PARSEOP_ARG6);}
;
BankFieldTerm
: PARSEOP_BANKFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_BANKFIELD);}
NameString
NameStringItem
TermArgItem
@@ -239,7 +239,7 @@ BankFieldTerm
',' LockRuleKeyword
',' UpdateRuleKeyword
PARSEOP_CLOSE_PAREN '{'
- FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,
+ FieldUnitList '}' {$$ = TrLinkOpChildren ($<n>3,7,
$4,$5,$6,$8,$10,$12,$15);}
| PARSEOP_BANKFIELD
PARSEOP_OPEN_PAREN
@@ -248,17 +248,17 @@ BankFieldTerm
;
BreakTerm
- : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);}
+ : PARSEOP_BREAK {$$ = TrCreateOp (PARSEOP_BREAK, 0);}
;
BreakPointTerm
- : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);}
+ : PARSEOP_BREAKPOINT {$$ = TrCreateOp (PARSEOP_BREAKPOINT, 0);}
;
BufferTerm
- : PARSEOP_BUFFER {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER); COMMENT_CAPTURE_OFF; }
+ : PARSEOP_BUFFER {$<n>$ = TrCreateLeafOp (PARSEOP_BUFFER); COMMENT_CAPTURE_OFF; }
OptionalDataCount
- '{' BufferTermData '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5); COMMENT_CAPTURE_ON;}
+ '{' BufferTermData '}' {$$ = TrLinkOpChildren ($<n>2,2,$3,$5); COMMENT_CAPTURE_ON;}
;
BufferTermData
@@ -268,10 +268,10 @@ BufferTermData
CaseTerm
: PARSEOP_CASE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CASE);}
DataObject
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_CASE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -279,11 +279,11 @@ CaseTerm
ConcatTerm
: PARSEOP_CONCATENATE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CONCATENATE);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_CONCATENATE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -291,12 +291,12 @@ ConcatTerm
ConcatResTerm
: PARSEOP_CONCATENATERESTEMPLATE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (
PARSEOP_CONCATENATERESTEMPLATE);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_CONCATENATERESTEMPLATE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -304,10 +304,10 @@ ConcatResTerm
CondRefOfTerm
: PARSEOP_CONDREFOF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CONDREFOF);}
CondRefOfSource
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_CONDREFOF
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -317,15 +317,15 @@ ConnectionTerm
: PARSEOP_CONNECTION
PARSEOP_OPEN_PAREN
NameString
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_CONNECTION,1,$3);}
| PARSEOP_CONNECTION
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CONNECTION);}
ResourceMacroTerm
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3, 1,
- TrLinkChildren (
- TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3,
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3, 1,
+ TrLinkOpChildren (
+ TrCreateLeafOp (PARSEOP_RESOURCETEMPLATE), 3,
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
$4));}
| PARSEOP_CONNECTION
PARSEOP_OPEN_PAREN
@@ -333,16 +333,16 @@ ConnectionTerm
;
ContinueTerm
- : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);}
+ : PARSEOP_CONTINUE {$$ = TrCreateOp (PARSEOP_CONTINUE, 0);}
;
CopyObjectTerm
: PARSEOP_COPYOBJECT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_COPYOBJECT);}
TermArg
',' SimpleName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,
- TrSetNodeFlags ($6, NODE_IS_TARGET));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,
+ TrSetOpFlags ($6, OP_IS_TARGET));}
| PARSEOP_COPYOBJECT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -350,12 +350,12 @@ CopyObjectTerm
CreateBitFieldTerm
: PARSEOP_CREATEBITFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEBITFIELD);}
TermArg
TermArgItem
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
- TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,
+ TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));}
| PARSEOP_CREATEBITFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -363,12 +363,12 @@ CreateBitFieldTerm
CreateByteFieldTerm
: PARSEOP_CREATEBYTEFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEBYTEFIELD);}
TermArg
TermArgItem
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
- TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,
+ TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));}
| PARSEOP_CREATEBYTEFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -376,12 +376,12 @@ CreateByteFieldTerm
CreateDWordFieldTerm
: PARSEOP_CREATEDWORDFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEDWORDFIELD);}
TermArg
TermArgItem
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
- TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,
+ TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));}
| PARSEOP_CREATEDWORDFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -389,13 +389,13 @@ CreateDWordFieldTerm
CreateFieldTerm
: PARSEOP_CREATEFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEFIELD);}
TermArg
TermArgItem
TermArgItem
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,
- TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$5,$6,
+ TrSetOpFlags ($7, OP_IS_NAME_DECLARATION));}
| PARSEOP_CREATEFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -403,12 +403,12 @@ CreateFieldTerm
CreateQWordFieldTerm
: PARSEOP_CREATEQWORDFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEQWORDFIELD);}
TermArg
TermArgItem
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
- TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,
+ TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));}
| PARSEOP_CREATEQWORDFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -416,12 +416,12 @@ CreateQWordFieldTerm
CreateWordFieldTerm
: PARSEOP_CREATEWORDFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CREATEWORDFIELD);}
TermArg
TermArgItem
NameStringItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
- TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,
+ TrSetOpFlags ($6, OP_IS_NAME_DECLARATION));}
| PARSEOP_CREATEWORDFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -429,44 +429,44 @@ CreateWordFieldTerm
DataRegionTerm
: PARSEOP_DATATABLEREGION
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DATATABLEREGION);}
NameString
TermArgItem
TermArgItem
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$5,$6,$7);}
| PARSEOP_DATATABLEREGION
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
DebugTerm
- : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);}
+ : PARSEOP_DEBUG {$$ = TrCreateLeafOp (PARSEOP_DEBUG);}
;
DecTerm
: PARSEOP_DECREMENT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DECREMENT);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_DECREMENT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
DefaultTerm
- : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);}
- TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
+ : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafOp (PARSEOP_DEFAULT);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_DEFAULT '{'
error '}' {$$ = AslDoError(); yyclearin;}
;
DerefOfTerm
: PARSEOP_DEREFOF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEREFOF);}
DerefOfSource
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_DEREFOF
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -474,11 +474,11 @@ DerefOfTerm
DeviceTerm
: PARSEOP_DEVICE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEVICE);}
NameString
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,2,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$7);}
| PARSEOP_DEVICE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -486,12 +486,12 @@ DeviceTerm
DivideTerm
: PARSEOP_DIVIDE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DIVIDE);}
TermArg
TermArgItem
Target
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$5,$6,$7);}
| PARSEOP_DIVIDE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -501,21 +501,21 @@ EISAIDTerm
: PARSEOP_EISAID
PARSEOP_OPEN_PAREN
StringData
- PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_EISAID, $3);}
+ PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_EISAID, $3);}
| PARSEOP_EISAID
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
ElseIfTerm
- : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);}
+ : IfTerm ElseTerm {$$ = TrLinkPeerOp ($1,$2);}
;
ElseTerm
: {$$ = NULL;}
| PARSEOP_ELSE '{'
- TermList {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
- '}' {$$ = TrLinkChildren ($<n>4,1,$3);}
+ TermList {$<n>$ = TrCreateLeafOp (PARSEOP_ELSE);}
+ '}' {$$ = TrLinkOpChildren ($<n>4,1,$3);}
| PARSEOP_ELSE '{'
error '}' {$$ = AslDoError(); yyclearin;}
@@ -524,12 +524,12 @@ ElseTerm
error {$$ = AslDoError(); yyclearin;}
| PARSEOP_ELSEIF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
- TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_ELSE);}
+ TermArg {$<n>$ = TrCreateLeafOp (PARSEOP_IF);}
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);}
- ElseTerm {TrLinkPeerNode ($<n>5,$11);}
- {$$ = TrLinkChildren ($<n>3,1,$<n>5);}
+ TermList '}' {TrLinkOpChildren ($<n>5,2,$4,$8);}
+ ElseTerm {TrLinkPeerOp ($<n>5,$11);}
+ {$$ = TrLinkOpChildren ($<n>3,1,$<n>5);}
| PARSEOP_ELSEIF
PARSEOP_OPEN_PAREN
@@ -541,10 +541,10 @@ ElseTerm
EventTerm
: PARSEOP_EVENT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EVENT);}
NameString
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION));}
| PARSEOP_EVENT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -557,7 +557,7 @@ ExternalTerm
OptionalObjectTypeKeyword
OptionalParameterTypePackage
OptionalParameterTypesPackage
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);}
| PARSEOP_EXTERNAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -565,11 +565,11 @@ ExternalTerm
FatalTerm
: PARSEOP_FATAL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FATAL);}
ByteConstExpr
',' DWordConstExpr
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);}
| PARSEOP_FATAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -577,13 +577,13 @@ FatalTerm
FieldTerm
: PARSEOP_FIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIELD);}
NameString
',' AccessTypeKeyword
',' LockRuleKeyword
',' UpdateRuleKeyword
PARSEOP_CLOSE_PAREN '{'
- FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);}
+ FieldUnitList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$6,$8,$10,$13);}
| PARSEOP_FIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN
@@ -592,10 +592,10 @@ FieldTerm
FindSetLeftBitTerm
: PARSEOP_FINDSETLEFTBIT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FINDSETLEFTBIT);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_FINDSETLEFTBIT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -603,10 +603,10 @@ FindSetLeftBitTerm
FindSetRightBitTerm
: PARSEOP_FINDSETRIGHTBIT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FINDSETRIGHTBIT);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_FINDSETRIGHTBIT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -615,29 +615,29 @@ FindSetRightBitTerm
/* Convert a For() loop to a While() loop */
ForTerm
: PARSEOP_FOR
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WHILE);}
OptionalTermArg ',' {}
OptionalPredicate ','
- OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3);
- TrSetParent ($9,$<n>3);} /* New parent is WHILE */
+ OptionalTermArg {$<n>$ = TrLinkPeerOp ($4,$<n>3);
+ TrSetOpParent ($9,$<n>3);} /* New parent is WHILE */
PARSEOP_CLOSE_PAREN
- '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);}
- {$<n>$ = TrLinkPeerNode ($13,$9);
+ '{' TermList '}' {$<n>$ = TrLinkOpChildren ($<n>3,2,$7,$13);}
+ {$<n>$ = TrLinkPeerOp ($13,$9);
$$ = $<n>10;}
;
OptionalPredicate
- : {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);}
+ : {$$ = TrCreateValuedLeafOp (PARSEOP_INTEGER, 1);}
| TermArg {$$ = $1;}
;
FprintfTerm
: PARSEOP_FPRINTF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FPRINTF);}
TermArg ','
StringData
PrintfArgList
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);}
| PARSEOP_FPRINTF
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -645,10 +645,10 @@ FprintfTerm
FromBCDTerm
: PARSEOP_FROMBCD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FROMBCD);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_FROMBCD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -656,16 +656,16 @@ FromBCDTerm
FunctionTerm
: PARSEOP_FUNCTION
- PARSEOP_OPEN_PAREN {COMMENT_CAPTURE_OFF; $<n>$ = TrCreateLeafNode (PARSEOP_METHOD); }
+ PARSEOP_OPEN_PAREN {COMMENT_CAPTURE_OFF; $<n>$ = TrCreateLeafOp (PARSEOP_METHOD); }
NameString
OptionalParameterTypePackage
OptionalParameterTypesPackage
PARSEOP_CLOSE_PAREN '{' {COMMENT_CAPTURE_ON; }
- TermList '}' {$$ = TrLinkChildren ($<n>3,7,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
- TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),
- TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL),
- TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$10);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,7,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),
+ TrCreateValuedLeafOp (PARSEOP_BYTECONST, 0),
+ TrCreateLeafOp (PARSEOP_SERIALIZERULE_NOTSERIAL),
+ TrCreateValuedLeafOp (PARSEOP_BYTECONST, 0),$5,$6,$10);}
| PARSEOP_FUNCTION
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -673,10 +673,10 @@ FunctionTerm
IfTerm
: PARSEOP_IF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IF);}
TermArg
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_IF
PARSEOP_OPEN_PAREN
@@ -687,20 +687,20 @@ IncludeTerm
: PARSEOP_INCLUDE
PARSEOP_OPEN_PAREN
String
- PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3);
+ PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_INCLUDE, $3);
FlOpenIncludeFile ($3);}
;
IncludeEndTerm
- : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);
- TrSetCurrentFilename ($$);}
+ : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafOp (PARSEOP_INCLUDE_END);
+ TrSetOpCurrentFilename ($$);}
;
IncTerm
: PARSEOP_INCREMENT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INCREMENT);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_INCREMENT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -708,14 +708,14 @@ IncTerm
IndexFieldTerm
: PARSEOP_INDEXFIELD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INDEXFIELD);}
NameString
NameStringItem
',' AccessTypeKeyword
',' LockRuleKeyword
',' UpdateRuleKeyword
PARSEOP_CLOSE_PAREN '{'
- FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);}
+ FieldUnitList '}' {$$ = TrLinkOpChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);}
| PARSEOP_INDEXFIELD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN
@@ -724,11 +724,11 @@ IndexFieldTerm
IndexTerm
: PARSEOP_INDEX
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INDEX);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_INDEX
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -736,10 +736,10 @@ IndexTerm
LAndTerm
: PARSEOP_LAND
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LAND);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_LAND
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -747,10 +747,10 @@ LAndTerm
LEqualTerm
: PARSEOP_LEQUAL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_LEQUAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -758,11 +758,11 @@ LEqualTerm
LGreaterEqualTerm
: PARSEOP_LGREATEREQUAL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1,
- TrLinkChildren ($<n>3,2,$4,$5));}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_LNOT, 1,
+ TrLinkOpChildren ($<n>3,2,$4,$5));}
| PARSEOP_LGREATEREQUAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -770,10 +770,10 @@ LGreaterEqualTerm
LGreaterTerm
: PARSEOP_LGREATER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_LGREATER
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -781,11 +781,11 @@ LGreaterTerm
LLessEqualTerm
: PARSEOP_LLESSEQUAL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LGREATER);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1,
- TrLinkChildren ($<n>3,2,$4,$5));}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_LNOT, 1,
+ TrLinkOpChildren ($<n>3,2,$4,$5));}
| PARSEOP_LLESSEQUAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -793,10 +793,10 @@ LLessEqualTerm
LLessTerm
: PARSEOP_LLESS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LLESS);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_LLESS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -804,11 +804,11 @@ LLessTerm
LNotEqualTerm
: PARSEOP_LNOTEQUAL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LEQUAL);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1,
- TrLinkChildren ($<n>3,2,$4,$5));}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_LNOT, 1,
+ TrLinkOpChildren ($<n>3,2,$4,$5));}
| PARSEOP_LNOTEQUAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -816,9 +816,9 @@ LNotEqualTerm
LNotTerm
: PARSEOP_LNOT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LNOT);}
TermArg
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_LNOT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -826,14 +826,14 @@ LNotTerm
LoadTableTerm
: PARSEOP_LOADTABLE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LOADTABLE);}
TermArg
TermArgItem
TermArgItem
OptionalListString
OptionalListString
OptionalReference
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);}
| PARSEOP_LOADTABLE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -841,32 +841,32 @@ LoadTableTerm
LoadTerm
: PARSEOP_LOAD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LOAD);}
NameString
RequiredTarget
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_LOAD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
LocalTerm
- : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);}
- | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);}
- | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);}
- | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);}
- | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);}
- | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);}
- | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);}
- | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);}
+ : PARSEOP_LOCAL0 {$$ = TrCreateLeafOp (PARSEOP_LOCAL0);}
+ | PARSEOP_LOCAL1 {$$ = TrCreateLeafOp (PARSEOP_LOCAL1);}
+ | PARSEOP_LOCAL2 {$$ = TrCreateLeafOp (PARSEOP_LOCAL2);}
+ | PARSEOP_LOCAL3 {$$ = TrCreateLeafOp (PARSEOP_LOCAL3);}
+ | PARSEOP_LOCAL4 {$$ = TrCreateLeafOp (PARSEOP_LOCAL4);}
+ | PARSEOP_LOCAL5 {$$ = TrCreateLeafOp (PARSEOP_LOCAL5);}
+ | PARSEOP_LOCAL6 {$$ = TrCreateLeafOp (PARSEOP_LOCAL6);}
+ | PARSEOP_LOCAL7 {$$ = TrCreateLeafOp (PARSEOP_LOCAL7);}
;
LOrTerm
: PARSEOP_LOR
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_LOR);}
TermArg
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_LOR
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -874,14 +874,14 @@ LOrTerm
MatchTerm
: PARSEOP_MATCH
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MATCH);}
TermArg
',' MatchOpKeyword
TermArgItem
',' MatchOpKeyword
TermArgItem
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);}
| PARSEOP_MATCH
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -889,7 +889,7 @@ MatchTerm
MethodTerm
: PARSEOP_METHOD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD); COMMENT_CAPTURE_OFF;}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_METHOD); COMMENT_CAPTURE_OFF;}
NameString
OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);}
OptionalSerializeRuleKeyword
@@ -897,8 +897,8 @@ MethodTerm
OptionalParameterTypePackage
OptionalParameterTypesPackage
PARSEOP_CLOSE_PAREN '{' {COMMENT_CAPTURE_ON;}
- TermList '}' {$$ = TrLinkChildren ($<n>3,7,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,7,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),
$5,$7,$8,$9,$10,$14);}
| PARSEOP_METHOD
PARSEOP_OPEN_PAREN
@@ -907,12 +907,12 @@ MethodTerm
MidTerm
: PARSEOP_MID
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MID);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MID);}
TermArg
TermArgItem
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$5,$6,$7);}
| PARSEOP_MID
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -920,11 +920,11 @@ MidTerm
ModTerm
: PARSEOP_MOD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MOD);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_MOD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -932,11 +932,11 @@ ModTerm
MultiplyTerm
: PARSEOP_MULTIPLY
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MULTIPLY);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_MULTIPLY
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -944,11 +944,11 @@ MultiplyTerm
MutexTerm
: PARSEOP_MUTEX
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MUTEX);}
NameString
',' ByteConstExpr
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$6);}
| PARSEOP_MUTEX
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -956,11 +956,11 @@ MutexTerm
NameTerm
: PARSEOP_NAME
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NAME);}
NameString
',' DataObject
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$6);}
| PARSEOP_NAME
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -968,27 +968,27 @@ NameTerm
NAndTerm
: PARSEOP_NAND
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NAND);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_NAND
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
NoOpTerm
- : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);}
+ : PARSEOP_NOOP {$$ = TrCreateOp (PARSEOP_NOOP, 0);}
;
NOrTerm
: PARSEOP_NOR
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NOR);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_NOR
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -996,10 +996,10 @@ NOrTerm
NotifyTerm
: PARSEOP_NOTIFY
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NOTIFY);}
SuperName
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_NOTIFY
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1007,10 +1007,10 @@ NotifyTerm
NotTerm
: PARSEOP_NOT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_NOT);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_NOT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1018,9 +1018,9 @@ NotTerm
ObjectTypeTerm
: PARSEOP_OBJECTTYPE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_OBJECTTYPE);}
ObjectTypeSource
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_OBJECTTYPE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1030,7 +1030,7 @@ OffsetTerm
: PARSEOP_OFFSET
PARSEOP_OPEN_PAREN
AmlPackageLengthTerm
- PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateOp (PARSEOP_OFFSET,1,$3);}
| PARSEOP_OFFSET
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1038,13 +1038,13 @@ OffsetTerm
OpRegionTerm
: PARSEOP_OPERATIONREGION
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_OPERATIONREGION);}
NameString
',' OpRegionSpaceIdTerm
TermArgItem
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),
$6,$7,$8);}
| PARSEOP_OPERATIONREGION
PARSEOP_OPEN_PAREN
@@ -1058,30 +1058,30 @@ OpRegionSpaceIdTerm
OrTerm
: PARSEOP_OR
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_OR);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_OR
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
PackageTerm
- : PARSEOP_PACKAGE {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);}
+ : PARSEOP_PACKAGE {$<n>$ = TrCreateLeafOp (PARSEOP_VAR_PACKAGE);}
OptionalDataCount
- '{' PackageList '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);}
+ '{' PackageList '}' {$$ = TrLinkOpChildren ($<n>2,2,$3,$5);}
PowerResTerm
: PARSEOP_POWERRESOURCE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_POWERRESOURCE);}
NameString
',' ByteConstExpr
',' WordConstExpr
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,4,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,4,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),
$6,$8,$11);}
| PARSEOP_POWERRESOURCE
PARSEOP_OPEN_PAREN
@@ -1090,10 +1090,10 @@ PowerResTerm
PrintfTerm
: PARSEOP_PRINTF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PRINTF);}
StringData
PrintfArgList
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_PRINTF
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1103,19 +1103,19 @@ PrintfArgList
: {$$ = NULL;}
| TermArg {$$ = $1;}
| PrintfArgList ','
- TermArg {$$ = TrLinkPeerNode ($1, $3);}
+ TermArg {$$ = TrLinkPeerOp ($1, $3);}
;
ProcessorTerm
: PARSEOP_PROCESSOR
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PROCESSOR);}
NameString
',' ByteConstExpr
OptionalDWordConstExpr
OptionalByteConstExpr
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,5,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,5,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),
$6,$7,$8,$11);}
| PARSEOP_PROCESSOR
PARSEOP_OPEN_PAREN
@@ -1124,10 +1124,10 @@ ProcessorTerm
RawDataBufferTerm
: PARSEOP_DATABUFFER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DATABUFFER);}
OptionalWordConst
PARSEOP_CLOSE_PAREN '{'
- ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_DATABUFFER
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1139,10 +1139,10 @@ RawDataBufferTerm
*/
RefOfTerm
: PARSEOP_REFOF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_REFOF);}
RefOfSource
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,
- TrSetNodeFlags ($4, NODE_IS_TARGET));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,
+ TrSetOpFlags ($4, OP_IS_TARGET));}
| PARSEOP_REFOF
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1150,9 +1150,9 @@ RefOfTerm
ReleaseTerm
: PARSEOP_RELEASE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_RELEASE);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_RELEASE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1160,9 +1160,9 @@ ReleaseTerm
ResetTerm
: PARSEOP_RESET
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_RESET);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_RESET
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1170,13 +1170,13 @@ ResetTerm
ReturnTerm
: PARSEOP_RETURN
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_RETURN);}
OptionalReturnArg
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
- | PARSEOP_RETURN {$$ = TrLinkChildren (
- TrCreateLeafNode (PARSEOP_RETURN),1,
- TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO),
- NODE_IS_NULL_RETURN));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
+ | PARSEOP_RETURN {$$ = TrLinkOpChildren (
+ TrCreateLeafOp (PARSEOP_RETURN),1,
+ TrSetOpFlags (TrCreateLeafOp (PARSEOP_ZERO),
+ OP_IS_NULL_RETURN));}
| PARSEOP_RETURN
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1184,11 +1184,11 @@ ReturnTerm
ScopeTerm
: PARSEOP_SCOPE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SCOPE);}
NameString
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,2,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$7);}
| PARSEOP_SCOPE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1196,11 +1196,11 @@ ScopeTerm
ShiftLeftTerm
: PARSEOP_SHIFTLEFT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTLEFT);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_SHIFTLEFT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1208,11 +1208,11 @@ ShiftLeftTerm
ShiftRightTerm
: PARSEOP_SHIFTRIGHT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SHIFTRIGHT);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_SHIFTRIGHT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1220,9 +1220,9 @@ ShiftRightTerm
SignalTerm
: PARSEOP_SIGNAL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SIGNAL);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_SIGNAL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1230,9 +1230,9 @@ SignalTerm
SizeOfTerm
: PARSEOP_SIZEOF
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SIZEOF);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_SIZEOF
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1240,9 +1240,9 @@ SizeOfTerm
SleepTerm
: PARSEOP_SLEEP
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SLEEP);}
TermArg
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_SLEEP
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1250,9 +1250,9 @@ SleepTerm
StallTerm
: PARSEOP_STALL
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STALL);}
TermArg
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_STALL
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1260,11 +1260,11 @@ StallTerm
StoreTerm
: PARSEOP_STORE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STORE);}
TermArg
',' SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,
- TrSetNodeFlags ($6, NODE_IS_TARGET));}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,
+ TrSetOpFlags ($6, OP_IS_TARGET));}
| PARSEOP_STORE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1272,11 +1272,11 @@ StoreTerm
SubtractTerm
: PARSEOP_SUBTRACT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SUBTRACT);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_SUBTRACT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1284,10 +1284,10 @@ SubtractTerm
SwitchTerm
: PARSEOP_SWITCH
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SWITCH);}
TermArg
PARSEOP_CLOSE_PAREN '{'
- CaseDefaultTermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ CaseDefaultTermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_SWITCH
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1295,11 +1295,11 @@ SwitchTerm
ThermalZoneTerm
: PARSEOP_THERMALZONE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_THERMALZONE);}
NameString
PARSEOP_CLOSE_PAREN '{'
- TermList '}' {$$ = TrLinkChildren ($<n>3,2,
- TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
+ TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,
+ TrSetOpFlags ($4, OP_IS_NAME_DECLARATION),$7);}
| PARSEOP_THERMALZONE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1307,10 +1307,10 @@ ThermalZoneTerm
TimerTerm
: PARSEOP_TIMER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);}
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,0);}
- | PARSEOP_TIMER {$$ = TrLinkChildren (
- TrCreateLeafNode (PARSEOP_TIMER),0);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TIMER);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,0);}
+ | PARSEOP_TIMER {$$ = TrLinkOpChildren (
+ TrCreateLeafOp (PARSEOP_TIMER),0);}
| PARSEOP_TIMER
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1318,10 +1318,10 @@ TimerTerm
ToBCDTerm
: PARSEOP_TOBCD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOBCD);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_TOBCD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1329,10 +1329,10 @@ ToBCDTerm
ToBufferTerm
: PARSEOP_TOBUFFER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOBUFFER);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_TOBUFFER
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1340,10 +1340,10 @@ ToBufferTerm
ToDecimalStringTerm
: PARSEOP_TODECIMALSTRING
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TODECIMALSTRING);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_TODECIMALSTRING
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1351,10 +1351,10 @@ ToDecimalStringTerm
ToHexStringTerm
: PARSEOP_TOHEXSTRING
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOHEXSTRING);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_TOHEXSTRING
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1362,10 +1362,10 @@ ToHexStringTerm
ToIntegerTerm
: PARSEOP_TOINTEGER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOINTEGER);}
TermArg
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_TOINTEGER
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1373,9 +1373,9 @@ ToIntegerTerm
ToPLDTerm
: PARSEOP_TOPLD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOPLD);}
PldKeywordList
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_TOPLD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1384,26 +1384,26 @@ ToPLDTerm
PldKeywordList
: {$$ = NULL;}
| PldKeyword
- PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);}
+ PARSEOP_EXP_EQUALS Integer {$$ = TrLinkOpChildren ($1,1,$3);}
| PldKeyword
- PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);}
+ PARSEOP_EXP_EQUALS String {$$ = TrLinkOpChildren ($1,1,$3);}
| PldKeywordList ',' /* Allows a trailing comma at list end */
| PldKeywordList ','
PldKeyword
- PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
+ PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerOp ($1,TrLinkOpChildren ($3,1,$5));}
| PldKeywordList ','
PldKeyword
- PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
+ PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerOp ($1,TrLinkOpChildren ($3,1,$5));}
;
ToStringTerm
: PARSEOP_TOSTRING
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_TOSTRING);}
TermArg
OptionalCount
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_TOSTRING
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1413,7 +1413,7 @@ ToUUIDTerm
: PARSEOP_TOUUID
PARSEOP_OPEN_PAREN
StringData
- PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);}
+ PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_TOUUID, $3);}
| PARSEOP_TOUUID
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1421,9 +1421,9 @@ ToUUIDTerm
UnicodeTerm
: PARSEOP_UNICODE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UNICODE);}
StringData
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,0,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,0,$4);}
| PARSEOP_UNICODE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1431,9 +1431,9 @@ UnicodeTerm
UnloadTerm
: PARSEOP_UNLOAD
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UNLOAD);}
SuperName
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,1,$4);}
| PARSEOP_UNLOAD
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1441,10 +1441,10 @@ UnloadTerm
WaitTerm
: PARSEOP_WAIT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WAIT);}
SuperName
TermArgItem
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);}
| PARSEOP_WAIT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1452,11 +1452,11 @@ WaitTerm
XOrTerm
: PARSEOP_XOR
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_XOR);}
TermArg
TermArgItem
Target
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$5,$6);}
| PARSEOP_XOR
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -1464,10 +1464,10 @@ XOrTerm
WhileTerm
: PARSEOP_WHILE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WHILE);}
TermArg
PARSEOP_CLOSE_PAREN
- '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ '{' TermList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_WHILE
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
diff --git a/sys/contrib/dev/acpica/compiler/aslprintf.c b/sys/contrib/dev/acpica/compiler/aslprintf.c
index 52179fa..a626f24 100644
--- a/sys/contrib/dev/acpica/compiler/aslprintf.c
+++ b/sys/contrib/dev/acpica/compiler/aslprintf.c
@@ -191,7 +191,7 @@ OpcDoPrintf (
/* Store destination is the Debug op */
- DestOp = TrAllocateNode (PARSEOP_DEBUG);
+ DestOp = TrAllocateOp (PARSEOP_DEBUG);
DestOp->Asl.AmlOpcode = AML_DEBUG_OP;
DestOp->Asl.Parent = Op;
DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
@@ -296,7 +296,7 @@ OpcParsePrintf (
NewString = UtStringCacheCalloc (StringLength + 1);
strncpy (NewString, StartPosition, StringLength);
- NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
+ NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = NewString;
NewOp->Asl.AmlOpcode = AML_STRING_OP;
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
@@ -357,7 +357,7 @@ OpcParsePrintf (
*/
if (!Op->Asl.Child)
{
- NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
+ NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = "";
NewOp->Asl.AmlOpcode = AML_STRING_OP;
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
@@ -385,7 +385,7 @@ OpcParsePrintf (
NewString = UtStringCacheCalloc (StringLength + 1);
strncpy (NewString, StartPosition, StringLength);
- NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
+ NewOp = TrAllocateOp (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = NewString;
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
NewOp->Asl.AmlOpcode = AML_STRING_OP;
@@ -423,7 +423,7 @@ OpcParsePrintf (
/* Disable further optimization */
- Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ Op->Asl.CompileFlags &= ~OP_COMPILE_TIME_CONST;
UtSetParseOpName (Op);
/* Set Store destination */
@@ -461,7 +461,7 @@ OpcCreateConcatenateNode (
return;
}
- NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE);
+ NewConcatOp = TrAllocateOp (PARSEOP_CONCATENATE);
NewConcatOp->Asl.AmlOpcode = AML_CONCATENATE_OP;
NewConcatOp->Asl.AcpiBtype = 0x7;
NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
@@ -479,7 +479,7 @@ OpcCreateConcatenateNode (
/* Third arg is Zero (not used) */
NewConcatOp->Asl.Child->Asl.Next->Asl.Next =
- TrAllocateNode (PARSEOP_ZERO);
+ TrAllocateOp (PARSEOP_ZERO);
NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent =
NewConcatOp;
diff --git a/sys/contrib/dev/acpica/compiler/aslresource.c b/sys/contrib/dev/acpica/compiler/aslresource.c
index 2fdeea5..7b8b7e6 100644
--- a/sys/contrib/dev/acpica/compiler/aslresource.c
+++ b/sys/contrib/dev/acpica/compiler/aslresource.c
@@ -573,7 +573,7 @@ RsCreateResourceField (
{
Op->Asl.ExternalName = Name;
- Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
+ Op->Asl.CompileFlags |= OP_IS_RESOURCE_FIELD;
Op->Asl.Value.Tag.BitOffset = (ByteOffset * 8) + BitOffset;
Op->Asl.Value.Tag.BitLength = BitLength;
@@ -719,9 +719,9 @@ RsCheckListForDuplicates (
{
/* Emit error only once per duplicate node */
- if (!(NextOp->Asl.CompileFlags & NODE_IS_DUPLICATE))
+ if (!(NextOp->Asl.CompileFlags & OP_IS_DUPLICATE))
{
- NextOp->Asl.CompileFlags |= NODE_IS_DUPLICATE;
+ NextOp->Asl.CompileFlags |= OP_IS_DUPLICATE;
AslError (ASL_ERROR, ASL_MSG_DUPLICATE_ITEM,
NextOp, NULL);
}
@@ -990,6 +990,31 @@ RsDoOneResourceDescriptor (
Rnode = RsDoUartSerialBusDescriptor (Info);
break;
+ case PARSEOP_PINCONFIG:
+
+ Rnode = RsDoPinConfigDescriptor (Info);
+ break;
+
+ case PARSEOP_PINFUNCTION:
+
+ Rnode = RsDoPinFunctionDescriptor (Info);
+ break;
+
+ case PARSEOP_PINGROUP:
+
+ Rnode = RsDoPinGroupDescriptor (Info);
+ break;
+
+ case PARSEOP_PINGROUPFUNCTION:
+
+ Rnode = RsDoPinGroupFunctionDescriptor (Info);
+ break;
+
+ case PARSEOP_PINGROUPCONFIG:
+
+ Rnode = RsDoPinGroupConfigDescriptor (Info);
+ break;
+
case PARSEOP_DEFAULT_ARG:
/* Just ignore any of these, they are used as fillers/placeholders */
@@ -1008,7 +1033,7 @@ RsDoOneResourceDescriptor (
* references to the descriptor can be resolved.
*/
Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
- Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
+ Info->DescriptorTypeOp->Asl.CompileFlags = OP_IS_RESOURCE_DESC;
Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset;
if (Rnode)
@@ -1107,7 +1132,7 @@ RsDoResourceTemplate (
if (Op->Asl.Parent)
{
- Op->Asl.Parent->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
+ Op->Asl.Parent->Asl.CompileFlags |= OP_IS_RESOURCE_DESC;
}
/* ResourceTemplate Opcode is first (Op) */
@@ -1146,7 +1171,7 @@ RsDoResourceTemplate (
Info.DescriptorTypeOp = DescriptorTypeOp;
Info.CurrentByteOffset = CurrentByteOffset;
- DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
+ DescriptorTypeOp->Asl.CompileFlags |= OP_IS_RESOURCE_DESC;
Rnode = RsDoOneResourceDescriptor (&Info, &State);
/*
@@ -1181,7 +1206,7 @@ RsDoResourceTemplate (
*/
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
Op->Asl.AmlOpcode = AML_BUFFER_OP;
- Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC;
+ Op->Asl.CompileFlags = OP_AML_PACKAGE | OP_IS_RESOURCE_DESC;
UtSetParseOpName (Op);
BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
@@ -1194,7 +1219,7 @@ RsDoResourceTemplate (
BufferOp->Asl.AmlOpcodeLength = 0;
BufferOp->Asl.AmlLength = CurrentByteOffset;
BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next;
- BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA;
+ BufferOp->Asl.CompileFlags |= OP_IS_RESOURCE_DATA;
UtSetParseOpName (BufferOp);
return;
diff --git a/sys/contrib/dev/acpica/compiler/aslresources.y b/sys/contrib/dev/acpica/compiler/aslresources.y
index d14fdd4..5b73ed8 100644
--- a/sys/contrib/dev/acpica/compiler/aslresources.y
+++ b/sys/contrib/dev/acpica/compiler/aslresources.y
@@ -169,11 +169,11 @@ ResourceTemplateTerm
: PARSEOP_RESOURCETEMPLATE {COMMENT_CAPTURE_OFF;}
OptionalParentheses
'{'
- ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4,
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
+ ResourceMacroList '}' {$$ = TrCreateOp (PARSEOP_RESOURCETEMPLATE,4,
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),
$5,
- TrCreateLeafNode (PARSEOP_ENDTAG));
+ TrCreateLeafOp (PARSEOP_ENDTAG));
COMMENT_CAPTURE_ON;}
;
@@ -186,7 +186,7 @@ OptionalParentheses
ResourceMacroList
: {$$ = NULL;}
| ResourceMacroList
- ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);}
+ ResourceMacroTerm {$$ = TrLinkPeerOp ($1,$2);}
;
ResourceMacroTerm
@@ -211,6 +211,11 @@ ResourceMacroTerm
| Memory24Term {}
| Memory32FixedTerm {}
| Memory32Term {}
+ | PinConfigTerm {}
+ | PinFunctionTerm {}
+ | PinGroupTerm {}
+ | PinGroupConfigTerm {}
+ | PinGroupFunctionTerm {}
| QWordIOTerm {}
| QWordMemoryTerm {}
| QWordSpaceTerm {}
@@ -230,13 +235,13 @@ ResourceMacroTerm
DMATerm
: PARSEOP_DMA
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DMA);}
DMATypeKeyword
OptionalBusMasterKeyword
',' XferTypeKeyword
OptionalNameString_Last
PARSEOP_CLOSE_PAREN '{'
- ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);}
+ ByteList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$7,$8,$11);}
| PARSEOP_DMA
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -244,7 +249,7 @@ DMATerm
DWordIOTerm
: PARSEOP_DWORDIO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDIO);}
OptionalResourceType_First
OptionalMinType
OptionalMaxType
@@ -260,7 +265,7 @@ DWordIOTerm
OptionalNameString
OptionalType
OptionalTranslationType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
| PARSEOP_DWORDIO
PARSEOP_OPEN_PAREN
@@ -269,7 +274,7 @@ DWordIOTerm
DWordMemoryTerm
: PARSEOP_DWORDMEMORY
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDMEMORY);}
OptionalResourceType_First
OptionalDecodeType
OptionalMinType
@@ -286,7 +291,7 @@ DWordMemoryTerm
OptionalNameString
OptionalAddressRange
OptionalType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,16,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
| PARSEOP_DWORDMEMORY
PARSEOP_OPEN_PAREN
@@ -295,7 +300,7 @@ DWordMemoryTerm
DWordSpaceTerm
: PARSEOP_DWORDSPACE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DWORDSPACE);}
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
OptionalResourceType
OptionalDecodeType
@@ -310,7 +315,7 @@ DWordSpaceTerm
OptionalByteConstExpr
OptionalStringData
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
| PARSEOP_DWORDSPACE
PARSEOP_OPEN_PAREN
@@ -320,7 +325,7 @@ DWordSpaceTerm
EndDependentFnTerm
: PARSEOP_ENDDEPENDENTFN
PARSEOP_OPEN_PAREN
- PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);}
+ PARSEOP_CLOSE_PAREN {$$ = TrCreateLeafOp (PARSEOP_ENDDEPENDENTFN);}
| PARSEOP_ENDDEPENDENTFN
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -328,7 +333,7 @@ EndDependentFnTerm
ExtendedIOTerm
: PARSEOP_EXTENDEDIO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDIO);}
OptionalResourceType_First
OptionalMinType
OptionalMaxType
@@ -343,7 +348,7 @@ ExtendedIOTerm
OptionalNameString
OptionalType
OptionalTranslationType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);}
| PARSEOP_EXTENDEDIO
PARSEOP_OPEN_PAREN
@@ -352,7 +357,7 @@ ExtendedIOTerm
ExtendedMemoryTerm
: PARSEOP_EXTENDEDMEMORY
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDMEMORY);}
OptionalResourceType_First
OptionalDecodeType
OptionalMinType
@@ -368,7 +373,7 @@ ExtendedMemoryTerm
OptionalNameString
OptionalAddressRange
OptionalType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);}
| PARSEOP_EXTENDEDMEMORY
PARSEOP_OPEN_PAREN
@@ -376,7 +381,7 @@ ExtendedMemoryTerm
;
ExtendedSpaceTerm
- : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);}
+ : PARSEOP_EXTENDEDSPACE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_EXTENDEDSPACE);}
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
OptionalResourceType
OptionalDecodeType
@@ -390,7 +395,7 @@ ExtendedSpaceTerm
',' QWordConstExpr
OptionalQWordConstExpr
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,13,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,13,
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);}
| PARSEOP_EXTENDEDSPACE
PARSEOP_OPEN_PAREN
@@ -399,12 +404,12 @@ ExtendedSpaceTerm
FixedDmaTerm
: PARSEOP_FIXEDDMA
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDDMA);}
WordConstExpr /* 04: DMA RequestLines */
',' WordConstExpr /* 06: DMA Channels */
OptionalXferSize /* 07: DMA TransferSize */
OptionalNameString /* 08: DescriptorName */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$7,$8);}
| PARSEOP_FIXEDDMA
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -412,11 +417,11 @@ FixedDmaTerm
FixedIOTerm
: PARSEOP_FIXEDIO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FIXEDIO);}
WordConstExpr
',' ByteConstExpr
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);}
| PARSEOP_FIXEDIO
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -424,7 +429,7 @@ FixedIOTerm
GpioIntTerm
: PARSEOP_GPIO_INT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_INT);}
InterruptTypeKeyword /* 04: InterruptType */
',' InterruptLevel /* 06: InterruptLevel */
OptionalShareType /* 07: SharedType */
@@ -436,7 +441,7 @@ GpioIntTerm
OptionalNameString /* 15: DescriptorName */
OptionalBuffer_Last /* 16: VendorData */
PARSEOP_CLOSE_PAREN '{'
- DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,
+ DWordConstExpr '}' {$$ = TrLinkOpChildren ($<n>3,11,
$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
| PARSEOP_GPIO_INT
PARSEOP_OPEN_PAREN
@@ -445,7 +450,7 @@ GpioIntTerm
GpioIoTerm
: PARSEOP_GPIO_IO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_GPIO_IO);}
OptionalShareType_First /* 04: SharedType */
',' PinConfigByte /* 06: PinConfig */
OptionalWordConstExpr /* 07: DebounceTimeout */
@@ -457,7 +462,7 @@ GpioIoTerm
OptionalNameString /* 14: DescriptorName */
OptionalBuffer_Last /* 15: VendorData */
PARSEOP_CLOSE_PAREN '{'
- DWordList '}' {$$ = TrLinkChildren ($<n>3,11,
+ DWordList '}' {$$ = TrLinkOpChildren ($<n>3,11,
$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
| PARSEOP_GPIO_IO
PARSEOP_OPEN_PAREN
@@ -466,7 +471,7 @@ GpioIoTerm
I2cSerialBusTerm
: PARSEOP_I2C_SERIALBUS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS);}
WordConstExpr /* 04: SlaveAddress */
OptionalSlaveMode /* 05: SlaveMode */
',' DWordConstExpr /* 07: ConnectionSpeed */
@@ -476,9 +481,9 @@ I2cSerialBusTerm
OptionalResourceType /* 12: ResourceType */
OptionalNameString /* 13: DescriptorName */
OptionalBuffer_Last /* 14: VendorData */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,10,
$4,$5,$7,$8,$10,$11,$12,$13,
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$14);}
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$14);}
| PARSEOP_I2C_SERIALBUS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -486,7 +491,7 @@ I2cSerialBusTerm
I2cSerialBusTermV2
: PARSEOP_I2C_SERIALBUS_V2
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS_V2);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_I2C_SERIALBUS_V2);}
WordConstExpr /* 04: SlaveAddress */
OptionalSlaveMode /* 05: SlaveMode */
',' DWordConstExpr /* 07: ConnectionSpeed */
@@ -497,7 +502,7 @@ I2cSerialBusTermV2
OptionalNameString /* 13: DescriptorName */
OptionalShareType /* 14: Share */
OptionalBuffer_Last /* 15: VendorData */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,10,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,10,
$4,$5,$7,$8,$10,$11,$12,$13,$14,$15);}
| PARSEOP_I2C_SERIALBUS_V2
PARSEOP_OPEN_PAREN
@@ -506,7 +511,7 @@ I2cSerialBusTermV2
InterruptTerm
: PARSEOP_INTERRUPT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_INTERRUPT);}
OptionalResourceType_First
',' InterruptTypeKeyword
',' InterruptLevel
@@ -515,7 +520,7 @@ InterruptTerm
OptionalStringData
OptionalNameString_Last
PARSEOP_CLOSE_PAREN '{'
- DWordList '}' {$$ = TrLinkChildren ($<n>3,8,
+ DWordList '}' {$$ = TrLinkOpChildren ($<n>3,8,
$4,$6,$8,$9,$10,$11,$12,$15);}
| PARSEOP_INTERRUPT
PARSEOP_OPEN_PAREN
@@ -524,14 +529,14 @@ InterruptTerm
IOTerm
: PARSEOP_IO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IO);}
IODecodeKeyword
',' WordConstExpr
',' WordConstExpr
',' ByteConstExpr
',' ByteConstExpr
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
| PARSEOP_IO
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -539,10 +544,10 @@ IOTerm
IRQNoFlagsTerm
: PARSEOP_IRQNOFLAGS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IRQNOFLAGS);}
OptionalNameString_First
PARSEOP_CLOSE_PAREN '{'
- ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_IRQNOFLAGS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -550,13 +555,13 @@ IRQNoFlagsTerm
IRQTerm
: PARSEOP_IRQ
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_IRQ);}
InterruptTypeKeyword
',' InterruptLevel
OptionalShareType
OptionalNameString_Last
PARSEOP_CLOSE_PAREN '{'
- ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);}
+ ByteList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$6,$7,$8,$11);}
| PARSEOP_IRQ
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -564,14 +569,14 @@ IRQTerm
Memory24Term
: PARSEOP_MEMORY24
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY24);}
OptionalReadWriteKeyword
',' WordConstExpr
',' WordConstExpr
',' WordConstExpr
',' WordConstExpr
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
| PARSEOP_MEMORY24
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -579,12 +584,12 @@ Memory24Term
Memory32FixedTerm
: PARSEOP_MEMORY32FIXED
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32FIXED);}
OptionalReadWriteKeyword
',' DWordConstExpr
',' DWordConstExpr
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,4,$4,$6,$8,$9);}
| PARSEOP_MEMORY32FIXED
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -592,22 +597,111 @@ Memory32FixedTerm
Memory32Term
: PARSEOP_MEMORY32
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_MEMORY32);}
OptionalReadWriteKeyword
',' DWordConstExpr
',' DWordConstExpr
',' DWordConstExpr
',' DWordConstExpr
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
| PARSEOP_MEMORY32
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
;
+PinConfigTerm
+ : PARSEOP_PINCONFIG
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINCONFIG);}
+ OptionalShareType_First /* 04: SharedType */
+ ',' ByteConstExpr /* 06: PinConfigType */
+ ',' DWordConstExpr /* 08: PinConfigValue */
+ ',' StringData /* 10: ResourceSource */
+ OptionalByteConstExpr /* 11: ResourceSourceIndex */
+ OptionalResourceType /* 12: ResourceType */
+ OptionalNameString /* 13: DescriptorName */
+ OptionalBuffer_Last /* 14: VendorData */
+ PARSEOP_CLOSE_PAREN '{'
+ DWordList '}' {$$ = TrLinkOpChildren ($<n>3,9,
+ $4,$6,$8,$10,$11,$12,$13,$14,$17);}
+ | PARSEOP_PINCONFIG
+ PARSEOP_OPEN_PAREN
+ error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
+ ;
+
+PinFunctionTerm
+ : PARSEOP_PINFUNCTION
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINFUNCTION);}
+ OptionalShareType_First /* 04: SharedType */
+ ',' PinConfigByte /* 06: PinConfig */
+ ',' WordConstExpr /* 08: FunctionNumber */
+ ',' StringData /* 10: ResourceSource */
+ OptionalByteConstExpr /* 11: ResourceSourceIndex */
+ OptionalResourceType /* 12: ResourceType */
+ OptionalNameString /* 13: DescriptorName */
+ OptionalBuffer_Last /* 14: VendorData */
+ PARSEOP_CLOSE_PAREN '{'
+ DWordList '}' {$$ = TrLinkOpChildren ($<n>3,9,
+ $4,$6,$8,$10,$11,$12,$13,$14,$17);}
+ | PARSEOP_PINFUNCTION
+ PARSEOP_OPEN_PAREN
+ error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
+ ;
+
+PinGroupTerm
+ : PARSEOP_PINGROUP
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUP);}
+ StringData /* 04: ResourceLabel */
+ OptionalProducerResourceType /* 05: ResourceType */
+ OptionalNameString /* 06: DescriptorName */
+ OptionalBuffer_Last /* 07: VendorData */
+ PARSEOP_CLOSE_PAREN '{'
+ DWordList '}' {$$ = TrLinkOpChildren ($<n>3,5,$4,$5,$6,$7,$10);}
+ | PARSEOP_PINGROUP
+ PARSEOP_OPEN_PAREN
+ error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
+ ;
+
+PinGroupConfigTerm
+ : PARSEOP_PINGROUPCONFIG
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPCONFIG);}
+ OptionalShareType_First /* 04: SharedType */
+ ',' ByteConstExpr /* 06: PinConfigType */
+ ',' DWordConstExpr /* 08: PinConfigValue */
+ ',' StringData /* 10: ResourceSource */
+ OptionalByteConstExpr /* 11: ResourceSourceIndex */
+ ',' StringData /* 13: ResourceSourceLabel */
+ OptionalResourceType /* 14: ResourceType */
+ OptionalNameString /* 15: DescriptorName */
+ OptionalBuffer_Last /* 16: VendorData */
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,9,
+ $4,$6,$8,$10,$11,$13,$14,$15,$16);}
+ | PARSEOP_PINGROUPCONFIG
+ PARSEOP_OPEN_PAREN
+ error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
+ ;
+
+PinGroupFunctionTerm
+ : PARSEOP_PINGROUPFUNCTION
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUPFUNCTION);}
+ OptionalShareType_First /* 04: SharedType */
+ ',' WordConstExpr /* 06: FunctionNumber */
+ ',' StringData /* 08: ResourceSource */
+ OptionalByteConstExpr /* 09: ResourceSourceIndex */
+ ',' StringData /* 11: ResourceSourceLabel */
+ OptionalResourceType /* 12: ResourceType */
+ OptionalNameString /* 13: DescriptorName */
+ OptionalBuffer_Last /* 14: VendorData */
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,8,
+ $4,$6,$8,$9,$11,$12,$13,$14);}
+ | PARSEOP_PINGROUPFUNCTION
+ PARSEOP_OPEN_PAREN
+ error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
+ ;
+
QWordIOTerm
: PARSEOP_QWORDIO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDIO);}
OptionalResourceType_First
OptionalMinType
OptionalMaxType
@@ -623,7 +717,7 @@ QWordIOTerm
OptionalNameString
OptionalType
OptionalTranslationType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
| PARSEOP_QWORDIO
PARSEOP_OPEN_PAREN
@@ -632,7 +726,7 @@ QWordIOTerm
QWordMemoryTerm
: PARSEOP_QWORDMEMORY
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDMEMORY);}
OptionalResourceType_First
OptionalDecodeType
OptionalMinType
@@ -649,7 +743,7 @@ QWordMemoryTerm
OptionalNameString
OptionalAddressRange
OptionalType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,16,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,16,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
| PARSEOP_QWORDMEMORY
PARSEOP_OPEN_PAREN
@@ -658,7 +752,7 @@ QWordMemoryTerm
QWordSpaceTerm
: PARSEOP_QWORDSPACE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_QWORDSPACE);}
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
OptionalResourceType
OptionalDecodeType
@@ -673,7 +767,7 @@ QWordSpaceTerm
OptionalByteConstExpr
OptionalStringData
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
| PARSEOP_QWORDSPACE
PARSEOP_OPEN_PAREN
@@ -682,14 +776,14 @@ QWordSpaceTerm
RegisterTerm
: PARSEOP_REGISTER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_REGISTER);}
AddressSpaceKeyword
',' ByteConstExpr
',' ByteConstExpr
',' QWordConstExpr
OptionalAccessSize
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
| PARSEOP_REGISTER
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -697,7 +791,7 @@ RegisterTerm
SpiSerialBusTerm
: PARSEOP_SPI_SERIALBUS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS);}
WordConstExpr /* 04: DeviceSelection */
OptionalDevicePolarity /* 05: DevicePolarity */
OptionalWireMode /* 06: WireMode */
@@ -711,9 +805,9 @@ SpiSerialBusTerm
OptionalResourceType /* 19: ResourceType */
OptionalNameString /* 20: DescriptorName */
OptionalBuffer_Last /* 21: VendorData */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);}
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);}
| PARSEOP_SPI_SERIALBUS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -721,7 +815,7 @@ SpiSerialBusTerm
SpiSerialBusTermV2
: PARSEOP_SPI_SERIALBUS_V2
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS_V2);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_SPI_SERIALBUS_V2);}
WordConstExpr /* 04: DeviceSelection */
OptionalDevicePolarity /* 05: DevicePolarity */
OptionalWireMode /* 06: WireMode */
@@ -736,7 +830,7 @@ SpiSerialBusTermV2
OptionalNameString /* 20: DescriptorName */
OptionalShareType /* 21: Share */
OptionalBuffer_Last /* 22: VendorData */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21,$22);}
| PARSEOP_SPI_SERIALBUS_V2
PARSEOP_OPEN_PAREN
@@ -745,9 +839,9 @@ SpiSerialBusTermV2
StartDependentFnNoPriTerm
: PARSEOP_STARTDEPENDENTFN_NOPRI
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN_NOPRI);}
PARSEOP_CLOSE_PAREN '{'
- ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);}
+ ResourceMacroList '}' {$$ = TrLinkOpChildren ($<n>3,1,$6);}
| PARSEOP_STARTDEPENDENTFN_NOPRI
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -755,11 +849,11 @@ StartDependentFnNoPriTerm
StartDependentFnTerm
: PARSEOP_STARTDEPENDENTFN
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_STARTDEPENDENTFN);}
ByteConstExpr
',' ByteConstExpr
PARSEOP_CLOSE_PAREN '{'
- ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);}
+ ResourceMacroList '}' {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$9);}
| PARSEOP_STARTDEPENDENTFN
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -767,7 +861,7 @@ StartDependentFnTerm
UartSerialBusTerm
: PARSEOP_UART_SERIALBUS
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS);}
DWordConstExpr /* 04: ConnectionSpeed */
OptionalBitsPerByte /* 05: BitsPerByte */
OptionalStopBits /* 06: StopBits */
@@ -782,9 +876,9 @@ UartSerialBusTerm
OptionalResourceType /* 19: ResourceType */
OptionalNameString /* 20: DescriptorName */
OptionalBuffer_Last /* 21: VendorData */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),$21);}
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),$21);}
| PARSEOP_UART_SERIALBUS
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -792,7 +886,7 @@ UartSerialBusTerm
UartSerialBusTermV2
: PARSEOP_UART_SERIALBUS_V2
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS_V2);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UART_SERIALBUS_V2);}
DWordConstExpr /* 04: ConnectionSpeed */
OptionalBitsPerByte /* 05: BitsPerByte */
OptionalStopBits /* 06: StopBits */
@@ -808,7 +902,7 @@ UartSerialBusTermV2
OptionalNameString /* 20: DescriptorName */
OptionalShareType /* 21: Share */
OptionalBuffer_Last /* 22: VendorData */
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21,$22);}
| PARSEOP_UART_SERIALBUS_V2
PARSEOP_OPEN_PAREN
@@ -817,10 +911,10 @@ UartSerialBusTermV2
VendorLongTerm
: PARSEOP_VENDORLONG
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORLONG);}
OptionalNameString_First
PARSEOP_CLOSE_PAREN '{'
- ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_VENDORLONG
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -828,10 +922,10 @@ VendorLongTerm
VendorShortTerm
: PARSEOP_VENDORSHORT
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_VENDORSHORT);}
OptionalNameString_First
PARSEOP_CLOSE_PAREN '{'
- ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
+ ByteList '}' {$$ = TrLinkOpChildren ($<n>3,2,$4,$7);}
| PARSEOP_VENDORSHORT
PARSEOP_OPEN_PAREN
error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
@@ -839,7 +933,7 @@ VendorShortTerm
WordBusNumberTerm
: PARSEOP_WORDBUSNUMBER
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDBUSNUMBER);}
OptionalResourceType_First
OptionalMinType
OptionalMaxType
@@ -852,7 +946,7 @@ WordBusNumberTerm
OptionalByteConstExpr
OptionalStringData
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,12,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,12,
$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);}
| PARSEOP_WORDBUSNUMBER
PARSEOP_OPEN_PAREN
@@ -861,7 +955,7 @@ WordBusNumberTerm
WordIOTerm
: PARSEOP_WORDIO
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDIO);}
OptionalResourceType_First
OptionalMinType
OptionalMaxType
@@ -877,7 +971,7 @@ WordIOTerm
OptionalNameString
OptionalType
OptionalTranslationType_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,15,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,15,
$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
| PARSEOP_WORDIO
PARSEOP_OPEN_PAREN
@@ -886,7 +980,7 @@ WordIOTerm
WordSpaceTerm
: PARSEOP_WORDSPACE
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_WORDSPACE);}
ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
OptionalResourceType
OptionalDecodeType
@@ -901,7 +995,7 @@ WordSpaceTerm
OptionalByteConstExpr
OptionalStringData
OptionalNameString_Last
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,14,
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,14,
$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
| PARSEOP_WORDSPACE
PARSEOP_OPEN_PAREN
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2s.c b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
index 86b3e42..ec1a446 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2s.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
@@ -163,7 +163,8 @@ RsGetBufferDataLength (
static UINT16
RsGetInterruptDataLength (
- ACPI_PARSE_OBJECT *InitializerOp);
+ ACPI_PARSE_OBJECT *InitializerOp,
+ UINT32 StartIndex);
static BOOLEAN
RsGetVendorData (
@@ -171,6 +172,11 @@ RsGetVendorData (
UINT8 *VendorData,
ACPI_SIZE DescriptorOffset);
+static UINT16
+RsGetStringDataLengthAt (
+ ACPI_PARSE_OBJECT *InitializerOp,
+ UINT32 StartIndex);
+
/*
* This module contains descriptors for serial buses and GPIO:
*
@@ -179,6 +185,11 @@ RsGetVendorData (
* I2cSerialBus
* SpiSerialBus
* UartSerialBus
+ * PinFunction
+ * PinConfig
+ * PinGroup
+ * PinGroupFunction
+ * PinGroupConfig
*/
@@ -238,6 +249,7 @@ RsGetBufferDataLength (
*
* PARAMETERS: InitializerOp - Current parse op, start of the resource
* descriptor
+ * StartIndex - Start index of interrupt/pin list
*
* RETURN: Length of the interrupt data list
*
@@ -248,7 +260,8 @@ RsGetBufferDataLength (
static UINT16
RsGetInterruptDataLength (
- ACPI_PARSE_OBJECT *InitializerOp)
+ ACPI_PARSE_OBJECT *InitializerOp,
+ UINT32 StartIndex)
{
UINT16 InterruptLength;
UINT32 i;
@@ -261,9 +274,9 @@ RsGetInterruptDataLength (
{
InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
- /* Interrupt list starts at offset 10 (Gpio descriptors) */
+ /* Interrupt list starts at offset StartIndex (Gpio descriptors) */
- if (i >= 10)
+ if (i >= StartIndex)
{
InterruptLength += 2;
}
@@ -373,6 +386,43 @@ RsGetVendorData (
/*******************************************************************************
*
+ * FUNCTION: RsGetStringDataLengthAt
+ *
+ * PARAMETERS: InitializerOp - Start of a subtree of init nodes
+ * StartIndex - Starting index of the string node
+ *
+ * RETURN: Valid string length if a string node is found at given
+ * StartIndex or 0 otherwise.
+ *
+ * DESCRIPTION: In a list of peer nodes, find the first one at given index
+ * that contains a string and return length.
+ *
+ ******************************************************************************/
+
+static UINT16
+RsGetStringDataLengthAt (
+ ACPI_PARSE_OBJECT *InitializerOp,
+ UINT32 StartIndex)
+{
+ UINT32 i;
+
+ for (i = 0; InitializerOp; i++)
+ {
+ if (i == StartIndex &&
+ InitializerOp->Asl.ParseOpcode == PARSEOP_STRING_LITERAL)
+ {
+ return ((UINT16) (strlen (InitializerOp->Asl.Value.String) + 1));
+ }
+
+ InitializerOp = ASL_GET_PEER_NODE (InitializerOp);
+ }
+
+ return (0);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: RsDoGpioIntDescriptor
*
* PARAMETERS: Info - Parse Op and resource template offset
@@ -414,7 +464,7 @@ RsDoGpioIntDescriptor (
*/
ResSourceLength = RsGetStringDataLength (InitializerOp);
VendorLength = RsGetBufferDataLength (InitializerOp);
- InterruptLength = RsGetInterruptDataLength (InitializerOp);
+ InterruptLength = RsGetInterruptDataLength (InitializerOp, 10);
DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
ResSourceLength + VendorLength + InterruptLength;
@@ -623,7 +673,7 @@ RsDoGpioIoDescriptor (
*/
ResSourceLength = RsGetStringDataLength (InitializerOp);
VendorLength = RsGetBufferDataLength (InitializerOp);
- InterruptLength = RsGetInterruptDataLength (InitializerOp);
+ InterruptLength = RsGetInterruptDataLength (InitializerOp, 10);
PinList = InterruptList;
DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
@@ -1336,3 +1386,858 @@ RsDoUartSerialBusDescriptor (
MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: RsDoPinFunctionDescriptor
+ *
+ * PARAMETERS: Info - Parse Op and resource template offset
+ *
+ * RETURN: Completed resource node
+ *
+ * DESCRIPTION: Construct a long "PinFunction" descriptor
+ *
+ ******************************************************************************/
+
+ASL_RESOURCE_NODE *
+RsDoPinFunctionDescriptor (
+ ASL_RESOURCE_INFO *Info)
+{
+ AML_RESOURCE *Descriptor;
+ ACPI_PARSE_OBJECT *InitializerOp;
+ ASL_RESOURCE_NODE *Rnode;
+ char *ResourceSource = NULL;
+ UINT8 *VendorData = NULL;
+ UINT16 *PinList = NULL;
+ UINT16 ResSourceLength;
+ UINT16 VendorLength;
+ UINT16 PinListLength;
+ UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
+ UINT32 i;
+
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
+
+ /*
+ * Calculate lengths for fields that have variable length:
+ * 1) Resource Source string
+ * 2) Vendor Data buffer
+ * 3) PIN (interrupt) list
+ */
+ ResSourceLength = RsGetStringDataLength (InitializerOp);
+ VendorLength = RsGetBufferDataLength (InitializerOp);
+ PinListLength = RsGetInterruptDataLength (InitializerOp, 8);
+
+ DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_FUNCTION) +
+ ResSourceLength + VendorLength + PinListLength;
+
+ /* Allocate the local resource node and initialize */
+
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
+
+ Descriptor = Rnode->Buffer;
+ Descriptor->PinFunction.ResourceLength = DescriptorSize;
+ Descriptor->PinFunction.DescriptorType = ACPI_RESOURCE_NAME_PIN_FUNCTION;
+ Descriptor->PinFunction.RevisionId = AML_RESOURCE_PIN_FUNCTION_REVISION;
+
+ /* Build pointers to optional areas */
+
+ PinList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_PIN_FUNCTION));
+ ResourceSource = ACPI_ADD_PTR (char, PinList, PinListLength);
+ VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
+
+ /* Setup offsets within the descriptor */
+
+ Descriptor->PinFunction.PinTableOffset = (UINT16)
+ ACPI_PTR_DIFF (PinList, Descriptor);
+
+ Descriptor->PinFunction.ResSourceOffset = (UINT16)
+ ACPI_PTR_DIFF (ResourceSource, Descriptor);
+
+ /* Process all child initialization nodes */
+
+ for (i = 0; InitializerOp; i++)
+ {
+ switch (i)
+ {
+ case 0: /* Share Type [Flags] (_SHR) */
+
+ RsSetFlagBits16 (&Descriptor->PinFunction.Flags, InitializerOp, 0, 0);
+ RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.Flags), 0);
+ break;
+
+ case 1: /* Pin Config [BYTE] (_PPI) */
+
+ Descriptor->PinFunction.PinConfig = (UINT8) InitializerOp->Asl.Value.Integer;
+ RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.PinConfig));
+ break;
+
+ case 2: /* Function Number [WORD] (_FUN) */
+
+ Descriptor->PinFunction.FunctionNumber = (UINT16) InitializerOp->Asl.Value.Integer;
+ RsCreateDwordField (InitializerOp, ACPI_RESTAG_FUNCTION,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.FunctionNumber));
+ break;
+
+ case 3: /* ResSource [Optional Field - STRING] */
+
+ if (ResSourceLength)
+ {
+ /* Copy string to the descriptor */
+
+ strcpy (ResourceSource, InitializerOp->Asl.Value.String);
+ }
+ break;
+
+ case 4: /* Resource Index */
+
+ if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
+ {
+ Descriptor->PinFunction.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ }
+ break;
+
+ case 5: /* Resource Usage (consumer/producer) */
+
+ /* Assumed to be consumer */
+
+ break;
+
+ case 6: /* Resource Tag (Descriptor Name) */
+
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
+ break;
+
+ case 7: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+ /*
+ * Always set the VendorOffset even if there is no Vendor Data.
+ * This field is required in order to calculate the length
+ * of the ResourceSource at runtime.
+ */
+ Descriptor->PinFunction.VendorOffset = (UINT16)
+ ACPI_PTR_DIFF (VendorData, Descriptor);
+
+ if (RsGetVendorData (InitializerOp, VendorData,
+ (CurrentByteOffset + Descriptor->PinFunction.VendorOffset)))
+ {
+ Descriptor->PinFunction.VendorLength = VendorLength;
+ }
+ break;
+
+ default:
+ /*
+ * PINs come through here, repeatedly. Each PIN must be a WORD.
+ * NOTE: there is no "length" field for this, so from ACPI spec:
+ * The number of pins in the table can be calculated from:
+ * PinCount = (Resource Source Name Offset - Pin Table Offset) / 2
+ * (implies resource source must immediately follow the pin list.)
+ * Name: _PIN
+ */
+ *PinList = (UINT16) InitializerOp->Asl.Value.Integer;
+ PinList++;
+ PinCount++;
+
+ /* Case 8: First pin number in list */
+
+ if (i == 8)
+ {
+ if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
+ {
+ /* Must be at least one interrupt */
+
+ AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN,
+ InitializerOp, NULL);
+ }
+
+ /* Check now for duplicates in list */
+
+ RsCheckListForDuplicates (InitializerOp);
+
+ /* Create a named field at the start of the list */
+
+ RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN,
+ CurrentByteOffset + Descriptor->PinFunction.PinTableOffset);
+ }
+ break;
+ }
+
+ InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+ }
+
+ return (Rnode);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: RsDoPinConfigDescriptor
+ *
+ * PARAMETERS: Info - Parse Op and resource template offset
+ *
+ * RETURN: Completed resource node
+ *
+ * DESCRIPTION: Construct a long "PinConfig" descriptor
+ *
+ ******************************************************************************/
+
+ASL_RESOURCE_NODE *
+RsDoPinConfigDescriptor (
+ ASL_RESOURCE_INFO *Info)
+{
+ AML_RESOURCE *Descriptor;
+ ACPI_PARSE_OBJECT *InitializerOp;
+ ASL_RESOURCE_NODE *Rnode;
+ char *ResourceSource = NULL;
+ UINT8 *VendorData = NULL;
+ UINT16 *PinList = NULL;
+ UINT16 ResSourceLength;
+ UINT16 VendorLength;
+ UINT16 PinListLength;
+ UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
+ UINT32 i;
+
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
+
+ /*
+ * Calculate lengths for fields that have variable length:
+ * 1) Resource Source string
+ * 2) Vendor Data buffer
+ * 3) PIN (interrupt) list
+ */
+ ResSourceLength = RsGetStringDataLength (InitializerOp);
+ VendorLength = RsGetBufferDataLength (InitializerOp);
+ PinListLength = RsGetInterruptDataLength (InitializerOp, 8);
+
+ DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_CONFIG) +
+ ResSourceLength + VendorLength + PinListLength;
+
+ /* Allocate the local resource node and initialize */
+
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
+
+ Descriptor = Rnode->Buffer;
+ Descriptor->PinConfig.ResourceLength = DescriptorSize;
+ Descriptor->PinConfig.DescriptorType = ACPI_RESOURCE_NAME_PIN_CONFIG;
+ Descriptor->PinConfig.RevisionId = AML_RESOURCE_PIN_CONFIG_REVISION;
+
+ /* Build pointers to optional areas */
+
+ PinList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_PIN_CONFIG));
+ ResourceSource = ACPI_ADD_PTR (char, PinList, PinListLength);
+ VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
+
+ /* Setup offsets within the descriptor */
+
+ Descriptor->PinConfig.PinTableOffset = (UINT16)
+ ACPI_PTR_DIFF (PinList, Descriptor);
+
+ Descriptor->PinConfig.ResSourceOffset = (UINT16)
+ ACPI_PTR_DIFF (ResourceSource, Descriptor);
+
+ /* Process all child initialization nodes */
+
+ for (i = 0; InitializerOp; i++)
+ {
+ BOOLEAN isValid;
+
+ switch (i)
+ {
+ case 0: /* Share Type [Flags] (_SHR) */
+
+ RsSetFlagBits16 (&Descriptor->PinConfig.Flags, InitializerOp, 0, 0);
+ RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.Flags), 0);
+ break;
+
+ case 1: /* Pin Config Type [BYTE] (_TYP) */
+
+ isValid = InitializerOp->Asl.Value.Integer <= 0x0d;
+ if (!isValid)
+ {
+ isValid = InitializerOp->Asl.Value.Integer >= 0x80 &&
+ InitializerOp->Asl.Value.Integer <= 0xff;
+ }
+ if (!isValid)
+ {
+ AslError (ASL_ERROR, ASL_MSG_RANGE, InitializerOp, NULL);
+ }
+
+ Descriptor->PinConfig.PinConfigType = (UINT8) InitializerOp->Asl.Value.Integer;
+ RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG_TYPE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.PinConfigType));
+
+ break;
+
+ case 2: /* Pin Config Value [DWORD] (_VAL) */
+
+ Descriptor->PinConfig.PinConfigValue = (UINT32) InitializerOp->Asl.Value.Integer;
+ RsCreateDwordField (InitializerOp, ACPI_RESTAG_PINCONFIG_VALUE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.PinConfigValue));
+ break;
+
+ case 3: /* ResSource [Optional Field - STRING] */
+
+ if (ResSourceLength)
+ {
+ /* Copy string to the descriptor */
+
+ strcpy (ResourceSource, InitializerOp->Asl.Value.String);
+ }
+ break;
+
+ case 4: /* Resource Index */
+
+ if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
+ {
+ Descriptor->PinConfig.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ }
+ break;
+
+ case 5: /* Resource Usage (consumer/producer) */
+
+ RsSetFlagBits16 (&Descriptor->PinConfig.Flags, InitializerOp, 1, 1);
+
+ break;
+
+ case 6: /* Resource Tag (Descriptor Name) */
+
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
+ break;
+
+ case 7: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+ /*
+ * Always set the VendorOffset even if there is no Vendor Data.
+ * This field is required in order to calculate the length
+ * of the ResourceSource at runtime.
+ */
+ Descriptor->PinConfig.VendorOffset = (UINT16)
+ ACPI_PTR_DIFF (VendorData, Descriptor);
+
+ if (RsGetVendorData (InitializerOp, VendorData,
+ (CurrentByteOffset + Descriptor->PinConfig.VendorOffset)))
+ {
+ Descriptor->PinConfig.VendorLength = VendorLength;
+ }
+ break;
+
+ default:
+ /*
+ * PINs come through here, repeatedly. Each PIN must be a WORD.
+ * NOTE: there is no "length" field for this, so from ACPI spec:
+ * The number of pins in the table can be calculated from:
+ * PinCount = (Resource Source Name Offset - Pin Table Offset) / 2
+ * (implies resource source must immediately follow the pin list.)
+ * Name: _PIN
+ */
+ *PinList = (UINT16) InitializerOp->Asl.Value.Integer;
+ PinList++;
+ PinCount++;
+
+ /* Case 8: First pin number in list */
+
+ if (i == 8)
+ {
+ if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
+ {
+ /* Must be at least one interrupt */
+
+ AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN,
+ InitializerOp, NULL);
+ }
+
+ /* Check now for duplicates in list */
+
+ RsCheckListForDuplicates (InitializerOp);
+
+ /* Create a named field at the start of the list */
+
+ RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN,
+ CurrentByteOffset + Descriptor->PinConfig.PinTableOffset);
+ }
+ break;
+ }
+
+ InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+ }
+
+ return (Rnode);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: RsDoPinGroupDescriptor
+ *
+ * PARAMETERS: Info - Parse Op and resource template offset
+ *
+ * RETURN: Completed resource node
+ *
+ * DESCRIPTION: Construct a long "PinGroup" descriptor
+ *
+ ******************************************************************************/
+
+ASL_RESOURCE_NODE *
+RsDoPinGroupDescriptor (
+ ASL_RESOURCE_INFO *Info)
+{
+ AML_RESOURCE *Descriptor;
+ ACPI_PARSE_OBJECT *InitializerOp;
+ ASL_RESOURCE_NODE *Rnode;
+ UINT8 *VendorData = NULL;
+ UINT16 *PinList = NULL;
+ char *Label = NULL;
+ UINT16 LabelLength;
+ UINT16 VendorLength;
+ UINT16 PinListLength;
+ UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
+ UINT32 i;
+
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
+
+ /*
+ * Calculate lengths for fields that have variable length:
+ * 1) Label
+ * 2) Vendor Data buffer
+ * 3) PIN (interrupt) list
+ */
+ LabelLength = RsGetStringDataLength (InitializerOp);
+ VendorLength = RsGetBufferDataLength (InitializerOp);
+ PinListLength = RsGetInterruptDataLength (InitializerOp, 4);
+
+ DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP) +
+ LabelLength + VendorLength + PinListLength;
+
+ /* Allocate the local resource node and initialize */
+
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
+
+ Descriptor = Rnode->Buffer;
+ Descriptor->PinGroup.ResourceLength = DescriptorSize;
+ Descriptor->PinGroup.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP;
+ Descriptor->PinGroup.RevisionId = AML_RESOURCE_PIN_GROUP_REVISION;
+
+ /* Build pointers to optional areas */
+
+ PinList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_PIN_GROUP));
+ Label = ACPI_ADD_PTR (char, PinList, PinListLength);
+ VendorData = ACPI_ADD_PTR (UINT8, Label, LabelLength);
+
+ /* Setup offsets within the descriptor */
+
+ Descriptor->PinGroup.PinTableOffset = (UINT16) ACPI_PTR_DIFF (PinList, Descriptor);
+ Descriptor->PinGroup.LabelOffset = (UINT16) ACPI_PTR_DIFF (Label, Descriptor);
+
+ /* Process all child initialization nodes */
+
+ for (i = 0; InitializerOp; i++)
+ {
+ switch (i)
+ {
+ case 0: /* Resource Label */
+
+ if (LabelLength < 2)
+ {
+ AslError(ASL_WARNING, ASL_MSG_NULL_STRING, InitializerOp, NULL);
+ }
+ strcpy (Label, InitializerOp->Asl.Value.String);
+
+ break;
+
+ case 1: /* Resource Usage (consumer/producer) */
+
+ RsSetFlagBits16 (&Descriptor->PinGroup.Flags, InitializerOp, 0, 0);
+
+ break;
+
+ case 2: /* Resource Tag (Descriptor Name) */
+
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
+ break;
+
+ case 3: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+ /*
+ * Always set the VendorOffset even if there is no Vendor Data.
+ * This field is required in order to calculate the length
+ * of the ResourceSource at runtime.
+ */
+ Descriptor->PinGroup.VendorOffset = (UINT16)
+ ACPI_PTR_DIFF (VendorData, Descriptor);
+
+ if (RsGetVendorData (InitializerOp, VendorData,
+ (CurrentByteOffset + Descriptor->PinGroup.VendorOffset)))
+ {
+ Descriptor->PinGroup.VendorLength = VendorLength;
+ }
+ break;
+
+ default:
+ /*
+ * PINs come through here, repeatedly. Each PIN must be a WORD.
+ * NOTE: there is no "length" field for this, so from ACPI spec:
+ * The number of pins in the table can be calculated from:
+ * PinCount = (Resource Source Name Offset - Pin Table Offset) / 2
+ * (implies resource source must immediately follow the pin list.)
+ * Name: _PIN
+ */
+ *PinList = (UINT16) InitializerOp->Asl.Value.Integer;
+ PinList++;
+ PinCount++;
+
+ /* Case 3: First pin number in list */
+
+ if (i == 4)
+ {
+ if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
+ {
+ /* Must be at least one interrupt */
+
+ AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN,
+ InitializerOp, NULL);
+ }
+
+ /* Check now for duplicates in list */
+
+ RsCheckListForDuplicates (InitializerOp);
+
+ /* Create a named field at the start of the list */
+
+ RsCreateWordField (InitializerOp, ACPI_RESTAG_PIN,
+ CurrentByteOffset + Descriptor->PinGroup.PinTableOffset);
+ }
+ break;
+ }
+
+ InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+ }
+
+ return (Rnode);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: RsDoPinGroupFunctionDescriptor
+ *
+ * PARAMETERS: Info - Parse Op and resource template offset
+ *
+ * RETURN: Completed resource node
+ *
+ * DESCRIPTION: Construct a long "PinGroupFunction" descriptor
+ *
+ ******************************************************************************/
+
+ASL_RESOURCE_NODE *
+RsDoPinGroupFunctionDescriptor (
+ ASL_RESOURCE_INFO *Info)
+{
+ AML_RESOURCE *Descriptor;
+ ACPI_PARSE_OBJECT *InitializerOp;
+ ASL_RESOURCE_NODE *Rnode;
+ char *ResourceSource = NULL;
+ char *ResourceSourceLabel = NULL;
+ UINT8 *VendorData = NULL;
+ UINT16 ResSourceLength;
+ UINT16 ResSourceLabelLength;
+ UINT16 VendorLength;
+ UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 i;
+
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
+
+ /*
+ * Calculate lengths for fields that have variable length:
+ * 1) Resource Source string
+ * 2) Resource Source Label string
+ * 3) Vendor Data buffer
+ */
+ ResSourceLength = RsGetStringDataLengthAt (InitializerOp, 2);
+ ResSourceLabelLength = RsGetStringDataLengthAt (InitializerOp, 4);
+ VendorLength = RsGetBufferDataLength (InitializerOp);
+
+ DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_FUNCTION) +
+ ResSourceLength + ResSourceLabelLength + VendorLength;
+
+ /* Allocate the local resource node and initialize */
+
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
+
+ Descriptor = Rnode->Buffer;
+ Descriptor->PinGroupFunction.ResourceLength = DescriptorSize;
+ Descriptor->PinGroupFunction.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION;
+ Descriptor->PinGroupFunction.RevisionId = AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION;
+
+ /* Build pointers to optional areas */
+
+ ResourceSource = ACPI_ADD_PTR (char, Descriptor, sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION));
+ ResourceSourceLabel = ACPI_ADD_PTR (char, ResourceSource, ResSourceLength);
+ VendorData = ACPI_ADD_PTR (UINT8, ResourceSourceLabel, ResSourceLabelLength);
+
+ /* Setup offsets within the descriptor */
+
+ Descriptor->PinGroupFunction.ResSourceOffset = (UINT16)
+ ACPI_PTR_DIFF (ResourceSource, Descriptor);
+ Descriptor->PinGroupFunction.ResSourceLabelOffset = (UINT16)
+ ACPI_PTR_DIFF (ResourceSourceLabel, Descriptor);
+
+ /* Process all child initialization nodes */
+
+ for (i = 0; InitializerOp; i++)
+ {
+ switch (i)
+ {
+ case 0: /* Share Type [Flags] (_SHR) */
+
+ RsSetFlagBits16 (&Descriptor->PinGroupFunction.Flags, InitializerOp, 0, 0);
+ RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupFunction.Flags), 0);
+ break;
+
+ case 1: /* Function Number [WORD] */
+
+ Descriptor->PinGroupFunction.FunctionNumber = (UINT16) InitializerOp->Asl.Value.Integer;
+ RsCreateDwordField (InitializerOp, ACPI_RESTAG_FUNCTION,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupFunction.FunctionNumber));
+ break;
+
+ case 2: /* ResourceSource [STRING] */
+
+ strcpy (ResourceSource, InitializerOp->Asl.Value.String);
+ break;
+
+ case 3: /* Resource Index */
+
+ Descriptor->PinGroupFunction.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ break;
+
+ case 4: /* ResourceSourceLabel [STRING] */
+
+ if (ResSourceLabelLength < 2)
+ {
+ AslError(ASL_WARNING, ASL_MSG_NULL_STRING, InitializerOp, NULL);
+ }
+
+ strcpy (ResourceSourceLabel, InitializerOp->Asl.Value.String);
+ break;
+
+ case 5: /* Resource Usage (consumer/producer) */
+
+ RsSetFlagBits16 (&Descriptor->PinGroupFunction.Flags, InitializerOp, 1, 1);
+
+ break;
+
+ case 6: /* Resource Tag (Descriptor Name) */
+
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
+ break;
+
+ case 7: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+ /*
+ * Always set the VendorOffset even if there is no Vendor Data.
+ * This field is required in order to calculate the length
+ * of the ResourceSource at runtime.
+ */
+ Descriptor->PinGroupFunction.VendorOffset = (UINT16)
+ ACPI_PTR_DIFF (VendorData, Descriptor);
+
+ if (RsGetVendorData (InitializerOp, VendorData,
+ (CurrentByteOffset + Descriptor->PinGroupFunction.VendorOffset)))
+ {
+ Descriptor->PinGroupFunction.VendorLength = VendorLength;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+ }
+
+ return (Rnode);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: RsDoPinGroupConfigDescriptor
+ *
+ * PARAMETERS: Info - Parse Op and resource template offset
+ *
+ * RETURN: Completed resource node
+ *
+ * DESCRIPTION: Construct a long "PinGroupConfig" descriptor
+ *
+ ******************************************************************************/
+
+ASL_RESOURCE_NODE *
+RsDoPinGroupConfigDescriptor (
+ ASL_RESOURCE_INFO *Info)
+{
+ AML_RESOURCE *Descriptor;
+ ACPI_PARSE_OBJECT *InitializerOp;
+ ASL_RESOURCE_NODE *Rnode;
+ char *ResourceSource = NULL;
+ char *ResourceSourceLabel = NULL;
+ UINT8 *VendorData = NULL;
+ UINT16 ResSourceLength;
+ UINT16 ResSourceLabelLength;
+ UINT16 VendorLength;
+ UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 i;
+
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
+
+ /*
+ * Calculate lengths for fields that have variable length:
+ * 1) Resource Source string
+ * 2) Resource Source Label string
+ * 3) Vendor Data buffer
+ */
+ ResSourceLength = RsGetStringDataLengthAt (InitializerOp, 3);
+ ResSourceLabelLength = RsGetStringDataLengthAt (InitializerOp, 5);
+ VendorLength = RsGetBufferDataLength (InitializerOp);
+
+ DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_CONFIG) +
+ ResSourceLength + ResSourceLabelLength + VendorLength;
+
+ /* Allocate the local resource node and initialize */
+
+ Rnode = RsAllocateResourceNode (DescriptorSize +
+ sizeof (AML_RESOURCE_LARGE_HEADER));
+
+ Descriptor = Rnode->Buffer;
+ Descriptor->PinGroupConfig.ResourceLength = DescriptorSize;
+ Descriptor->PinGroupConfig.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG;
+ Descriptor->PinGroupConfig.RevisionId = AML_RESOURCE_PIN_GROUP_CONFIG_REVISION;
+
+ /* Build pointers to optional areas */
+
+ ResourceSource = ACPI_ADD_PTR (char, Descriptor, sizeof (AML_RESOURCE_PIN_GROUP_CONFIG));
+ ResourceSourceLabel = ACPI_ADD_PTR (char, ResourceSource, ResSourceLength);
+ VendorData = ACPI_ADD_PTR (UINT8, ResourceSourceLabel, ResSourceLabelLength);
+
+ /* Setup offsets within the descriptor */
+
+ Descriptor->PinGroupConfig.ResSourceOffset = (UINT16)
+ ACPI_PTR_DIFF (ResourceSource, Descriptor);
+ Descriptor->PinGroupConfig.ResSourceLabelOffset = (UINT16)
+ ACPI_PTR_DIFF (ResourceSourceLabel, Descriptor);
+
+ /* Process all child initialization nodes */
+
+ for (i = 0; InitializerOp; i++)
+ {
+ BOOLEAN isValid;
+
+ switch (i)
+ {
+ case 0: /* Share Type [Flags] (_SHR) */
+
+ RsSetFlagBits16 (&Descriptor->PinGroupConfig.Flags, InitializerOp, 0, 0);
+ RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.Flags), 0);
+ break;
+
+ case 1: /* Pin Config Type [BYTE] (_TYP) */
+
+ isValid = InitializerOp->Asl.Value.Integer <= 0x0d;
+ if (!isValid)
+ {
+ isValid = InitializerOp->Asl.Value.Integer >= 0x80 &&
+ InitializerOp->Asl.Value.Integer <= 0xff;
+ }
+ if (!isValid)
+ {
+ AslError (ASL_ERROR, ASL_MSG_RANGE, InitializerOp, NULL);
+ }
+
+ Descriptor->PinGroupConfig.PinConfigType = (UINT8) InitializerOp->Asl.Value.Integer;
+ RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG_TYPE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.PinConfigType));
+
+ break;
+
+ case 2: /* Pin Config Value [DWORD] (_VAL) */
+
+ Descriptor->PinGroupConfig.PinConfigValue = (UINT32) InitializerOp->Asl.Value.Integer;
+ RsCreateDwordField (InitializerOp, ACPI_RESTAG_PINCONFIG_VALUE,
+ CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.PinConfigValue));
+ break;
+
+ case 3: /* ResourceSource [STRING] */
+
+ /* Copy string to the descriptor */
+
+ strcpy (ResourceSource, InitializerOp->Asl.Value.String);
+ break;
+
+ case 4: /* Resource Index */
+
+ Descriptor->PinGroupConfig.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer;
+ break;
+
+ case 5: /* ResourceSourceLabel [STRING] */
+
+ if (ResSourceLabelLength < 2)
+ {
+ AslError(ASL_WARNING, ASL_MSG_NULL_STRING, InitializerOp, NULL);
+ }
+
+ strcpy (ResourceSourceLabel, InitializerOp->Asl.Value.String);
+ break;
+
+ case 6: /* Resource Usage (consumer/producer) */
+
+ RsSetFlagBits16 (&Descriptor->PinGroupConfig.Flags, InitializerOp, 1, 1);
+
+ break;
+
+ case 7: /* Resource Tag (Descriptor Name) */
+
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
+ break;
+
+ case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
+ /*
+ * Always set the VendorOffset even if there is no Vendor Data.
+ * This field is required in order to calculate the length
+ * of the ResourceSource at runtime.
+ */
+ Descriptor->PinGroupConfig.VendorOffset = (UINT16)
+ ACPI_PTR_DIFF (VendorData, Descriptor);
+
+ if (RsGetVendorData (InitializerOp, VendorData,
+ (CurrentByteOffset + Descriptor->PinGroupConfig.VendorOffset)))
+ {
+ Descriptor->PinGroupConfig.VendorLength = VendorLength;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
+ }
+
+ return (Rnode);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslrules.y b/sys/contrib/dev/acpica/compiler/aslrules.y
index ae4d371..f26ea87 100644
--- a/sys/contrib/dev/acpica/compiler/aslrules.y
+++ b/sys/contrib/dev/acpica/compiler/aslrules.y
@@ -165,8 +165,8 @@ NoEcho('
* to handle output from preprocessors
*/
AslCode
- : DefinitionBlockList {$<n>$ = TrLinkChildren (
- TrCreateLeafNode (PARSEOP_ASL_CODE),1, $1);}
+ : DefinitionBlockList {$<n>$ = TrLinkOpChildren (
+ TrCreateLeafOp (PARSEOP_ASL_CODE),1, $1);}
| error {YYABORT; $$ = NULL;}
;
@@ -192,22 +192,22 @@ AslCode
*/
DefinitionBlockTerm
: PARSEOP_DEFINITION_BLOCK
- PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITION_BLOCK); COMMENT_CAPTURE_OFF;}
+ PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_DEFINITION_BLOCK); COMMENT_CAPTURE_OFF;}
String ','
String ','
ByteConst ','
String ','
String ','
DWordConst
- PARSEOP_CLOSE_PAREN {TrSetEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;}
- '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,
+ PARSEOP_CLOSE_PAREN {TrSetOpEndLineNumber ($<n>3); COMMENT_CAPTURE_ON;}
+ '{' TermList '}' {$$ = TrLinkOpChildren ($<n>3,7,
$4,$6,$8,$10,$12,$14,$18);}
;
DefinitionBlockList
: DefinitionBlockTerm
| DefinitionBlockTerm
- DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);}
+ DefinitionBlockList {$$ = TrLinkPeerOps (2, $1,$2);}
;
@@ -217,21 +217,21 @@ DefinitionBlockList
NameString
: NameSeg {}
- | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);}
- | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");}
- | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");}
- | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");}
- | PARSEOP_FOR {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");}
+ | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);}
+ | PARSEOP_IO {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");}
+ | PARSEOP_DMA {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");}
+ | PARSEOP_IRQ {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");}
+ | PARSEOP_FOR {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");}
;
/*
NameSeg
- : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT)
+ : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESEG, (ACPI_NATIVE_INT)
TrNormalizeNameSeg ($1));}
;
*/
NameSeg
- : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
+ : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafOp (PARSEOP_NAMESEG,
(ACPI_NATIVE_INT) AslCompilerlval.s);}
;
@@ -242,8 +242,8 @@ Term
: Object {}
| Type1Opcode {}
| Type2Opcode {}
- | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
- | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
+ | Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
| Type2BufferOpcode {}
| Type2BufferOrStringOpcode {}
| error {$$ = AslDoError(); yyclearin;}
@@ -256,47 +256,45 @@ SuperName
;
Target
- : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
- | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
- | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
+ : {$$ = TrCreateNullTargetOp ();} /* Placeholder is a ZeroOp object */
+ | ',' {$$ = TrCreateNullTargetOp ();} /* Placeholder is a ZeroOp object */
+ | ',' SuperName {$$ = TrSetOpFlags ($2, OP_IS_TARGET);}
;
RequiredTarget
- : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
+ : ',' SuperName {$$ = TrSetOpFlags ($2, OP_IS_TARGET);}
;
TermArg
- : SimpleName {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
- | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
- | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
-/*
+ : SimpleName {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
+ | Type2Opcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
+ | DataObject {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
| PARSEOP_OPEN_PAREN
TermArg
- PARSEOP_CLOSE_PAREN {}
-*/
+ PARSEOP_CLOSE_PAREN {$$ = TrSetOpFlags ($2, OP_IS_TERM_ARG);}
;
/*
NOTE: Removed from TermArg due to reduce/reduce conflicts:
- | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
- | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
- | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
- | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
+ | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
+ | Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
+ | Type2BufferOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
+ | Type2BufferOrStringOpcode {$$ = TrSetOpFlags ($1, OP_IS_TERM_ARG);}
*/
MethodInvocationTerm
: NameString
- PARSEOP_OPEN_PAREN {TrUpdateNode (PARSEOP_METHODCALL, $1); COMMENT_CAPTURE_OFF;}
+ PARSEOP_OPEN_PAREN {TrSetOpIntegerValue (PARSEOP_METHODCALL, $1); COMMENT_CAPTURE_OFF;}
ArgList
- PARSEOP_CLOSE_PAREN {$$ = TrLinkChildNode ($1,$4); COMMENT_CAPTURE_ON;}
+ PARSEOP_CLOSE_PAREN {$$ = TrLinkChildOp ($1,$4); COMMENT_CAPTURE_ON;}
;
/* OptionalCount must appear before ByteList or an incorrect reduction will result */
OptionalCount
- : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
- | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
+ : {$$ = TrCreateLeafOp (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
+ | ',' {$$ = TrCreateLeafOp (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
| ',' TermArg {$$ = $2;}
;
@@ -336,14 +334,14 @@ OptionalDataCount
TermList
: {$$ = NULL;}
- | TermList Term {$$ = TrLinkPeerNode (
- TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
- | TermList Term ';' {$$ = TrLinkPeerNode (
- TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
- | TermList ';' Term {$$ = TrLinkPeerNode (
- TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
- | TermList ';' Term ';' {$$ = TrLinkPeerNode (
- TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
+ | TermList Term {$$ = TrLinkPeerOp (
+ TrSetOpFlags ($1, OP_RESULT_NOT_USED),$2);}
+ | TermList Term ';' {$$ = TrLinkPeerOp (
+ TrSetOpFlags ($1, OP_RESULT_NOT_USED),$2);}
+ | TermList ';' Term {$$ = TrLinkPeerOp (
+ TrSetOpFlags ($1, OP_RESULT_NOT_USED),$3);}
+ | TermList ';' Term ';' {$$ = TrLinkPeerOp (
+ TrSetOpFlags ($1, OP_RESULT_NOT_USED),$3);}
;
ArgList
@@ -351,7 +349,7 @@ ArgList
| TermArg
| ArgList ',' /* Allows a trailing comma at list end */
| ArgList ','
- TermArg {$$ = TrLinkPeerNode ($1,$3);}
+ TermArg {$$ = TrLinkPeerOp ($1,$3);}
;
ByteList
@@ -359,7 +357,7 @@ ByteList
| ByteConstExpr
| ByteList ',' /* Allows a trailing comma at list end */
| ByteList ','
- ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);}
+ ByteConstExpr {$$ = TrLinkPeerOp ($1,$3);}
;
DWordList
@@ -367,7 +365,7 @@ DWordList
| DWordConstExpr
| DWordList ',' /* Allows a trailing comma at list end */
| DWordList ','
- DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);}
+ DWordConstExpr {$$ = TrLinkPeerOp ($1,$3);}
;
FieldUnitList
@@ -375,7 +373,7 @@ FieldUnitList
| FieldUnit
| FieldUnitList ',' /* Allows a trailing comma at list end */
| FieldUnitList ','
- FieldUnit {$$ = TrLinkPeerNode ($1,$3);}
+ FieldUnit {$$ = TrLinkPeerOp ($1,$3);}
;
FieldUnit
@@ -386,16 +384,16 @@ FieldUnit
;
FieldUnitEntry
- : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);}
+ : ',' AmlPackageLengthTerm {$$ = TrCreateOp (PARSEOP_RESERVED_BYTES,1,$2);}
| NameSeg ','
- AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);}
+ AmlPackageLengthTerm {$$ = TrLinkChildOp ($1,$3);}
;
Object
: CompilerDirective {}
| NamedObject {}
| NameSpaceModifier {}
-// | StructureTerm {}
+/* | StructureTerm {} */
;
PackageList
@@ -403,7 +401,7 @@ PackageList
| PackageElement
| PackageList ',' /* Allows a trailing comma at list end */
| PackageList ','
- PackageElement {$$ = TrLinkPeerNode ($1,$3);}
+ PackageElement {$$ = TrLinkPeerOp ($1,$3);}
;
PackageElement
@@ -417,7 +415,7 @@ ParameterTypePackage
: {$$ = NULL;}
| ObjectTypeKeyword {$$ = $1;}
| ParameterTypePackage ','
- ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);}
+ ObjectTypeKeyword {$$ = TrLinkPeerOps (2,$1,$3);}
;
ParameterTypePackageList
@@ -427,9 +425,9 @@ ParameterTypePackageList
;
OptionalParameterTypePackage
- : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
- | ',' ParameterTypePackageList {$$ = TrLinkChildren (
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
+ : {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);}
+ | ',' ParameterTypePackageList {$$ = TrLinkOpChildren (
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),1,$2);}
;
/* Rules for specifying the types for method arguments */
@@ -437,7 +435,7 @@ OptionalParameterTypePackage
ParameterTypesPackage
: ParameterTypePackageList {$$ = $1;}
| ParameterTypesPackage ','
- ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);}
+ ParameterTypePackageList {$$ = TrLinkPeerOps (2,$1,$3);}
;
ParameterTypesPackageList
@@ -447,9 +445,9 @@ ParameterTypesPackageList
;
OptionalParameterTypesPackage
- : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
- | ',' ParameterTypesPackageList {$$ = TrLinkChildren (
- TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
+ : {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);}
+ | ',' ParameterTypesPackageList {$$ = TrLinkOpChildren (
+ TrCreateLeafOp (PARSEOP_DEFAULT_ARG),1,$2);}
;
/*
@@ -460,9 +458,9 @@ CaseDefaultTermList
| CaseTerm {}
| DefaultTerm {}
| CaseDefaultTermList
- CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
+ CaseTerm {$$ = TrLinkPeerOp ($1,$2);}
| CaseDefaultTermList
- DefaultTerm {$$ = TrLinkPeerNode ($1,$2);}
+ DefaultTerm {$$ = TrLinkPeerOp ($1,$2);}
/* Original - attempts to force zero or one default term within the switch */
@@ -471,16 +469,16 @@ CaseDefaultTermList
: {$$ = NULL;}
| CaseTermList
DefaultTerm
- CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));}
+ CaseTermList {$$ = TrLinkPeerOp ($1,TrLinkPeerOp ($2, $3));}
| CaseTermList
- CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
+ CaseTerm {$$ = TrLinkPeerOp ($1,$2);}
;
CaseTermList
: {$$ = NULL;}
| CaseTerm {}
| CaseTermList
- CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
+ CaseTerm {$$ = TrLinkPeerOp ($1,$2);}
;
*/
@@ -499,9 +497,9 @@ DataObject
;
BufferData
- : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
- | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
- | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ : Type5Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
+ | Type2BufferOrStringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
+ | Type2BufferOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
| BufferTerm {}
;
@@ -510,35 +508,35 @@ PackageData
;
IntegerData
- : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
- | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ : Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
+ | Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
| Integer {}
| ConstTerm {}
;
StringData
- : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ : Type2StringOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
| String {}
;
ByteConst
- : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
+ : Integer {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);}
;
WordConst
- : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
+ : Integer {$$ = TrSetOpIntegerValue (PARSEOP_WORDCONST, $1);}
;
DWordConst
- : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
+ : Integer {$$ = TrSetOpIntegerValue (PARSEOP_DWORDCONST, $1);}
;
QWordConst
- : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
+ : Integer {$$ = TrSetOpIntegerValue (PARSEOP_QWORDCONST, $1);}
;
/*
- * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
+ * The OP_COMPILE_TIME_CONST flag in the following constant expressions
* enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
* to simple integers. It is an error if these types of expressions cannot be
* reduced, since the AML grammar for ****ConstExpr requires a simple constant.
@@ -546,63 +544,64 @@ QWordConst
* constant folding code in the node AmlLength field.
*/
ByteConstExpr
- : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 1);}
- | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 1);}
- | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
+ : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 1);}
+ | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 1);}
+ | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);}
| ByteConst {}
;
WordConstExpr
- : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 2);}
- | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 2);}
- | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 2);}
+ | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 2);}
+ | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_WORDCONST, $1);}
| WordConst {}
;
DWordConstExpr
- : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 4);}
- | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 4);}
- | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 4);}
+ | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 4);}
+ | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_DWORDCONST, $1);}
| DWordConst {}
;
QWordConstExpr
- : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 8);}
- | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);
- TrSetNodeAmlLength ($1, 8);}
- | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 8);}
+ | Type2IntegerOpcode {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);
+ TrSetOpAmlLength ($1, 8);}
+ | ConstExprTerm {$$ = TrSetOpIntegerValue (PARSEOP_QWORDCONST, $1);}
| QWordConst {}
;
ConstTerm
: ConstExprTerm {}
- | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);}
+ | PARSEOP_REVISION {$$ = TrCreateLeafOp (PARSEOP_REVISION);}
;
ConstExprTerm
- : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);}
- | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);}
- | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);}
- | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);}
- | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);}
- | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);}
- | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
+ : PARSEOP_ZERO {$$ = TrCreateValuedLeafOp (PARSEOP_ZERO, 0);}
+ | PARSEOP_ONE {$$ = TrCreateValuedLeafOp (PARSEOP_ONE, 1);}
+ | PARSEOP_ONES {$$ = TrCreateValuedLeafOp (PARSEOP_ONES, ACPI_UINT64_MAX);}
+ | PARSEOP___DATE__ {$$ = TrCreateConstantLeafOp (PARSEOP___DATE__);}
+ | PARSEOP___FILE__ {$$ = TrCreateConstantLeafOp (PARSEOP___FILE__);}
+ | PARSEOP___LINE__ {$$ = TrCreateConstantLeafOp (PARSEOP___LINE__);}
+ | PARSEOP___PATH__ {$$ = TrCreateConstantLeafOp (PARSEOP___PATH__);}
+ | PARSEOP___METHOD__ {$$ = TrCreateConstantLeafOp (PARSEOP___METHOD__);}
;
Integer
- : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER,
+ : PARSEOP_INTEGER {$$ = TrCreateValuedLeafOp (PARSEOP_INTEGER,
AslCompilerlval.i);}
;
String
- : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
+ : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL,
(ACPI_NATIVE_INT) AslCompilerlval.s);}
;
@@ -644,7 +643,7 @@ NamedObject
NameSpaceModifier
: AliasTerm {}
| NameTerm {}
-// | NameTermAslPlus {}
+/* | NameTermAslPlus {} */
| ScopeTerm {}
;
@@ -741,7 +740,7 @@ Type2Opcode
* Type 3/4/5 opcodes
*/
Type2IntegerOpcode /* "Type3" opcodes */
- : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ : Expression {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
| AddTerm {}
| AndTerm {}
| DecTerm {}
@@ -751,8 +750,8 @@ Type2IntegerOpcode /* "Type3" opcodes */
| FromBCDTerm {}
| IncTerm {}
| IndexTerm {}
-// | StructureIndexTerm {}
-// | StructurePointerTerm {}
+/* | StructureIndexTerm {} */
+/* | StructurePointerTerm {} */
| LAndTerm {}
| LEqualTerm {}
| LGreaterTerm {}
@@ -790,7 +789,7 @@ Type2BufferOpcode /* "Type5" Opcodes */
;
Type2BufferOrStringOpcode
- : ConcatTerm {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ : ConcatTerm {$$ = TrSetOpFlags ($1, OP_COMPILE_TIME_CONST);}
| PrintfTerm {}
| FprintfTerm {}
| MidTerm {}
@@ -827,8 +826,8 @@ Type6Opcode
| DerefOfTerm {}
| IndexTerm {}
| IndexExpTerm {}
-// | StructureIndexTerm {}
-// | StructurePointerTerm {}
+/* | StructureIndexTerm {} */
+/* | StructurePointerTerm {} */
| MethodInvocationTerm {}
;
@@ -840,7 +839,7 @@ Type6Opcode
******************************************************************************/
AmlPackageLengthTerm
- : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,
+ : Integer {$$ = TrSetOpIntegerValue (PARSEOP_PACKAGE_LENGTH,
(ACPI_PARSE_OBJECT *) $1);}
;
@@ -855,14 +854,14 @@ TermArgItem
;
OptionalReference
- : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
- | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
+ : {$$ = TrCreateLeafOp (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
+ | ',' {$$ = TrCreateLeafOp (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
| ',' TermArg {$$ = $2;}
;
OptionalReturnArg
- : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO),
- NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */
+ : {$$ = TrSetOpFlags (TrCreateLeafOp (PARSEOP_ZERO),
+ OP_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */
| TermArg {$$ = $1;}
;
@@ -873,7 +872,7 @@ OptionalSerializeRuleKeyword
;
OptionalTermArg
- : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
+ : {$$ = TrCreateLeafOp (PARSEOP_DEFAULT_ARG);}
| TermArg {$$ = $1;}
;
diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c
index 48a9824..8ce0375 100644
--- a/sys/contrib/dev/acpica/compiler/aslstartup.c
+++ b/sys/contrib/dev/acpica/compiler/aslstartup.c
@@ -237,7 +237,7 @@ AslInitializeGlobals (
{
Gbl_CommentState.SpacesBefore = 0;
Gbl_CommentState.CommentType = 1;
- Gbl_CommentState.Latest_Parse_Node = NULL;
+ Gbl_CommentState.LatestParseOp = NULL;
Gbl_CommentState.ParsingParenBraceNode = NULL;
Gbl_CommentState.CaptureComments = TRUE;
}
@@ -316,6 +316,11 @@ AslDetectSourceFileType (
Type = ASL_INPUT_TYPE_BINARY_ACPI_TABLE;
goto Cleanup;
}
+ else
+ {
+ fprintf (stderr,
+ "Binary file does not contain a valid ACPI table\n");
+ }
Type = ASL_INPUT_TYPE_BINARY;
@@ -456,7 +461,7 @@ AslDoOneFile (
/*
* AML Disassembly (Optional)
*/
- if (Gbl_DisasmFlag)
+ if (AcpiGbl_DisasmFlag)
{
Status = AslDoDisassembly ();
if (Status != AE_CTRL_CONTINUE)
@@ -581,7 +586,7 @@ AslDoOneFile (
CvDbgPrint ("OUTPUTFILENAME: %s\n", Gbl_OutputFilenamePrefix);
Gbl_Files[ASL_FILE_INPUT].Filename =
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename;
-
+ AcpiGbl_DisasmFlag = TRUE;
fprintf (stderr, "\n");
AslDoDisassembly ();
@@ -601,7 +606,7 @@ AslDoOneFile (
FlCloseFile (ASL_FILE_INPUT);
Gbl_DoCompile = FALSE;
- Gbl_DisasmFlag = TRUE;
+ AcpiGbl_DisasmFlag = TRUE;
Status = AslDoDisassembly ();
return (Status);
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.l b/sys/contrib/dev/acpica/compiler/aslsupport.l
index 1305406..42cee75 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.l
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.l
@@ -697,15 +697,19 @@ AslDoCommentType2 (
AslInsertLineBuffer ('/');
- AslInsertLineBuffer ('*');
if (Gbl_CaptureComments && CurrentState.CaptureComments)
{
+ AslInsertLineBuffer ('*');
*StringBuffer = '/';
++StringBuffer;
*StringBuffer = '*';
++StringBuffer;
}
+ else
+ {
+ AslInsertLineBuffer ('/');
+ }
while (((c = input ()) != '\n') && (c != EOF))
{
@@ -1006,15 +1010,6 @@ CompletedString:
*StringBuffer = 0;
CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
- if (!CleanString)
- {
- AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
- return (FALSE);
- }
-
strcpy (CleanString, MsgBuffer);
AslCompilerlval.s = CleanString;
return (TRUE);
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.y b/sys/contrib/dev/acpica/compiler/aslsupport.y
index 0eefb7b..bcced92 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.y
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.y
@@ -195,7 +195,7 @@ AslDoError (
void)
{
- return (TrCreateLeafNode (PARSEOP_ERRORNODE));
+ return (TrCreateLeafOp (PARSEOP_ERRORNODE));
}
diff --git a/sys/contrib/dev/acpica/compiler/asltokens.y b/sys/contrib/dev/acpica/compiler/asltokens.y
index ba0803f..38c55c1 100644
--- a/sys/contrib/dev/acpica/compiler/asltokens.y
+++ b/sys/contrib/dev/acpica/compiler/asltokens.y
@@ -389,6 +389,11 @@ NoEcho('
%token <i> PARSEOP_PARITYTYPE_NONE
%token <i> PARSEOP_PARITYTYPE_ODD
%token <i> PARSEOP_PARITYTYPE_SPACE
+%token <i> PARSEOP_PINCONFIG
+%token <i> PARSEOP_PINFUNCTION
+%token <i> PARSEOP_PINGROUP
+%token <i> PARSEOP_PINGROUPCONFIG
+%token <i> PARSEOP_PINGROUPFUNCTION
%token <i> PARSEOP_PIN_NOPULL
%token <i> PARSEOP_PIN_PULLDEFAULT
%token <i> PARSEOP_PIN_PULLDOWN
@@ -632,3 +637,4 @@ NoEcho('
%token <i> PARSEOP___FILE__
%token <i> PARSEOP___LINE__
%token <i> PARSEOP___PATH__
+%token <i> PARSEOP___METHOD__
diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c
index 00330ba..3b7a691 100644
--- a/sys/contrib/dev/acpica/compiler/asltransform.c
+++ b/sys/contrib/dev/acpica/compiler/asltransform.c
@@ -430,6 +430,8 @@ static void
TrTransformSubtree (
ACPI_PARSE_OBJECT *Op)
{
+ ACPI_PARSE_OBJECT *MethodOp;
+
if (Op->Asl.AmlOpcode == AML_RAW_DATA_BYTE)
{
@@ -465,6 +467,35 @@ TrTransformSubtree (
break;
+ case PARSEOP___METHOD__:
+
+ /* Transform to a string op containing the parent method name */
+
+ Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+ UtSetParseOpName (Op);
+
+ /* Find the parent control method op */
+
+ MethodOp = Op;
+ while (MethodOp)
+ {
+ if (MethodOp->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ /* First child contains the method name */
+
+ MethodOp = MethodOp->Asl.Child;
+ Op->Asl.Value.String = MethodOp->Asl.Value.String;
+ return;
+ }
+
+ MethodOp = MethodOp->Asl.Parent;
+ }
+
+ /* At the root, invocation not within a control method */
+
+ Op->Asl.Value.String = "\\";
+ break;
+
default:
/* Nothing to do here for other opcodes */
@@ -602,7 +633,7 @@ TrDoSwitch (
{
/* Add an ELSE to complete the previous CASE */
- NewOp = TrCreateLeafNode (PARSEOP_ELSE);
+ NewOp = TrCreateLeafOp (PARSEOP_ELSE);
NewOp->Asl.Parent = Conditional->Asl.Parent;
TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent);
@@ -627,49 +658,49 @@ TrDoSwitch (
* If (LNotEqual (Match (Package(<size>){<data>},
* MEQ, _T_x, MTR, Zero, Zero), Ones))
*/
- NewOp2 = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);
+ NewOp2 = TrCreateLeafOp (PARSEOP_MATCHTYPE_MEQ);
Predicate->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Conditional);
NewOp = NewOp2;
- NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
+ NewOp2 = TrCreateValuedLeafOp (PARSEOP_NAMESTRING,
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Predicate);
NewOp = NewOp2;
- NewOp2 = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);
+ NewOp2 = TrCreateLeafOp (PARSEOP_MATCHTYPE_MTR);
NewOp->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Predicate);
NewOp = NewOp2;
- NewOp2 = TrCreateLeafNode (PARSEOP_ZERO);
+ NewOp2 = TrCreateLeafOp (PARSEOP_ZERO);
NewOp->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Predicate);
NewOp = NewOp2;
- NewOp2 = TrCreateLeafNode (PARSEOP_ZERO);
+ NewOp2 = TrCreateLeafOp (PARSEOP_ZERO);
NewOp->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Predicate);
- NewOp2 = TrCreateLeafNode (PARSEOP_MATCH);
+ NewOp2 = TrCreateLeafOp (PARSEOP_MATCH);
NewOp2->Asl.Child = Predicate; /* PARSEOP_PACKAGE */
TrAmlInitLineNumbers (NewOp2, Conditional);
TrAmlSetSubtreeParent (Predicate, NewOp2);
NewOp = NewOp2;
- NewOp2 = TrCreateLeafNode (PARSEOP_ONES);
+ NewOp2 = TrCreateLeafOp (PARSEOP_ONES);
NewOp->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Conditional);
- NewOp2 = TrCreateLeafNode (PARSEOP_LEQUAL);
+ NewOp2 = TrCreateLeafOp (PARSEOP_LEQUAL);
NewOp2->Asl.Child = NewOp;
NewOp->Asl.Parent = NewOp2;
TrAmlInitLineNumbers (NewOp2, Conditional);
TrAmlSetSubtreeParent (NewOp, NewOp2);
NewOp = NewOp2;
- NewOp2 = TrCreateLeafNode (PARSEOP_LNOT);
+ NewOp2 = TrCreateLeafOp (PARSEOP_LNOT);
NewOp2->Asl.Child = NewOp;
NewOp2->Asl.Parent = Conditional;
NewOp->Asl.Parent = NewOp2;
@@ -690,12 +721,12 @@ TrDoSwitch (
* CaseOp->Child is the case value
* CaseOp->Child->Peer is the beginning of the case block
*/
- NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
+ NewOp = TrCreateValuedLeafOp (PARSEOP_NAMESTRING,
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Next = Predicate;
TrAmlInitLineNumbers (NewOp, Predicate);
- NewOp2 = TrCreateLeafNode (PARSEOP_LEQUAL);
+ NewOp2 = TrCreateLeafOp (PARSEOP_LEQUAL);
NewOp2->Asl.Parent = Conditional;
NewOp2->Asl.Child = NewOp;
TrAmlInitLineNumbers (NewOp2, Conditional);
@@ -792,7 +823,7 @@ TrDoSwitch (
/* Create the Name node */
Predicate = StartNode->Asl.Child;
- NewOp = TrCreateLeafNode (PARSEOP_NAME);
+ NewOp = TrCreateLeafOp (PARSEOP_NAME);
TrAmlInitLineNumbers (NewOp, StartNode);
/* Find the parent method */
@@ -805,7 +836,7 @@ TrDoSwitch (
}
MethodOp = Next;
- NewOp->Asl.CompileFlags |= NODE_COMPILER_EMITTED;
+ NewOp->Asl.CompileFlags |= OP_COMPILER_EMITTED;
NewOp->Asl.Parent = Next;
/* Insert name after the method name and arguments */
@@ -836,10 +867,10 @@ TrDoSwitch (
/* Create the NameSeg child for the Name node */
- NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
+ NewOp2 = TrCreateValuedLeafOp (PARSEOP_NAMESEG,
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
TrAmlInitLineNumbers (NewOp2, NewOp);
- NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION;
+ NewOp2->Asl.CompileFlags |= OP_IS_NAME_DECLARATION;
NewOp->Asl.Child = NewOp2;
/* Create the initial value for the Name. Btype was already validated above */
@@ -848,31 +879,32 @@ TrDoSwitch (
{
case ACPI_BTYPE_INTEGER:
- NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO,
+ NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_ZERO,
(UINT64) 0);
TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp);
break;
case ACPI_BTYPE_STRING:
- NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
+ NewOp2->Asl.Next = TrCreateValuedLeafOp (PARSEOP_STRING_LITERAL,
(UINT64) ACPI_TO_INTEGER (""));
TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp);
break;
case ACPI_BTYPE_BUFFER:
- (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER,
+ (void) TrLinkPeerOp (NewOp2, TrCreateValuedLeafOp (PARSEOP_BUFFER,
(UINT64) 0));
Next = NewOp2->Asl.Next;
TrAmlInitLineNumbers (Next, NewOp2);
- (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO,
+
+ (void) TrLinkOpChildren (Next, 1, TrCreateValuedLeafOp (PARSEOP_ZERO,
(UINT64) 1));
TrAmlInitLineNumbers (Next->Asl.Child, Next);
- BufferOp = TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0);
+ BufferOp = TrCreateValuedLeafOp (PARSEOP_DEFAULT_ARG, (UINT64) 0);
TrAmlInitLineNumbers (BufferOp, Next->Asl.Child);
- (void) TrLinkPeerNode (Next->Asl.Child, BufferOp);
+ (void) TrLinkPeerOp (Next->Asl.Child, BufferOp);
TrAmlSetSubtreeParent (Next->Asl.Child, Next);
break;
@@ -891,7 +923,7 @@ TrDoSwitch (
* where _T_x is the temp variable.
*/
TrAmlInitNode (StartNode, PARSEOP_WHILE);
- NewOp = TrCreateLeafNode (PARSEOP_ONE);
+ NewOp = TrCreateLeafOp (PARSEOP_ONE);
TrAmlInitLineNumbers (NewOp, StartNode);
NewOp->Asl.Next = Predicate->Asl.Next;
NewOp->Asl.Parent = StartNode;
@@ -899,7 +931,7 @@ TrDoSwitch (
/* Create a Store() node */
- StoreOp = TrCreateLeafNode (PARSEOP_STORE);
+ StoreOp = TrCreateLeafOp (PARSEOP_STORE);
TrAmlInitLineNumbers (StoreOp, NewOp);
StoreOp->Asl.Parent = StartNode;
TrAmlInsertPeer (NewOp, StoreOp);
@@ -909,7 +941,7 @@ TrDoSwitch (
StoreOp->Asl.Child = Predicate;
Predicate->Asl.Parent = StoreOp;
- NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
+ NewOp = TrCreateValuedLeafOp (PARSEOP_NAMESEG,
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
TrAmlInitLineNumbers (NewOp, StoreOp);
NewOp->Asl.Parent = StoreOp;
@@ -923,7 +955,7 @@ TrDoSwitch (
Conditional = Conditional->Asl.Next;
}
- BreakOp = TrCreateLeafNode (PARSEOP_BREAK);
+ BreakOp = TrCreateLeafOp (PARSEOP_BREAK);
TrAmlInitLineNumbers (BreakOp, NewOp);
BreakOp->Asl.Parent = StartNode;
TrAmlInsertPeer (Conditional, BreakOp);
diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c
index d99bf9b..b510d59 100644
--- a/sys/contrib/dev/acpica/compiler/asltree.c
+++ b/sys/contrib/dev/acpica/compiler/asltree.c
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Module Name: asltree - parse tree management
+ * Module Name: asltree - Parse tree management
*
*****************************************************************************/
@@ -152,253 +152,27 @@
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acapps.h>
-#include <contrib/dev/acpica/include/acconvert.h>
-#include <time.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("asltree")
-/* Local prototypes */
-
-static ACPI_PARSE_OBJECT *
-TrGetNextNode (
- void);
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrSetParent
- *
- * PARAMETERS: Op - To be set to new parent
- * ParentOp - The parent
- *
- * RETURN: None, sets Op parent directly
- *
- * DESCRIPTION: Change the parent of a parse op.
- *
- ******************************************************************************/
-
-void
-TrSetParent (
- ACPI_PARSE_OBJECT *Op,
- ACPI_PARSE_OBJECT *ParentOp)
-{
-
- Op->Asl.Parent = ParentOp;
-}
-
/*******************************************************************************
*
- * FUNCTION: TrGetNextNode
+ * FUNCTION: TrSetOpIntegerValue
*
- * PARAMETERS: None
+ * PARAMETERS: ParseOpcode - New opcode to be assigned to the op
+ * Op - An existing parse op
*
- * RETURN: New parse node. Aborts on allocation failure
+ * RETURN: The updated op
*
- * DESCRIPTION: Allocate a new parse node for the parse tree. Bypass the local
- * dynamic memory manager for performance reasons (This has a
- * major impact on the speed of the compiler.)
- *
- ******************************************************************************/
-
-static ACPI_PARSE_OBJECT *
-TrGetNextNode (
- void)
-{
- ASL_CACHE_INFO *Cache;
-
-
- if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
- {
- /* Allocate a new buffer */
-
- Cache = UtLocalCalloc (sizeof (Cache->Next) +
- (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
-
- /* Link new cache buffer to head of list */
-
- Cache->Next = Gbl_ParseOpCacheList;
- Gbl_ParseOpCacheList = Cache;
-
- /* Setup cache management pointers */
-
- Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
- Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
- }
-
- Gbl_ParseOpCount++;
- return (Gbl_ParseOpCacheNext++);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrAllocateNode
- *
- * PARAMETERS: ParseOpcode - Opcode to be assigned to the node
- *
- * RETURN: New parse node. Aborts on allocation failure
- *
- * DESCRIPTION: Allocate and initialize a new parse node for the parse tree
+ * DESCRIPTION: Used to set the integer value of a op,
+ * usually to a specific size (8, 16, 32, or 64 bits)
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrAllocateNode (
- UINT32 ParseOpcode)
-{
- ACPI_PARSE_OBJECT *Op;
- ACPI_PARSE_OBJECT *LatestNode;
-
-
- Op = TrGetNextNode ();
-
- Op->Asl.ParseOpcode = (UINT16) ParseOpcode;
- Op->Asl.Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
- Op->Asl.LineNumber = Gbl_CurrentLineNumber;
- Op->Asl.LogicalLineNumber = Gbl_LogicalLineNumber;
- Op->Asl.LogicalByteOffset = Gbl_CurrentLineOffset;
- Op->Asl.Column = Gbl_CurrentColumn;
-
- UtSetParseOpName (Op);
-
- /* The following is for capturing comments */
-
- if(Gbl_CaptureComments)
- {
- LatestNode = Gbl_CommentState.Latest_Parse_Node;
- Op->Asl.InlineComment = NULL;
- Op->Asl.EndNodeComment = NULL;
- Op->Asl.CommentList = NULL;
- Op->Asl.FileChanged = FALSE;
-
- /*
- * Check to see if the file name has changed before resetting the
- * latest parse node.
- */
- if (LatestNode &&
- (ParseOpcode != PARSEOP_INCLUDE) &&
- (ParseOpcode != PARSEOP_INCLUDE_END) &&
- strcmp (LatestNode->Asl.Filename, Op->Asl.Filename))
- {
- CvDbgPrint ("latest node: %s\n", LatestNode->Asl.ParseOpName);
- Op->Asl.FileChanged = TRUE;
- if (Gbl_IncludeFileStack)
- {
- Op->Asl.ParentFilename = Gbl_IncludeFileStack->Filename;
- }
- else
- {
- Op->Asl.ParentFilename = NULL;
- }
- }
-
- Gbl_CommentState.Latest_Parse_Node = Op;
- CvDbgPrint ("trallocatenode=Set latest parse node to this node.\n");
- CvDbgPrint (" Op->Asl.ParseOpName = %s\n",
- Gbl_CommentState.Latest_Parse_Node->Asl.ParseOpName);
- CvDbgPrint (" Op->Asl.ParseOpcode = 0x%x\n", ParseOpcode);
-
- if (Op->Asl.FileChanged)
- {
- CvDbgPrint(" file has been changed!\n");
- }
-
- /*
- * if this parse op's syntax uses () and {} (i.e. Package(1){0x00}) then
- * set a flag in the comment state. This facilitates paring comments for
- * these types of opcodes.
- */
- if ((CvParseOpBlockType(Op) == (BLOCK_PAREN | BLOCK_BRACE)) &&
- (ParseOpcode != PARSEOP_DEFINITION_BLOCK))
- {
- CvDbgPrint ("Parsing paren/Brace node now!\n");
- Gbl_CommentState.ParsingParenBraceNode = Op;
- }
-
- if (Gbl_Comment_List_Head)
- {
- CvDbgPrint ("Transferring...\n");
- Op->Asl.CommentList = Gbl_Comment_List_Head;
- Gbl_Comment_List_Head = NULL;
- Gbl_Comment_List_Tail = NULL;
- CvDbgPrint (" Transferred current comment list to this node.\n");
- CvDbgPrint (" %s\n", Op->Asl.CommentList->Comment);
- }
- if (Gbl_Inline_Comment_Buffer)
- {
- Op->Asl.InlineComment = Gbl_Inline_Comment_Buffer;
- Gbl_Inline_Comment_Buffer = NULL;
- CvDbgPrint ("Transferred current inline comment list to this node.\n");
- }
-
- }
-
- return (Op);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrReleaseNode
- *
- * PARAMETERS: Op - Op to be released
- *
- * RETURN: None
- *
- * DESCRIPTION: "release" a node. In truth, nothing is done since the node
- * is part of a larger buffer
- *
- ******************************************************************************/
-
-void
-TrReleaseNode (
- ACPI_PARSE_OBJECT *Op)
-{
-
- return;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrSetCurrentFilename
- *
- * PARAMETERS: Op - An existing parse node
- *
- * RETURN: None
- *
- * DESCRIPTION: Save the include file filename. Used for debug output only.
- *
- ******************************************************************************/
-
-void
-TrSetCurrentFilename (
- ACPI_PARSE_OBJECT *Op)
-{
- Op->Asl.Filename = Gbl_PreviousIncludeFilename;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrUpdateNode
- *
- * PARAMETERS: ParseOpcode - New opcode to be assigned to the node
- * Op - An existing parse node
- *
- * RETURN: The updated node
- *
- * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to
- * change an opcode to DEFAULT_ARG so that the node is ignored
- * during the code generation. Also used to set generic integers
- * to a specific size (8, 16, 32, or 64 bits)
- *
- ******************************************************************************/
-
-ACPI_PARSE_OBJECT *
-TrUpdateNode (
+TrSetOpIntegerValue (
UINT32 ParseOpcode,
ACPI_PARSE_OBJECT *Op)
{
@@ -409,7 +183,7 @@ TrUpdateNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
- "\nUpdateNode: Old - %s, New - %s\n",
+ "\nUpdateOp: Old - %s, New - %s\n",
UtGetOpName (Op->Asl.ParseOpcode),
UtGetOpName (ParseOpcode));
@@ -477,7 +251,8 @@ TrUpdateNode (
break;
}
- /* Converter: if this is a method invocation, turn off capture comments. */
+ /* Converter: if this is a method invocation, turn off capture comments */
+
if (Gbl_CaptureComments &&
(ParseOpcode == PARSEOP_METHODCALL))
{
@@ -490,164 +265,19 @@ TrUpdateNode (
/*******************************************************************************
*
- * FUNCTION: TrPrintNodeCompileFlags
- *
- * PARAMETERS: Flags - Flags word to be decoded
- *
- * RETURN: None
- *
- * DESCRIPTION: Decode a flags word to text. Displays all flags that are set.
- *
- ******************************************************************************/
-
-void
-TrPrintNodeCompileFlags (
- UINT32 Flags)
-{
- UINT32 i;
- UINT32 FlagBit = 1;
- char *FlagName = NULL;
-
-
- for (i = 0; i < 32; i++)
- {
- switch (Flags & FlagBit)
- {
- case NODE_VISITED:
-
- FlagName = "NODE_VISITED";
- break;
-
- case NODE_AML_PACKAGE:
-
- FlagName = "NODE_AML_PACKAGE";
- break;
-
- case NODE_IS_TARGET:
-
- FlagName = "NODE_IS_TARGET";
- break;
-
- case NODE_IS_RESOURCE_DESC:
-
- FlagName = "NODE_IS_RESOURCE_DESC";
- break;
-
- case NODE_IS_RESOURCE_FIELD:
-
- FlagName = "NODE_IS_RESOURCE_FIELD";
- break;
-
- case NODE_HAS_NO_EXIT:
-
- FlagName = "NODE_HAS_NO_EXIT";
- break;
-
- case NODE_IF_HAS_NO_EXIT:
-
- FlagName = "NODE_IF_HAS_NO_EXIT";
- break;
-
- case NODE_NAME_INTERNALIZED:
-
- FlagName = "NODE_NAME_INTERNALIZED";
- break;
-
- case NODE_METHOD_NO_RETVAL:
-
- FlagName = "NODE_METHOD_NO_RETVAL";
- break;
-
- case NODE_METHOD_SOME_NO_RETVAL:
-
- FlagName = "NODE_METHOD_SOME_NO_RETVAL";
- break;
-
- case NODE_RESULT_NOT_USED:
-
- FlagName = "NODE_RESULT_NOT_USED";
- break;
-
- case NODE_METHOD_TYPED:
-
- FlagName = "NODE_METHOD_TYPED";
- break;
-
- case NODE_COULD_NOT_REDUCE:
-
- FlagName = "NODE_COULD_NOT_REDUCE";
- break;
-
- case NODE_COMPILE_TIME_CONST:
-
- FlagName = "NODE_COMPILE_TIME_CONST";
- break;
-
- case NODE_IS_TERM_ARG:
-
- FlagName = "NODE_IS_TERM_ARG";
- break;
-
- case NODE_WAS_ONES_OP:
-
- FlagName = "NODE_WAS_ONES_OP";
- break;
-
- case NODE_IS_NAME_DECLARATION:
-
- FlagName = "NODE_IS_NAME_DECLARATION";
- break;
-
- case NODE_COMPILER_EMITTED:
-
- FlagName = "NODE_COMPILER_EMITTED";
- break;
-
- case NODE_IS_DUPLICATE:
-
- FlagName = "NODE_IS_DUPLICATE";
- break;
-
- case NODE_IS_RESOURCE_DATA:
-
- FlagName = "NODE_IS_RESOURCE_DATA";
- break;
-
- case NODE_IS_NULL_RETURN:
-
- FlagName = "NODE_IS_NULL_RETURN";
- break;
-
- default:
- break;
- }
-
- if (FlagName)
- {
- DbgPrint (ASL_PARSE_OUTPUT, " %s", FlagName);
- FlagName = NULL;
- }
-
- FlagBit <<= 1;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrSetNodeFlags
+ * FUNCTION: TrSetOpFlags
*
- * PARAMETERS: Op - An existing parse node
+ * PARAMETERS: Op - An existing parse op
* Flags - New flags word
*
* RETURN: The updated parser op
*
- * DESCRIPTION: Set bits in the node flags word. Will not clear bits, only set
+ * DESCRIPTION: Set bits in the op flags word. Will not clear bits, only set
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrSetNodeFlags (
+TrSetOpFlags (
ACPI_PARSE_OBJECT *Op,
UINT32 Flags)
{
@@ -658,9 +288,9 @@ TrSetNodeFlags (
}
DbgPrint (ASL_PARSE_OUTPUT,
- "\nSetNodeFlags: %s Op %p, %8.8X", Op->Asl.ParseOpName, Op, Flags);
+ "\nSetOpFlags: %s Op %p, %8.8X", Op->Asl.ParseOpName, Op, Flags);
- TrPrintNodeCompileFlags (Flags);
+ TrPrintOpFlags (Flags, ASL_PARSE_OUTPUT);
DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
Op->Asl.CompileFlags |= Flags;
@@ -670,27 +300,27 @@ TrSetNodeFlags (
/*******************************************************************************
*
- * FUNCTION: TrSetNodeAmlLength
+ * FUNCTION: TrSetOpAmlLength
*
- * PARAMETERS: Op - An existing parse node
+ * PARAMETERS: Op - An existing parse op
* Length - AML Length
*
* RETURN: The updated parser op
*
- * DESCRIPTION: Set the AML Length in a node. Used by the parser to indicate
- * the presence of a node that must be reduced to a fixed length
+ * DESCRIPTION: Set the AML Length in a op. Used by the parser to indicate
+ * the presence of a op that must be reduced to a fixed length
* constant.
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrSetNodeAmlLength (
+TrSetOpAmlLength (
ACPI_PARSE_OBJECT *Op,
UINT32 Length)
{
DbgPrint (ASL_PARSE_OUTPUT,
- "\nSetNodeAmlLength: Op %p, %8.8X\n", Op, Length);
+ "\nSetOpAmlLength: Op %p, %8.8X\n", Op, Length);
if (!Op)
{
@@ -704,646 +334,95 @@ TrSetNodeAmlLength (
/*******************************************************************************
*
- * FUNCTION: TrSetEndLineNumber
+ * FUNCTION: TrSetOpParent
*
- * PARAMETERS: Op - An existing parse node
+ * PARAMETERS: Op - To be set to new parent
+ * ParentOp - The parent
*
- * RETURN: None.
+ * RETURN: None, sets Op parent directly
*
- * DESCRIPTION: Set the ending line numbers (file line and logical line) of a
- * parse node to the current line numbers.
+ * DESCRIPTION: Change the parent of a parse op.
*
******************************************************************************/
void
-TrSetEndLineNumber (
- ACPI_PARSE_OBJECT *Op)
-{
-
- /* If the end line # is already set, just return */
-
- if (Op->Asl.EndLine)
- {
- return;
- }
-
- Op->Asl.EndLine = Gbl_CurrentLineNumber;
- Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrCreateAssignmentNode
- *
- * PARAMETERS: Target - Assignment target
- * Source - Assignment source
- *
- * RETURN: Pointer to the new node. Aborts on allocation failure
- *
- * DESCRIPTION: Implements the C-style '=' operator. It changes the parse
- * tree if possible to utilize the last argument of the math
- * operators which is a target operand -- thus saving invocation
- * of and additional Store() operator. An optimization.
- *
- ******************************************************************************/
-
-ACPI_PARSE_OBJECT *
-TrCreateAssignmentNode (
- ACPI_PARSE_OBJECT *Target,
- ACPI_PARSE_OBJECT *Source)
-{
- ACPI_PARSE_OBJECT *TargetOp;
- ACPI_PARSE_OBJECT *SourceOp1;
- ACPI_PARSE_OBJECT *SourceOp2;
- ACPI_PARSE_OBJECT *Operator;
-
-
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nTrCreateAssignmentNode Line [%u to %u] Source %s Target %s\n",
- Source->Asl.LineNumber, Source->Asl.EndLine,
- UtGetOpName (Source->Asl.ParseOpcode),
- UtGetOpName (Target->Asl.ParseOpcode));
-
- TrSetNodeFlags (Target, NODE_IS_TARGET);
-
- switch (Source->Asl.ParseOpcode)
- {
- /*
- * Only these operators can be optimized because they have
- * a target operand
- */
- case PARSEOP_ADD:
- case PARSEOP_AND:
- case PARSEOP_DIVIDE:
- case PARSEOP_INDEX:
- case PARSEOP_MOD:
- case PARSEOP_MULTIPLY:
- case PARSEOP_NOT:
- case PARSEOP_OR:
- case PARSEOP_SHIFTLEFT:
- case PARSEOP_SHIFTRIGHT:
- case PARSEOP_SUBTRACT:
- case PARSEOP_XOR:
-
- break;
-
- /* Otherwise, just create a normal Store operator */
-
- default:
-
- goto CannotOptimize;
- }
-
- /*
- * Transform the parse tree such that the target is moved to the
- * last operand of the operator
- */
- SourceOp1 = Source->Asl.Child;
- SourceOp2 = SourceOp1->Asl.Next;
-
- /* NOT only has one operand, but has a target */
-
- if (Source->Asl.ParseOpcode == PARSEOP_NOT)
- {
- SourceOp2 = SourceOp1;
- }
-
- /* DIVIDE has an extra target operand (remainder) */
-
- if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE)
- {
- SourceOp2 = SourceOp2->Asl.Next;
- }
-
- TargetOp = SourceOp2->Asl.Next;
-
- /*
- * Can't perform this optimization if there already is a target
- * for the operator (ZERO is a "no target" placeholder).
- */
- if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO)
- {
- goto CannotOptimize;
- }
-
- /* Link in the target as the final operand */
-
- SourceOp2->Asl.Next = Target;
- Target->Asl.Parent = Source;
-
- return (Source);
-
-
-CannotOptimize:
-
- Operator = TrAllocateNode (PARSEOP_STORE);
- TrLinkChildren (Operator, 2, Source, Target);
-
- /* Set the appropriate line numbers for the new node */
-
- Operator->Asl.LineNumber = Target->Asl.LineNumber;
- Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber;
- Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset;
- Operator->Asl.Column = Target->Asl.Column;
-
- return (Operator);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrCreateLeafNode
- *
- * PARAMETERS: ParseOpcode - New opcode to be assigned to the node
- *
- * RETURN: Pointer to the new node. Aborts on allocation failure
- *
- * DESCRIPTION: Create a simple leaf node (no children or peers, and no value
- * assigned to the node)
- *
- ******************************************************************************/
-
-ACPI_PARSE_OBJECT *
-TrCreateLeafNode (
- UINT32 ParseOpcode)
-{
- ACPI_PARSE_OBJECT *Op;
-
-
- Op = TrAllocateNode (ParseOpcode);
-
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n",
- Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode));
-
- return (Op);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrCreateNullTarget
- *
- * PARAMETERS: None
- *
- * RETURN: Pointer to the new node. Aborts on allocation failure
- *
- * DESCRIPTION: Create a "null" target node. This is defined by the ACPI
- * specification to be a zero AML opcode, and indicates that
- * no target has been specified for the parent operation
- *
- ******************************************************************************/
-
-ACPI_PARSE_OBJECT *
-TrCreateNullTarget (
- void)
-{
- ACPI_PARSE_OBJECT *Op;
-
-
- Op = TrAllocateNode (PARSEOP_ZERO);
- Op->Asl.CompileFlags |= (NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);
-
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateNullTarget Ln/Col %u/%u NewNode %p Op %s\n",
- Op->Asl.LineNumber, Op->Asl.Column, Op,
- UtGetOpName (Op->Asl.ParseOpcode));
-
- return (Op);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrCreateConstantLeafNode
- *
- * PARAMETERS: ParseOpcode - The constant opcode
- *
- * RETURN: Pointer to the new node. Aborts on allocation failure
- *
- * DESCRIPTION: Create a leaf node (no children or peers) for one of the
- * special constants - __LINE__, __FILE__, and __DATE__.
- *
- * Note: An implemenation of __FUNC__ cannot happen here because we don't
- * have a full parse tree at this time and cannot find the parent control
- * method. If it is ever needed, __FUNC__ must be implemented later, after
- * the parse tree has been fully constructed.
- *
- ******************************************************************************/
-
-ACPI_PARSE_OBJECT *
-TrCreateConstantLeafNode (
- UINT32 ParseOpcode)
-{
- ACPI_PARSE_OBJECT *Op = NULL;
- time_t CurrentTime;
- char *StaticTimeString;
- char *TimeString;
- char *Filename;
-
-
- switch (ParseOpcode)
- {
- case PARSEOP___LINE__:
-
- Op = TrAllocateNode (PARSEOP_INTEGER);
- Op->Asl.Value.Integer = Op->Asl.LineNumber;
- break;
-
- case PARSEOP___PATH__:
-
- Op = TrAllocateNode (PARSEOP_STRING_LITERAL);
-
- /* Op.Asl.Filename contains the full pathname to the file */
-
- Op->Asl.Value.String = Op->Asl.Filename;
- break;
-
- case PARSEOP___FILE__:
-
- Op = TrAllocateNode (PARSEOP_STRING_LITERAL);
-
- /* Get the simple filename from the full path */
-
- FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
- Op->Asl.Value.String = Filename;
- break;
-
- case PARSEOP___DATE__:
-
- Op = TrAllocateNode (PARSEOP_STRING_LITERAL);
-
- /* Get a copy of the current time */
-
- CurrentTime = time (NULL);
- StaticTimeString = ctime (&CurrentTime);
- TimeString = UtLocalCalloc (strlen (StaticTimeString) + 1);
- strcpy (TimeString, StaticTimeString);
-
- TimeString[strlen(TimeString) -1] = 0; /* Remove trailing newline */
- Op->Asl.Value.String = TimeString;
- break;
-
- default: /* This would be an internal error */
-
- return (NULL);
- }
-
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p "
- "Op %s Value %8.8X%8.8X \n",
- Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
- ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
- return (Op);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: TrCreateTargetOperand
- *
- * PARAMETERS: OriginalOp - Op to be copied
- *
- * RETURN: Pointer to the new node. Aborts on allocation failure
- *
- * DESCRIPTION: Copy an existing node (and subtree). Used in ASL+ (C-style)
- * expressions where the target is the same as one of the
- * operands. A new node and subtree must be created from the
- * original so that the parse tree can be linked properly.
- *
- * NOTE: This code is specific to target operands that are the last
- * operand in an ASL/AML operator. Meaning that the top-level
- * parse Op in a possible subtree has a NULL Next pointer.
- * This simplifies the recursion.
- *
- * Subtree example:
- * DeRefOf (Local1) += 32
- *
- * This gets converted to:
- * Add (DeRefOf (Local1), 32, DeRefOf (Local1))
- *
- * Each DeRefOf has a single child, Local1. Even more complex
- * subtrees can be created via the Index and DeRefOf operators.
- *
- ******************************************************************************/
-
-ACPI_PARSE_OBJECT *
-TrCreateTargetOperand (
- ACPI_PARSE_OBJECT *OriginalOp,
+TrSetOpParent (
+ ACPI_PARSE_OBJECT *Op,
ACPI_PARSE_OBJECT *ParentOp)
{
- ACPI_PARSE_OBJECT *Op;
-
-
- if (!OriginalOp)
- {
- return (NULL);
- }
-
- Op = TrGetNextNode ();
-
- /* Copy the pertinent values (omit link pointer fields) */
-
- Op->Asl.Value = OriginalOp->Asl.Value;
- Op->Asl.Filename = OriginalOp->Asl.Filename;
- Op->Asl.LineNumber = OriginalOp->Asl.LineNumber;
- Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber;
- Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset;
- Op->Asl.Column = OriginalOp->Asl.Column;
- Op->Asl.Flags = OriginalOp->Asl.Flags;
- Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags;
- Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode;
- Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode;
- Op->Asl.Parent = ParentOp;
- UtSetParseOpName (Op);
-
- /* Copy a possible subtree below this node */
-
- if (OriginalOp->Asl.Child)
- {
- Op->Asl.Child = TrCreateTargetOperand (OriginalOp->Asl.Child, Op);
- }
-
- if (OriginalOp->Asl.Next) /* Null for top-level node */
- {
- Op->Asl.Next = TrCreateTargetOperand (OriginalOp->Asl.Next, ParentOp);
- }
- return (Op);
+ Op->Asl.Parent = ParentOp;
}
/*******************************************************************************
*
- * FUNCTION: TrCreateValuedLeafNode
+ * FUNCTION: TrSetOpCurrentFilename
*
- * PARAMETERS: ParseOpcode - New opcode to be assigned to the node
- * Value - Value to be assigned to the node
+ * PARAMETERS: Op - An existing parse op
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: None
*
- * DESCRIPTION: Create a leaf node (no children or peers) with a value
- * assigned to it
+ * DESCRIPTION: Save the include file filename. Used for debug output only.
*
******************************************************************************/
-ACPI_PARSE_OBJECT *
-TrCreateValuedLeafNode (
- UINT32 ParseOpcode,
- UINT64 Value)
+void
+TrSetOpCurrentFilename (
+ ACPI_PARSE_OBJECT *Op)
{
- ACPI_PARSE_OBJECT *Op;
-
-
- Op = TrAllocateNode (ParseOpcode);
-
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p "
- "Op %s Value %8.8X%8.8X ",
- Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
- ACPI_FORMAT_UINT64 (Value));
- Op->Asl.Value.Integer = Value;
-
- switch (ParseOpcode)
- {
- case PARSEOP_STRING_LITERAL:
-
- DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
- break;
- case PARSEOP_NAMESEG:
-
- DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
- break;
-
- case PARSEOP_NAMESTRING:
-
- DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
- break;
-
- case PARSEOP_EISAID:
-
- DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
- break;
-
- case PARSEOP_METHOD:
-
- DbgPrint (ASL_PARSE_OUTPUT, "METHOD");
- break;
-
- case PARSEOP_INTEGER:
-
- DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X",
- ACPI_FORMAT_UINT64 (Value));
- break;
-
- default:
-
- break;
- }
-
- DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
- return (Op);
+ Op->Asl.Filename = Gbl_PreviousIncludeFilename;
}
/*******************************************************************************
*
- * FUNCTION: TrCreateNode
+ * FUNCTION: TrSetOpEndLineNumber
*
- * PARAMETERS: ParseOpcode - Opcode to be assigned to the node
- * NumChildren - Number of children to follow
- * ... - A list of child nodes to link to the new
- * node. NumChildren long.
+ * PARAMETERS: Op - An existing parse op
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: None.
*
- * DESCRIPTION: Create a new parse node and link together a list of child
- * nodes underneath the new node.
+ * DESCRIPTION: Set the ending line numbers (file line and logical line) of a
+ * parse op to the current line numbers.
*
******************************************************************************/
-ACPI_PARSE_OBJECT *
-TrCreateNode (
- UINT32 ParseOpcode,
- UINT32 NumChildren,
- ...)
+void
+TrSetOpEndLineNumber (
+ ACPI_PARSE_OBJECT *Op)
{
- ACPI_PARSE_OBJECT *Op;
- ACPI_PARSE_OBJECT *Child;
- ACPI_PARSE_OBJECT *PrevChild;
- va_list ap;
- UINT32 i;
- BOOLEAN FirstChild;
+ /* If the end line # is already set, just return */
- va_start (ap, NumChildren);
-
- /* Allocate one new node */
-
- Op = TrAllocateNode (ParseOpcode);
-
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ",
- Op->Asl.LineNumber, Op->Asl.Column, Op,
- NumChildren, UtGetOpName(ParseOpcode));
-
- /* Some extra debug output based on the parse opcode */
-
- switch (ParseOpcode)
- {
- case PARSEOP_ASL_CODE:
-
- Gbl_ParseTreeRoot = Op;
- Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
- DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
- break;
-
- case PARSEOP_DEFINITION_BLOCK:
-
- DbgPrint (ASL_PARSE_OUTPUT, "DEFINITION_BLOCK (Tree Completed)->");
- break;
-
- case PARSEOP_OPERATIONREGION:
-
- DbgPrint (ASL_PARSE_OUTPUT, "OPREGION->");
- break;
-
- case PARSEOP_OR:
-
- DbgPrint (ASL_PARSE_OUTPUT, "OR->");
- break;
-
- default:
-
- /* Nothing to do for other opcodes */
-
- break;
- }
-
- /* Link the new node to its children */
-
- PrevChild = NULL;
- FirstChild = TRUE;
- for (i = 0; i < NumChildren; i++)
+ if (Op->Asl.EndLine)
{
- /* Get the next child */
-
- Child = va_arg (ap, ACPI_PARSE_OBJECT *);
- DbgPrint (ASL_PARSE_OUTPUT, "%p, ", Child);
-
- /*
- * If child is NULL, this means that an optional argument
- * was omitted. We must create a placeholder with a special
- * opcode (DEFAULT_ARG) so that the code generator will know
- * that it must emit the correct default for this argument
- */
- if (!Child)
- {
- Child = TrAllocateNode (PARSEOP_DEFAULT_ARG);
- }
-
- /* Link first child to parent */
-
- if (FirstChild)
- {
- FirstChild = FALSE;
- Op->Asl.Child = Child;
-
- /*
- * For the ASL-/ASL+ converter: if the ParseOp is a connection,
- * external, offset or accessAs, it means that the comments in the
- * FirstChild belongs to their parent due to the parsing order in
- * the .y files. To correct this, take the comments in the
- * FirstChild place it in the parent. This also means that
- * legitimate comments for the child gets put to the parent.
- */
- if (Gbl_CaptureComments &&
- ((ParseOpcode == PARSEOP_CONNECTION) ||
- (ParseOpcode == PARSEOP_EXTERNAL) ||
- (ParseOpcode == PARSEOP_OFFSET) ||
- (ParseOpcode == PARSEOP_ACCESSAS)))
- {
- Op->Asl.CommentList = Child->Asl.CommentList;
- Op->Asl.EndBlkComment = Child->Asl.EndBlkComment;
- Op->Asl.InlineComment = Child->Asl.InlineComment;
- Op->Asl.FileChanged = Child->Asl.FileChanged;
-
- Child->Asl.CommentList = NULL;
- Child->Asl.EndBlkComment = NULL;
- Child->Asl.InlineComment = NULL;
- Child->Asl.FileChanged = FALSE;
-
- /*
- * These do not need to be "passed off". They can be copied
- * because the code for these opcodes should be printed in the
- * same file.
- */
- Op->Asl.Filename = Child->Asl.Filename;
- Op->Asl.ParentFilename = Child->Asl.ParentFilename;
- }
- }
-
- /* Point all children to parent */
-
- Child->Asl.Parent = Op;
-
- /* Link children in a peer list */
-
- if (PrevChild)
- {
- PrevChild->Asl.Next = Child;
- };
-
- /* Get the comment from last child in the resource template call */
-
- if (Gbl_CaptureComments &&
- (Op->Asl.ParseOpcode == PARSEOP_RESOURCETEMPLATE))
- {
- CvDbgPrint ("Transferred current comment list to this node.\n");
- Op->Asl.CommentList = Child->Asl.CommentList;
- Child->Asl.CommentList = NULL;
- Op->Asl.InlineComment = Child->Asl.InlineComment;
- Child->Asl.InlineComment = NULL;
- }
-
- /*
- * This child might be a list, point all nodes in the list
- * to the same parent
- */
- while (Child->Asl.Next)
- {
- Child = Child->Asl.Next;
- Child->Asl.Parent = Op;
- }
-
- PrevChild = Child;
+ return;
}
- va_end(ap);
- DbgPrint (ASL_PARSE_OUTPUT, "\n");
- return (Op);
+ Op->Asl.EndLine = Gbl_CurrentLineNumber;
+ Op->Asl.EndLogicalLine = Gbl_LogicalLineNumber;
}
/*******************************************************************************
*
- * FUNCTION: TrLinkChildren
+ * FUNCTION: TrLinkOpChildren
*
- * PARAMETERS: Op - An existing parse node
+ * PARAMETERS: Op - An existing parse op
* NumChildren - Number of children to follow
- * ... - A list of child nodes to link to the new
- * node. NumChildren long.
+ * ... - A list of child ops to link to the new
+ * op. NumChildren long.
*
- * RETURN: The updated (linked) node
+ * RETURN: The updated (linked) op
*
- * DESCRIPTION: Link a group of nodes to an existing parse node
+ * DESCRIPTION: Link a group of ops to an existing parse op
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrLinkChildren (
+TrLinkOpChildren (
ACPI_PARSE_OBJECT *Op,
UINT32 NumChildren,
...)
@@ -1357,8 +436,7 @@ TrLinkChildren (
va_start (ap, NumChildren);
-
- TrSetEndLineNumber (Op);
+ TrSetOpEndLineNumber (Op);
DbgPrint (ASL_PARSE_OUTPUT,
"\nLinkChildren Line [%u to %u] NewParent %p Child %u Op %s ",
@@ -1403,19 +481,19 @@ TrLinkChildren (
/*
* If there are "regular comments" detected at this point,
* then is an endBlk comment. Categorize it as so and distribute
- * all regular comments to this parse node.
+ * all regular comments to this parse op.
*/
- if (Gbl_Comment_List_Head)
+ if (Gbl_CommentListHead)
{
- Op->Asl.EndBlkComment = Gbl_Comment_List_Head;
+ Op->Asl.EndBlkComment = Gbl_CommentListHead;
CvDbgPrint ("EndBlk Comment for %s: %s",
- Op->Asl.ParseOpName, Gbl_Comment_List_Head->Comment);
- Gbl_Comment_List_Head = NULL;
- Gbl_Comment_List_Tail = NULL;
+ Op->Asl.ParseOpName, Gbl_CommentListHead->Comment);
+ Gbl_CommentListHead = NULL;
+ Gbl_CommentListTail = NULL;
}
}
- /* Link the new node to it's children */
+ /* Link the new op to it's children */
PrevChild = NULL;
FirstChild = TRUE;
@@ -1426,7 +504,7 @@ TrLinkChildren (
if ((Child == PrevChild) && (Child != NULL))
{
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Child,
- "Child node list invalid");
+ "Child op list invalid");
va_end(ap);
return (Op);
}
@@ -1441,7 +519,7 @@ TrLinkChildren (
*/
if (!Child)
{
- Child = TrAllocateNode (PARSEOP_DEFAULT_ARG);
+ Child = TrAllocateOp (PARSEOP_DEFAULT_ARG);
}
/* Link first child to parent */
@@ -1461,10 +539,10 @@ TrLinkChildren (
if (PrevChild)
{
PrevChild->Asl.Next = Child;
- };
+ }
/*
- * This child might be a list, point all nodes in the list
+ * This child might be a list, point all ops in the list
* to the same parent
*/
while (Child->Asl.Next)
@@ -1479,31 +557,31 @@ TrLinkChildren (
va_end(ap);
DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
-
if(Gbl_CaptureComments)
{
- Gbl_CommentState.Latest_Parse_Node = Op;
- CvDbgPrint ("trlinkchildren=====Set latest parse node to this node.\n");
+ Gbl_CommentState.LatestParseOp = Op;
+ CvDbgPrint ("TrLinkOpChildren=====Set latest parse op to this op.\n");
}
+
return (Op);
}
/*******************************************************************************
*
- * FUNCTION: TrLinkPeerNode
+ * FUNCTION: TrLinkPeerOp
*
* PARAMETERS: Op1 - First peer
* Op2 - Second peer
*
- * RETURN: Op1 or the non-null node.
+ * RETURN: Op1 or the non-null op.
*
- * DESCRIPTION: Link two nodes as peers. Handles cases where one peer is null.
+ * DESCRIPTION: Link two ops as peers. Handles cases where one peer is null.
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrLinkPeerNode (
+TrLinkPeerOp (
ACPI_PARSE_OBJECT *Op1,
ACPI_PARSE_OBJECT *Op2)
{
@@ -1511,18 +589,18 @@ TrLinkPeerNode (
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkPeerNode: 1=%p (%s), 2=%p (%s)\n",
+ "\nLinkPeerOp: 1=%p (%s), 2=%p (%s)\n",
Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode) : NULL,
Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode) : NULL);
if ((!Op1) && (!Op2))
{
- DbgPrint (ASL_PARSE_OUTPUT, "\nTwo Null nodes!\n");
+ DbgPrint (ASL_PARSE_OUTPUT, "\nTwo Null ops!\n");
return (Op1);
}
- /* If one of the nodes is null, just return the non-null node */
+ /* If one of the ops is null, just return the non-null op */
if (!Op2)
{
@@ -1537,10 +615,10 @@ TrLinkPeerNode (
if (Op1 == Op2)
{
DbgPrint (ASL_DEBUG_OUTPUT,
- "\n************* Internal error, linking node to itself %p\n",
+ "\n************* Internal error, linking op to itself %p\n",
Op1);
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op1,
- "Linking node to itself");
+ "Linking op to itself");
return (Op1);
}
@@ -1564,19 +642,19 @@ TrLinkPeerNode (
/*******************************************************************************
*
- * FUNCTION: TrLinkPeerNodes
+ * FUNCTION: TrLinkPeerOps
*
- * PARAMETERS: NumPeers - The number of nodes in the list to follow
- * ... - A list of nodes to link together as peers
+ * PARAMETERS: NumPeers - The number of ops in the list to follow
+ * ... - A list of ops to link together as peers
*
- * RETURN: The first node in the list (head of the peer list)
+ * RETURN: The first op in the list (head of the peer list)
*
- * DESCRIPTION: Link together an arbitrary number of peer nodes.
+ * DESCRIPTION: Link together an arbitrary number of peer ops.
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrLinkPeerNodes (
+TrLinkPeerOps (
UINT32 NumPeers,
...)
{
@@ -1588,7 +666,7 @@ TrLinkPeerNodes (
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkPeerNodes: (%u) ", NumPeers);
+ "\nLinkPeerOps: (%u) ", NumPeers);
va_start (ap, NumPeers);
This = va_arg (ap, ACPI_PARSE_OBJECT *);
@@ -1606,21 +684,21 @@ TrLinkPeerNodes (
This = This->Asl.Next;
}
- /* Get another peer node */
+ /* Get another peer op */
Next = va_arg (ap, ACPI_PARSE_OBJECT *);
if (!Next)
{
- Next = TrAllocateNode (PARSEOP_DEFAULT_ARG);
+ Next = TrAllocateOp (PARSEOP_DEFAULT_ARG);
}
- /* link new node to the current node */
+ /* link new op to the current op */
This->Asl.Next = Next;
This = Next;
}
- va_end (ap);
+ va_end (ap);
DbgPrint (ASL_PARSE_OUTPUT,"\n");
return (Start);
}
@@ -1628,19 +706,19 @@ TrLinkPeerNodes (
/*******************************************************************************
*
- * FUNCTION: TrLinkChildNode
+ * FUNCTION: TrLinkChildOp
*
- * PARAMETERS: Op1 - Parent node
+ * PARAMETERS: Op1 - Parent op
* Op2 - Op to become a child
*
- * RETURN: The parent node
+ * RETURN: The parent op
*
- * DESCRIPTION: Link two nodes together as a parent and child
+ * DESCRIPTION: Link two ops together as a parent and child
*
******************************************************************************/
ACPI_PARSE_OBJECT *
-TrLinkChildNode (
+TrLinkChildOp (
ACPI_PARSE_OBJECT *Op1,
ACPI_PARSE_OBJECT *Op2)
{
@@ -1648,23 +726,24 @@ TrLinkChildNode (
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n",
+ "\nLinkChildOp: Parent=%p (%s), Child=%p (%s)\n",
Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode): NULL,
Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode): NULL);
/*
- * Converter: if TrLinkChildNode is called to link a method call,
+ * Converter: if TrLinkChildOp is called to link a method call,
* turn on capture comments as it signifies that we are done parsing
* a method call.
*/
- if (Gbl_CaptureComments)
+ if (Gbl_CaptureComments && Op1)
{
if (Op1->Asl.ParseOpcode == PARSEOP_METHODCALL)
{
Gbl_CommentState.CaptureComments = TRUE;
}
- Gbl_CommentState.Latest_Parse_Node = Op1;
+ Gbl_CommentState.LatestParseOp = Op1;
}
+
if (!Op1 || !Op2)
{
return (Op1);
@@ -1689,7 +768,8 @@ TrLinkChildNode (
*
* FUNCTION: TrWalkParseTree
*
- * PARAMETERS: Visitation - Type of walk
+ * PARAMETERS: Op - Walk starting point
+ * Visitation - Type of walk
* DescendingCallback - Called during tree descent
* AscendingCallback - Called during tree ascent
* Context - To be passed to the callbacks
@@ -1709,7 +789,7 @@ TrWalkParseTree (
void *Context)
{
UINT32 Level;
- BOOLEAN NodePreviouslyVisited;
+ BOOLEAN OpPreviouslyVisited;
ACPI_PARSE_OBJECT *StartOp = Op;
ACPI_STATUS Status;
@@ -1720,7 +800,7 @@ TrWalkParseTree (
}
Level = 0;
- NodePreviouslyVisited = FALSE;
+ OpPreviouslyVisited = FALSE;
switch (Visitation)
{
@@ -1728,9 +808,9 @@ TrWalkParseTree (
while (Op)
{
- if (!NodePreviouslyVisited)
+ if (!OpPreviouslyVisited)
{
- /* Let the callback process the node. */
+ /* Let the callback process the op. */
Status = DescendingCallback (Op, Level, Context);
if (ACPI_SUCCESS (Status))
@@ -1764,7 +844,7 @@ TrWalkParseTree (
if (Op->Asl.Next)
{
Op = Op->Asl.Next;
- NodePreviouslyVisited = FALSE;
+ OpPreviouslyVisited = FALSE;
}
else
{
@@ -1775,7 +855,7 @@ TrWalkParseTree (
Level--;
}
Op = Op->Asl.Parent;
- NodePreviouslyVisited = TRUE;
+ OpPreviouslyVisited = TRUE;
}
}
break;
@@ -1784,12 +864,12 @@ TrWalkParseTree (
while (Op)
{
- /* Visit leaf node (no children) or parent node on return trip */
+ /* Visit leaf op (no children) or parent op on return trip */
if ((!Op->Asl.Child) ||
- (NodePreviouslyVisited))
+ (OpPreviouslyVisited))
{
- /* Let the callback process the node. */
+ /* Let the callback process the op. */
Status = AscendingCallback (Op, Level, Context);
if (ACPI_FAILURE (Status))
@@ -1818,7 +898,7 @@ TrWalkParseTree (
if (Op->Asl.Next)
{
Op = Op->Asl.Next;
- NodePreviouslyVisited = FALSE;
+ OpPreviouslyVisited = FALSE;
}
else
{
@@ -1829,7 +909,7 @@ TrWalkParseTree (
Level--;
}
Op = Op->Asl.Parent;
- NodePreviouslyVisited = TRUE;
+ OpPreviouslyVisited = TRUE;
}
}
break;
@@ -1838,7 +918,7 @@ TrWalkParseTree (
while (Op)
{
- if (NodePreviouslyVisited)
+ if (OpPreviouslyVisited)
{
Status = AscendingCallback (Op, Level, Context);
if (ACPI_FAILURE (Status))
@@ -1848,7 +928,7 @@ TrWalkParseTree (
}
else
{
- /* Let the callback process the node. */
+ /* Let the callback process the op. */
Status = DescendingCallback (Op, Level, Context);
if (ACPI_SUCCESS (Status))
@@ -1882,7 +962,7 @@ TrWalkParseTree (
if (Op->Asl.Next)
{
Op = Op->Asl.Next;
- NodePreviouslyVisited = FALSE;
+ OpPreviouslyVisited = FALSE;
}
else
{
@@ -1893,7 +973,7 @@ TrWalkParseTree (
Level--;
}
Op = Op->Asl.Parent;
- NodePreviouslyVisited = TRUE;
+ OpPreviouslyVisited = TRUE;
}
}
break;
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h
index d8fafe0..e425087 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.h
+++ b/sys/contrib/dev/acpica/compiler/asltypes.h
@@ -162,27 +162,29 @@
/* Op flags for the ACPI_PARSE_OBJECT */
-#define NODE_VISITED 0x00000001
-#define NODE_AML_PACKAGE 0x00000002
-#define NODE_IS_TARGET 0x00000004
-#define NODE_IS_RESOURCE_DESC 0x00000008
-#define NODE_IS_RESOURCE_FIELD 0x00000010
-#define NODE_HAS_NO_EXIT 0x00000020
-#define NODE_IF_HAS_NO_EXIT 0x00000040
-#define NODE_NAME_INTERNALIZED 0x00000080
-#define NODE_METHOD_NO_RETVAL 0x00000100
-#define NODE_METHOD_SOME_NO_RETVAL 0x00000200
-#define NODE_RESULT_NOT_USED 0x00000400
-#define NODE_METHOD_TYPED 0x00000800
-#define NODE_COULD_NOT_REDUCE 0x00001000
-#define NODE_COMPILE_TIME_CONST 0x00002000
-#define NODE_IS_TERM_ARG 0x00004000
-#define NODE_WAS_ONES_OP 0x00008000
-#define NODE_IS_NAME_DECLARATION 0x00010000
-#define NODE_COMPILER_EMITTED 0x00020000
-#define NODE_IS_DUPLICATE 0x00040000
-#define NODE_IS_RESOURCE_DATA 0x00080000
-#define NODE_IS_NULL_RETURN 0x00100000
+#define OP_VISITED 0x00000001
+#define OP_AML_PACKAGE 0x00000002
+#define OP_IS_TARGET 0x00000004
+#define OP_IS_RESOURCE_DESC 0x00000008
+#define OP_IS_RESOURCE_FIELD 0x00000010
+#define OP_HAS_NO_EXIT 0x00000020
+#define OP_IF_HAS_NO_EXIT 0x00000040
+#define OP_NAME_INTERNALIZED 0x00000080
+#define OP_METHOD_NO_RETVAL 0x00000100
+#define OP_METHOD_SOME_NO_RETVAL 0x00000200
+#define OP_RESULT_NOT_USED 0x00000400
+#define OP_METHOD_TYPED 0x00000800
+#define OP_COULD_NOT_REDUCE 0x00001000
+#define OP_COMPILE_TIME_CONST 0x00002000
+#define OP_IS_TERM_ARG 0x00004000
+#define OP_WAS_ONES_OP 0x00008000
+#define OP_IS_NAME_DECLARATION 0x00010000
+#define OP_COMPILER_EMITTED 0x00020000
+#define OP_IS_DUPLICATE 0x00040000
+#define OP_IS_RESOURCE_DATA 0x00080000
+#define OP_IS_NULL_RETURN 0x00100000
+
+#define ACPI_NUM_OP_FLAGS 0x21
/* Keeps information about individual control methods */
@@ -353,6 +355,15 @@ typedef struct asl_error_msg
} ASL_ERROR_MSG;
+/* An entry in the expected messages array */
+typedef struct asl_expected_message
+{
+ UINT32 MessageId;
+ char *MessageIdStr;
+ BOOLEAN MessageReceived;
+
+} ASL_EXPECTED_MESSAGE;
+
/* An entry in the listing file stack (for include files) */
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.y b/sys/contrib/dev/acpica/compiler/asltypes.y
index 7f0680e..6886a0d 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.y
+++ b/sys/contrib/dev/acpica/compiler/asltypes.y
@@ -432,6 +432,11 @@ NoEcho('
%type <n> Memory32Term
%type <n> NameSeg
%type <n> NameString
+%type <n> PinConfigTerm
+%type <n> PinFunctionTerm
+%type <n> PinGroupTerm
+%type <n> PinGroupConfigTerm
+%type <n> PinGroupFunctionTerm
%type <n> QWordIOTerm
%type <n> QWordMemoryTerm
%type <n> QWordSpaceTerm
@@ -487,6 +492,7 @@ NoEcho('
%type <n> OptionalReference
%type <n> OptionalResourceType
%type <n> OptionalResourceType_First
+%type <n> OptionalProducerResourceType
%type <n> OptionalReturnArg
%type <n> OptionalSerializeRuleKeyword
%type <n> OptionalShareType
diff --git a/sys/contrib/dev/acpica/compiler/aslutils.c b/sys/contrib/dev/acpica/compiler/aslutils.c
index bbea58e..e4d8eef 100644
--- a/sys/contrib/dev/acpica/compiler/aslutils.c
+++ b/sys/contrib/dev/acpica/compiler/aslutils.c
@@ -174,6 +174,12 @@ UtAttachNameseg (
ACPI_PARSE_OBJECT *Op,
char *Name);
+static void
+UtReallocLineBuffers (
+ char **Buffer,
+ UINT32 OldSize,
+ UINT32 NewSize);
+
/*******************************************************************************
*
@@ -635,7 +641,7 @@ UtCheckIntegerRange (
*
* PARAMETERS: Length - Size of buffer requested
*
- * RETURN: Pointer to the buffer. Aborts on allocation failure
+ * RETURN: Pointer to the buffer. Aborts compiler on allocation failure
*
* DESCRIPTION: Allocate a string buffer. Bypass the local
* dynamic memory manager for performance reasons (This has a
@@ -733,43 +739,48 @@ UtExpandLineBuffers (
Gbl_LineBufferSize, NewSize);
}
- Gbl_CurrentLineBuffer = realloc (Gbl_CurrentLineBuffer, NewSize);
+ UtReallocLineBuffers (&Gbl_CurrentLineBuffer, Gbl_LineBufferSize, NewSize);
+ UtReallocLineBuffers (&Gbl_MainTokenBuffer, Gbl_LineBufferSize, NewSize);
+ UtReallocLineBuffers (&Gbl_MacroTokenBuffer, Gbl_LineBufferSize, NewSize);
+ UtReallocLineBuffers (&Gbl_ExpressionTokenBuffer, Gbl_LineBufferSize, NewSize);
+
Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
- if (!Gbl_CurrentLineBuffer)
- {
- goto ErrorExit;
- }
+ Gbl_LineBufferSize = NewSize;
+}
- Gbl_MainTokenBuffer = realloc (Gbl_MainTokenBuffer, NewSize);
- if (!Gbl_MainTokenBuffer)
- {
- goto ErrorExit;
- }
- Gbl_MacroTokenBuffer = realloc (Gbl_MacroTokenBuffer, NewSize);
- if (!Gbl_MacroTokenBuffer)
- {
- goto ErrorExit;
- }
+/******************************************************************************
+ *
+ * FUNCTION: UtReallocLineBuffers
+ *
+ * PARAMETERS: Buffer - Buffer to realloc
+ * OldSize - Old size of Buffer
+ * NewSize - New size of Buffer
+ *
+ * RETURN: none
+ *
+ * DESCRIPTION: Reallocate and initialize Buffer
+ *
+ *****************************************************************************/
- Gbl_ExpressionTokenBuffer = realloc (Gbl_ExpressionTokenBuffer, NewSize);
- if (!Gbl_ExpressionTokenBuffer)
+static void
+UtReallocLineBuffers (
+ char **Buffer,
+ UINT32 OldSize,
+ UINT32 NewSize)
+{
+
+ *Buffer = realloc (*Buffer, NewSize);
+ if (*Buffer)
{
- goto ErrorExit;
+ memset (*Buffer + OldSize, 0, NewSize - OldSize);
+ return;
}
- Gbl_LineBufferSize = NewSize;
- return;
-
-
- /* On error above, simply issue error messages and abort, cannot continue */
-
-ErrorExit:
printf ("Could not increase line buffer size from %u to %u\n",
- Gbl_LineBufferSize, Gbl_LineBufferSize * 2);
+ OldSize, NewSize);
- AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION,
- NULL, NULL);
+ AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, NULL, NULL);
AslAbort ();
}
@@ -833,10 +844,6 @@ UtInternalizeName (
/* We need a segment to store the internal name */
Info.InternalName = UtStringCacheCalloc (Info.Length);
- if (!Info.InternalName)
- {
- return (AE_NO_MEMORY);
- }
/* Build the name */
diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c
index fc6ee87..04a2656 100644
--- a/sys/contrib/dev/acpica/compiler/aslwalks.c
+++ b/sys/contrib/dev/acpica/compiler/aslwalks.c
@@ -195,7 +195,7 @@ AnMethodTypingWalkEnd (
{
case PARSEOP_METHOD:
- Op->Asl.CompileFlags |= NODE_METHOD_TYPED;
+ Op->Asl.CompileFlags |= OP_METHOD_TYPED;
break;
case PARSEOP_RETURN:
diff --git a/sys/contrib/dev/acpica/compiler/aslxref.c b/sys/contrib/dev/acpica/compiler/aslxref.c
index 604a5a7..4c4dcc2 100644
--- a/sys/contrib/dev/acpica/compiler/aslxref.c
+++ b/sys/contrib/dev/acpica/compiler/aslxref.c
@@ -533,7 +533,7 @@ XfNamespaceLocateBegin (
* references to other objects within the namespace and the parent objects
* of name declarations
*/
- if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
+ if (Op->Asl.CompileFlags & OP_IS_NAME_DECLARATION)
{
return_ACPI_STATUS (AE_OK);
}
@@ -559,7 +559,7 @@ XfNamespaceLocateBegin (
RegisterNumber = Op->Asl.AmlOpcode & 0x0007; /* 0x60 through 0x67 */
MethodLocals = Node->MethodLocals;
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
/* Local is being initialized */
@@ -603,7 +603,7 @@ XfNamespaceLocateBegin (
MethodArgs[RegisterNumber].Flags |= ASL_ARG_REFERENCED;
MethodArgs[RegisterNumber].Op = Op;
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
+ if (Op->Asl.CompileFlags & OP_IS_TARGET)
{
/* Arg is being initialized */
@@ -621,7 +621,8 @@ XfNamespaceLocateBegin (
(!(OpInfo->Flags & AML_CREATE)) &&
(Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
(Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
- (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
+ (Op->Asl.ParseOpcode != PARSEOP_METHODCALL) &&
+ (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL))
{
return_ACPI_STATUS (AE_OK);
}
@@ -644,7 +645,8 @@ XfNamespaceLocateBegin (
Flags = ACPI_NS_SEARCH_PARENT;
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
- (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
+ (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) ||
+ (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
{
/*
* These are name references, do not push the scope stack
@@ -674,7 +676,7 @@ XfNamespaceLocateBegin (
/* Name must appear as the last parameter */
NextOp = Op->Asl.Child;
- while (!(NextOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
+ while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION))
{
NextOp = NextOp->Asl.Next;
}
@@ -914,7 +916,7 @@ XfNamespaceLocateBegin (
Op->Asl.AmlLength = 0;
Op->Asl.ParseOpcode = PARSEOP_INTEGER;
Op->Asl.Value.Integer = (UINT64) Offset;
- Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD;
+ Op->Asl.CompileFlags |= OP_IS_RESOURCE_FIELD;
OpcGenerateAmlOpcode (Op);
}
@@ -1183,7 +1185,8 @@ XfNamespaceLocateEnd (
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
- (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
+ (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) ||
+ (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL))
{
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/cvcompiler.c b/sys/contrib/dev/acpica/compiler/cvcompiler.c
index c9e5b71..57eef4b 100644
--- a/sys/contrib/dev/acpica/compiler/cvcompiler.c
+++ b/sys/contrib/dev/acpica/compiler/cvcompiler.c
@@ -164,7 +164,7 @@
* StringBuffer Buffer containing the comment being processed
* c1 Current input
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Process a single line comment of a c Style comment. This
* function captures a line of a c style comment in a char* and
@@ -191,6 +191,7 @@ CvProcessComment (
*StringBuffer = (char) c1;
++StringBuffer;
*StringBuffer = 0;
+
CvDbgPrint ("Multi-line comment\n");
CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
strcpy (CommentString, MsgBuffer);
@@ -198,17 +199,15 @@ CvProcessComment (
CvDbgPrint ("CommentString: %s\n", CommentString);
/*
- * Determine whether if this comment spans multiple lines.
- * If so, break apart the comment by line so that it can be
- * properly indented.
+ * Determine whether if this comment spans multiple lines. If so,
+ * break apart the comment by storing each line in a different node
+ * within the comment list. This allows the disassembler to
+ * properly indent a multi-line comment.
*/
- if (strchr (CommentString, '\n') != NULL)
+ LineToken = strtok (CommentString, "\n");
+
+ if (LineToken)
{
- /*
- * Get the first token. The for loop pads subsequent lines
- * for comments similar to the style of this comment.
- */
- LineToken = strtok (CommentString, "\n");
FinalLineToken = UtStringCacheCalloc (strlen (LineToken) + 1);
strcpy (FinalLineToken, LineToken);
@@ -218,14 +217,15 @@ CvProcessComment (
{
FinalLineToken[strlen(FinalLineToken)-1] = 0;
}
+
CvAddToCommentList (FinalLineToken);
LineToken = strtok (NULL, "\n");
while (LineToken != NULL)
{
/*
* It is assumed that each line has some sort of indentation.
- * This means that we need to find the first character that is not
- * a white space within each line.
+ * This means that we need to find the first character that
+ * is not a white space within each line.
*/
CharStart = FALSE;
for (i = 0; (i < (strlen (LineToken) + 1)) && !CharStart; i++)
@@ -237,6 +237,7 @@ CvProcessComment (
LineToken [0] = ' '; /* Pad for Formatting */
}
}
+
FinalLineToken = UtStringCacheCalloc (strlen (LineToken) + 1);
strcat (FinalLineToken, LineToken);
@@ -246,29 +247,36 @@ CvProcessComment (
{
FinalLineToken[strlen(FinalLineToken) - 1] = 0;
}
+
CvAddToCommentList (FinalLineToken);
LineToken = strtok (NULL,"\n");
}
}
/*
- * If this only spans a single line, check to see whether if this comment
- * appears on the same line as a line of code. If does, retain it's
- * position for stylistic reasons. If it doesn't, add it to the comment
- * List so that it can be associated with the next node that's created.
+ * If this only spans a single line, check to see whether if this
+ * comment appears on the same line as a line of code. If does,
+ * retain it's position for stylistic reasons. If it doesn't,
+ * add it to the comment list so that it can be associated with
+ * the next node that's created.
*/
else
{
/*
- * if this is not a regular comment, pad with extra spaces that appeared
- * in the original source input to retain the original spacing.
+ * If this is not a regular comment, pad with extra spaces that
+ * appeared in the original source input to retain the original
+ * spacing.
*/
- FinalCommentString = UtStringCacheCalloc (strlen (CommentString) + CurrentState.SpacesBefore + 1);
- for (i=0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) &&
- (i < CurrentState.SpacesBefore); ++i)
+ FinalCommentString =
+ UtStringCacheCalloc (strlen (CommentString) +
+ CurrentState.SpacesBefore + 1);
+
+ for (i = 0; (CurrentState.CommentType != ASL_COMMENT_STANDARD) &&
+ (i < CurrentState.SpacesBefore); i++)
{
FinalCommentString[i] = ' ';
}
+
strcat (FinalCommentString, CommentString);
CvPlaceComment (CurrentState.CommentType, FinalCommentString);
}
@@ -308,10 +316,10 @@ CvProcessCommentType2 (
CommentString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
strcpy (CommentString, MsgBuffer);
- /* If this comment lies on the same line as the latest parse node,
- * assign it to that node's CommentAfter field. Saving in this field
- * will allow us to support comments that come after code on the same
- * line as the code itself. For example,
+ /* If this comment lies on the same line as the latest parse op,
+ * assign it to that op's CommentAfter field. Saving in this field
+ * will allow us to support comments that come after code on the
+ * same line as the code itself. For example,
* Name(A,"") //comment
*
* will be retained rather than transformed into
@@ -328,29 +336,36 @@ CvProcessCommentType2 (
* Create a new string with the approperiate spaces. Since we need
* to account for the proper spacing, the actual comment,
* extra 2 spaces so that this comment can be converted to the "/ *"
- * style and the null terminator, the string would look something like
+ * style and the null terminator, the string would look something
+ * like:
*
* [ (spaces) (comment) ( * /) ('\0') ]
*
*/
- FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore + strlen (CommentString) + 3 + 1);
- for (i=0; (CurrentState.CommentType!=1) && (i<CurrentState.SpacesBefore); ++i)
+ FinalCommentString = UtStringCacheCalloc (CurrentState.SpacesBefore +
+ strlen (CommentString) + 3 + 1);
+
+ for (i = 0; (CurrentState.CommentType != 1) &&
+ (i < CurrentState.SpacesBefore); i++)
{
FinalCommentString[i] = ' ';
}
+
strcat (FinalCommentString, CommentString);
/* convert to a "/ *" style comment */
strcat (FinalCommentString, " */");
- FinalCommentString [CurrentState.SpacesBefore + strlen (CommentString) + 3] = 0;
+ FinalCommentString [CurrentState.SpacesBefore +
+ strlen (CommentString) + 3] = 0;
/* get rid of the carriage return */
if (FinalCommentString[strlen (FinalCommentString) - 1] == 0x0D)
{
- FinalCommentString[strlen(FinalCommentString)-1] = 0;
+ FinalCommentString[strlen(FinalCommentString) - 1] = 0;
}
+
CvPlaceComment (CurrentState.CommentType, FinalCommentString);
}
}
@@ -362,9 +377,9 @@ CvProcessCommentType2 (
*
* PARAMETERS: Op - Calculate all comments of this Op
*
- * RETURN: TotalCommentLength - Length of all comments within this node.
+ * RETURN: TotalCommentLength - Length of all comments within this op.
*
- * DESCRIPTION: calculate the length that the each comment takes up within Op.
+ * DESCRIPTION: Calculate the length that the each comment takes up within Op.
* Comments look like the follwoing: [0xA9 OptionBtye comment 0x00]
* therefore, we add 1 + 1 + strlen (comment) + 1 to get the actual
* length of this comment.
@@ -385,7 +400,9 @@ CvCalculateCommentLengths(
return (0);
}
- CvDbgPrint ("==Calculating comment lengths for %s\n", Op->Asl.ParseOpName);
+ CvDbgPrint ("==Calculating comment lengths for %s\n",
+ Op->Asl.ParseOpName);
+
if (Op->Asl.FileChanged)
{
TotalCommentLength += strlen (Op->Asl.Filename) + 3;
@@ -396,6 +413,7 @@ CvCalculateCommentLengths(
TotalCommentLength += strlen (Op->Asl.ParentFilename) + 3;
}
}
+
if (Op->Asl.CommentList)
{
Current = Op->Asl.CommentList;
@@ -408,6 +426,7 @@ CvCalculateCommentLengths(
Current = Current->Next;
}
}
+
if (Op->Asl.EndBlkComment)
{
Current = Op->Asl.EndBlkComment;
@@ -420,6 +439,7 @@ CvCalculateCommentLengths(
Current = Current->Next;
}
}
+
if (Op->Asl.InlineComment)
{
CommentLength = strlen (Op->Asl.InlineComment)+3;
@@ -427,6 +447,7 @@ CvCalculateCommentLengths(
CvDbgPrint (" Comment string: %s\n\n", Op->Asl.InlineComment);
TotalCommentLength += CommentLength;
}
+
if (Op->Asl.EndNodeComment)
{
CommentLength = strlen(Op->Asl.EndNodeComment)+3;
@@ -444,9 +465,7 @@ CvCalculateCommentLengths(
}
CvDbgPrint("\n\n");
-
- return TotalCommentLength;
-
+ return (TotalCommentLength);
}
@@ -486,7 +505,7 @@ CgWriteAmlDefBlockComment(
CvDbgPrint ("Printing comments for a definition block..\n");
- /* first, print the file name comment after changing .asl to .dsl */
+ /* First, print the file name comment after changing .asl to .dsl */
NewFilename = UtStringCacheCalloc (strlen (Op->Asl.Filename));
strcpy (NewFilename, Op->Asl.Filename);
@@ -514,15 +533,17 @@ CgWriteAmlDefBlockComment(
Current = Op->Asl.CommentList;
CommentOption = STD_DEFBLK_COMMENT;
+
while (Current)
{
CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
CvDbgPrint ("Printing comment: %s\n", Current->Comment);
Current = Current->Next;
}
+
Op->Asl.CommentList = NULL;
- /* print any Inline comments associated with this node */
+ /* Print any Inline comments associated with this node */
if (Op->Asl.CloseBraceComment)
{
@@ -553,8 +574,14 @@ CgWriteOneAmlComment(
char* CommentToPrint,
UINT8 InputOption)
{
- UINT8 CommentOption = InputOption;
- UINT8 CommentOpcode = (UINT8)AML_COMMENT_OP;
+ UINT8 CommentOption = InputOption;
+ UINT8 CommentOpcode = (UINT8) AML_COMMENT_OP;
+
+
+ if (!CommentToPrint)
+ {
+ return;
+ }
CgLocalWriteAmlData (Op, &CommentOpcode, 1);
CgLocalWriteAmlData (Op, &CommentOption, 1);
@@ -573,8 +600,7 @@ CgWriteOneAmlComment(
*
* RETURN: None
*
- * DESCRIPTION: write all comments pertaining to the
- * current parse op
+ * DESCRIPTION: Write all comments pertaining to the current parse op
*
******************************************************************************/
@@ -599,12 +625,16 @@ CgWriteAmlComment(
if (Op->Asl.FileChanged)
{
- /* first, print the file name comment after changing .asl to .dsl */
+ /* First, print the file name comment after changing .asl to .dsl */
NewFilename =
FlGenerateFilename (Op->Asl.Filename, FILE_SUFFIX_DISASSEMBLY);
- CvDbgPrint ("Writing file comment, \"%s\" for %s\n",
- NewFilename, Op->Asl.ParseOpName);
+ if (NewFilename)
+ {
+ CvDbgPrint ("Writing file comment, \"%s\" for %s\n",
+ NewFilename, Op->Asl.ParseOpName);
+ }
+
CgWriteOneAmlComment(Op, NewFilename, FILENAME_COMMENT);
if (Op->Asl.ParentFilename &&
@@ -615,7 +645,7 @@ CgWriteAmlComment(
CgWriteOneAmlComment(Op, ParentFilename, PARENTFILENAME_COMMENT);
}
- /* prevent multiple writes of the same comment */
+ /* Prevent multiple writes of the same comment */
Op->Asl.FileChanged = FALSE;
}
@@ -640,6 +670,7 @@ CgWriteAmlComment(
CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
Current = Current->Next;
}
+
Op->Asl.CommentList = NULL;
Current = Op->Asl.EndBlkComment;
@@ -649,9 +680,10 @@ CgWriteAmlComment(
CgWriteOneAmlComment(Op, Current->Comment, CommentOption);
Current = Current->Next;
}
+
Op->Asl.EndBlkComment = NULL;
- /* print any Inline comments associated with this node */
+ /* Print any Inline comments associated with this node */
if (Op->Asl.InlineComment)
{
@@ -680,7 +712,7 @@ CgWriteAmlComment(
*
* FUNCTION: CvCommentNodeCalloc
*
- * PARAMETERS: none
+ * PARAMETERS: None
*
* RETURN: Pointer to the comment node. Aborts on allocation failure
*
@@ -688,17 +720,16 @@ CgWriteAmlComment(
*
******************************************************************************/
-ACPI_COMMENT_NODE*
+ACPI_COMMENT_NODE *
CvCommentNodeCalloc (
void)
{
ACPI_COMMENT_NODE *NewCommentNode;
- NewCommentNode =
- (ACPI_COMMENT_NODE*) UtLocalCalloc (sizeof(ACPI_COMMENT_NODE));
+ NewCommentNode = UtLocalCalloc (sizeof (ACPI_COMMENT_NODE));
NewCommentNode->Next = NULL;
- return NewCommentNode;
+ return (NewCommentNode);
}
@@ -720,6 +751,7 @@ UINT32
CvParseOpBlockType (
ACPI_PARSE_OBJECT *Op)
{
+
if (!Op)
{
return (BLOCK_NONE);
@@ -727,8 +759,7 @@ CvParseOpBlockType (
switch (Op->Asl.ParseOpcode)
{
-
- /* from aslprimaries.y */
+ /* From aslprimaries.y */
case PARSEOP_VAR_PACKAGE:
case PARSEOP_BANKFIELD:
@@ -750,7 +781,7 @@ CvParseOpBlockType (
case PARSEOP_THERMALZONE:
case PARSEOP_WHILE:
- /* from aslresources.y */
+ /* From aslresources.y */
case PARSEOP_RESOURCETEMPLATE: /* optional parens */
case PARSEOP_VENDORLONG:
@@ -762,13 +793,12 @@ CvParseOpBlockType (
case PARSEOP_GPIO_IO:
case PARSEOP_DMA:
- /*from aslrules.y */
+ /* From aslrules.y */
case PARSEOP_DEFINITION_BLOCK:
return (BLOCK_PAREN | BLOCK_BRACE);
default:
-
return (BLOCK_NONE);
}
}
@@ -778,7 +808,7 @@ CvParseOpBlockType (
*
* FUNCTION: CvProcessCommentState
*
- * PARAMETERS: char
+ * PARAMETERS: Input - Input character
*
* RETURN: None
*
@@ -790,15 +820,15 @@ CvParseOpBlockType (
void
CvProcessCommentState (
- char input)
+ char Input)
{
- if (input != ' ')
+ if (Input != ' ')
{
Gbl_CommentState.SpacesBefore = 0;
}
- switch (input)
+ switch (Input)
{
case '\n':
@@ -843,7 +873,6 @@ CvProcessCommentState (
Gbl_CommentState.CommentType = ASLCOMMENT_INLINE;
break;
-
}
}
@@ -852,7 +881,7 @@ CvProcessCommentState (
*
* FUNCTION: CvAddToCommentList
*
- * PARAMETERS: toAdd - Contains the comment to be inserted
+ * PARAMETERS: ToAdd - Contains the comment to be inserted
*
* RETURN: None
*
@@ -863,24 +892,24 @@ CvProcessCommentState (
void
CvAddToCommentList (
- char* ToAdd)
+ char *ToAdd)
{
- if (Gbl_Comment_List_Head)
+
+ if (Gbl_CommentListHead)
{
- Gbl_Comment_List_Tail->Next = CvCommentNodeCalloc ();
- Gbl_Comment_List_Tail = Gbl_Comment_List_Tail->Next;
+ Gbl_CommentListTail->Next = CvCommentNodeCalloc ();
+ Gbl_CommentListTail = Gbl_CommentListTail->Next;
}
else
{
- Gbl_Comment_List_Head = CvCommentNodeCalloc ();
- Gbl_Comment_List_Tail = Gbl_Comment_List_Head;
+ Gbl_CommentListHead = CvCommentNodeCalloc ();
+ Gbl_CommentListTail = Gbl_CommentListHead;
}
- Gbl_Comment_List_Tail->Comment = ToAdd;
-
- return;
+ Gbl_CommentListTail->Comment = ToAdd;
}
+
/*******************************************************************************
*
* FUNCTION: CvAppendInlineComment
@@ -894,7 +923,7 @@ CvAddToCommentList (
*
******************************************************************************/
-char*
+char *
CvAppendInlineComment (
char *InlineComment,
char *ToAdd)
@@ -905,19 +934,22 @@ CvAppendInlineComment (
if (!InlineComment)
{
- return ToAdd;
+ return (ToAdd);
}
- if (ToAdd)
+
+ if (!ToAdd)
{
- Size = strlen (ToAdd);
+ return (InlineComment);
}
+
+ Size = strlen (ToAdd);
Size += strlen (InlineComment);
- Str = UtStringCacheCalloc (Size+1);
+ Str = UtStringCacheCalloc (Size + 1);
+
strcpy (Str, InlineComment);
strcat (Str, ToAdd);
- Str[Size+1] = 0;
-
- return Str;
+ Str[Size +1] = 0;
+ return (Str);
}
@@ -925,8 +957,8 @@ CvAppendInlineComment (
*
* FUNCTION: CvPlaceComment
*
- * PARAMETERS: Int - Type
- * char* - CommentString
+ * PARAMETERS: UINT8 - Type
+ * char * - CommentString
*
* RETURN: None
*
@@ -944,7 +976,7 @@ CvPlaceComment(
ACPI_PARSE_OBJECT *ParenBraceNode;
- LatestParseNode = Gbl_CommentState.Latest_Parse_Node;
+ LatestParseNode = Gbl_CommentState.LatestParseOp;
ParenBraceNode = Gbl_CommentState.ParsingParenBraceNode;
CvDbgPrint ("Placing comment %s for type %d\n", CommentString, Type);
@@ -964,8 +996,8 @@ CvPlaceComment(
case ASL_COMMENT_OPEN_PAREN:
- Gbl_Inline_Comment_Buffer =
- CvAppendInlineComment(Gbl_Inline_Comment_Buffer,
+ Gbl_InlineCommentBuffer =
+ CvAppendInlineComment(Gbl_InlineCommentBuffer,
CommentString);
break;
@@ -993,6 +1025,5 @@ CvPlaceComment(
default:
break;
-
}
}
diff --git a/sys/contrib/dev/acpica/compiler/cvdisasm.c b/sys/contrib/dev/acpica/compiler/cvdisasm.c
index 0ddf2a5..25deb73 100644
--- a/sys/contrib/dev/acpica/compiler/cvdisasm.c
+++ b/sys/contrib/dev/acpica/compiler/cvdisasm.c
@@ -156,6 +156,8 @@
#include <contrib/dev/acpica/include/acconvert.h>
+/* Local prototypes */
+
static void
CvPrintInclude(
ACPI_FILE_NODE *FNode,
@@ -198,6 +200,7 @@ CvPrintOneCommentList (
AcpiOsPrintf("%s\n", Current->Comment);
Current->Comment = NULL;
}
+
Current = Current->Next;
AcpiOsReleaseObject(AcpiGbl_RegCommentCache, Previous);
}
@@ -208,7 +211,7 @@ CvPrintOneCommentList (
*
* FUNCTION: CvListIsSingleton
*
- * PARAMETERS: CommentList -- check to see if this is a single item list.
+ * PARAMETERS: CommentList - check to see if this is a single item list.
*
* RETURN: BOOLEAN
*
@@ -221,16 +224,17 @@ CvListIsSingleton (
ACPI_COMMENT_NODE *CommentList)
{
+
if (!CommentList)
{
- return FALSE;
+ return (FALSE);
}
else if (CommentList->Next)
{
- return FALSE;
+ return (FALSE);
}
- return TRUE;
+ return (TRUE);
}
@@ -275,6 +279,7 @@ CvPrintOneCommentType (
{
CvPrintOneCommentList (Op->Common.CommentList, Level);
}
+
Op->Common.CommentList = NULL;
return;
@@ -314,6 +319,7 @@ CvPrintOneCommentType (
if (*CommentToPrint)
{
+ CommentExists = TRUE;
AcpiOsPrintf ("%s", *CommentToPrint);
*CommentToPrint = NULL;
}
@@ -332,7 +338,7 @@ CvPrintOneCommentType (
* PARAMETERS: Op
* Level
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Print a close brace } and any open brace comments associated
* with this parse object.
@@ -345,6 +351,7 @@ CvCloseBraceWriteComment(
ACPI_PARSE_OBJECT *Op,
UINT32 Level)
{
+
if (!Gbl_CaptureComments)
{
AcpiOsPrintf ("}");
@@ -364,7 +371,7 @@ CvCloseBraceWriteComment(
* PARAMETERS: Op
* Level
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Print a closing paren ) and any end node comments associated
* with this parse object.
@@ -377,6 +384,7 @@ CvCloseParenWriteComment(
ACPI_PARSE_OBJECT *Op,
UINT32 Level)
{
+
if (!Gbl_CaptureComments)
{
AcpiOsPrintf (")");
@@ -426,13 +434,15 @@ BOOLEAN
CvFileHasSwitched(
ACPI_PARSE_OBJECT *Op)
{
+
if (Op->Common.CvFilename &&
AcpiGbl_CurrentFilename &&
AcpiUtStricmp(Op->Common.CvFilename, AcpiGbl_CurrentFilename))
{
- return TRUE;
+ return (TRUE);
}
- return FALSE;
+
+ return (FALSE);
}
@@ -458,17 +468,21 @@ CvPrintInclude(
ACPI_FILE_NODE *FNode,
UINT32 Level)
{
+
if (!FNode || FNode->IncludeWritten)
{
return;
}
- CvDbgPrint ("Writing include for %s within %s\n", FNode->Filename, FNode->Parent->Filename);
+ CvDbgPrint ("Writing include for %s within %s\n",
+ FNode->Filename, FNode->Parent->Filename);
AcpiOsRedirectOutput (FNode->Parent->File);
CvPrintOneCommentList (FNode->IncludeComment, Level);
+
AcpiDmIndent (Level);
AcpiOsPrintf ("Include (\"%s\")\n", FNode->Filename);
- CvDbgPrint ("emitted the following: Include (\"%s\")\n", FNode->Filename);
+ CvDbgPrint ("emitted the following: Include (\"%s\")\n",
+ FNode->Filename);
FNode->IncludeWritten = TRUE;
}
@@ -477,7 +491,7 @@ CvPrintInclude(
*
* FUNCTION: CvSwitchFiles
*
- * PARAMETERS: Level - indentation level
+ * PARAMETERS: Level - indentation level
* Op
*
* RETURN: None
@@ -495,8 +509,11 @@ CvSwitchFiles(
{
char *Filename = Op->Common.CvFilename;
ACPI_FILE_NODE *FNode;
+ ACPI_FILE_NODE *Current;
- CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename, Filename);
+
+ CvDbgPrint ("Switching from %s to %s\n", AcpiGbl_CurrentFilename,
+ Filename);
FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot);
if (!FNode)
{
@@ -505,27 +522,30 @@ CvSwitchFiles(
* if it does not exist, then abort.
*/
FlDeleteFile (ASL_FILE_AML_OUTPUT);
- sprintf (MsgBuffer, "\"Cannot find %s\" - %s", Filename, strerror (errno));
- AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer);
+ sprintf (MsgBuffer, "\"Cannot find %s\" - %s",
+ Filename, strerror (errno));
+ AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0,
+ NULL, MsgBuffer);
AslAbort ();
}
+ Current = FNode;
+
/*
* If the previous file is a descendent of the current file,
* make sure that Include statements from the current file
* to the previous have been emitted.
*/
- while (FNode &&
- FNode->Parent &&
- AcpiUtStricmp (FNode->Filename, AcpiGbl_CurrentFilename))
+ while (Current &&
+ Current->Parent &&
+ AcpiUtStricmp (Current->Filename, AcpiGbl_CurrentFilename))
{
- CvPrintInclude (FNode, Level);
- FNode = FNode->Parent;
+ CvPrintInclude (Current, Level);
+ Current = Current->Parent;
}
- /* Redirect output to the Op->Common.CvFilename */
+ /* Redirect output to Op->Common.CvFilename */
- FNode = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot);
AcpiOsRedirectOutput (FNode->File);
AcpiGbl_CurrentFilename = FNode->Filename;
}
diff --git a/sys/contrib/dev/acpica/compiler/cvparser.c b/sys/contrib/dev/acpica/compiler/cvparser.c
index 74d9bb4..eb89c46 100644
--- a/sys/contrib/dev/acpica/compiler/cvparser.c
+++ b/sys/contrib/dev/acpica/compiler/cvparser.c
@@ -204,23 +204,24 @@ CvIsFilename (
char *Filename)
{
UINT64 Length = strlen(Filename);
- UINT64 i;
char *FileExt = Filename + Length - 4;
+ UINT64 i;
if ((Length > 4) && AcpiUtStricmp (FileExt, ".dsl"))
{
- return FALSE;
+ return (FALSE);
}
for(i = 0; i<Length; ++i)
{
- if (!isprint (Filename[i]))
+ if (!isprint ((int) Filename[i]))
{
- return FALSE;
+ return (FALSE);
}
}
- return TRUE;
+
+ return (TRUE);
}
@@ -232,7 +233,7 @@ CvIsFilename (
* AmlStart - Address of the starting point of the AML.
* AmlLength - Length of the AML file.
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Initialize the file dependency tree by scanning the AML.
* This is referred as ASL_CV_INIT_FILETREE.
@@ -263,6 +264,7 @@ CvInitFileTree (
CvDbgPrint ("AmlEnd?: %p\n", AmlStart+AmlLength);
AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
+
AcpiGbl_FileTreeRoot->FileStart = (char *)(AmlStart);
AcpiGbl_FileTreeRoot->FileEnd = (char *)(AmlStart + Table->Length);
AcpiGbl_FileTreeRoot->Next = NULL;
@@ -293,25 +295,27 @@ CvInitFileTree (
* raw data that doesn't outline a filename.
*/
if ((*TreeAml == AML_COMMENT_OP) &&
- (*(TreeAml+1) == FILENAME_COMMENT) &&
- (CvIsFilename ((char *)(TreeAml+2))))
+ (*(TreeAml +1) == FILENAME_COMMENT) &&
+ (CvIsFilename ((char *)(TreeAml +2))))
{
CvDbgPrint ("A9 and a 08 file\n");
PreviousFilename = Filename;
- Filename = (char *) (TreeAml+2);
+ Filename = (char *) (TreeAml +2);
+
CvAddToFileTree (Filename, PreviousFilename);
ChildFilename = Filename;
CvDbgPrint ("%s\n", Filename);
}
else if ((*TreeAml == AML_COMMENT_OP) &&
- (*(TreeAml+1) == PARENTFILENAME_COMMENT) &&
- (CvIsFilename ((char *)(TreeAml+2))))
+ (*(TreeAml +1) == PARENTFILENAME_COMMENT) &&
+ (CvIsFilename ((char *)(TreeAml +2))))
{
CvDbgPrint ("A9 and a 09 file\n");
- ParentFilename = (char *)(TreeAml+2);
+ ParentFilename = (char *)(TreeAml +2);
CvSetFileParent (ChildFilename, ParentFilename);
CvDbgPrint ("%s\n", ParentFilename);
}
+
++TreeAml;
}
}
@@ -323,7 +327,7 @@ CvInitFileTree (
*
* PARAMETERS: Op -- clear all comments within this Op
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Clear all converter-related fields of the given Op.
* This is referred as ASL_CV_CLEAR_OP_COMMENTS.
@@ -334,6 +338,7 @@ void
CvClearOpComments (
ACPI_PARSE_OBJECT *Op)
{
+
Op->Common.InlineComment = NULL;
Op->Common.EndNodeComment = NULL;
Op->Common.NameComment = NULL;
@@ -349,12 +354,12 @@ CvClearOpComments (
*
* FUNCTION: CvCommentExists
*
- * PARAMETERS: address - check if this address appears in the list
+ * PARAMETERS: Address - check if this address appears in the list
*
* RETURN: BOOLEAN - TRUE if the address exists.
*
- * DESCRIPTION: look at the pointer address and check if this appears in the
- * list of all addresses. If it exitsts in the list, return TRUE
+ * DESCRIPTION: Look at the pointer address and check if this appears in the
+ * list of all addresses. If it exists in the list, return TRUE
* if it exists. Otherwise add to the list and return FALSE.
*
******************************************************************************/
@@ -371,13 +376,15 @@ CvCommentExists (
{
return (FALSE);
}
+
Option = *(Address + 1);
/*
- * FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as comments.
- * They serve as markers for where the file starts and ends.
+ * FILENAME_COMMENT and PARENTFILENAME_COMMENT are not treated as
+ * comments. They serve as markers for where the file starts and ends.
*/
- if ((Option == FILENAME_COMMENT) || (Option == PARENTFILENAME_COMMENT))
+ if ((Option == FILENAME_COMMENT) ||
+ (Option == PARENTFILENAME_COMMENT))
{
return (FALSE);
}
@@ -405,13 +412,14 @@ CvCommentExists (
}
/*
- * If the execution gets to this point, it means that this address
- * does not exists in the list. Add this address to the
+ * If the execution gets to this point, it means that this
+ * address does not exists in the list. Add this address to the
* beginning of the list.
*/
Current = AcpiGbl_CommentAddrListHead;
AcpiGbl_CommentAddrListHead =
AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
+
AcpiGbl_CommentAddrListHead->Addr = Address;
AcpiGbl_CommentAddrListHead->Next = Current;
return (FALSE);
@@ -440,12 +448,18 @@ CvFilenameExists(
ACPI_FILE_NODE *Current = Head;
+ if (!Filename)
+ {
+ return (NULL);
+ }
+
while (Current)
{
if (!AcpiUtStricmp (Current->Filename, Filename))
{
return (Current);
}
+
Current = Current->Next;
}
return (NULL);
@@ -459,7 +473,7 @@ CvFilenameExists(
* PARAMETERS: Address - address to look up
* Head - file dependency tree
*
- * RETURN: ACPI_FLE_NODE - pointer to a file node containing the address
+ * RETURN: ACPI_FILE_NODE - pointer to a file node containing the address
*
* DESCRIPTION: Look for the given address in the file dependency tree.
* Returns the first file node where the given address is within
@@ -467,7 +481,7 @@ CvFilenameExists(
*
******************************************************************************/
-static ACPI_FILE_NODE*
+static ACPI_FILE_NODE *
CvFileAddressLookup(
char *Address,
ACPI_FILE_NODE *Head)
@@ -483,6 +497,7 @@ CvFileAddressLookup(
{
return (Current);
}
+
Current = Current->Next;
}
@@ -517,7 +532,8 @@ CvLabelFileNode(
return;
}
- Node = CvFileAddressLookup ((char *)Op->Common.Aml, AcpiGbl_FileTreeRoot);
+ Node = CvFileAddressLookup ((char *)
+ Op->Common.Aml, AcpiGbl_FileTreeRoot);
if (!Node)
{
return;
@@ -544,7 +560,7 @@ CvLabelFileNode(
* PreviousFilename - Address containing the name of the previous
* filename
*
- * RETURN: void
+ * RETURN: None
*
* DESCRIPTION: Add this filename to the AcpiGbl_FileTree if it does not exist.
*
@@ -581,9 +597,9 @@ CvAddToFileTree (
if (Node && PreviousFilename)
{
/*
- * Update the end of the previous file and all of their parents' ending
- * Addresses. This is done to ensure that parent file ranges extend to
- * the end of their childrens' files.
+ * Update the end of the previous file and all of their parents'
+ * ending addresses. This is done to ensure that parent file
+ * ranges extend to the end of their childrens' files.
*/
Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot);
if (Node && (Node->FileEnd < Filename))
@@ -596,6 +612,7 @@ CvAddToFileTree (
{
Node->FileEnd = Filename;
}
+
Node = Node->Parent;
}
}
@@ -604,6 +621,7 @@ CvAddToFileTree (
{
Node = AcpiGbl_FileTreeRoot;
AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
+
AcpiGbl_FileTreeRoot->Next = Node;
AcpiGbl_FileTreeRoot->Parent = NULL;
AcpiGbl_FileTreeRoot->Filename = Filename;
@@ -621,7 +639,8 @@ CvAddToFileTree (
FlDeleteFile (ASL_FILE_AML_OUTPUT);
sprintf (MsgBuffer, "\"%s\" - %s", Filename, strerror (errno));
- AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0, NULL, MsgBuffer);
+ AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0,
+ NULL, MsgBuffer);
AslAbort ();
}
}
@@ -635,9 +654,9 @@ CvAddToFileTree (
* PARAMETERS: ChildFile - contains the filename of the child file
* ParentFile - contains the filename of the parent file.
*
- * RETURN: none
+ * RETURN: None
*
- * DESCRIPTION: point the parent pointer of the Child to the node that
+ * DESCRIPTION: Point the parent pointer of the Child to the node that
* corresponds with the parent file node.
*
******************************************************************************/
@@ -653,6 +672,7 @@ CvSetFileParent (
Child = CvFilenameExists (ChildFile, AcpiGbl_FileTreeRoot);
Parent = CvFilenameExists (ParentFile, AcpiGbl_FileTreeRoot);
+
if (Child && Parent)
{
Child->Parent = Parent;
@@ -663,6 +683,7 @@ CvSetFileParent (
{
Child->Parent->FileEnd = Child->FileStart;
}
+
Child = Child->Parent;
}
}
@@ -675,9 +696,9 @@ CvSetFileParent (
*
* PARAMETERS: ParserState - A parser state object
*
- * RETURN: none
+ * RETURN: None
*
- * DESCRIPTION: look at the aml that the parser state is pointing to,
+ * DESCRIPTION: Look at the aml that the parser state is pointing to,
* capture any AML_COMMENT_OP and it's arguments and increment the
* aml pointer past the comment. Comments are transferred to parse
* nodes through CvTransferComments() as well as
@@ -715,13 +736,15 @@ CvCaptureCommentsOnly (
}
else
{
- CommentOption = *(Aml+1);
-
- /* Increment past the comment option and point the approperiate char pointers.*/
+ CommentOption = *(Aml +1);
+ /*
+ * Increment past the comment option and point the
+ * appropriate char pointers
+ */
Aml += 2;
- /* found a comment. Now, set pointers to these comments. */
+ /* Found a comment. Now, set pointers to these comments. */
switch (CommentOption)
{
@@ -729,9 +752,12 @@ CvCaptureCommentsOnly (
StdDefBlockFlag = TRUE;
- /* add to a linked list of nodes. This list will be taken by the parse node created next. */
-
- CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
+ /*
+ * Add to a linked list of nodes. This list will be
+ * taken by the parse node created next.
+ */
+ CommentNode = AcpiOsAcquireObject (
+ AcpiGbl_RegCommentCache);
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
CommentNode->Next = NULL;
@@ -743,7 +769,8 @@ CvCaptureCommentsOnly (
else
{
AcpiGbl_DefBlkCommentListTail->Next = CommentNode;
- AcpiGbl_DefBlkCommentListTail = AcpiGbl_DefBlkCommentListTail->Next;
+ AcpiGbl_DefBlkCommentListTail =
+ AcpiGbl_DefBlkCommentListTail->Next;
}
break;
@@ -751,9 +778,12 @@ CvCaptureCommentsOnly (
CvDbgPrint ("found regular comment.\n");
- /* add to a linked list of nodes. This list will be taken by the parse node created next. */
-
- CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
+ /*
+ * Add to a linked list of nodes. This list will be
+ * taken by the parse node created next.
+ */
+ CommentNode = AcpiOsAcquireObject (
+ AcpiGbl_RegCommentCache);
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
CommentNode->Next = NULL;
@@ -765,7 +795,8 @@ CvCaptureCommentsOnly (
else
{
AcpiGbl_RegCommentListTail->Next = CommentNode;
- AcpiGbl_RegCommentListTail = AcpiGbl_RegCommentListTail->Next;
+ AcpiGbl_RegCommentListTail =
+ AcpiGbl_RegCommentListTail->Next;
}
break;
@@ -773,9 +804,11 @@ CvCaptureCommentsOnly (
CvDbgPrint ("found endblk comment.\n");
- /* add to a linked list of nodes. This will be taken by the next created parse node. */
-
- CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
+ /* Add to a linked list of nodes. This will be
+ * taken by the next created parse node.
+ */
+ CommentNode = AcpiOsAcquireObject (
+ AcpiGbl_RegCommentCache);
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
CommentNode->Next = NULL;
@@ -787,38 +820,46 @@ CvCaptureCommentsOnly (
else
{
AcpiGbl_EndBlkCommentListTail->Next = CommentNode;
- AcpiGbl_EndBlkCommentListTail = AcpiGbl_EndBlkCommentListTail->Next;
+ AcpiGbl_EndBlkCommentListTail =
+ AcpiGbl_EndBlkCommentListTail->Next;
}
break;
case INLINE_COMMENT:
CvDbgPrint ("found inline comment.\n");
- AcpiGbl_CurrentInlineComment = ACPI_CAST_PTR (char, Aml);
+ AcpiGbl_CurrentInlineComment =
+ ACPI_CAST_PTR (char, Aml);
break;
case ENDNODE_COMMENT:
CvDbgPrint ("found EndNode comment.\n");
- AcpiGbl_CurrentEndNodeComment = ACPI_CAST_PTR (char, Aml);
+ AcpiGbl_CurrentEndNodeComment =
+ ACPI_CAST_PTR (char, Aml);
break;
case CLOSE_BRACE_COMMENT:
CvDbgPrint ("found close brace comment.\n");
- AcpiGbl_CurrentCloseBraceComment = ACPI_CAST_PTR (char, Aml);
+ AcpiGbl_CurrentCloseBraceComment =
+ ACPI_CAST_PTR (char, Aml);
break;
case END_DEFBLK_COMMENT:
- CvDbgPrint ("Found comment that belongs after the } for a definition block.\n");
- AcpiGbl_CurrentScope->Common.CloseBraceComment = ACPI_CAST_PTR (char, Aml);
+ CvDbgPrint ("Found comment that belongs after"
+ " the } for a definition block.\n");
+ AcpiGbl_CurrentScope->Common.CloseBraceComment =
+ ACPI_CAST_PTR (char, Aml);
break;
case FILENAME_COMMENT:
- CvDbgPrint ("Found a filename: %s\n", ACPI_CAST_PTR (char, Aml));
- FileNode = CvFilenameExists (ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot);
+ CvDbgPrint ("Found a filename: %s\n",
+ ACPI_CAST_PTR (char, Aml));
+ FileNode = CvFilenameExists (
+ ACPI_CAST_PTR (char, Aml), AcpiGbl_FileTreeRoot);
/*
* If there is an INCLUDE_COMMENT followed by a
@@ -846,7 +887,8 @@ CvCaptureCommentsOnly (
* parse node created next. See the FILENAME_COMMENT case
* for more details
*/
- CommentNode = AcpiOsAcquireObject (AcpiGbl_RegCommentCache);
+ CommentNode = AcpiOsAcquireObject (
+ AcpiGbl_RegCommentCache);
CommentNode->Comment = ACPI_CAST_PTR (char, Aml);
CommentNode->Next = NULL;
@@ -858,10 +900,12 @@ CvCaptureCommentsOnly (
else
{
AcpiGbl_IncCommentListTail->Next = CommentNode;
- AcpiGbl_IncCommentListTail = AcpiGbl_IncCommentListTail->Next;
+ AcpiGbl_IncCommentListTail =
+ AcpiGbl_IncCommentListTail->Next;
}
- CvDbgPrint ("Found a include comment: %s\n", CommentNode->Comment);
+ CvDbgPrint ("Found a include comment: %s\n",
+ CommentNode->Comment);
break;
default:
@@ -870,13 +914,12 @@ CvCaptureCommentsOnly (
Aml -= 2;
goto DefBlock;
- break;
- } /* end switch statement */
+ } /* End switch statement */
- } /* end else */
+ } /* End else */
- /* determine the length and move forward that amount */
+ /* Determine the length and move forward that amount */
Length = 0;
while (ParserState->Aml[Length])
@@ -886,12 +929,10 @@ CvCaptureCommentsOnly (
ParserState->Aml += Length + 1;
-
/* Peek at the next Opcode. */
Aml = ParserState->Aml;
Opcode = (UINT16) ACPI_GET8 (Aml);
-
}
DefBlock:
@@ -916,7 +957,7 @@ DefBlock:
*
* PARAMETERS: ParserState - A parser state object
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Wrapper function for CvCaptureCommentsOnly
* This is referred as ASL_CV_CAPTURE_COMMENTS.
@@ -938,8 +979,8 @@ CvCaptureComments (
}
/*
- * Before parsing, check to see that comments that come directly after
- * deferred opcodes aren't being processed.
+ * Before parsing, check to see that comments that come directly
+ * after deferred opcodes aren't being processed.
*/
Aml = WalkState->ParserState.Aml;
Opcode = (UINT16) ACPI_GET8 (Aml);
@@ -960,9 +1001,9 @@ CvCaptureComments (
*
* FUNCTION: CvTransferComments
*
- * PARAMETERS: Op - Transfer comments to this Op
+ * PARAMETERS: Op - Transfer comments to this Op
*
- * RETURN: none
+ * RETURN: None
*
* DESCRIPTION: Transfer all of the commments stored in global containers to the
* given Op. This will be invoked shortly after the parser creates
@@ -975,6 +1016,7 @@ void
CvTransferComments (
ACPI_PARSE_OBJECT *Op)
{
+
Op->Common.InlineComment = AcpiGbl_CurrentInlineComment;
AcpiGbl_CurrentInlineComment = NULL;
@@ -991,5 +1033,4 @@ CvTransferComments (
Op->Common.EndBlkComment = AcpiGbl_EndBlkCommentListHead;
AcpiGbl_EndBlkCommentListHead = NULL;
AcpiGbl_EndBlkCommentListTail = NULL;
-
}
diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c
index 5289296..43bc081 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompile.c
+++ b/sys/contrib/dev/acpica/compiler/dtcompile.c
@@ -486,18 +486,21 @@ DtCompileDataTable (
}
else if (TableData->TableInfo)
{
- /* Simple table, just walk the info table */
+ /* Simple table, just walk the info table, unless its empty */
- Subtable = NULL;
- Status = DtCompileTable (FieldList, TableData->TableInfo,
- &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
+ if (FieldList && *FieldList)
{
- return (Status);
- }
+ Subtable = NULL;
+ Status = DtCompileTable (FieldList, TableData->TableInfo,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
- DtInsertSubtable (Gbl_RootTable, Subtable);
- DtPopSubtable ();
+ DtInsertSubtable (Gbl_RootTable, Subtable);
+ DtPopSubtable ();
+ }
}
else
{
diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h
index 9200d5e..c2a067e 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h
@@ -578,6 +578,10 @@ DtCompileHest (
void **PFieldList);
ACPI_STATUS
+DtCompileHmat (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileIort (
void **PFieldList);
@@ -618,6 +622,10 @@ DtCompilePmtt (
void **PFieldList);
ACPI_STATUS
+DtCompilePptt (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompilePcct (
void **PFieldList);
@@ -698,6 +706,7 @@ extern const unsigned char TemplateFadt[];
extern const unsigned char TemplateFpdt[];
extern const unsigned char TemplateGtdt[];
extern const unsigned char TemplateHest[];
+extern const unsigned char TemplateHmat[];
extern const unsigned char TemplateHpet[];
extern const unsigned char TemplateIort[];
extern const unsigned char TemplateIvrs[];
@@ -712,10 +721,12 @@ extern const unsigned char TemplateMtmr[];
extern const unsigned char TemplateNfit[];
extern const unsigned char TemplatePcct[];
extern const unsigned char TemplatePmtt[];
+extern const unsigned char TemplatePptt[];
extern const unsigned char TemplateRasf[];
extern const unsigned char TemplateRsdt[];
extern const unsigned char TemplateS3pt[];
extern const unsigned char TemplateSbst[];
+extern const unsigned char TemplateSdei[];
extern const unsigned char TemplateSlic[];
extern const unsigned char TemplateSlit[];
extern const unsigned char TemplateSpcr[];
@@ -731,6 +742,7 @@ extern const unsigned char TemplateWdat[];
extern const unsigned char TemplateWddt[];
extern const unsigned char TemplateWdrt[];
extern const unsigned char TemplateWpbt[];
+extern const unsigned char TemplateWsmt[];
extern const unsigned char TemplateXenv[];
extern const unsigned char TemplateXsdt[];
diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c
index bf7a024..47641cb 100644
--- a/sys/contrib/dev/acpica/compiler/dtfield.c
+++ b/sys/contrib/dev/acpica/compiler/dtfield.c
@@ -679,6 +679,36 @@ DtCompileFlag (
BitLength = 2;
break;
+ case ACPI_DMT_FLAGS4_0:
+
+ BitPosition = 0;
+ BitLength = 4;
+ break;
+
+ case ACPI_DMT_FLAGS4_4:
+
+ BitPosition = 4;
+ BitLength = 4;
+ break;
+
+ case ACPI_DMT_FLAGS4_8:
+
+ BitPosition = 8;
+ BitLength = 4;
+ break;
+
+ case ACPI_DMT_FLAGS4_12:
+
+ BitPosition = 12;
+ BitLength = 4;
+ break;
+
+ case ACPI_DMT_FLAGS16_16:
+
+ BitPosition = 16;
+ BitLength = 16;
+ break;
+
default:
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid flag opcode");
diff --git a/sys/contrib/dev/acpica/compiler/dttable1.c b/sys/contrib/dev/acpica/compiler/dttable1.c
index 169669b..81a61b3 100644
--- a/sys/contrib/dev/acpica/compiler/dttable1.c
+++ b/sys/contrib/dev/acpica/compiler/dttable1.c
@@ -1249,6 +1249,16 @@ DtCompileHest (
InfoTable = AcpiDmTableInfoHest9;
break;
+ case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
+
+ InfoTable = AcpiDmTableInfoHest10;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
+
+ InfoTable = AcpiDmTableInfoHest11;
+ break;
+
default:
/* Cannot continue on unknown type */
@@ -1283,6 +1293,12 @@ DtCompileHest (
Subtable->Buffer))->NumHardwareBanks;
break;
+ case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
+
+ BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
+ Subtable->Buffer))->NumHardwareBanks;
+ break;
+
default:
break;
@@ -1308,6 +1324,218 @@ DtCompileHest (
/******************************************************************************
*
+ * FUNCTION: DtCompileHmat
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile HMAT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileHmat (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ DT_FIELD *EntryStart;
+ ACPI_HMAT_STRUCTURE *HmatStruct;
+ ACPI_HMAT_LOCALITY *HmatLocality;
+ ACPI_HMAT_CACHE *HmatCache;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 IntPDNumber;
+ UINT32 TgtPDNumber;
+ UINT64 EntryNumber;
+ UINT16 SMBIOSHandleNumber;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ /* Compile HMAT structure header */
+
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmatHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+
+ HmatStruct = ACPI_CAST_PTR (ACPI_HMAT_STRUCTURE, Subtable->Buffer);
+ HmatStruct->Length = Subtable->Length;
+
+ /* Compile HMAT structure body */
+
+ switch (HmatStruct->Type)
+ {
+ case ACPI_HMAT_TYPE_ADDRESS_RANGE:
+
+ InfoTable = AcpiDmTableInfoHmat0;
+ break;
+
+ case ACPI_HMAT_TYPE_LOCALITY:
+
+ InfoTable = AcpiDmTableInfoHmat1;
+ break;
+
+ case ACPI_HMAT_TYPE_CACHE:
+
+ InfoTable = AcpiDmTableInfoHmat2;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HMAT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ HmatStruct->Length += Subtable->Length;
+
+ /* Compile HMAT structure additionals */
+
+ switch (HmatStruct->Type)
+ {
+ case ACPI_HMAT_TYPE_LOCALITY:
+
+ HmatLocality = ACPI_SUB_PTR (ACPI_HMAT_LOCALITY,
+ Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE));
+
+ /* Compile initiator proximity domain list */
+
+ IntPDNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoHmat1a, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ HmatStruct->Length += Subtable->Length;
+ IntPDNumber++;
+ }
+ HmatLocality->NumberOfInitiatorPDs = IntPDNumber;
+
+ /* Compile target proximity domain list */
+
+ TgtPDNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoHmat1b, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ HmatStruct->Length += Subtable->Length;
+ TgtPDNumber++;
+ }
+ HmatLocality->NumberOfTargetPDs = TgtPDNumber;
+
+ /* Save start of the entries for reporting errors */
+
+ EntryStart = *PFieldList;
+
+ /* Compile latency/bandwidth entries */
+
+ EntryNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoHmat1c, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ HmatStruct->Length += Subtable->Length;
+ EntryNumber++;
+ }
+
+ /* Validate number of entries */
+
+ if (EntryNumber !=
+ ((UINT64)IntPDNumber * (UINT64)TgtPDNumber))
+ {
+ DtFatal (ASL_MSG_INVALID_EXPRESSION, EntryStart, "HMAT");
+ return (AE_ERROR);
+ }
+ break;
+
+ case ACPI_HMAT_TYPE_CACHE:
+
+ /* Compile SMBIOS handles */
+
+ HmatCache = ACPI_SUB_PTR (ACPI_HMAT_CACHE,
+ Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE));
+ SMBIOSHandleNumber = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoHmat2a, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ HmatStruct->Length += Subtable->Length;
+ SMBIOSHandleNumber++;
+ }
+ HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber;
+ break;
+
+ default:
+
+ break;
+ }
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileIort
*
* PARAMETERS: List - Current field list pointer
diff --git a/sys/contrib/dev/acpica/compiler/dttable2.c b/sys/contrib/dev/acpica/compiler/dttable2.c
index 878cad9..4460394 100644
--- a/sys/contrib/dev/acpica/compiler/dttable2.c
+++ b/sys/contrib/dev/acpica/compiler/dttable2.c
@@ -871,6 +871,16 @@ DtCompilePcct (
InfoTable = AcpiDmTableInfoPcct2;
break;
+ case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct3;
+ break;
+
+ case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct4;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
@@ -1037,6 +1047,125 @@ DtCompilePmtt (
/******************************************************************************
*
+ * FUNCTION: DtCompilePptt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile PPTT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompilePptt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ ACPI_SUBTABLE_HEADER *PpttHeader;
+ ACPI_PPTT_PROCESSOR *PpttProcessor = NULL;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_DMTABLE_INFO *InfoTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+
+
+ ParentTable = DtPeekSubtable ();
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* Compile PPTT subtable header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPpttHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ PpttHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+ PpttHeader->Length = (UINT8)(Subtable->Length);
+
+ switch (PpttHeader->Type)
+ {
+ case ACPI_PPTT_TYPE_PROCESSOR:
+
+ InfoTable = AcpiDmTableInfoPptt0;
+ break;
+
+ case ACPI_PPTT_TYPE_CACHE:
+
+ InfoTable = AcpiDmTableInfoPptt1;
+ break;
+
+ case ACPI_PPTT_TYPE_ID:
+
+ InfoTable = AcpiDmTableInfoPptt2;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PPTT");
+ return (AE_ERROR);
+ }
+
+ /* Compile PPTT subtable body */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ DtInsertSubtable (ParentTable, Subtable);
+ PpttHeader->Length += (UINT8)(Subtable->Length);
+
+ /* Compile PPTT subtable additionals */
+
+ switch (PpttHeader->Type)
+ {
+ case ACPI_PPTT_TYPE_PROCESSOR:
+
+ PpttProcessor = ACPI_SUB_PTR (ACPI_PPTT_PROCESSOR,
+ Subtable->Buffer, sizeof (ACPI_SUBTABLE_HEADER));
+ if (PpttProcessor)
+ {
+ /* Compile initiator proximity domain list */
+
+ PpttProcessor->NumberOfPrivResources = 0;
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList,
+ AcpiDmTableInfoPptt0a, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (!Subtable)
+ {
+ break;
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ PpttHeader->Length += (UINT8)(Subtable->Length);
+ PpttProcessor->NumberOfPrivResources++;
+ }
+ }
+ break;
+
+ default:
+
+ break;
+ }
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileRsdt
*
* PARAMETERS: List - Current field list pointer
@@ -1324,6 +1453,11 @@ DtCompileSrat (
InfoTable = AcpiDmTableInfoSrat3;
break;
+ case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat4;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h
index 701e70f..8d27359 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.h
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.h
@@ -577,11 +577,11 @@ const unsigned char TemplateGtdt[] =
const unsigned char TemplateHest[] =
{
- 0x48,0x45,0x53,0x54,0xD4,0x01,0x00,0x00, /* 00000000 "HEST...." */
- 0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x48,0x45,0x53,0x54,0x7C,0x02,0x00,0x00, /* 00000000 "HEST|..." */
+ 0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x28,0x05,0x10,0x20,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */
+ 0x03,0x03,0x17,0x20,0x04,0x00,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 00000028 "........" */
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -596,7 +596,7 @@ const unsigned char TemplateHest[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000088 "........" */
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 000000B0 "........" */
@@ -635,7 +635,52 @@ const unsigned char TemplateHest[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */
- 0x00,0x10,0x00,0x00 /* 000001D0 "...." */
+ 0x00,0x10,0x00,0x00,0x0A,0x00,0x03,0x00, /* 000001D0 "........" */
+ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 000001D8 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001E0 "........" */
+ 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001E8 ".@......" */
+ 0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001F0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000208 "........" */
+ 0x00,0x10,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000228 "........" */
+ 0x0B,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000230 "........" */
+ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000238 "........" */
+ 0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000240 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000248 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000258 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000268 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000270 "........" */
+ 0x00,0x00,0x00,0x00 /* 00000278 "...." */
+};
+
+const unsigned char TemplateHmat[] =
+{
+ 0x48,0x4D,0x41,0x54,0x9C,0x00,0x00,0x00, /* 00000000 "HMAT...." */
+ 0x00,0x54,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".TINTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x03,0x03,0x17,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
+ 0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00, /* 00000028 "....(..." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x01,0x00,0x00,0x00,0x2A,0x00,0x00,0x00, /* 00000050 "....*..." */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x02,0x00,0x00,0x00,0x22,0x00, /* 00000078 "......"." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x01,0x00,0x00,0x00 /* 00000098 "...." */
};
const unsigned char TemplateHpet[] =
@@ -958,39 +1003,80 @@ const unsigned char TemplateMtmr[] =
const unsigned char TemplatePcct[] =
{
- 0x50,0x43,0x43,0x54,0x06,0x01,0x00,0x00, /* 00000000 "PCCT...." */
- 0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x18,0x03,0x16,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
+ 0x50,0x43,0x43,0x54,0x4e,0x02,0x00,0x00, /* 00000000 "PCCTN..." */
+ 0x01,0x47,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".GINTEL " */
+ 0x54,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x03,0x03,0x17,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
- 0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */
+ 0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, /* 00000038 "........" */
0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000040 """""""""" */
0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33, /* 00000048 ".2..3333" */
0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000050 "3333DDDD" */
0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55, /* 00000058 "DDDDUUUU" */
0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66, /* 00000060 "UUUUffff" */
- 0x77,0x77,0x77,0x77,0x88,0x88,0x01,0x3E, /* 00000068 "wwww...>" */
+ 0x77,0x77,0x77,0x77,0x88,0x88,0x01,0x3e, /* 00000068 "wwww...>" */
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */
0x00,0x03,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000088 "..DDDDDD" */
0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000090 "DDDDDDDD" */
0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55, /* 00000098 "DDUUUUUU" */
- 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000000A0 "UUffffww" */
- 0x77,0x77,0x88,0x88,0x02,0x5A,0x01,0x00, /* 000000A8 "ww...Z.." */
- 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
- 0x00,0x00,0x00,0x00,0x01,0x32,0x00,0x03, /* 000000C0 ".....2.." */
- 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000C8 "DDDDDDDD" */
- 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000D0 "DDDDDDDD" */
- 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, /* 000000D8 "UUUUUUUU" */
- 0x66,0x66,0x66,0x66,0x77,0x77,0x77,0x77, /* 000000E0 "ffffwwww" */
- 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 000000E8 "...2..33" */
- 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 000000F0 "333333DD" */
- 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 000000F8 "DDDDDDUU" */
- 0x55,0x55,0x55,0x55,0x55,0x55 /* 00000100 "UUUUUU" */
+ 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000000a0 "UUffffww" */
+ 0x77,0x77,0x88,0x88,0x02,0x5a,0x01,0x00, /* 000000a8 "ww...Z.." */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000b0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x32,0x00,0x03, /* 000000c0 ".....2.." */
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000c8 "DDDDDDDD" */
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44, /* 000000d0 "DDDDDDDD" */
+ 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, /* 000000d8 "UUUUUUUU" */
+ 0x66,0x66,0x66,0x66,0x77,0x77,0x77,0x77, /* 000000e0 "ffffwwww" */
+ 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 000000e8 "...2..33" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 000000f0 "333333DD" */
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 000000f8 "DDDDDDUU" */
+ 0x55,0x55,0x55,0x55,0x55,0x55,0x03,0xa4, /* 00000100 "UUUUUU.." */
+ 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000108 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
+ 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000118 "...2..33" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 00000120 "333333DD" */
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x55,0x55, /* 00000128 "DDDDDDUU" */
+ 0x55,0x55,0x55,0x55,0x55,0x55,0x66,0x66, /* 00000130 "UUUUUUff" */
+ 0x66,0x66,0x77,0x77,0x77,0x77,0x88,0x88, /* 00000138 "ffwwww.." */
+ 0x88,0x88,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000140 "...2..33" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x99,0x99, /* 00000148 "333333.." */
+ 0x99,0x99,0x99,0x99,0x99,0x99,0x00,0x00, /* 00000150 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000160 ".......2" */
+ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000168 "..333333" */
+ 0x33,0x33,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000170 "33""""""" */
+ 0x22,0x22,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000178 """.2..33" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000180 "33333333" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x44,0x44, /* 00000188 "333333DD" */
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x01,0x32, /* 00000190 "DDDDDD.2" */
+ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000198 "..333333" */
+ 0x33,0x33,0x55,0x55,0x55,0x55,0x55,0x55, /* 000001a0 "33UUUUUU" */
+ 0x55,0x55,0x04,0xa4,0x01,0x00,0x00,0x00, /* 000001a8 "UU......" */
+ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001b0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 000001b8 ".......2" */
+ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 000001c0 "..333333" */
+ 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 000001c8 "33DDDDDD" */
+ 0x44,0x44,0x55,0x55,0x55,0x55,0x55,0x55, /* 000001d0 "DDUUUUUU" */
+ 0x55,0x55,0x66,0x66,0x66,0x66,0x77,0x77, /* 000001d8 "UUffffww" */
+ 0x77,0x77,0x88,0x88,0x88,0x88,0x01,0x32, /* 000001e0 "ww.....2" */
+ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 000001e8 "..333333" */
+ 0x33,0x33,0x99,0x99,0x99,0x99,0x99,0x99, /* 000001f0 "33......" */
+ 0x99,0x99,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001f8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */
+ 0x00,0x00,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000208 "...2..33" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x22,0x22, /* 00000210 "333333""" */
+ 0x22,0x22,0x22,0x22,0x22,0x22,0x01,0x32, /* 00000218 """"""".2" */
+ 0x00,0x03,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000220 "..333333" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33, /* 00000228 "33333333" */
+ 0x33,0x33,0x44,0x44,0x44,0x44,0x44,0x44, /* 00000230 "33DDDDDD" */
+ 0x44,0x44,0x01,0x32,0x00,0x03,0x33,0x33, /* 00000238 "DD.2..33" */
+ 0x33,0x33,0x33,0x33,0x33,0x33,0x55,0x55, /* 00000240 "333333UU" */
+ 0x55,0x55,0x55,0x55,0x55,0x55 /* 00000248 "UUUUUU| */
};
const unsigned char TemplatePmtt[] =
@@ -1020,6 +1106,25 @@ const unsigned char TemplatePmtt[] =
0x00,0x00,0x00,0x00 /* 000000B0 "...." */
};
+const unsigned char TemplatePptt[] =
+{
+ 0x50,0x50,0x54,0x54,0x72,0x00,0x00,0x00, /* 00000000 "PPTTr..." */
+ 0x01,0x86,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x03,0x03,0x17,0x20,0x00,0x18,0x00,0x00, /* 00000020 "... ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x18,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x02,0x1E,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x00,0x00 /* 00000070 ".." */
+};
+
const unsigned char TemplateRasf[] =
{
0x52,0x41,0x53,0x46,0x30,0x00,0x00,0x00, /* 00000000 "RASF0..." */
@@ -1073,6 +1178,15 @@ const unsigned char TemplateSbst[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
};
+const unsigned char TemplateSdei[] =
+{
+ 0x53,0x44,0x45,0x49,0x3e,0x00,0x00,0x00, /* 00000000 "SDEI>..." */
+ 0x01,0x59,0x41,0x52,0x4d,0x20,0x20,0x20, /* 00000008 ".mARM " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x30,0x09,0x16,0x20 /* 00000028 "0.. " */
+};
+
const unsigned char TemplateSlic[] =
{
0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00, /* 00000000 "SLICv..." */
@@ -1213,11 +1327,11 @@ const unsigned char TemplateSpmi[] =
const unsigned char TemplateSrat[] =
{
- 0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */
- 0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */
+ 0x53,0x52,0x41,0x54,0x9E,0x00,0x00,0x00, /* 00000000 "SRAT...." */
+ 0x03,0x55,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".UINTEL " */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */
+ 0x03,0x03,0x17,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -1231,7 +1345,8 @@ const unsigned char TemplateSrat[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
- 0x00,0x00 /* 00000090 ".." */
+ 0x00,0x00,0x04,0x0C,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00 /* 00000098 "......" */
};
const unsigned char TemplateStao[] =
@@ -1379,6 +1494,15 @@ const unsigned char TemplateWpbt[] =
0x72,0x00,0x74,0x00,0x68,0x00,0x00,0x00 /* 00000090 "r.t.h..." */
};
+const unsigned char TemplateWsmt[] =
+{
+ 0x57,0x53,0x4D,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WSMT(..." */
+ 0x00,0x08,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x19,0x01,0x17,0x20,0x05,0x00,0x00,0x00 /* 00000020 "... ...." */
+};
+
const unsigned char TemplateXenv[] =
{
0x58,0x45,0x4E,0x56,0x39,0x00,0x00,0x00, /* 00000000 "XENV9..." */
diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c
index 8e4b77a..031dc2e 100644
--- a/sys/contrib/dev/acpica/compiler/dtutils.c
+++ b/sys/contrib/dev/acpica/compiler/dtutils.c
@@ -190,7 +190,7 @@ DtError (
/* Check if user wants to ignore this exception */
- if (AslIsExceptionDisabled (Level, MessageId))
+ if (AslIsExceptionIgnored (Level, MessageId))
{
return;
}
@@ -371,6 +371,11 @@ DtGetFieldType (
case ACPI_DMT_FLAGS1:
case ACPI_DMT_FLAGS2:
case ACPI_DMT_FLAGS4:
+ case ACPI_DMT_FLAGS4_0:
+ case ACPI_DMT_FLAGS4_4:
+ case ACPI_DMT_FLAGS4_8:
+ case ACPI_DMT_FLAGS4_12:
+ case ACPI_DMT_FLAGS16_16:
Type = DT_FIELD_TYPE_FLAG;
break;
@@ -512,6 +517,11 @@ DtGetFieldLength (
case ACPI_DMT_FLAGS1:
case ACPI_DMT_FLAGS2:
case ACPI_DMT_FLAGS4:
+ case ACPI_DMT_FLAGS4_0:
+ case ACPI_DMT_FLAGS4_4:
+ case ACPI_DMT_FLAGS4_8:
+ case ACPI_DMT_FLAGS4_12:
+ case ACPI_DMT_FLAGS16_16:
case ACPI_DMT_LABEL:
case ACPI_DMT_EXTRA_TEXT:
@@ -527,6 +537,7 @@ DtGetFieldLength (
case ACPI_DMT_MADT:
case ACPI_DMT_PCCT:
case ACPI_DMT_PMTT:
+ case ACPI_DMT_PPTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
case ACPI_DMT_HESTNTYP:
@@ -543,6 +554,7 @@ DtGetFieldLength (
case ACPI_DMT_UINT16:
case ACPI_DMT_DMAR:
case ACPI_DMT_HEST:
+ case ACPI_DMT_HMAT:
case ACPI_DMT_NFIT:
case ACPI_DMT_PCI_PATH:
diff --git a/sys/contrib/dev/acpica/compiler/prmacros.c b/sys/contrib/dev/acpica/compiler/prmacros.c
index 6111ffd..82b221a 100644
--- a/sys/contrib/dev/acpica/compiler/prmacros.c
+++ b/sys/contrib/dev/acpica/compiler/prmacros.c
@@ -483,7 +483,7 @@ PrAddMacro (
{
/* Search the macro arg list for matching arg */
- for (i = 0; Args[i].Name && (i < PR_MAX_MACRO_ARGS); i++)
+ for (i = 0; ((i < PR_MAX_MACRO_ARGS) && Args[i].Name); i++)
{
/*
* Save argument offset within macro body. This is the mechanism
diff --git a/sys/contrib/dev/acpica/components/debugger/dbdisply.c b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
index afb9374..ab55280 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbdisply.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
@@ -451,7 +451,7 @@ DumpNode:
else
{
- AcpiOsPrintf ("Object (%p) Pathname: %s\n",
+ AcpiOsPrintf ("Object %p: Namespace Node - Pathname: %s\n",
Node, (char *) RetBuf.Pointer);
}
@@ -468,7 +468,7 @@ DumpNode:
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
{
- AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
+ AcpiOsPrintf ("\nAttached Object %p:", ObjDesc);
if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
{
AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
@@ -476,8 +476,33 @@ DumpNode:
return;
}
- AcpiUtDebugDumpBuffer ((void *) ObjDesc,
- sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
+ if (ACPI_GET_DESCRIPTOR_TYPE (
+ ((ACPI_NAMESPACE_NODE *) ObjDesc)) == ACPI_DESC_TYPE_NAMED)
+ {
+ AcpiOsPrintf (" Namespace Node - ");
+ Status = AcpiGetName ((ACPI_NAMESPACE_NODE *) ObjDesc,
+ ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not convert name to pathname\n");
+ }
+ else
+ {
+ AcpiOsPrintf ("Pathname: %s",
+ (char *) RetBuf.Pointer);
+ }
+
+ AcpiOsPrintf ("\n");
+ AcpiUtDebugDumpBuffer ((void *) ObjDesc,
+ sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX);
+ }
+ else
+ {
+ AcpiOsPrintf ("\n");
+ AcpiUtDebugDumpBuffer ((void *) ObjDesc,
+ sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
+ }
+
AcpiExDumpObjectDescriptor (ObjDesc, 1);
}
}
diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c
index fda9c7e..2ca3a12 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbexec.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c
@@ -314,6 +314,18 @@ AcpiDbExecuteMethod (
if (ACPI_FAILURE (Status))
{
+ if ((Status == AE_ABORT_METHOD) || AcpiGbl_AbortMethod)
+ {
+ /* Clear the abort and fall back to the debugger prompt */
+
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Aborting top-level method"));
+
+ AcpiGbl_AbortMethod = FALSE;
+ Status = AE_OK;
+ goto Cleanup;
+ }
+
ACPI_EXCEPTION ((AE_INFO, Status,
"while executing %s from debugger", Info->Pathname));
diff --git a/sys/contrib/dev/acpica/components/debugger/dbobject.c b/sys/contrib/dev/acpica/components/debugger/dbobject.c
index eb30d56..20508fc 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbobject.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbobject.c
@@ -588,7 +588,7 @@ AcpiDbDecodeLocals (
if (DisplayLocals)
{
- AcpiOsPrintf ("\nInitialized Local Variables for method [%4.4s]:\n",
+ AcpiOsPrintf ("\nInitialized Local Variables for Method [%4.4s]:\n",
AcpiUtGetNodeName (Node));
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
@@ -604,7 +604,7 @@ AcpiDbDecodeLocals (
else
{
AcpiOsPrintf (
- "No Local Variables are initialized for method [%4.4s]\n",
+ "No Local Variables are initialized for Method [%4.4s]\n",
AcpiUtGetNodeName (Node));
}
}
@@ -667,7 +667,7 @@ AcpiDbDecodeArguments (
AcpiOsPrintf (
"Initialized Arguments for Method [%4.4s]: "
"(%X arguments defined for method invocation)\n",
- AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount);
+ AcpiUtGetNodeName (Node), Node->Object->Method.ParamCount);
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
diff --git a/sys/contrib/dev/acpica/components/debugger/dbxface.c b/sys/contrib/dev/acpica/components/debugger/dbxface.c
index 31b1334..aa48803 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbxface.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbxface.c
@@ -379,7 +379,7 @@ AcpiDbSingleStep (
if ((AcpiGbl_DbOutputToFile) ||
(AcpiDbgLevel & ACPI_LV_PARSE))
{
- AcpiOsPrintf ("\n[AmlDebug] Next AML Opcode to execute:\n");
+ AcpiOsPrintf ("\nAML Debug: Next AML Opcode to execute:\n");
}
/*
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
index 69fefd1..984087a 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
@@ -261,7 +261,7 @@ AcpiDmDisasmByteList (
/* Dump the ASCII equivalents within a comment */
- AcpiOsPrintf (" /* ");
+ AcpiOsPrintf (" // ");
for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
CurrentIndex = i + j;
@@ -283,7 +283,7 @@ AcpiDmDisasmByteList (
/* Finished with this line */
- AcpiOsPrintf (" */\n");
+ AcpiOsPrintf ("\n");
}
}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
index 4ed0c55..8e22ddc 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
@@ -190,7 +190,7 @@ AcpiDmParseDeferredOps (
ACPI_STATUS Status;
- ACPI_FUNCTION_ENTRY ();
+ ACPI_FUNCTION_TRACE (DmParseDeferredOps);
/* Traverse the entire parse tree */
@@ -217,7 +217,7 @@ AcpiDmParseDeferredOps (
Op, Op->Named.Data, Op->Named.Length);
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
break;
@@ -245,7 +245,7 @@ AcpiDmParseDeferredOps (
Op = AcpiPsGetDepthNext (Root, Op);
}
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
index 587c5c0..3cec7e8 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
@@ -177,15 +177,6 @@ static void
AcpiDmPromoteSubtree (
ACPI_PARSE_OBJECT *StartOp);
-static BOOLEAN
-AcpiDmIsSwitchBlock (
- ACPI_PARSE_OBJECT *Op,
- char *Temp);
-
-static BOOLEAN
-AcpiDmIsCaseBlock (
- ACPI_PARSE_OBJECT *Op);
-
/*******************************************************************************
*
* FUNCTION: AcpiDmDisplayTargetPathname
@@ -537,25 +528,30 @@ AcpiDmFieldPredefinedDescription (
/* Major cheat: We previously put the Tag ptr in the Node field */
Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node);
- if (!Tag)
+ if (!Tag || (*Tag == 0))
{
return;
}
- /* Match the name in the info table */
+ /* Is the tag a predefined name? */
Info = AcpiAhMatchPredefinedName (Tag);
- if (Info)
+ if (!Info)
{
- AcpiOsPrintf (" // %4.4s: %s", Tag,
- ACPI_CAST_PTR (char, Info->Description));
+ /* Not a predefined name (does not start with underscore) */
+
+ return;
}
- /* AML buffer (String) was allocated in AcpiGetTagPathname */
+ AcpiOsPrintf (" // %4.4s: %s", Tag,
+ ACPI_CAST_PTR (char, Info->Description));
- ACPI_FREE (IndexOp->Common.Value.String);
+ /* String contains the prefix path, free it */
+ ACPI_FREE (IndexOp->Common.Value.String);
+ IndexOp->Common.Value.String = NULL;
#endif
+
return;
}
@@ -1127,9 +1123,7 @@ AcpiDmDisassembleOneOp (
if (AcpiGbl_DmEmitExternalOpcodes)
{
- AcpiDmEmitExternal (AcpiPsGetArg(Op, 0),
- AcpiPsGetArg(Op, 1));
- break;
+ AcpiDmEmitExternal (Op, AcpiPsGetArg(Op, 0));
}
break;
@@ -1367,414 +1361,3 @@ AcpiDmPromoteSubtree (
Op = Op->Common.Next;
}
}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDmIsTempName
- *
- * PARAMETERS: Op - Object to be examined
- *
- * RETURN: TRUE if object is a temporary (_T_x) name for a matching While
- * loop that can be converted to a Switch.
- *
- * DESCRIPTION: _T_X objects are only used for Switch statements. If a temporary
- * name exists, search the siblings for a matching While (One) loop
- * that can be converted to a Switch. Return TRUE if a match was
- * found, FALSE otherwise.
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiDmIsTempName (
- ACPI_PARSE_OBJECT *Op)
-{
- ACPI_PARSE_OBJECT *CurrentOp;
- char *Temp;
-
- if (Op->Common.AmlOpcode != AML_NAME_OP)
- {
- return (FALSE);
- }
-
- Temp = (char *)(Op->Common.Aml);
- ++Temp;
-
- if (strncmp(Temp, "_T_", 3))
- {
- return (FALSE);
- }
-
- CurrentOp = Op->Common.Next;
- while (CurrentOp)
- {
- if (CurrentOp->Common.AmlOpcode == AML_WHILE_OP &&
- AcpiDmIsSwitchBlock(CurrentOp, Temp))
- {
- Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_SWITCH;
-
- return (TRUE);
- }
- CurrentOp = CurrentOp->Common.Next;
- }
-
- return (FALSE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDmIsSwitchBlock
- *
- * PARAMETERS: Op - While Object
- *
- * RETURN: TRUE if While block can be converted to a Switch/Case block
- *
- * DESCRIPTION: Determines if While block is a Switch/Case statement. Modifies
- * parse tree to allow for Switch/Case disassembly during walk.
- *
- * EXAMPLE: Example of parse tree to be converted
- *
- * While
- * One
- * Store
- * ByteConst
- * -NamePath-
- * If
- * LEqual
- * -NamePath-
- * Zero
- * Return
- * One
- * Else
- * Return
- * WordConst
- * Break
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiDmIsSwitchBlock (
- ACPI_PARSE_OBJECT *Op,
- char *Temp)
-{
- ACPI_PARSE_OBJECT *OneOp;
- ACPI_PARSE_OBJECT *StoreOp;
- ACPI_PARSE_OBJECT *NamePathOp;
- ACPI_PARSE_OBJECT *PredicateOp;
- ACPI_PARSE_OBJECT *CurrentOp;
- ACPI_PARSE_OBJECT *TempOp;
-
- /* Check for One Op Predicate */
-
- OneOp = AcpiPsGetArg (Op, 0);
- if (!OneOp || (OneOp->Common.AmlOpcode != AML_ONE_OP))
- {
- return (FALSE);
- }
-
- /* Check for Store Op */
-
- StoreOp = OneOp->Common.Next;
- if (!StoreOp || (StoreOp->Common.AmlOpcode != AML_STORE_OP))
- {
- return (FALSE);
- }
-
- /* Check for Name Op with _T_ string */
-
- NamePathOp = AcpiPsGetArg (StoreOp, 1);
- if (!NamePathOp || (NamePathOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
- {
- return (FALSE);
- }
-
- if (strncmp((char *)(NamePathOp->Common.Aml), Temp, 4))
- {
- return (FALSE);
- }
-
- /* This is a Switch/Case control block */
-
- /* Ignore the One Op Predicate */
-
- OneOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
-
- /* Ignore the Store Op, but not the children */
-
- StoreOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE;
-
- /*
- * First arg of Store Op is the Switch condition.
- * Mark it as a Switch predicate and as a parameter list for paren
- * closing and correct indentation.
- */
- PredicateOp = AcpiPsGetArg (StoreOp, 0);
- PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE;
- PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
-
- /* Ignore the Name Op */
-
- NamePathOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE;
-
- /* Remaining opcodes are the Case statements (If/ElseIf's) */
-
- CurrentOp = StoreOp->Common.Next;
- while (AcpiDmIsCaseBlock (CurrentOp))
- {
- /* Block is a Case structure */
-
- if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- /* ElseIf */
-
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE;
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- }
-
- /* If */
-
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE;
-
- /*
- * Mark the parse tree for Case disassembly. There are two
- * types of Case statements. The first type of statement begins with
- * an LEqual. The second starts with an LNot and uses a Match statement
- * on a Package of constants.
- */
- TempOp = AcpiPsGetArg (CurrentOp, 0);
- switch (TempOp->Common.AmlOpcode)
- {
- case (AML_LOGICAL_EQUAL_OP):
-
- /* Ignore just the LEqual Op */
-
- TempOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE;
-
- /* Ignore the NamePath Op */
-
- TempOp = AcpiPsGetArg (TempOp, 0);
- TempOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE;
-
- /*
- * Second arg of LEqual will be the Case predicate.
- * Mark it as a predicate and also as a parameter list for paren
- * closing and correct indentation.
- */
- PredicateOp = TempOp->Common.Next;
- PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE;
- PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
-
- break;
-
- case (AML_LOGICAL_NOT_OP):
-
- /*
- * The Package will be the predicate of the Case statement.
- * It's under:
- * LNOT
- * LEQUAL
- * MATCH
- * PACKAGE
- */
-
- /* Get the LEqual Op from LNot */
-
- TempOp = AcpiPsGetArg (TempOp, 0);
-
- /* Get the Match Op from LEqual */
-
- TempOp = AcpiPsGetArg (TempOp, 0);
-
- /* Get the Package Op from Match */
-
- PredicateOp = AcpiPsGetArg (TempOp, 0);
-
- /* Mark as parameter list for paren closing */
-
- PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
-
- /*
- * The Package list would be too deeply indented if we
- * chose to simply ignore the all the parent opcodes, so
- * we rearrange the parse tree instead.
- */
-
- /*
- * Save the second arg of the If/Else Op which is the
- * block code of code for this Case statement.
- */
- TempOp = AcpiPsGetArg (CurrentOp, 1);
-
- /*
- * Move the Package Op to the child (predicate) of the
- * Case statement.
- */
- CurrentOp->Common.Value.Arg = PredicateOp;
- PredicateOp->Common.Parent = CurrentOp;
-
- /* Add the block code */
-
- PredicateOp->Common.Next = TempOp;
-
- break;
-
- default:
-
- /* Should never get here */
-
- break;
- }
-
- /* Advance to next Case block */
-
- CurrentOp = CurrentOp->Common.Next;
- }
-
- /* If CurrentOp is now an Else, then this is a Default block */
-
- if (CurrentOp && CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- CurrentOp->Common.DisasmOpcode = ACPI_DASM_DEFAULT;
- }
-
- /*
- * From the first If advance to the Break op. It's possible to
- * have an Else (Default) op here when there is only one Case
- * statement, so check for it.
- */
- CurrentOp = StoreOp->Common.Next->Common.Next;
- if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- CurrentOp = CurrentOp->Common.Next;
- }
-
- /* Ignore the Break Op */
-
- CurrentOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
-
- return (TRUE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDmIsCaseBlock
- *
- * PARAMETERS: Op - Object to test
- *
- * RETURN: TRUE if Object is beginning of a Case block.
- *
- * DESCRIPTION: Determines if an Object is the beginning of a Case block for a
- * Switch/Case statement. Parse tree must be one of the following
- * forms:
- *
- * Else (Optional)
- * If
- * LEqual
- * -NamePath- _T_x
- *
- * Else (Optional)
- * If
- * LNot
- * LEqual
- * Match
- * Package
- * ByteConst
- * -NamePath- _T_x
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiDmIsCaseBlock (
- ACPI_PARSE_OBJECT *Op)
-{
- ACPI_PARSE_OBJECT *CurrentOp;
-
- if (!Op)
- {
- return (FALSE);
- }
-
- /* Look for an If or ElseIf */
-
- CurrentOp = Op;
- if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP)
- {
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp)
- {
- return (FALSE);
- }
- }
-
- if (!CurrentOp || CurrentOp->Common.AmlOpcode != AML_IF_OP)
- {
- return (FALSE);
- }
-
- /* Child must be LEqual or LNot */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp)
- {
- return (FALSE);
- }
-
- switch (CurrentOp->Common.AmlOpcode)
- {
- case (AML_LOGICAL_EQUAL_OP):
-
- /* Next child must be NamePath with string _T_ */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || !CurrentOp->Common.Value.Name ||
- strncmp(CurrentOp->Common.Value.Name, "_T_", 3))
- {
- return (FALSE);
- }
-
- break;
-
- case (AML_LOGICAL_NOT_OP):
-
- /* Child of LNot must be LEqual op */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_LOGICAL_EQUAL_OP))
- {
- return (FALSE);
- }
-
- /* Child of LNot must be Match op */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_MATCH_OP))
- {
- return (FALSE);
- }
-
- /* First child of Match must be Package op */
-
- CurrentOp = AcpiPsGetArg (CurrentOp, 0);
- if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_PACKAGE_OP))
- {
- return (FALSE);
- }
-
- /* Third child of Match must be NamePath with string _T_ */
-
- CurrentOp = AcpiPsGetArg (CurrentOp->Common.Parent, 2);
- if (!CurrentOp || !CurrentOp->Common.Value.Name ||
- strncmp(CurrentOp->Common.Value.Name, "_T_", 3))
- {
- return (FALSE);
- }
-
- break;
-
- default:
-
- return (FALSE);
- }
-
- return (TRUE);
-}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
index 8295a0c..260c23f 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
@@ -197,8 +197,12 @@ static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] =
AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
AcpiDmExtendedDescriptor, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
AcpiDmGpioDescriptor, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
- NULL, /* 0x0D, Reserved */
- AcpiDmSerialBusDescriptor /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */
+ AcpiDmPinFunctionDescriptor, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
+ AcpiDmSerialBusDescriptor, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS */
+ AcpiDmPinConfigDescriptor, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
+ AcpiDmPinGroupDescriptor, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
+ AcpiDmPinGroupFunctionDescriptor, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
+ AcpiDmPinGroupConfigDescriptor, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
};
@@ -540,6 +544,15 @@ AcpiDmIsResourceTemplate (
* intialization byte list. Because the resource macros will create
* a buffer of the exact required length (buffer length will be equal
* to the actual length).
+ *
+ * NOTE (April 2017): Resource templates with this issue have been
+ * seen in the field. We still don't want to attempt to disassemble
+ * a buffer like this to a resource template because this output
+ * would not match the original input buffer (it would be shorter
+ * than the original when the disassembled code is recompiled).
+ * Basically, a buffer like this appears to be hand crafted in the
+ * first place, so just emitting a buffer object instead of a
+ * resource template more closely resembles the original ASL code.
*/
if (DeclaredBufferLength != BufferLength)
{
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
index ad1a493..e2cbdae 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
@@ -517,6 +517,112 @@ AcpiDmGpioDescriptor (
}
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinFunctionDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinFunction descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinFunction (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinFunction.Flags)]);
+
+ if (Resource->PinFunction.PinConfig <= 3)
+ {
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_PpcDecode[Resource->PinFunction.PinConfig]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinFunction.PinConfig);
+ }
+
+ /* FunctionNumber */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
+
+ if (Resource->PinFunction.ResSourceOffset)
+ {
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinFunction.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X,\n", Resource->PinFunction.ResSourceIndex);
+
+ AcpiDmIndent (Level + 1);
+
+ /* Always ResourceConsumer */
+ AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_CONSUMER]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinFunction.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinFunction.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinFunction.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
+ Resource->PinFunction.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinFunction.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
/*******************************************************************************
*
@@ -856,3 +962,363 @@ AcpiDmSerialBusDescriptor (
SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
Info, Resource, Length, Level);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinConfig
+ *
+ * PARAMETERS: PinConfigType - Pin configuration type
+ * PinConfigValue - Pin configuration value
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Pretty prints PinConfig type and value.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmPinConfig(
+ UINT8 PinConfigType,
+ UINT32 PinConfigValue)
+{
+ if (PinConfigType <= 13)
+ {
+ AcpiOsPrintf ("0x%2.2X /* %s */, ", PinConfigType,
+ AcpiGbl_PtypDecode[PinConfigType]);
+ }
+ else
+ {
+ AcpiOsPrintf ("0x%2.2X, /* Vendor Defined */ ", PinConfigType);
+ }
+
+ /* PinConfigValue */
+
+ AcpiOsPrintf ("0x%4.4X,\n", PinConfigValue);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinConfigDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinConfig descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinConfig (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinConfig.Flags)]);
+
+ AcpiDmPinConfig (Resource->PinConfig.PinConfigType,
+ Resource->PinConfig.PinConfigValue);
+
+ AcpiDmIndent (Level + 1);
+
+ if (Resource->PinConfig.ResSourceOffset)
+ {
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinConfig.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+ }
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinConfig.ResSourceIndex);
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinConfig.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinConfig.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinConfig.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinConfig.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = ((UINT32) (Resource->PinConfig.ResSourceOffset -
+ Resource->PinConfig.PinTableOffset)) /
+ sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinConfig.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroup descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ char *Label;
+ UINT16 *PinList;
+ UINT8 *VendorData;
+ UINT32 PinCount;
+ UINT32 i;
+
+ AcpiDmIndent (Level);
+ /* Always producer */
+ AcpiOsPrintf ("PinGroup (");
+
+ Label = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroup.LabelOffset),
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroup.Flags)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroup.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroup.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroup.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+
+ AcpiDmIndent (Level + 1);
+
+ /* Dump the interrupt list */
+
+ AcpiOsPrintf ("{ // Pin list\n");
+
+ PinCount = (Resource->PinGroup.LabelOffset -
+ Resource->PinGroup.PinTableOffset) / sizeof (UINT16);
+
+ PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroup.PinTableOffset);
+
+ for (i = 0; i < PinCount; i++)
+ {
+ AcpiDmIndent (Level + 2);
+ AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
+ ((i + 1) < PinCount) ? "," : "");
+ }
+
+ AcpiDmIndent (Level + 1);
+ AcpiOsPrintf ("}\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupFunctionDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroupFunction descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ char *Label = NULL;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinGroupFunction (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupFunction.Flags)]);
+
+ /* FunctionNumber */
+
+ AcpiOsPrintf ("0x%4.4X, ", Resource->PinGroupFunction.FunctionNumber);
+
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroupFunction.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X,\n", Resource->PinGroupFunction.ResSourceIndex);
+
+ AcpiDmIndent (Level + 1);
+
+ Label = ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroupFunction.ResSourceLabelOffset);
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupFunction.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroupFunction.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroupFunction.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroupFunction.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPinGroupConfigDescriptor
+ *
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
+ * Length - Length of the descriptor in bytes
+ * Level - Current source code indentation level
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Decode a PinGroupConfig descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiDmPinGroupConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level)
+{
+ UINT8 *VendorData;
+ char *DeviceName = NULL;
+ char *Label = NULL;
+
+ AcpiDmIndent (Level);
+ AcpiOsPrintf ("PinGroupConfig (%s, ",
+ AcpiGbl_ShrDecode [ACPI_GET_1BIT_FLAG (Resource->PinGroupConfig.Flags)]);
+
+ AcpiDmPinConfig(Resource->PinGroupConfig.PinConfigType,
+ Resource->PinGroupConfig.PinConfigValue);
+
+ AcpiDmIndent (Level + 1);
+
+ DeviceName = ACPI_ADD_PTR (char,
+ Resource, Resource->PinGroupConfig.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+ AcpiOsPrintf ("0x%2.2X, ", Resource->PinGroupConfig.ResSourceIndex);
+
+ Label = ACPI_ADD_PTR (char, Resource,
+ Resource->PinGroupConfig.ResSourceLabelOffset);
+ AcpiUtPrintString (Label, ACPI_UINT16_MAX);
+
+ AcpiOsPrintf (", ");
+
+ AcpiOsPrintf ("%s, ",
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->PinGroupConfig.Flags, 1)]);
+
+ /* Insert a descriptor name */
+
+ AcpiDmDescriptorName ();
+
+ AcpiOsPrintf (",");
+
+ /* Dump the vendor data */
+
+ if (Resource->PinGroupConfig.VendorLength)
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmIndent (Level + 1);
+ VendorData = ACPI_ADD_PTR (UINT8, Resource,
+ Resource->PinGroupConfig.VendorOffset);
+
+ AcpiDmDumpRawDataBuffer (VendorData,
+ Resource->PinGroupConfig.VendorLength, Level);
+ }
+
+ AcpiOsPrintf (")\n");
+}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
index 8f7a475..dceb6bf 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
@@ -161,8 +161,6 @@
ACPI_MODULE_NAME ("dmwalk")
-#define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: "
-
/* Stub for non-compiler code */
#ifndef ACPI_ASL_COMPILER
@@ -584,13 +582,6 @@ AcpiDmDescendingOp (
return (AE_CTRL_DEPTH);
}
- if (AcpiDmIsTempName(Op))
- {
- /* Ignore compiler generated temporary names */
-
- return (AE_CTRL_DEPTH);
- }
-
if (Op->Common.DisasmOpcode == ACPI_DASM_IGNORE_SINGLE)
{
/* Ignore this op, but not it's children */
@@ -642,10 +633,16 @@ AcpiDmDescendingOp (
Info->WalkState->ParserState.AmlStart);
if (AcpiGbl_DmOpt_Verbose)
{
- AcpiOsPrintf (DB_FULL_OP_INFO,
- (Info->WalkState->MethodNode ?
- Info->WalkState->MethodNode->Name.Ascii : " "),
- AmlOffset, (UINT32) Op->Common.AmlOpcode);
+ if (AcpiGbl_CmSingleStep)
+ {
+ AcpiOsPrintf ("%5.5X/%4.4X: ",
+ AmlOffset, (UINT32) Op->Common.AmlOpcode);
+ }
+ else
+ {
+ AcpiOsPrintf ("AML Offset %5.5X, Opcode %4.4X: ",
+ AmlOffset, (UINT32) Op->Common.AmlOpcode);
+ }
}
}
@@ -782,7 +779,7 @@ AcpiDmDescendingOp (
Name = AcpiPsGetName (Op);
if (Op->Named.Path)
{
- AcpiDmNamestring ((char *) Op->Named.Path);
+ AcpiDmNamestring (Op->Named.Path);
}
else
{
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
index ba8b7dc..c930337 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
@@ -197,7 +197,7 @@ AcpiDsExecuteArguments (
ACPI_WALK_STATE *WalkState;
- ACPI_FUNCTION_TRACE (DsExecuteArguments);
+ ACPI_FUNCTION_TRACE_PTR (DsExecuteArguments, AmlStart);
/* Allocate a new parser op to be the root of the parsed tree */
@@ -474,7 +474,8 @@ AcpiDsGetPackageArguments (
return_ACPI_STATUS (AE_AML_INTERNAL);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n",
+ ObjDesc->Package.AmlStart));
/* Execute the AML code for the TermArg arguments */
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
index 2a14006..1e99b66 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
@@ -320,6 +320,7 @@ AcpiDsDumpMethodStack (
Op->Common.Next = NULL;
#ifdef ACPI_DISASSEMBLER
+ AcpiOsPrintf ("Failed at ");
AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
#endif
Op->Common.Next = Next;
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
index e43a615..a526863 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
@@ -313,6 +313,8 @@ AcpiDsCreateBufferField (
if (!(WalkState->ParseFlags & ACPI_PARSE_EXECUTE))
{
+ ACPI_ERROR ((AE_INFO,
+ "Parse execute mode is not set"));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -701,6 +703,8 @@ AcpiDsInitFieldObjects (
return_ACPI_STATUS (AE_OK);
}
+ ACPI_ERROR ((AE_INFO,
+ "Parse deferred mode is not set"));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
index 5297eb1..53ba644 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
@@ -333,6 +333,7 @@ AcpiDsMethodError (
ACPI_WALK_STATE *WalkState)
{
UINT32 AmlOffset;
+ ACPI_NAME Name = 0;
ACPI_FUNCTION_ENTRY ();
@@ -361,9 +362,16 @@ AcpiDsMethodError (
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
WalkState->ParserState.AmlStart);
- Status = AcpiGbl_ExceptionHandler (Status,
- WalkState->MethodNode ?
- WalkState->MethodNode->Name.Integer : 0,
+ if (WalkState->MethodNode)
+ {
+ Name = WalkState->MethodNode->Name.Integer;
+ }
+ else if (WalkState->DeferredNode)
+ {
+ Name = WalkState->DeferredNode->Name.Integer;
+ }
+
+ Status = AcpiGbl_ExceptionHandler (Status, Name,
WalkState->Opcode, AmlOffset, NULL);
AcpiExEnterInterpreter ();
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
index ba739f5..55061de 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
@@ -160,14 +160,6 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsobject")
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiDsBuildInternalObject (
- ACPI_WALK_STATE *WalkState,
- ACPI_PARSE_OBJECT *Op,
- ACPI_OPERAND_OBJECT **ObjDescPtr);
-
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
@@ -185,7 +177,7 @@ AcpiDsBuildInternalObject (
*
******************************************************************************/
-static ACPI_STATUS
+ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
@@ -193,7 +185,6 @@ AcpiDsBuildInternalObject (
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
- ACPI_OBJECT_TYPE Type;
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
@@ -204,129 +195,43 @@ AcpiDsBuildInternalObject (
{
/*
* This is a named object reference. If this name was
- * previously looked up in the namespace, it was stored in this op.
- * Otherwise, go ahead and look it up now
+ * previously looked up in the namespace, it was stored in
+ * this op. Otherwise, go ahead and look it up now
*/
if (!Op->Common.Node)
{
- Status = AcpiNsLookup (WalkState->ScopeInfo,
- Op->Common.Value.String,
- ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
- if (ACPI_FAILURE (Status))
- {
- /* Check if we are resolving a named reference within a package */
-
- if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) &&
-
- ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
- (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)))
- {
- /*
- * We didn't find the target and we are populating elements
- * of a package - ignore if slack enabled. Some ASL code
- * contains dangling invalid references in packages and
- * expects that no exception will be issued. Leave the
- * element as a null element. It cannot be used, but it
- * can be overwritten by subsequent ASL code - this is
- * typically the case.
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Ignoring unresolved reference in package [%4.4s]\n",
- WalkState->ScopeInfo->Scope.Node->Name.Ascii));
-
- return_ACPI_STATUS (AE_OK);
- }
- else
- {
- ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
- }
-
- return_ACPI_STATUS (Status);
- }
- }
-
- /* Special object resolution for elements of a package */
-
- if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
- (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
- {
- /*
- * Attempt to resolve the node to a value before we insert it into
- * the package. If this is a reference to a common data type,
- * resolve it immediately. According to the ACPI spec, package
- * elements can only be "data objects" or method references.
- * Attempt to resolve to an Integer, Buffer, String or Package.
- * If cannot, return the named reference (for things like Devices,
- * Methods, etc.) Buffer Fields and Fields will resolve to simple
- * objects (int/buf/str/pkg).
- *
- * NOTE: References to things like Devices, Methods, Mutexes, etc.
- * will remain as named references. This behavior is not described
- * in the ACPI spec, but it appears to be an oversight.
- */
- ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
-
- Status = AcpiExResolveNodeToValue (
- ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
- WalkState);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
+ /* Check if we are resolving a named reference within a package */
- /*
- * Special handling for Alias objects. We need to setup the type
- * and the Op->Common.Node to point to the Alias target. Note,
- * Alias has at most one level of indirection internally.
- */
- Type = Op->Common.Node->Type;
- if (Type == ACPI_TYPE_LOCAL_ALIAS)
+ if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
+ (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
- Type = ObjDesc->Common.Type;
- Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
- Op->Common.Node->Object);
- }
-
- switch (Type)
- {
- /*
- * For these types, we need the actual node, not the subobject.
- * However, the subobject did not get an extra reference count above.
- *
- * TBD: should ExResolveNodeToValue be changed to fix this?
- */
- case ACPI_TYPE_DEVICE:
- case ACPI_TYPE_THERMAL:
-
- AcpiUtAddReference (Op->Common.Node->Object);
-
- /*lint -fallthrough */
- /*
- * For these types, we need the actual node, not the subobject.
- * The subobject got an extra reference count in ExResolveNodeToValue.
- */
- case ACPI_TYPE_MUTEX:
- case ACPI_TYPE_METHOD:
- case ACPI_TYPE_POWER:
- case ACPI_TYPE_PROCESSOR:
- case ACPI_TYPE_EVENT:
- case ACPI_TYPE_REGION:
-
- /* We will create a reference object for these types below */
- break;
-
- default:
/*
- * All other types - the node was resolved to an actual
- * object, we are done.
+ * We won't resolve package elements here, we will do this
+ * after all ACPI tables are loaded into the namespace. This
+ * behavior supports both forward references to named objects
+ * and external references to objects in other tables.
*/
- goto Exit;
+ goto CreateNewObject;
+ }
+ else
+ {
+ Status = AcpiNsLookup (WalkState->ScopeInfo,
+ Op->Common.Value.String,
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
+ ACPI_CAST_INDIRECT_PTR (
+ ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
+ return_ACPI_STATUS (Status);
+ }
}
}
}
+CreateNewObject:
+
/* Create and init a new internal ACPI object */
ObjDesc = AcpiUtCreateInternalObject (
@@ -344,7 +249,28 @@ AcpiDsBuildInternalObject (
return_ACPI_STATUS (Status);
}
-Exit:
+ /*
+ * Handling for unresolved package reference elements.
+ * These are elements that are namepaths.
+ */
+ if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
+ (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
+ {
+ ObjDesc->Reference.Resolved = TRUE;
+
+ if ((Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
+ !ObjDesc->Reference.Node)
+ {
+ /*
+ * Name was unresolved above.
+ * Get the prefix node for later lookup
+ */
+ ObjDesc->Reference.Node = WalkState->ScopeInfo->Scope.Node;
+ ObjDesc->Reference.Aml = Op->Common.Aml;
+ ObjDesc->Reference.Resolved = FALSE;
+ }
+ }
+
*ObjDescPtr = ObjDesc;
return_ACPI_STATUS (Status);
}
@@ -466,209 +392,6 @@ AcpiDsBuildInternalBufferObj (
return_ACPI_STATUS (AE_OK);
}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDsBuildInternalPackageObj
- *
- * PARAMETERS: WalkState - Current walk state
- * Op - Parser object to be translated
- * ElementCount - Number of elements in the package - this is
- * the NumElements argument to Package()
- * ObjDescPtr - Where the ACPI internal object is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Translate a parser Op package object to the equivalent
- * namespace object
- *
- * NOTE: The number of elements in the package will be always be the NumElements
- * count, regardless of the number of elements in the package list. If
- * NumElements is smaller, only that many package list elements are used.
- * if NumElements is larger, the Package object is padded out with
- * objects of type Uninitialized (as per ACPI spec.)
- *
- * Even though the ASL compilers do not allow NumElements to be smaller
- * than the Package list length (for the fixed length package opcode), some
- * BIOS code modifies the AML on the fly to adjust the NumElements, and
- * this code compensates for that. This also provides compatibility with
- * other AML interpreters.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiDsBuildInternalPackageObj (
- ACPI_WALK_STATE *WalkState,
- ACPI_PARSE_OBJECT *Op,
- UINT32 ElementCount,
- ACPI_OPERAND_OBJECT **ObjDescPtr)
-{
- ACPI_PARSE_OBJECT *Arg;
- ACPI_PARSE_OBJECT *Parent;
- ACPI_OPERAND_OBJECT *ObjDesc = NULL;
- ACPI_STATUS Status = AE_OK;
- UINT32 i;
- UINT16 Index;
- UINT16 ReferenceCount;
-
-
- ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
-
-
- /* Find the parent of a possibly nested package */
-
- Parent = Op->Common.Parent;
- while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
- (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
- {
- Parent = Parent->Common.Parent;
- }
-
- /*
- * If we are evaluating a Named package object "Name (xxxx, Package)",
- * the package object already exists, otherwise it must be created.
- */
- ObjDesc = *ObjDescPtr;
- if (!ObjDesc)
- {
- ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
- *ObjDescPtr = ObjDesc;
- if (!ObjDesc)
- {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- ObjDesc->Package.Node = Parent->Common.Node;
- }
-
- /*
- * Allocate the element array (array of pointers to the individual
- * objects) based on the NumElements parameter. Add an extra pointer slot
- * so that the list is always null terminated.
- */
- ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
-
- if (!ObjDesc->Package.Elements)
- {
- AcpiUtDeleteObjectDesc (ObjDesc);
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- ObjDesc->Package.Count = ElementCount;
-
- /*
- * Initialize the elements of the package, up to the NumElements count.
- * Package is automatically padded with uninitialized (NULL) elements
- * if NumElements is greater than the package list length. Likewise,
- * Package is truncated if NumElements is less than the list length.
- */
- Arg = Op->Common.Value.Arg;
- Arg = Arg->Common.Next;
- for (i = 0; Arg && (i < ElementCount); i++)
- {
- if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
- {
- if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
- {
- /*
- * A method reference "looks" to the parser to be a method
- * invocation, so we special case it here
- */
- Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
- Status = AcpiDsBuildInternalObject (
- WalkState, Arg, &ObjDesc->Package.Elements[i]);
- }
- else
- {
- /* This package element is already built, just get it */
-
- ObjDesc->Package.Elements[i] =
- ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
- }
- }
- else
- {
- Status = AcpiDsBuildInternalObject (
- WalkState, Arg, &ObjDesc->Package.Elements[i]);
- }
-
- if (*ObjDescPtr)
- {
- /* Existing package, get existing reference count */
-
- ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
- if (ReferenceCount > 1)
- {
- /* Make new element ref count match original ref count */
-
- for (Index = 0; Index < (ReferenceCount - 1); Index++)
- {
- AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
- }
- }
- }
-
- Arg = Arg->Common.Next;
- }
-
- /* Check for match between NumElements and actual length of PackageList */
-
- if (Arg)
- {
- /*
- * NumElements was exhausted, but there are remaining elements in the
- * PackageList. Truncate the package to NumElements.
- *
- * Note: technically, this is an error, from ACPI spec: "It is an error
- * for NumElements to be less than the number of elements in the
- * PackageList". However, we just print a message and
- * no exception is returned. This provides Windows compatibility. Some
- * BIOSs will alter the NumElements on the fly, creating this type
- * of ill-formed package object.
- */
- while (Arg)
- {
- /*
- * We must delete any package elements that were created earlier
- * and are not going to be used because of the package truncation.
- */
- if (Arg->Common.Node)
- {
- AcpiUtRemoveReference (
- ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
- Arg->Common.Node = NULL;
- }
-
- /* Find out how many elements there really are */
-
- i++;
- Arg = Arg->Common.Next;
- }
-
- ACPI_INFO ((
- "Actual Package length (%u) is larger than "
- "NumElements field (%u), truncated",
- i, ElementCount));
- }
- else if (i < ElementCount)
- {
- /*
- * Arg list (elements) was exhausted, but we did not reach NumElements count.
- * Note: this is not an error, the package is padded out with NULLs.
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Package List length (%u) smaller than NumElements "
- "count (%u), padded with null elements\n",
- i, ElementCount));
- }
-
- ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
- Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
- return_ACPI_STATUS (Status);
-}
-
-
/*******************************************************************************
*
* FUNCTION: AcpiDsCreateNode
@@ -796,10 +519,20 @@ AcpiDsInitObjectFromOp (
case ACPI_TYPE_PACKAGE:
/*
- * Defer evaluation of Package TermArg operand
+ * Defer evaluation of Package TermArg operand and all
+ * package elements. (01/2017): We defer the element
+ * resolution to allow forward references from the package
+ * in order to provide compatibility with other ACPI
+ * implementations.
*/
ObjDesc->Package.Node = ACPI_CAST_PTR (
ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
+
+ if (!Op->Named.Data)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
ObjDesc->Package.AmlStart = Op->Named.Data;
ObjDesc->Package.AmlLength = Op->Named.Length;
break;
@@ -940,8 +673,11 @@ AcpiDsInitObjectFromOp (
/* Node was saved in Op */
ObjDesc->Reference.Node = Op->Common.Node;
- ObjDesc->Reference.Object = Op->Common.Node->Object;
ObjDesc->Reference.Class = ACPI_REFCLASS_NAME;
+ if (Op->Common.Node)
+ {
+ ObjDesc->Reference.Object = Op->Common.Node->Object;
+ }
break;
case AML_DEBUG_OP:
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
index 1968ee3..5800762 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
@@ -353,10 +353,9 @@ AcpiDsInitBufferField (
(8 * (UINT32) BufferDesc->Buffer.Length))
{
ACPI_ERROR ((AE_INFO,
- "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)",
- AcpiUtGetNodeName (ResultDesc),
- BitOffset + BitCount,
- AcpiUtGetNodeName (BufferDesc->Buffer.Node),
+ "Field [%4.4s] at bit offset/length %u/%u "
+ "exceeds size of target Buffer (%u bits)",
+ AcpiUtGetNodeName (ResultDesc), BitOffset, BitCount,
8 * (UINT32) BufferDesc->Buffer.Length));
Status = AE_AML_BUFFER_LIMIT;
goto Cleanup;
@@ -748,6 +747,16 @@ AcpiDsEvalDataObjectOperands (
*/
WalkState->OperandIndex = WalkState->NumOperands;
+ /* Ignore if child is not valid */
+
+ if (!Op->Common.Value.Arg)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Dispatch: Missing child while executing TermArg for %X",
+ Op->Common.AmlOpcode));
+ return_ACPI_STATUS (AE_OK);
+ }
+
Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
if (ACPI_FAILURE (Status))
{
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c b/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
new file mode 100644
index 0000000..b7d45a6
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c
@@ -0,0 +1,635 @@
+/******************************************************************************
+ *
+ * Module Name: dspkginit - Completion of deferred package initialization
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2017, 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/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acdispat.h>
+#include <contrib/dev/acpica/include/acinterp.h>
+
+
+#define _COMPONENT ACPI_NAMESPACE
+ ACPI_MODULE_NAME ("dspkginit")
+
+
+/* Local prototypes */
+
+static void
+AcpiDsResolvePackageElement (
+ ACPI_OPERAND_OBJECT **Element);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDsBuildInternalPackageObj
+ *
+ * PARAMETERS: WalkState - Current walk state
+ * Op - Parser object to be translated
+ * ElementCount - Number of elements in the package - this is
+ * the NumElements argument to Package()
+ * ObjDescPtr - Where the ACPI internal object is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Translate a parser Op package object to the equivalent
+ * namespace object
+ *
+ * NOTE: The number of elements in the package will be always be the NumElements
+ * count, regardless of the number of elements in the package list. If
+ * NumElements is smaller, only that many package list elements are used.
+ * if NumElements is larger, the Package object is padded out with
+ * objects of type Uninitialized (as per ACPI spec.)
+ *
+ * Even though the ASL compilers do not allow NumElements to be smaller
+ * than the Package list length (for the fixed length package opcode), some
+ * BIOS code modifies the AML on the fly to adjust the NumElements, and
+ * this code compensates for that. This also provides compatibility with
+ * other AML interpreters.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDsBuildInternalPackageObj (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 ElementCount,
+ ACPI_OPERAND_OBJECT **ObjDescPtr)
+{
+ ACPI_PARSE_OBJECT *Arg;
+ ACPI_PARSE_OBJECT *Parent;
+ ACPI_OPERAND_OBJECT *ObjDesc = NULL;
+ ACPI_STATUS Status = AE_OK;
+ UINT16 ReferenceCount;
+ UINT32 Index;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
+
+
+ /* Find the parent of a possibly nested package */
+
+ Parent = Op->Common.Parent;
+ while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
+ (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
+ {
+ Parent = Parent->Common.Parent;
+ }
+
+ /*
+ * If we are evaluating a Named package object of the form:
+ * Name (xxxx, Package)
+ * the package object already exists, otherwise it must be created.
+ */
+ ObjDesc = *ObjDescPtr;
+ if (!ObjDesc)
+ {
+ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
+ *ObjDescPtr = ObjDesc;
+ if (!ObjDesc)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ ObjDesc->Package.Node = Parent->Common.Node;
+ }
+
+ if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) /* Just in case */
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
+ /*
+ * Allocate the element array (array of pointers to the individual
+ * objects) based on the NumElements parameter. Add an extra pointer slot
+ * so that the list is always null terminated.
+ */
+ ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
+ ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
+
+ if (!ObjDesc->Package.Elements)
+ {
+ AcpiUtDeleteObjectDesc (ObjDesc);
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ ObjDesc->Package.Count = ElementCount;
+ Arg = Op->Common.Value.Arg;
+ Arg = Arg->Common.Next;
+
+ if (Arg)
+ {
+ ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+ }
+
+ /*
+ * Initialize the elements of the package, up to the NumElements count.
+ * Package is automatically padded with uninitialized (NULL) elements
+ * if NumElements is greater than the package list length. Likewise,
+ * Package is truncated if NumElements is less than the list length.
+ */
+ for (i = 0; Arg && (i < ElementCount); i++)
+ {
+ if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
+ {
+ if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
+ {
+ /*
+ * A method reference "looks" to the parser to be a method
+ * invocation, so we special case it here
+ */
+ Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
+ Status = AcpiDsBuildInternalObject (
+ WalkState, Arg, &ObjDesc->Package.Elements[i]);
+ }
+ else
+ {
+ /* This package element is already built, just get it */
+
+ ObjDesc->Package.Elements[i] =
+ ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
+ }
+ }
+ else
+ {
+ Status = AcpiDsBuildInternalObject (
+ WalkState, Arg, &ObjDesc->Package.Elements[i]);
+ if (Status == AE_NOT_FOUND)
+ {
+ ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
+ }
+
+ /*
+ * Initialize this package element. This function handles the
+ * resolution of named references within the package.
+ */
+ AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
+ NULL, &ObjDesc->Package.Elements[i]);
+ }
+
+ if (*ObjDescPtr)
+ {
+ /* Existing package, get existing reference count */
+
+ ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
+ if (ReferenceCount > 1)
+ {
+ /* Make new element ref count match original ref count */
+ /* TBD: Probably need an AcpiUtAddReferences function */
+
+ for (Index = 0; Index < ((UINT32) ReferenceCount - 1); Index++)
+ {
+ AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
+ }
+ }
+ }
+
+ Arg = Arg->Common.Next;
+ }
+
+ /* Check for match between NumElements and actual length of PackageList */
+
+ if (Arg)
+ {
+ /*
+ * NumElements was exhausted, but there are remaining elements in
+ * the PackageList. Truncate the package to NumElements.
+ *
+ * Note: technically, this is an error, from ACPI spec: "It is an
+ * error for NumElements to be less than the number of elements in
+ * the PackageList". However, we just print a message and no
+ * exception is returned. This provides compatibility with other
+ * ACPI implementations. Some firmware implementations will alter
+ * the NumElements on the fly, possibly creating this type of
+ * ill-formed package object.
+ */
+ while (Arg)
+ {
+ /*
+ * We must delete any package elements that were created earlier
+ * and are not going to be used because of the package truncation.
+ */
+ if (Arg->Common.Node)
+ {
+ AcpiUtRemoveReference (
+ ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
+ Arg->Common.Node = NULL;
+ }
+
+ /* Find out how many elements there really are */
+
+ i++;
+ Arg = Arg->Common.Next;
+ }
+
+ ACPI_INFO ((
+ "Actual Package length (%u) is larger than "
+ "NumElements field (%u), truncated",
+ i, ElementCount));
+ }
+ else if (i < ElementCount)
+ {
+ /*
+ * Arg list (elements) was exhausted, but we did not reach
+ * NumElements count.
+ *
+ * Note: this is not an error, the package is padded out
+ * with NULLs.
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Package List length (%u) smaller than NumElements "
+ "count (%u), padded with null elements\n",
+ i, ElementCount));
+ }
+
+ ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+ Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDsInitPackageElement
+ *
+ * PARAMETERS: ACPI_PKG_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Resolve a named reference element within a package object
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDsInitPackageElement (
+ UINT8 ObjectType,
+ ACPI_OPERAND_OBJECT *SourceObject,
+ ACPI_GENERIC_STATE *State,
+ void *Context)
+{
+ ACPI_OPERAND_OBJECT **ElementPtr;
+
+
+ if (!SourceObject)
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * The following code is a bit of a hack to workaround a (current)
+ * limitation of the ACPI_PKG_CALLBACK interface. We need a pointer
+ * to the location within the element array because a new object
+ * may be created and stored there.
+ */
+ if (Context)
+ {
+ /* A direct call was made to this function */
+
+ ElementPtr = (ACPI_OPERAND_OBJECT **) Context;
+ }
+ else
+ {
+ /* Call came from AcpiUtWalkPackageTree */
+
+ ElementPtr = State->Pkg.ThisTargetObj;
+ }
+
+ /* We are only interested in reference objects/elements */
+
+ if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
+ {
+ /* Attempt to resolve the (named) reference to a namespace node */
+
+ AcpiDsResolvePackageElement (ElementPtr);
+ }
+ else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE)
+ {
+ SourceObject->Package.Flags |= AOPOBJ_DATA_VALID;
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDsResolvePackageElement
+ *
+ * PARAMETERS: ElementPtr - Pointer to a reference object
+ *
+ * RETURN: Possible new element is stored to the indirect ElementPtr
+ *
+ * DESCRIPTION: Resolve a package element that is a reference to a named
+ * object.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDsResolvePackageElement (
+ ACPI_OPERAND_OBJECT **ElementPtr)
+{
+ ACPI_STATUS Status;
+ ACPI_GENERIC_STATE ScopeInfo;
+ ACPI_OPERAND_OBJECT *Element = *ElementPtr;
+ ACPI_NAMESPACE_NODE *ResolvedNode;
+ char *ExternalPath = NULL;
+ ACPI_OBJECT_TYPE Type;
+
+
+ ACPI_FUNCTION_TRACE (DsResolvePackageElement);
+
+
+ /* Check if reference element is already resolved */
+
+ if (Element->Reference.Resolved)
+ {
+ return_VOID;
+ }
+
+ /* Element must be a reference object of correct type */
+
+ ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
+
+ Status = AcpiNsLookup (&ScopeInfo,
+ (char *) Element->Reference.Aml, /* Pointer to AML path */
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+ NULL, &ResolvedNode);
+ if (ACPI_FAILURE (Status))
+ {
+ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
+ (char *) Element->Reference.Aml,
+ NULL, &ExternalPath);
+
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Could not find/resolve named package element: %s", ExternalPath));
+
+ ACPI_FREE (ExternalPath);
+ *ElementPtr = NULL;
+ return_VOID;
+ }
+ else if (ResolvedNode->Type == ACPI_TYPE_ANY)
+ {
+ /* Named reference not resolved, return a NULL package element */
+
+ ACPI_ERROR ((AE_INFO,
+ "Could not resolve named package element [%4.4s] in [%4.4s]",
+ ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii));
+ *ElementPtr = NULL;
+ return_VOID;
+ }
+#if 0
+ else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
+ {
+ /*
+ * A temporary node found here indicates that the reference is
+ * to a node that was created within this method. We are not
+ * going to allow it (especially if the package is returned
+ * from the method) -- the temporary node will be deleted out
+ * from under the method. (05/2017).
+ */
+ ACPI_ERROR ((AE_INFO,
+ "Package element refers to a temporary name [%4.4s], "
+ "inserting a NULL element",
+ ResolvedNode->Name.Ascii));
+ *ElementPtr = NULL;
+ return_VOID;
+ }
+#endif
+
+ /*
+ * Special handling for Alias objects. We need ResolvedNode to point
+ * to the Alias target. This effectively "resolves" the alias.
+ */
+ if (ResolvedNode->Type == ACPI_TYPE_LOCAL_ALIAS)
+ {
+ ResolvedNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
+ ResolvedNode->Object);
+ }
+
+ /* Update the reference object */
+
+ Element->Reference.Resolved = TRUE;
+ Element->Reference.Node = ResolvedNode;
+ Type = Element->Reference.Node->Type;
+
+ /*
+ * Attempt to resolve the node to a value before we insert it into
+ * the package. If this is a reference to a common data type,
+ * resolve it immediately. According to the ACPI spec, package
+ * elements can only be "data objects" or method references.
+ * Attempt to resolve to an Integer, Buffer, String or Package.
+ * If cannot, return the named reference (for things like Devices,
+ * Methods, etc.) Buffer Fields and Fields will resolve to simple
+ * objects (int/buf/str/pkg).
+ *
+ * NOTE: References to things like Devices, Methods, Mutexes, etc.
+ * will remain as named references. This behavior is not described
+ * in the ACPI spec, but it appears to be an oversight.
+ */
+ Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ return_VOID;
+ }
+
+#if 0
+/* TBD - alias support */
+ /*
+ * Special handling for Alias objects. We need to setup the type
+ * and the Op->Common.Node to point to the Alias target. Note,
+ * Alias has at most one level of indirection internally.
+ */
+ Type = Op->Common.Node->Type;
+ if (Type == ACPI_TYPE_LOCAL_ALIAS)
+ {
+ Type = ObjDesc->Common.Type;
+ Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
+ Op->Common.Node->Object);
+ }
+#endif
+
+ switch (Type)
+ {
+ /*
+ * These object types are a result of named references, so we will
+ * leave them as reference objects. In other words, these types
+ * have no intrinsic "value".
+ */
+ case ACPI_TYPE_DEVICE:
+ case ACPI_TYPE_THERMAL:
+
+ /* TBD: This may not be necesssary */
+
+ AcpiUtAddReference (ResolvedNode->Object);
+ break;
+
+ case ACPI_TYPE_MUTEX:
+ case ACPI_TYPE_METHOD:
+ case ACPI_TYPE_POWER:
+ case ACPI_TYPE_PROCESSOR:
+ case ACPI_TYPE_EVENT:
+ case ACPI_TYPE_REGION:
+
+ break;
+
+ default:
+ /*
+ * For all other types - the node was resolved to an actual
+ * operand object with a value, return the object
+ */
+ *ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode;
+ break;
+ }
+
+ return_VOID;
+}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
index 246db00..41583ab 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
@@ -791,12 +791,6 @@ AcpiDsCreateOperand (
if ((OpInfo->Flags & AML_HAS_RETVAL) ||
(Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
{
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "Argument previously created, already stacked\n"));
-
- AcpiDbDisplayArgumentObject (
- WalkState->Operands [WalkState->NumOperands - 1], WalkState);
-
/*
* Use value that was already previously returned
* by the evaluation of this argument
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
index 6f6063a..9cdf756 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
@@ -723,7 +723,8 @@ AcpiDsExecEndOp (
case AML_TYPE_CREATE_OBJECT:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
+ "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
+ Op, Op->Named.Data));
switch (Op->Common.Parent->Common.AmlOpcode)
{
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
index 47a3614..2ac3d6d 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
@@ -518,7 +518,7 @@ AcpiDsLoad1BeginOp (
/* Initialize the op */
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
- Op->Named.Path = ACPI_CAST_PTR (UINT8, Path);
+ Op->Named.Path = Path;
#endif
if (Node)
@@ -558,6 +558,10 @@ AcpiDsLoad1EndOp (
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status = AE_OK;
+#ifdef ACPI_ASL_COMPILER
+ UINT8 ParamCount;
+#endif
+
ACPI_FUNCTION_TRACE (DsLoad1EndOp);
@@ -642,6 +646,37 @@ AcpiDsLoad1EndOp (
}
}
+#ifdef ACPI_ASL_COMPILER
+ /*
+ * For external opcode, get the object type from the argument and
+ * get the parameter count from the argument's next.
+ */
+ if (AcpiGbl_DisasmFlag &&
+ Op->Common.Node &&
+ Op->Common.AmlOpcode == AML_EXTERNAL_OP)
+ {
+ /*
+ * Note, if this external is not a method
+ * Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0
+ * Therefore, ParamCount will be 0.
+ */
+ ParamCount = (UINT8) Op->Common.Value.Arg->Common.Next->Common.Value.Integer;
+ ObjectType = (UINT8) Op->Common.Value.Arg->Common.Value.Integer;
+ Op->Common.Node->Flags |= ANOBJ_IS_EXTERNAL;
+ Op->Common.Node->Type = (UINT8) ObjectType;
+
+ AcpiDmCreateSubobjectForExternal ((UINT8)ObjectType,
+ &Op->Common.Node, ParamCount);
+
+ /*
+ * Add the external to the external list because we may be
+ * emitting code based off of the items within the external list.
+ */
+ AcpiDmAddOpToExternalList (Op, Op->Named.Path, (UINT8)ObjectType, ParamCount,
+ ACPI_EXT_ORIGIN_FROM_OPCODE | ACPI_EXT_RESOLVED_REFERENCE);
+ }
+#endif
+
/*
* If we are executing a method, do not create any namespace objects
* during the load phase, only during execution.
@@ -689,6 +724,7 @@ AcpiDsLoad1EndOp (
/* Pop the scope stack (only if loading a table) */
if (!WalkState->MethodNode &&
+ Op->Common.AmlOpcode != AML_EXTERNAL_OP &&
AcpiNsOpensScope (ObjectType))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
index 5f790fd..f0bcdba 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
@@ -428,6 +428,24 @@ AcpiDsLoad2BeginOp (
}
}
+#ifdef ACPI_ASL_COMPILER
+
+ /*
+ * Do not open a scope for AML_EXTERNAL_OP
+ * AcpiNsLookup can open a new scope based on the object type
+ * of this op. AML_EXTERNAL_OP is a declaration rather than a
+ * definition. In the case that this external is a method object,
+ * AcpiNsLookup will open a new scope. However, an AML_EXTERNAL_OP
+ * associated with the ACPI_TYPE_METHOD is a declaration, rather than
+ * a definition. Flags is set to avoid opening a scope for any
+ * AML_EXTERNAL_OP.
+ */
+ if (WalkState->Opcode == AML_EXTERNAL_OP)
+ {
+ Flags |= ACPI_NS_DONT_OPEN_SCOPE;
+ }
+#endif
+
/* Add new entry or lookup existing entry */
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
diff --git a/sys/contrib/dev/acpica/components/events/evxfevnt.c b/sys/contrib/dev/acpica/components/events/evxfevnt.c
index 4889a86..0feb9e9 100644
--- a/sys/contrib/dev/acpica/components/events/evxfevnt.c
+++ b/sys/contrib/dev/acpica/components/events/evxfevnt.c
@@ -306,6 +306,13 @@ AcpiEnableEvent (
ACPI_FUNCTION_TRACE (AcpiEnableEvent);
+ /* If Hardware Reduced flag is set, there are no fixed events */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
@@ -372,6 +379,13 @@ AcpiDisableEvent (
ACPI_FUNCTION_TRACE (AcpiDisableEvent);
+ /* If Hardware Reduced flag is set, there are no fixed events */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
@@ -433,6 +447,13 @@ AcpiClearEvent (
ACPI_FUNCTION_TRACE (AcpiClearEvent);
+ /* If Hardware Reduced flag is set, there are no fixed events */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
diff --git a/sys/contrib/dev/acpica/components/executer/excreate.c b/sys/contrib/dev/acpica/components/executer/excreate.c
index 0d46e27..7f2deb1 100644
--- a/sys/contrib/dev/acpica/components/executer/excreate.c
+++ b/sys/contrib/dev/acpica/components/executer/excreate.c
@@ -203,65 +203,40 @@ AcpiExCreateAlias (
TargetNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, TargetNode->Object);
}
- /*
- * For objects that can never change (i.e., the NS node will
- * permanently point to the same object), we can simply attach
- * the object to the new NS node. For other objects (such as
- * Integers, buffers, etc.), we have to point the Alias node
- * to the original Node.
- */
- switch (TargetNode->Type)
- {
+ /* Ensure that the target node is valid */
- /* For these types, the sub-object can change dynamically via a Store */
+ if (!TargetNode)
+ {
+ return_ACPI_STATUS (AE_NULL_OBJECT);
+ }
- case ACPI_TYPE_INTEGER:
- case ACPI_TYPE_STRING:
- case ACPI_TYPE_BUFFER:
- case ACPI_TYPE_PACKAGE:
- case ACPI_TYPE_BUFFER_FIELD:
- /*
- * These types open a new scope, so we need the NS node in order to access
- * any children.
- */
- case ACPI_TYPE_DEVICE:
- case ACPI_TYPE_POWER:
- case ACPI_TYPE_PROCESSOR:
- case ACPI_TYPE_THERMAL:
- case ACPI_TYPE_LOCAL_SCOPE:
- /*
- * The new alias has the type ALIAS and points to the original
- * NS node, not the object itself.
- */
- AliasNode->Type = ACPI_TYPE_LOCAL_ALIAS;
- AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
- break;
+ /* Construct the alias object (a namespace node) */
+ switch (TargetNode->Type)
+ {
case ACPI_TYPE_METHOD:
/*
- * Control method aliases need to be differentiated
+ * Control method aliases need to be differentiated with
+ * a special type
*/
AliasNode->Type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
- AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
break;
default:
-
- /* Attach the original source object to the new Alias Node */
-
/*
- * The new alias assumes the type of the target, and it points
- * to the same object. The reference count of the object has an
- * additional reference to prevent deletion out from under either the
- * target node or the alias Node
+ * All other object types.
+ *
+ * The new alias has the type ALIAS and points to the original
+ * NS node, not the object itself.
*/
- Status = AcpiNsAttachObject (AliasNode,
- AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
+ AliasNode->Type = ACPI_TYPE_LOCAL_ALIAS;
+ AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
break;
}
/* Since both operands are Nodes, we don't need to delete them */
+ AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/executer/exdebug.c b/sys/contrib/dev/acpica/components/executer/exdebug.c
index 867221f..d4187d1 100644
--- a/sys/contrib/dev/acpica/components/executer/exdebug.c
+++ b/sys/contrib/dev/acpica/components/executer/exdebug.c
@@ -237,11 +237,11 @@ AcpiExDoDebugObject (
Timer = ((UINT32) AcpiOsGetTimer () / 10);
Timer &= 0x03FFFFFF;
- AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " ");
+ AcpiOsPrintf ("ACPI Debug: T=0x%8.8X %*s", Timer, Level, " ");
}
else
{
- AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+ AcpiOsPrintf ("ACPI Debug: %*s", Level, " ");
}
}
diff --git a/sys/contrib/dev/acpica/components/executer/exdump.c b/sys/contrib/dev/acpica/components/executer/exdump.c
index 47aae28..3c67608 100644
--- a/sys/contrib/dev/acpica/components/executer/exdump.c
+++ b/sys/contrib/dev/acpica/components/executer/exdump.c
@@ -229,7 +229,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
- {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
+ {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Element Count"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
{ACPI_EXD_PACKAGE, 0, NULL}
};
@@ -510,6 +510,11 @@ AcpiExDumpObject (
while (Count)
{
+ if (!ObjDesc)
+ {
+ return;
+ }
+
Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);
Name = Info->Name;
@@ -522,7 +527,8 @@ AcpiExDumpObject (
case ACPI_EXD_TYPE:
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
- ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
+ ObjDesc->Common.Type,
+ AcpiUtGetObjectTypeName (ObjDesc));
break;
case ACPI_EXD_UINT8:
@@ -588,10 +594,10 @@ AcpiExDumpObject (
Start = *ACPI_CAST_PTR (void *, Target);
Next = Start;
- AcpiOsPrintf ("%20s : %p", Name, Next);
+ AcpiOsPrintf ("%20s : %p ", Name, Next);
if (Next)
{
- AcpiOsPrintf ("(%s %2.2X)",
+ AcpiOsPrintf ("%s (Type %2.2X)",
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
while (Next->Common.NextObject)
@@ -614,6 +620,10 @@ AcpiExDumpObject (
}
}
}
+ else
+ {
+ AcpiOsPrintf ("- No attached objects");
+ }
AcpiOsPrintf ("\n");
break;
@@ -775,12 +785,13 @@ AcpiExDumpOperand (
if (Depth > 0)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ",
- Depth, " ", Depth, ObjDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",
+ Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
}
else
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Refs=%u ",
+ ObjDesc, ObjDesc->Common.ReferenceCount));
}
/* Decode object type */
@@ -818,8 +829,10 @@ AcpiExDumpOperand (
case ACPI_REFCLASS_NAME:
- AcpiOsPrintf ("- [%4.4s]\n",
- ObjDesc->Reference.Node->Name.Ascii);
+ AcpiUtRepairName (ObjDesc->Reference.Node->Name.Ascii);
+ AcpiOsPrintf ("- [%4.4s] (Node %p)\n",
+ ObjDesc->Reference.Node->Name.Ascii,
+ ObjDesc->Reference.Node);
break;
case ACPI_REFCLASS_ARG:
@@ -1158,12 +1171,15 @@ AcpiExDumpReferenceObj (
&RetBuf, TRUE);
if (ACPI_FAILURE (Status))
{
- AcpiOsPrintf (" Could not convert name to pathname\n");
+ AcpiOsPrintf (" Could not convert name to pathname: %s\n",
+ AcpiFormatException (Status));
}
else
{
- AcpiOsPrintf ("%s\n", (char *) RetBuf.Pointer);
- ACPI_FREE (RetBuf.Pointer);
+ AcpiOsPrintf ("%s: %s\n",
+ AcpiUtGetTypeName (ObjDesc->Reference.Node->Type),
+ (char *) RetBuf.Pointer);
+ ACPI_FREE (RetBuf.Pointer);
}
}
else if (ObjDesc->Reference.Object)
@@ -1281,15 +1297,15 @@ AcpiExDumpPackageObj (
case ACPI_TYPE_LOCAL_REFERENCE:
- AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
- AcpiUtGetReferenceName (ObjDesc),
- ObjDesc->Reference.Class);
+ AcpiOsPrintf ("[Object Reference] Class [%s]",
+ AcpiUtGetReferenceName (ObjDesc));
AcpiExDumpReferenceObj (ObjDesc);
break;
default:
- AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type);
+ AcpiOsPrintf ("[%s] Type: %2.2X\n",
+ AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type);
break;
}
}
@@ -1333,10 +1349,19 @@ AcpiExDumpObjectDescriptor (
{
AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);
- AcpiOsPrintf ("\nAttached Object (%p):\n",
- ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
-
ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
+ if (!ObjDesc)
+ {
+ return_VOID;
+ }
+
+ AcpiOsPrintf ("\nAttached Object %p", ObjDesc);
+ if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
+ {
+ AcpiOsPrintf (" - Namespace Node");
+ }
+
+ AcpiOsPrintf (":\n");
goto DumpObject;
}
@@ -1360,6 +1385,11 @@ AcpiExDumpObjectDescriptor (
DumpObject:
+ if (!ObjDesc)
+ {
+ return_VOID;
+ }
+
/* Common Fields */
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
diff --git a/sys/contrib/dev/acpica/components/executer/exmisc.c b/sys/contrib/dev/acpica/components/executer/exmisc.c
index c1ca2b9..6385fc7 100644
--- a/sys/contrib/dev/acpica/components/executer/exmisc.c
+++ b/sys/contrib/dev/acpica/components/executer/exmisc.c
@@ -401,6 +401,8 @@ AcpiExDoLogicalNumericOp (
default:
+ ACPI_ERROR ((AE_INFO,
+ "Invalid numeric logical opcode: %X", Opcode));
Status = AE_AML_INTERNAL;
break;
}
@@ -486,6 +488,9 @@ AcpiExDoLogicalOp (
default:
+ ACPI_ERROR ((AE_INFO,
+ "Invalid object type for logical operator: %X",
+ Operand0->Common.Type));
Status = AE_AML_INTERNAL;
break;
}
@@ -535,6 +540,8 @@ AcpiExDoLogicalOp (
default:
+ ACPI_ERROR ((AE_INFO,
+ "Invalid comparison opcode: %X", Opcode));
Status = AE_AML_INTERNAL;
break;
}
@@ -613,6 +620,8 @@ AcpiExDoLogicalOp (
default:
+ ACPI_ERROR ((AE_INFO,
+ "Invalid comparison opcode: %X", Opcode));
Status = AE_AML_INTERNAL;
break;
}
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg1.c b/sys/contrib/dev/acpica/components/executer/exoparg1.c
index 003a5c7..ccd8013 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg1.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg1.c
@@ -959,7 +959,7 @@ AcpiExOpcode_1A_0T_1R (
if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED)
{
TempDesc = AcpiNsGetAttachedObject (
- (ACPI_NAMESPACE_NODE *) Operand[0]);
+ (ACPI_NAMESPACE_NODE *) Operand[0]);
if (TempDesc &&
((TempDesc->Common.Type == ACPI_TYPE_STRING) ||
(TempDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)))
@@ -1072,11 +1072,27 @@ AcpiExOpcode_1A_0T_1R (
* This is a DerefOf (ObjectReference)
* Get the actual object from the Node (This is the dereference).
* This case may only happen when a LocalX or ArgX is
- * dereferenced above.
+ * dereferenced above, or for references to device and
+ * thermal objects.
*/
- ReturnDesc = AcpiNsGetAttachedObject (
- (ACPI_NAMESPACE_NODE *) Operand[0]);
- AcpiUtAddReference (ReturnDesc);
+ switch (((ACPI_NAMESPACE_NODE *) Operand[0])->Type)
+ {
+ case ACPI_TYPE_DEVICE:
+ case ACPI_TYPE_THERMAL:
+
+ /* These types have no node subobject, return the NS node */
+
+ ReturnDesc = Operand[0];
+ break;
+
+ default:
+ /* For most types, get the object attached to the node */
+
+ ReturnDesc = AcpiNsGetAttachedObject (
+ (ACPI_NAMESPACE_NODE *) Operand[0]);
+ AcpiUtAddReference (ReturnDesc);
+ break;
+ }
}
else
{
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg2.c b/sys/contrib/dev/acpica/components/executer/exoparg2.c
index 12afcaf..834becd 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg2.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg2.c
@@ -556,6 +556,8 @@ AcpiExOpcode_2A_1T_1R (
default:
+ ACPI_ERROR ((AE_INFO,
+ "Invalid object type: %X", (Operand[0])->Common.Type));
Status = AE_AML_INTERNAL;
goto Cleanup;
}
diff --git a/sys/contrib/dev/acpica/components/executer/exresolv.c b/sys/contrib/dev/acpica/components/executer/exresolv.c
index 5a824e7..a044796 100644
--- a/sys/contrib/dev/acpica/components/executer/exresolv.c
+++ b/sys/contrib/dev/acpica/components/executer/exresolv.c
@@ -493,12 +493,26 @@ AcpiExResolveMultiple (
(ACPI_NAMESPACE_NODE *) ObjDesc);
}
- if (!ObjDesc)
+ switch (Type)
{
- ACPI_ERROR ((AE_INFO,
- "[%4.4s] Node is unresolved or uninitialized",
- AcpiUtGetNodeName (Node)));
- return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
+ case ACPI_TYPE_DEVICE:
+ case ACPI_TYPE_THERMAL:
+
+ /* These types have no attached subobject */
+ break;
+
+ default:
+
+ /* All other types require a subobject */
+
+ if (!ObjDesc)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "[%4.4s] Node is unresolved or uninitialized",
+ AcpiUtGetNodeName (Node)));
+ return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
+ }
+ break;
}
break;
diff --git a/sys/contrib/dev/acpica/components/hardware/hwregs.c b/sys/contrib/dev/acpica/components/hardware/hwregs.c
index 3c5de6c..af4381c 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwregs.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwregs.c
@@ -228,7 +228,7 @@ AcpiHwGetAccessBitWidth (
}
else if (Reg->AccessWidth)
{
- AccessBitWidth = (1 << (Reg->AccessWidth + 2));
+ AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth);
}
else
{
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index b7411dd..f9e8c8b 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -184,9 +184,18 @@ AcpiHwSleepDispatch (
static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
{
- {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
- {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
- {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
+ {ACPI_STRUCT_INIT (legacy_function,
+ ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep)),
+ ACPI_STRUCT_INIT (extended_function,
+ AcpiHwExtendedSleep) },
+ {ACPI_STRUCT_INIT (legacy_function,
+ ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
+ ACPI_STRUCT_INIT (extended_function,
+ AcpiHwExtendedWakePrep) },
+ {ACPI_STRUCT_INIT (legacy_function,
+ ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
+ ACPI_STRUCT_INIT (extended_function,
+ AcpiHwExtendedWake) }
};
diff --git a/sys/contrib/dev/acpica/components/namespace/nsaccess.c b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
index 353fa66..1d979ce 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsaccess.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
@@ -155,6 +155,9 @@
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdispat.h>
+#ifdef ACPI_ASL_COMPILER
+ #include <contrib/dev/acpica/include/acdisasm.h>
+#endif
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsaccess")
@@ -407,6 +410,7 @@ AcpiNsLookup (
{
ACPI_STATUS Status;
char *Path = Pathname;
+ char *ExternalPath;
ACPI_NAMESPACE_NODE *PrefixNode;
ACPI_NAMESPACE_NODE *CurrentNode = NULL;
ACPI_NAMESPACE_NODE *ThisNode = NULL;
@@ -553,11 +557,21 @@ AcpiNsLookup (
ThisNode = ThisNode->Parent;
if (!ThisNode)
{
- /* Current scope has no parent scope */
+ /*
+ * Current scope has no parent scope. Externalize
+ * the internal path for error message.
+ */
+ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Pathname,
+ NULL, &ExternalPath);
+ if (ACPI_SUCCESS (Status))
+ {
+ ACPI_ERROR ((AE_INFO,
+ "%s: Path has too many parent prefixes (^)",
+ ExternalPath));
+
+ ACPI_FREE (ExternalPath);
+ }
- ACPI_ERROR ((AE_INFO,
- "%s: Path has too many parent prefixes (^) "
- "- reached beyond root node", Pathname));
return_ACPI_STATUS (AE_NOT_FOUND);
}
}
@@ -710,6 +724,30 @@ AcpiNsLookup (
CurrentNode));
}
+#ifdef ACPI_ASL_COMPILER
+ /*
+ * If this ACPI name already exists within the namespace as an
+ * external declaration, then mark the external as a conflicting
+ * declaration and proceed to process the current node as if it did
+ * not exist in the namespace. If this node is not processed as
+ * normal, then it could cause improper namespace resolution
+ * by failing to open a new scope.
+ */
+ if (AcpiGbl_DisasmFlag &&
+ (Status == AE_ALREADY_EXISTS) &&
+ ((ThisNode->Flags & ANOBJ_IS_EXTERNAL) ||
+ (WalkState && WalkState->Opcode == AML_EXTERNAL_OP)))
+ {
+ ThisNode->Flags &= ~ANOBJ_IS_EXTERNAL;
+ ThisNode->Type = (UINT8)ThisSearchType;
+ if (WalkState->Opcode != AML_EXTERNAL_OP)
+ {
+ AcpiDmMarkExternalConflict (ThisNode);
+ }
+ break;
+ }
+#endif
+
*ReturnNode = ThisNode;
return_ACPI_STATUS (Status);
}
@@ -737,6 +775,13 @@ AcpiNsLookup (
ThisNode = (ACPI_NAMESPACE_NODE *) ThisNode->Object;
}
}
+#ifdef ACPI_ASL_COMPILER
+ if (!AcpiGbl_DisasmFlag &&
+ (ThisNode->Flags & ANOBJ_IS_EXTERNAL))
+ {
+ ThisNode->Flags |= IMPLICIT_EXTERNAL;
+ }
+#endif
}
/* Special handling for the last segment (NumSegments == 0) */
diff --git a/sys/contrib/dev/acpica/components/namespace/nsarguments.c b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
index a6fbe7f..b743e5d 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsarguments.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
@@ -183,9 +183,14 @@ AcpiNsCheckArgumentTypes (
UINT32 i;
- /* If not a predefined name, cannot typecheck args */
-
- if (!Info->Predefined)
+ /*
+ * If not a predefined name, cannot typecheck args, because
+ * we have no idea what argument types are expected.
+ * Also, ignore typecheck if warnings/errors if this method
+ * has already been evaluated at least once -- in order
+ * to suppress repetitive messages.
+ */
+ if (!Info->Predefined || (Info->Node->Flags & ANOBJ_EVALUATED))
{
return;
}
@@ -207,6 +212,10 @@ AcpiNsCheckArgumentTypes (
"Found [%s], ACPI requires [%s]", (i + 1),
AcpiUtGetTypeName (UserArgType),
AcpiUtGetTypeName (ArgType)));
+
+ /* Prevent any additional typechecking for this method */
+
+ Info->Node->Flags |= ANOBJ_EVALUATED;
}
}
}
@@ -238,7 +247,7 @@ AcpiNsCheckAcpiCompliance (
UINT32 RequiredParamCount;
- if (!Predefined)
+ if (!Predefined || (Node->Flags & ANOBJ_EVALUATED))
{
return;
}
@@ -332,6 +341,11 @@ AcpiNsCheckArgumentCount (
UINT32 RequiredParamCount;
+ if (Node->Flags & ANOBJ_EVALUATED)
+ {
+ return;
+ }
+
if (!Predefined)
{
/*
diff --git a/sys/contrib/dev/acpica/components/namespace/nsinit.c b/sys/contrib/dev/acpica/components/namespace/nsinit.c
index 4aa4754..20916a0 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsinit.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsinit.c
@@ -535,6 +535,20 @@ AcpiNsInitOneObject (
Info->PackageInit++;
Status = AcpiDsGetPackageArguments (ObjDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ break;
+ }
+
+ /*
+ * Resolve all named references in package objects (and all
+ * sub-packages). This action has been deferred until the entire
+ * namespace has been loaded, in order to support external and
+ * forward references from individual package elements (05/2017).
+ */
+ Status = AcpiUtWalkPackageTree (ObjDesc, NULL,
+ AcpiDsInitPackageElement, NULL);
+ ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
break;
default:
diff --git a/sys/contrib/dev/acpica/components/namespace/nsnames.c b/sys/contrib/dev/acpica/components/namespace/nsnames.c
index 75adc5c..f122729 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsnames.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsnames.c
@@ -208,8 +208,15 @@ AcpiNsGetPathnameLength (
ACPI_SIZE Size;
- ACPI_FUNCTION_ENTRY ();
+ /* Validate the Node */
+ if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/cached reference target node: %p, descriptor type %d",
+ Node, ACPI_GET_DESCRIPTOR_TYPE (Node)));
+ return (0);
+ }
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
return (Size);
@@ -324,10 +331,6 @@ AcpiNsHandleToPathname (
(void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
RequiredSize, NoTrailing);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n",
(char *) Buffer->Pointer, (UINT32) RequiredSize));
diff --git a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
index 6794d0f..bddbd18 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
@@ -722,6 +722,8 @@ AcpiNsCheckPackageList (
default: /* Should not get here, type was validated by caller */
+ ACPI_ERROR ((AE_INFO, "Invalid Package type: %X",
+ Package->RetInfo.Type));
return (AE_AML_INTERNAL);
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsutils.c b/sys/contrib/dev/acpica/components/namespace/nsutils.c
index 6f40c96..3136603 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsutils.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsutils.c
@@ -206,7 +206,7 @@ AcpiNsPrintNodePathname (
AcpiOsPrintf ("%s ", Message);
}
- AcpiOsPrintf ("[%s] (Node %p)", (char *) Buffer.Pointer, Node);
+ AcpiOsPrintf ("%s", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
}
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
index e9badfb..b8590f2 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
@@ -199,6 +199,8 @@ AcpiEvaluateObjectTyped (
{
ACPI_STATUS Status;
BOOLEAN FreeBufferOnError = FALSE;
+ ACPI_HANDLE TargetHandle;
+ char *FullPathname;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -216,41 +218,56 @@ AcpiEvaluateObjectTyped (
FreeBufferOnError = TRUE;
}
+ Status = AcpiGetHandle (Handle, Pathname, &TargetHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ FullPathname = AcpiNsGetExternalPathname (TargetHandle);
+ if (!FullPathname)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
/* Evaluate the object */
- Status = AcpiEvaluateObject (Handle, Pathname,
- ExternalParams, ReturnBuffer);
+ Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams,
+ ReturnBuffer);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ goto Exit;
}
- /* Type ANY means "don't care" */
+ /* Type ANY means "don't care about return value type" */
if (ReturnType == ACPI_TYPE_ANY)
{
- return_ACPI_STATUS (AE_OK);
+ goto Exit;
}
if (ReturnBuffer->Length == 0)
{
/* Error because caller specifically asked for a return value */
- ACPI_ERROR ((AE_INFO, "No return value"));
- return_ACPI_STATUS (AE_NULL_OBJECT);
+ ACPI_ERROR ((AE_INFO, "%s did not return any object",
+ FullPathname));
+ Status = AE_NULL_OBJECT;
+ goto Exit;
}
/* Examine the object type returned from EvaluateObject */
if (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type == ReturnType)
{
- return_ACPI_STATUS (AE_OK);
+ goto Exit;
}
/* Return object type does not match requested type */
ACPI_ERROR ((AE_INFO,
- "Incorrect return type [%s] requested [%s]",
+ "Incorrect return type from %s - received [%s], requested [%s]",
+ FullPathname,
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
AcpiUtGetTypeName (ReturnType)));
@@ -268,7 +285,11 @@ AcpiEvaluateObjectTyped (
}
ReturnBuffer->Length = 0;
- return_ACPI_STATUS (AE_TYPE);
+ Status = AE_TYPE;
+
+Exit:
+ ACPI_FREE (FullPathname);
+ return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)
diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c
index e6b09d6..f000d50 100644
--- a/sys/contrib/dev/acpica/components/parser/psloop.c
+++ b/sys/contrib/dev/acpica/components/parser/psloop.c
@@ -282,6 +282,9 @@ AcpiPsGetArguments (
INCREMENT_ARG_LIST (WalkState->ArgTypes);
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Final argument count: %u pass %u\n",
+ WalkState->ArgCount, WalkState->PassNumber));
/*
* Handle executable code at "module-level". This refers to
@@ -380,6 +383,10 @@ AcpiPsGetArguments (
(Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) &&
(WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2))
{
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Setup Package/Buffer: Pass %u, AML Ptr: %p\n",
+ WalkState->PassNumber, AmlOpStart));
+
/*
* Skip parsing of Buffers and Packages because we don't have
* enough info in the first pass to parse them correctly.
@@ -689,6 +696,9 @@ AcpiPsParseLoop (
/* Check for arguments that need to be processed */
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Parseloop: argument count: %u\n", WalkState->ArgCount));
+
if (WalkState->ArgCount)
{
/*
diff --git a/sys/contrib/dev/acpica/components/parser/psobject.c b/sys/contrib/dev/acpica/components/parser/psobject.c
index 84ab18f..73091e3 100644
--- a/sys/contrib/dev/acpica/components/parser/psobject.c
+++ b/sys/contrib/dev/acpica/components/parser/psobject.c
@@ -237,12 +237,23 @@ AcpiPsGetAmlOpcode (
WalkState->Opcode,
(UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER)));
+ ACPI_ERROR ((AE_INFO,
+ "Aborting disassembly, AML byte code is corrupt"));
+
/* Dump the context surrounding the invalid opcode */
AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
48, DB_BYTE_DISPLAY,
(AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
AcpiOsPrintf (" */\n");
+
+ /*
+ * Just abort the disassembly, cannot continue because the
+ * parser is essentially lost. The disassembler can then
+ * randomly fail because an ill-constructed parse tree
+ * can result.
+ */
+ return_ACPI_STATUS (AE_AML_BAD_OPCODE);
#endif
}
@@ -458,6 +469,10 @@ AcpiPsCreateOp (
{
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
}
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
/* Create Op structure and append to parent's argument list */
@@ -472,6 +487,31 @@ AcpiPsCreateOp (
{
Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp);
AcpiPsFreeOp (Op);
+
+#ifdef ACPI_ASL_COMPILER
+ if (AcpiGbl_DisasmFlag && WalkState->Opcode == AML_EXTERNAL_OP &&
+ Status == AE_NOT_FOUND)
+ {
+ /*
+ * If parsing of AML_EXTERNAL_OP's name path fails, then skip
+ * past this opcode and keep parsing. This is a much better
+ * alternative than to abort the entire disassembler. At this
+ * point, the ParserState is at the end of the namepath of the
+ * external declaration opcode. Setting WalkState->Aml to
+ * WalkState->ParserState.Aml + 2 moves increments the
+ * WalkState->Aml past the object type and the paramcount of the
+ * external opcode. For the error message, only print the AML
+ * offset. We could attempt to print the name but this may cause
+ * a segmentation fault when printing the namepath because the
+ * AML may be incorrect.
+ */
+ AcpiOsPrintf (
+ "// Invalid external declaration at AML offset 0x%x.\n",
+ WalkState->Aml - WalkState->ParserState.AmlStart);
+ WalkState->Aml = WalkState->ParserState.Aml + 2;
+ return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
+ }
+#endif
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/sys/contrib/dev/acpica/components/parser/psopcode.c b/sys/contrib/dev/acpica/components/parser/psopcode.c
index 10b8fef..26b393d 100644
--- a/sys/contrib/dev/acpica/components/parser/psopcode.c
+++ b/sys/contrib/dev/acpica/components/parser/psopcode.c
@@ -445,7 +445,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* ACPI 6.0 opcodes */
-/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R),
+/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 82 */ ACPI_OP ("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT)
/*! [End] no source code translation !*/
diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c
index 63c2219..bb0a961 100644
--- a/sys/contrib/dev/acpica/components/parser/psparse.c
+++ b/sys/contrib/dev/acpica/components/parser/psparse.c
@@ -164,6 +164,7 @@
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psparse")
@@ -664,8 +665,17 @@ AcpiPsParseAml (
/* Either the method parse or actual execution failed */
AcpiExExitInterpreter ();
- ACPI_ERROR_METHOD ("Method parse/execution failed",
- WalkState->MethodNode, NULL, Status);
+ if (Status == AE_ABORT_METHOD)
+ {
+ AcpiNsPrintNodePathname (
+ WalkState->MethodNode, "Method aborted:");
+ AcpiOsPrintf ("\n");
+ }
+ else
+ {
+ ACPI_ERROR_METHOD ("Method parse/execution failed",
+ WalkState->MethodNode, NULL, Status);
+ }
AcpiExEnterInterpreter ();
/* Check for possible multi-thread reentrancy problem */
diff --git a/sys/contrib/dev/acpica/components/resources/rscalc.c b/sys/contrib/dev/acpica/components/resources/rscalc.c
index 1655861..4432108 100644
--- a/sys/contrib/dev/acpica/components/resources/rscalc.c
+++ b/sys/contrib/dev/acpica/components/resources/rscalc.c
@@ -471,6 +471,15 @@ AcpiRsGetAmlLength (
break;
+ case ACPI_RESOURCE_TYPE_PIN_FUNCTION:
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ (Resource->Data.PinFunction.PinTableLength * 2) +
+ Resource->Data.PinFunction.ResourceSource.StringLength +
+ Resource->Data.PinFunction.VendorLength);
+
+ break;
+
case ACPI_RESOURCE_TYPE_SERIAL_BUS:
@@ -483,6 +492,42 @@ AcpiRsGetAmlLength (
break;
+ case ACPI_RESOURCE_TYPE_PIN_CONFIG:
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ (Resource->Data.PinConfig.PinTableLength * 2) +
+ Resource->Data.PinConfig.ResourceSource.StringLength +
+ Resource->Data.PinConfig.VendorLength);
+
+ break;
+
+ case ACPI_RESOURCE_TYPE_PIN_GROUP:
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ (Resource->Data.PinGroup.PinTableLength * 2) +
+ Resource->Data.PinGroup.ResourceLabel.StringLength +
+ Resource->Data.PinGroup.VendorLength);
+
+ break;
+
+ case ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION:
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ Resource->Data.PinGroupFunction.ResourceSource.StringLength +
+ Resource->Data.PinGroupFunction.ResourceSourceLabel.StringLength +
+ Resource->Data.PinGroupFunction.VendorLength);
+
+ break;
+
+ case ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG:
+
+ TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+ Resource->Data.PinGroupConfig.ResourceSource.StringLength +
+ Resource->Data.PinGroupConfig.ResourceSourceLabel.StringLength +
+ Resource->Data.PinGroupConfig.VendorLength);
+
+ break;
+
default:
break;
@@ -668,6 +713,26 @@ AcpiRsGetListLength (
}
break;
+ case ACPI_RESOURCE_NAME_PIN_FUNCTION:
+
+ /* Vendor data is optional */
+
+ if (AmlResource->PinFunction.VendorLength)
+ {
+ ExtraStructBytes +=
+ AmlResource->PinFunction.VendorOffset -
+ AmlResource->PinFunction.PinTableOffset +
+ AmlResource->PinFunction.VendorLength;
+ }
+ else
+ {
+ ExtraStructBytes +=
+ AmlResource->LargeHeader.ResourceLength +
+ sizeof (AML_RESOURCE_LARGE_HEADER) -
+ AmlResource->PinFunction.PinTableOffset;
+ }
+ break;
+
case ACPI_RESOURCE_NAME_SERIAL_BUS:
MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[
@@ -677,6 +742,53 @@ AcpiRsGetListLength (
MinimumAmlResourceLength;
break;
+ case ACPI_RESOURCE_NAME_PIN_CONFIG:
+
+ /* Vendor data is optional */
+
+ if (AmlResource->PinConfig.VendorLength)
+ {
+ ExtraStructBytes +=
+ AmlResource->PinConfig.VendorOffset -
+ AmlResource->PinConfig.PinTableOffset +
+ AmlResource->PinConfig.VendorLength;
+ }
+ else
+ {
+ ExtraStructBytes +=
+ AmlResource->LargeHeader.ResourceLength +
+ sizeof (AML_RESOURCE_LARGE_HEADER) -
+ AmlResource->PinConfig.PinTableOffset;
+ }
+ break;
+
+ case ACPI_RESOURCE_NAME_PIN_GROUP:
+
+ ExtraStructBytes +=
+ AmlResource->PinGroup.VendorOffset -
+ AmlResource->PinGroup.PinTableOffset +
+ AmlResource->PinGroup.VendorLength;
+
+ break;
+
+ case ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION:
+
+ ExtraStructBytes +=
+ AmlResource->PinGroupFunction.VendorOffset -
+ AmlResource->PinGroupFunction.ResSourceOffset +
+ AmlResource->PinGroupFunction.VendorLength;
+
+ break;
+
+ case ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG:
+
+ ExtraStructBytes +=
+ AmlResource->PinGroupConfig.VendorOffset -
+ AmlResource->PinGroupConfig.ResSourceOffset +
+ AmlResource->PinGroupConfig.VendorLength;
+
+ break;
+
default:
break;
diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c
index b09d2cd..c141d03 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdump.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdump.c
@@ -216,6 +216,11 @@ AcpiRsDumpResourceSource (
ACPI_RESOURCE_SOURCE *ResourceSource);
static void
+AcpiRsDumpResourceLabel (
+ char *Title,
+ ACPI_RESOURCE_LABEL *ResourceLabel);
+
+static void
AcpiRsDumpAddressCommon (
ACPI_RESOURCE_DATA *Resource);
@@ -531,6 +536,22 @@ AcpiRsDumpDescriptor (
ACPI_RESOURCE_SOURCE, Target));
break;
+ case ACPI_RSD_LABEL:
+ /*
+ * ResourceLabel
+ */
+ AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR (
+ ACPI_RESOURCE_LABEL, Target));
+ break;
+
+ case ACPI_RSD_SOURCE_LABEL:
+ /*
+ * ResourceSourceLabel
+ */
+ AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR (
+ ACPI_RESOURCE_LABEL, Target));
+ break;
+
default:
AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
@@ -580,6 +601,32 @@ AcpiRsDumpResourceSource (
/*******************************************************************************
*
+ * FUNCTION: AcpiRsDumpResourceLabel
+ *
+ * PARAMETERS: Title - Title of the dumped resource field
+ * ResourceLabel - Pointer to a Resource Label struct
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Common routine for dumping the ResourceLabel
+ *
+ ******************************************************************************/
+
+static void
+AcpiRsDumpResourceLabel (
+ char *Title,
+ ACPI_RESOURCE_LABEL *ResourceLabel)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+ AcpiRsOutString (Title,
+ ResourceLabel->StringPtr ?
+ ResourceLabel->StringPtr : "[Not Specified]");
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiRsDumpAddressCommon
*
* PARAMETERS: Resource - Pointer to an internal resource descriptor
diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
index c5f8937..58c74e2 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
@@ -360,6 +360,74 @@ ACPI_RSDUMP_INFO AcpiRsDumpGpio[16] =
{ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (Gpio.VendorData), "VendorData", NULL},
};
+ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[10] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinFunction), "PinFunction", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinFunction.RevisionId), "RevisionId", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinFunction.PinConfig), "PinConfig", AcpiGbl_PpcDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinFunction.Sharable), "Sharing", AcpiGbl_ShrDecode},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinFunction.FunctionNumber), "FunctionNumber", NULL},
+ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinFunction.ResourceSource), "ResourceSource", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinFunction.PinTableLength), "PinTableLength", NULL},
+ {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinFunction.PinTable), "PinTable", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinFunction.VendorLength), "VendorLength", NULL},
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinFunction.VendorData), "VendorData", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[11] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinConfig), "PinConfig", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinConfig.RevisionId), "RevisionId", NULL},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinConfig.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinConfig.Sharable), "Sharing", AcpiGbl_ShrDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinConfig.PinConfigType), "PinConfigType", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (PinConfig.PinConfigValue), "PinConfigValue", NULL},
+ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinConfig.ResourceSource), "ResourceSource", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinConfig.PinTableLength), "PinTableLength", NULL},
+ {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinConfig.PinTable), "PinTable", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinConfig.VendorLength), "VendorLength", NULL},
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinConfig.VendorData), "VendorData", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[8] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroup), "PinGroup", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroup.RevisionId), "RevisionId", NULL},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroup.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroup.PinTableLength), "PinTableLength", NULL},
+ {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinGroup.PinTable), "PinTable", NULL},
+ {ACPI_RSD_LABEL, ACPI_RSD_OFFSET (PinGroup.ResourceLabel), "ResourceLabel", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroup.VendorLength), "VendorLength", NULL},
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroup.VendorData), "VendorData", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[9] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroupFunction), "PinGroupFunction", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroupFunction.RevisionId), "RevisionId", NULL},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupFunction.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupFunction.Sharable), "Sharing", AcpiGbl_ShrDecode},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroupFunction.FunctionNumber), "FunctionNumber", NULL},
+ {ACPI_RSD_SOURCE_LABEL, ACPI_RSD_OFFSET (PinGroupFunction.ResourceSourceLabel), "ResourceSourceLabel", NULL},
+ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinGroupFunction.ResourceSource), "ResourceSource", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroupFunction.VendorLength), "VendorLength", NULL},
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroupFunction.VendorData), "VendorData", NULL},
+};
+
+ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[10] =
+{
+ {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroupConfig), "PinGroupConfig", NULL},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroupConfig.RevisionId), "RevisionId", NULL},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupConfig.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode},
+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupConfig.Sharable), "Sharing", AcpiGbl_ShrDecode},
+ {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (PinGroupConfig.PinConfigType), "PinConfigType", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (PinGroupConfig.PinConfigValue), "PinConfigValue", NULL},
+ {ACPI_RSD_SOURCE_LABEL, ACPI_RSD_OFFSET (PinGroupConfig.ResourceSourceLabel), "ResourceSourceLabel", NULL},
+ {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (PinGroupConfig.ResourceSource), "ResourceSource", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (PinGroupConfig.VendorLength), "VendorLength", NULL},
+ {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroupConfig.VendorData), "VendorData", NULL},
+};
+
ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[4] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedDma), "FixedDma", NULL},
diff --git a/sys/contrib/dev/acpica/components/resources/rsinfo.c b/sys/contrib/dev/acpica/components/resources/rsinfo.c
index 0321092..d72e7b9 100644
--- a/sys/contrib/dev/acpica/components/resources/rsinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsinfo.c
@@ -192,6 +192,11 @@ ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[] =
AcpiRsConvertGpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */
AcpiRsConvertFixedDma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */
NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */
+ AcpiRsConvertPinFunction, /* 0x14, ACPI_RESOURCE_TYPE_PIN_FUNCTION */
+ AcpiRsConvertPinConfig, /* 0x15, ACPI_RESOURCE_TYPE_PIN_CONFIG */
+ AcpiRsConvertPinGroup, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */
+ AcpiRsConvertPinGroupFunction, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
+ AcpiRsConvertPinGroupConfig, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
};
/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
@@ -232,8 +237,12 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] =
AcpiRsConvertAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
AcpiRsConvertExtAddress64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
AcpiRsConvertGpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
- NULL, /* 0x0D, Reserved */
+ AcpiRsConvertPinFunction, /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
+ AcpiRsConvertPinConfig, /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
+ AcpiRsConvertPinGroup, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
+ AcpiRsConvertPinGroupFunction, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
+ AcpiRsConvertPinGroupConfig, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
};
/* Subtype table for SerialBus -- I2C, SPI, and UART */
@@ -273,6 +282,11 @@ ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[] =
AcpiRsDumpGpio, /* ACPI_RESOURCE_TYPE_GPIO */
AcpiRsDumpFixedDma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */
NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
+ AcpiRsDumpPinFunction, /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
+ AcpiRsDumpPinConfig, /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
+ AcpiRsDumpPinGroup, /* ACPI_RESOURCE_TYPE_PIN_GROUP */
+ AcpiRsDumpPinGroupFunction, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
+ AcpiRsDumpPinGroupConfig, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
};
ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] =
@@ -312,6 +326,11 @@ const UINT8 AcpiGbl_AmlResourceSizes[] =
sizeof (AML_RESOURCE_GPIO), /* ACPI_RESOURCE_TYPE_GPIO */
sizeof (AML_RESOURCE_FIXED_DMA), /* ACPI_RESOURCE_TYPE_FIXED_DMA */
sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
+ sizeof (AML_RESOURCE_PIN_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
+ sizeof (AML_RESOURCE_PIN_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
+ sizeof (AML_RESOURCE_PIN_GROUP), /* ACPI_RESOURCE_TYPE_PIN_GROUP */
+ sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
+ sizeof (AML_RESOURCE_PIN_GROUP_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
};
@@ -351,7 +370,12 @@ const UINT8 AcpiGbl_ResourceStructSizes[] =
ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64),
ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64),
ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
- ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS)
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
+ ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS),
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
};
const UINT8 AcpiGbl_AmlResourceSerialBusSizes[] =
diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c
index 9d024ba..9e0424e 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmisc.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmisc.c
@@ -705,10 +705,7 @@ AcpiRsConvertResourceToAml (
/* Set vendor offset only if there is vendor data */
- if (Resource->Data.Gpio.VendorLength)
- {
- ACPI_SET16 (Target, AmlLength);
- }
+ ACPI_SET16 (Target, AmlLength);
AcpiRsSetResourceLength (AmlLength, Aml);
break;
diff --git a/sys/contrib/dev/acpica/components/resources/rsserial.c b/sys/contrib/dev/acpica/components/resources/rsserial.c
index f8d3087..a004e7f 100644
--- a/sys/contrib/dev/acpica/components/resources/rsserial.c
+++ b/sys/contrib/dev/acpica/components/resources/rsserial.c
@@ -254,6 +254,78 @@ ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] =
0},
};
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinfunction
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[13] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_FUNCTION,
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_FUNCTION,
+ sizeof (AML_RESOURCE_PIN_FUNCTION),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.RevisionId),
+ AML_OFFSET (PinFunction.RevisionId),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Sharable),
+ AML_OFFSET (PinFunction.Flags),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.PinConfig),
+ AML_OFFSET (PinFunction.PinConfig),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber),
+ AML_OFFSET (PinFunction.FunctionNumber),
+ 2},
+
+ /* Pin Table */
+
+ /*
+ * It is OK to use GPIO operations here because none of them refer GPIO
+ * structures directly but instead use offsets given here.
+ */
+
+ {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength),
+ AML_OFFSET (PinFunction.PinTableOffset),
+ AML_OFFSET (PinFunction.ResSourceOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable),
+ AML_OFFSET (PinFunction.PinTableOffset),
+ 0},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index),
+ AML_OFFSET (PinFunction.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength),
+ AML_OFFSET (PinFunction.ResSourceOffset),
+ AML_OFFSET (PinFunction.VendorOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr),
+ AML_OFFSET (PinFunction.ResSourceOffset),
+ 0},
+
+ /* Vendor Data */
+
+ {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinFunction.VendorLength),
+ AML_OFFSET (PinFunction.VendorLength),
+ 1},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinFunction.VendorData),
+ AML_OFFSET (PinFunction.VendorOffset),
+ 0},
+};
+
/*******************************************************************************
*
@@ -545,3 +617,278 @@ ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[23] =
AML_OFFSET (UartSerialBus.DefaultBaudRate),
1},
};
+
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinConfig
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[14] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_CONFIG,
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_CONFIG,
+ sizeof (AML_RESOURCE_PIN_CONFIG),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.RevisionId),
+ AML_OFFSET (PinConfig.RevisionId),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Sharable),
+ AML_OFFSET (PinConfig.Flags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),
+ AML_OFFSET (PinConfig.Flags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),
+ AML_OFFSET (PinConfig.PinConfigType),
+ 1},
+
+ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),
+ AML_OFFSET (PinConfig.PinConfigValue),
+ 1},
+
+ /* Pin Table */
+
+ /*
+ * It is OK to use GPIO operations here because none of them refer GPIO
+ * structures directly but instead use offsets given here.
+ */
+
+ {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),
+ AML_OFFSET (PinConfig.PinTableOffset),
+ AML_OFFSET (PinConfig.ResSourceOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),
+ AML_OFFSET (PinConfig.PinTableOffset),
+ 0},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),
+ AML_OFFSET (PinConfig.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),
+ AML_OFFSET (PinConfig.ResSourceOffset),
+ AML_OFFSET (PinConfig.VendorOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),
+ AML_OFFSET (PinConfig.ResSourceOffset),
+ 0},
+
+ /* Vendor Data */
+
+ {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinConfig.VendorLength),
+ AML_OFFSET (PinConfig.VendorLength),
+ 1},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinConfig.VendorData),
+ AML_OFFSET (PinConfig.VendorOffset),
+ 0},
+};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinGroup
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[10] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP,
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP,
+ sizeof (AML_RESOURCE_PIN_GROUP),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroup.RevisionId),
+ AML_OFFSET (PinGroup.RevisionId),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),
+ AML_OFFSET (PinGroup.Flags),
+ 0},
+
+ /* Pin Table */
+
+ /*
+ * It is OK to use GPIO operations here because none of them refer GPIO
+ * structures directly but instead use offsets given here.
+ */
+
+ {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),
+ AML_OFFSET (PinGroup.PinTableOffset),
+ AML_OFFSET (PinGroup.LabelOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),
+ AML_OFFSET (PinGroup.PinTableOffset),
+ 0},
+
+ /* Resource Label */
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),
+ AML_OFFSET (PinGroup.LabelOffset),
+ AML_OFFSET (PinGroup.VendorOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),
+ AML_OFFSET (PinGroup.LabelOffset),
+ 0},
+
+ /* Vendor Data */
+
+ {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroup.VendorLength),
+ AML_OFFSET (PinGroup.VendorLength),
+ 1},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.VendorData),
+ AML_OFFSET (PinGroup.VendorOffset),
+ 0},
+};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinGroupFunction
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[13] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
+ sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),
+ AML_OFFSET (PinGroupFunction.RevisionId),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Sharable),
+ AML_OFFSET (PinGroupFunction.Flags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),
+ AML_OFFSET (PinGroupFunction.Flags),
+ 1},
+
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),
+ AML_OFFSET (PinGroupFunction.FunctionNumber),
+ 1},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),
+ AML_OFFSET (PinGroupFunction.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),
+ AML_OFFSET (PinGroupFunction.ResSourceOffset),
+ AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),
+ AML_OFFSET (PinGroupFunction.ResSourceOffset),
+ 0},
+
+ /* Resource Source Label */
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),
+ AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
+ AML_OFFSET (PinGroupFunction.VendorOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),
+ AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
+ 0},
+
+ /* Vendor Data */
+
+ {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),
+ AML_OFFSET (PinGroupFunction.VendorLength),
+ 1},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),
+ AML_OFFSET (PinGroupFunction.VendorOffset),
+ 0},
+};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinGroupConfig
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[14] =
+{
+ {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
+ ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
+ ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},
+
+ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
+ sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),
+ 0},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),
+ AML_OFFSET (PinGroupConfig.RevisionId),
+ 1},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Sharable),
+ AML_OFFSET (PinGroupConfig.Flags),
+ 0},
+
+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),
+ AML_OFFSET (PinGroupConfig.Flags),
+ 1},
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),
+ AML_OFFSET (PinGroupConfig.PinConfigType),
+ 1},
+
+ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),
+ AML_OFFSET (PinGroupConfig.PinConfigValue),
+ 1},
+
+ /* Resource Source */
+
+ {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),
+ AML_OFFSET (PinGroupConfig.ResSourceIndex),
+ 1},
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),
+ AML_OFFSET (PinGroupConfig.ResSourceOffset),
+ AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),
+ AML_OFFSET (PinGroupConfig.ResSourceOffset),
+ 0},
+
+ /* Resource Source Label */
+
+ {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),
+ AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
+ AML_OFFSET (PinGroupConfig.VendorOffset)},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),
+ AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
+ 0},
+
+ /* Vendor Data */
+
+ {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),
+ AML_OFFSET (PinGroupConfig.VendorLength),
+ 1},
+
+ {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),
+ AML_OFFSET (PinGroupConfig.VendorOffset),
+ 0},
+};
diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c
index 40ad8d5..b31b5e6 100644
--- a/sys/contrib/dev/acpica/components/resources/rsxface.c
+++ b/sys/contrib/dev/acpica/components/resources/rsxface.c
@@ -796,7 +796,7 @@ ACPI_EXPORT_SYMBOL (AcpiWalkResourceBuffer)
* device we are querying
* Name - Method name of the resources we want.
* (METHOD_NAME__CRS, METHOD_NAME__PRS, or
- * METHOD_NAME__AEI)
+ * METHOD_NAME__AEI or METHOD_NAME__DMA)
* UserFunction - Called for each resource
* Context - Passed to UserFunction
*
@@ -827,12 +827,13 @@ AcpiWalkResources (
if (!DeviceHandle || !UserFunction || !Name ||
(!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) &&
!ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS) &&
- !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI)))
+ !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI) &&
+ !ACPI_COMPARE_NAME (Name, METHOD_NAME__DMA)))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the _CRS/_PRS/_AEI resource list */
+ /* Get the _CRS/_PRS/_AEI/_DMA resource list */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer);
diff --git a/sys/contrib/dev/acpica/components/tables/tbdata.c b/sys/contrib/dev/acpica/components/tables/tbdata.c
index 37c2fcb..08ebf55 100644
--- a/sys/contrib/dev/acpica/components/tables/tbdata.c
+++ b/sys/contrib/dev/acpica/components/tables/tbdata.c
@@ -158,6 +158,66 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbdata")
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiTbCheckDuplication (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 *TableIndex);
+
+static BOOLEAN
+AcpiTbCompareTables (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 TableIndex);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbCompareTables
+ *
+ * PARAMETERS: TableDesc - Table 1 descriptor to be compared
+ * TableIndex - Index of table 2 to be compared
+ *
+ * RETURN: TRUE if both tables are identical.
+ *
+ * DESCRIPTION: This function compares a table with another table that has
+ * already been installed in the root table list.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+AcpiTbCompareTables (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 TableIndex)
+{
+ ACPI_STATUS Status = AE_OK;
+ BOOLEAN IsIdentical;
+ ACPI_TABLE_HEADER *Table;
+ UINT32 TableLength;
+ UINT8 TableFlags;
+
+
+ Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
+ &Table, &TableLength, &TableFlags);
+ if (ACPI_FAILURE (Status))
+ {
+ return (FALSE);
+ }
+
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
+ memcmp (TableDesc->Pointer, Table, TableLength)) ?
+ FALSE : TRUE);
+
+ /* Release the acquired table */
+
+ AcpiTbReleaseTable (Table, TableLength, TableFlags);
+ return (IsIdentical);
+}
+
/*******************************************************************************
*
@@ -477,7 +537,7 @@ AcpiTbValidateTempTable (
ACPI_TABLE_DESC *TableDesc)
{
- if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum)
+ if (!TableDesc->Pointer && !AcpiGbl_EnableTableValidation)
{
/*
* Only validates the header of the table.
@@ -495,24 +555,109 @@ AcpiTbValidateTempTable (
}
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbCheckDuplication
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * TableIndex - Where the table index is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Avoid installing duplicated tables. However table override and
+ * user aided dynamic table load is allowed, thus comparing the
+ * address of the table is not sufficient, and checking the entire
+ * table content is required.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiTbCheckDuplication (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 *TableIndex)
+{
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (TbCheckDuplication);
+
+
+ /* Check if table is already registered */
+
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+ {
+ /* Do not compare with unverified tables */
+
+ if (!(AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_VERIFIED))
+ {
+ continue;
+ }
+
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ if (!AcpiTbCompareTables (TableDesc, i))
+ {
+ continue;
+ }
+
+ /*
+ * Note: the current mechanism does not unregister a table if it is
+ * dynamically unloaded. The related namespace entries are deleted,
+ * but the table remains in the root table list.
+ *
+ * The assumption here is that the number of different tables that
+ * will be loaded is actually small, and there is minimal overhead
+ * in just keeping the table in case it is needed again.
+ *
+ * If this assumption changes in the future (perhaps on large
+ * machines with many table load/unload operations), tables will
+ * need to be unregistered when they are unloaded, and slots in the
+ * root table list should be reused when empty.
+ */
+ if (AcpiGbl_RootTableList.Tables[i].Flags &
+ ACPI_TABLE_IS_LOADED)
+ {
+ /* Table is still loaded, this is an error */
+
+ return_ACPI_STATUS (AE_ALREADY_EXISTS);
+ }
+ else
+ {
+ *TableIndex = i;
+ return_ACPI_STATUS (AE_CTRL_TERMINATE);
+ }
+ }
+
+ /* Indicate no duplication to the caller */
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiTbVerifyTempTable
*
* PARAMETERS: TableDesc - Table descriptor
* Signature - Table signature to verify
+ * TableIndex - Where the table index is returned
*
* RETURN: Status
*
* DESCRIPTION: This function is called to validate and verify the table, the
* returned table descriptor is in "VALIDATED" state.
+ * Note that 'TableIndex' is required to be set to !NULL to
+ * enable duplication check.
*
*****************************************************************************/
ACPI_STATUS
AcpiTbVerifyTempTable (
ACPI_TABLE_DESC *TableDesc,
- char *Signature)
+ char *Signature,
+ UINT32 *TableIndex)
{
ACPI_STATUS Status = AE_OK;
@@ -540,10 +685,10 @@ AcpiTbVerifyTempTable (
goto InvalidateAndExit;
}
- /* Verify the checksum */
-
- if (AcpiGbl_VerifyTableChecksum)
+ if (AcpiGbl_EnableTableValidation)
{
+ /* Verify the checksum */
+
Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
if (ACPI_FAILURE (Status))
{
@@ -556,9 +701,32 @@ AcpiTbVerifyTempTable (
goto InvalidateAndExit;
}
+
+ /* Avoid duplications */
+
+ if (TableIndex)
+ {
+ Status = AcpiTbCheckDuplication (TableDesc, TableIndex);
+ if (ACPI_FAILURE (Status))
+ {
+ if (Status != AE_CTRL_TERMINATE)
+ {
+ ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+ "%4.4s 0x%8.8X%8.8X"
+ " Table is duplicated",
+ AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
+ TableDesc->Signature.Ascii : "????",
+ ACPI_FORMAT_UINT64 (TableDesc->Address)));
+ }
+
+ goto InvalidateAndExit;
+ }
+ }
+
+ TableDesc->Flags |= ACPI_TABLE_IS_VERIFIED;
}
- return_ACPI_STATUS (AE_OK);
+ return_ACPI_STATUS (Status);
InvalidateAndExit:
AcpiTbInvalidateTable (TableDesc);
@@ -584,6 +752,8 @@ AcpiTbResizeRootTableList (
{
ACPI_TABLE_DESC *Tables;
UINT32 TableCount;
+ UINT32 CurrentTableCount, MaxTableCount;
+ UINT32 i;
ACPI_FUNCTION_TRACE (TbResizeRootTableList);
@@ -608,9 +778,9 @@ AcpiTbResizeRootTableList (
TableCount = AcpiGbl_RootTableList.CurrentTableCount;
}
+ MaxTableCount = TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
Tables = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
- sizeof (ACPI_TABLE_DESC));
+ ((ACPI_SIZE) MaxTableCount) * sizeof (ACPI_TABLE_DESC));
if (!Tables)
{
ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
@@ -619,10 +789,19 @@ AcpiTbResizeRootTableList (
/* Copy and free the previous table array */
+ CurrentTableCount = 0;
if (AcpiGbl_RootTableList.Tables)
{
- memcpy (Tables, AcpiGbl_RootTableList.Tables,
- (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
+ for (i = 0; i < TableCount; i++)
+ {
+ if (AcpiGbl_RootTableList.Tables[i].Address)
+ {
+ memcpy (Tables + CurrentTableCount,
+ AcpiGbl_RootTableList.Tables + i,
+ sizeof (ACPI_TABLE_DESC));
+ CurrentTableCount++;
+ }
+ }
if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
{
@@ -631,8 +810,8 @@ AcpiTbResizeRootTableList (
}
AcpiGbl_RootTableList.Tables = Tables;
- AcpiGbl_RootTableList.MaxTableCount =
- TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
+ AcpiGbl_RootTableList.MaxTableCount = MaxTableCount;
+ AcpiGbl_RootTableList.CurrentTableCount = CurrentTableCount;
AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
return_ACPI_STATUS (AE_OK);
@@ -1029,14 +1208,9 @@ AcpiTbLoadTable (
AcpiEvUpdateGpes (OwnerId);
}
- /* Invoke table handler if present */
-
- if (AcpiGbl_TableHandler)
- {
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
- AcpiGbl_TableHandlerContext);
- }
+ /* Invoke table handler */
+ AcpiTbNotifyTable (ACPI_TABLE_EVENT_LOAD, Table);
return_ACPI_STATUS (Status);
}
@@ -1070,24 +1244,19 @@ AcpiTbInstallAndLoadTable (
ACPI_FUNCTION_TRACE (TbInstallAndLoadTable);
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
-
/* Install the table and load it into the namespace */
Status = AcpiTbInstallStandardTable (Address, Flags, TRUE,
Override, &i);
if (ACPI_FAILURE (Status))
{
- goto UnlockAndExit;
+ goto Exit;
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
Status = AcpiTbLoadTable (i, AcpiGbl_RootNode);
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
-UnlockAndExit:
+Exit:
*TableIndex = i;
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (Status);
}
@@ -1122,16 +1291,12 @@ AcpiTbUnloadTable (
return_ACPI_STATUS (AE_NOT_EXIST);
}
- /* Invoke table handler if present */
+ /* Invoke table handler */
- if (AcpiGbl_TableHandler)
+ Status = AcpiGetTableByIndex (TableIndex, &Table);
+ if (ACPI_SUCCESS (Status))
{
- Status = AcpiGetTableByIndex (TableIndex, &Table);
- if (ACPI_SUCCESS (Status))
- {
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table,
- AcpiGbl_TableHandlerContext);
- }
+ AcpiTbNotifyTable (ACPI_TABLE_EVENT_UNLOAD, Table);
}
/* Delete the portion of the namespace owned by this table */
@@ -1146,3 +1311,31 @@ AcpiTbUnloadTable (
AcpiTbSetTableLoadedFlag (TableIndex, FALSE);
return_ACPI_STATUS (Status);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbNotifyTable
+ *
+ * PARAMETERS: Event - Table event
+ * Table - Validated table pointer
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Notify a table event to the users.
+ *
+ ******************************************************************************/
+
+void
+AcpiTbNotifyTable (
+ UINT32 Event,
+ void *Table)
+{
+ /* Invoke table handler if present */
+
+ if (AcpiGbl_TableHandler)
+ {
+ (void) AcpiGbl_TableHandler (Event, Table,
+ AcpiGbl_TableHandlerContext);
+ }
+}
diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c
index ce50e0e..26cb133 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfadt.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c
@@ -597,8 +597,8 @@ AcpiTbCreateLocalFadt (
* The 64-bit X fields are optional extensions to the original 32-bit FADT
* V1.0 fields. Even if they are present in the FADT, they are optional and
* are unused if the BIOS sets them to zero. Therefore, we must copy/expand
- * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is
- * originally zero.
+ * 32-bit V1.0 fields to the 64-bit X fields if the 64-bit X field is originally
+ * zero.
*
* For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address
* fields are expanded to the corresponding 64-bit X fields in the internal
diff --git a/sys/contrib/dev/acpica/components/tables/tbinstal.c b/sys/contrib/dev/acpica/components/tables/tbinstal.c
index 40d7e97..03b90b3 100644
--- a/sys/contrib/dev/acpica/components/tables/tbinstal.c
+++ b/sys/contrib/dev/acpica/components/tables/tbinstal.c
@@ -156,61 +156,6 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbinstal")
-/* Local prototypes */
-
-static BOOLEAN
-AcpiTbCompareTables (
- ACPI_TABLE_DESC *TableDesc,
- UINT32 TableIndex);
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbCompareTables
- *
- * PARAMETERS: TableDesc - Table 1 descriptor to be compared
- * TableIndex - Index of table 2 to be compared
- *
- * RETURN: TRUE if both tables are identical.
- *
- * DESCRIPTION: This function compares a table with another table that has
- * already been installed in the root table list.
- *
- ******************************************************************************/
-
-static BOOLEAN
-AcpiTbCompareTables (
- ACPI_TABLE_DESC *TableDesc,
- UINT32 TableIndex)
-{
- ACPI_STATUS Status = AE_OK;
- BOOLEAN IsIdentical;
- ACPI_TABLE_HEADER *Table;
- UINT32 TableLength;
- UINT8 TableFlags;
-
-
- Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
- &Table, &TableLength, &TableFlags);
- if (ACPI_FAILURE (Status))
- {
- return (FALSE);
- }
-
- /*
- * Check for a table match on the entire table length,
- * not just the header.
- */
- IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
- memcmp (TableDesc->Pointer, Table, TableLength)) ?
- FALSE : TRUE);
-
- /* Release the acquired table */
-
- AcpiTbReleaseTable (Table, TableLength, TableFlags);
- return (IsIdentical);
-}
-
/*******************************************************************************
*
@@ -337,105 +282,48 @@ AcpiTbInstallStandardTable (
goto ReleaseAndExit;
}
+ /* Acquire the table lock */
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
/* Validate and verify a table before installation */
- Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i);
if (ACPI_FAILURE (Status))
{
- goto ReleaseAndExit;
- }
-
- if (Reload)
- {
- /*
- * Validate the incoming table signature.
- *
- * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
- * 2) We added support for OEMx tables, signature "OEM".
- * 3) Valid tables were encountered with a null signature, so we just
- * gave up on validating the signature, (05/2008).
- * 4) We encountered non-AML tables such as the MADT, which caused
- * interpreter errors and kernel faults. So now, we once again allow
- * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
- */
- if ((NewTableDesc.Signature.Ascii[0] != 0x00) &&
- (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) &&
- (strncmp (NewTableDesc.Signature.Ascii, "OEM", 3)))
- {
- ACPI_BIOS_ERROR ((AE_INFO,
- "Table has invalid signature [%4.4s] (0x%8.8X), "
- "must be SSDT or OEMx",
- AcpiUtValidNameseg (NewTableDesc.Signature.Ascii) ?
- NewTableDesc.Signature.Ascii : "????",
- NewTableDesc.Signature.Integer));
-
- Status = AE_BAD_SIGNATURE;
- goto ReleaseAndExit;
- }
-
- /* Check if table is already registered */
-
- for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+ if (Status == AE_CTRL_TERMINATE)
{
/*
- * Check for a table match on the entire table length,
- * not just the header.
+ * Table was unloaded, allow it to be reloaded.
+ * As we are going to return AE_OK to the caller, we should
+ * take the responsibility of freeing the input descriptor.
+ * Refill the input descriptor to ensure
+ * AcpiTbInstallTableWithOverride() can be called again to
+ * indicate the re-installation.
*/
- if (!AcpiTbCompareTables (&NewTableDesc, i))
- {
- continue;
- }
-
- /*
- * Note: the current mechanism does not unregister a table if it is
- * dynamically unloaded. The related namespace entries are deleted,
- * but the table remains in the root table list.
- *
- * The assumption here is that the number of different tables that
- * will be loaded is actually small, and there is minimal overhead
- * in just keeping the table in case it is needed again.
- *
- * If this assumption changes in the future (perhaps on large
- * machines with many table load/unload operations), tables will
- * need to be unregistered when they are unloaded, and slots in the
- * root table list should be reused when empty.
- */
- if (AcpiGbl_RootTableList.Tables[i].Flags &
- ACPI_TABLE_IS_LOADED)
- {
- /* Table is still loaded, this is an error */
-
- Status = AE_ALREADY_EXISTS;
- goto ReleaseAndExit;
- }
- else
- {
- /*
- * Table was unloaded, allow it to be reloaded.
- * As we are going to return AE_OK to the caller, we should
- * take the responsibility of freeing the input descriptor.
- * Refill the input descriptor to ensure
- * AcpiTbInstallTableWithOverride() can be called again to
- * indicate the re-installation.
- */
- AcpiTbUninstallTable (&NewTableDesc);
- *TableIndex = i;
- return_ACPI_STATUS (AE_OK);
- }
+ AcpiTbUninstallTable (&NewTableDesc);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ *TableIndex = i;
+ return_ACPI_STATUS (AE_OK);
}
+ goto UnlockAndExit;
}
/* Add the table to the global root table list */
AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex);
- /* Invoke table handler if present */
+ /* Invoke table handler */
- if (AcpiGbl_TableHandler)
- {
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_INSTALL,
- NewTableDesc.Pointer, AcpiGbl_TableHandlerContext);
- }
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ AcpiTbNotifyTable (ACPI_TABLE_EVENT_INSTALL, NewTableDesc.Pointer);
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+UnlockAndExit:
+
+ /* Release the table lock */
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
ReleaseAndExit:
@@ -503,9 +391,11 @@ AcpiTbOverrideTable (
FinishOverride:
- /* Validate and verify a table before overriding */
-
- Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
+ /*
+ * Validate and verify a table before overriding, no nested table
+ * duplication check as it's too complicated and unnecessary.
+ */
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, NULL);
if (ACPI_FAILURE (Status))
{
return;
diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c
index 1efd1a7..d1b96b1 100644
--- a/sys/contrib/dev/acpica/components/tables/tbutils.c
+++ b/sys/contrib/dev/acpica/components/tables/tbutils.c
@@ -257,9 +257,9 @@ AcpiTbCheckDsdtHeader (
*
* FUNCTION: AcpiTbCopyDsdt
*
- * PARAMETERS: TableDesc - Installed table to copy
+ * PARAMETERS: TableIndex - Index of installed table to copy
*
- * RETURN: None
+ * RETURN: The copied DSDT
*
* DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory.
* Some very bad BIOSs are known to either corrupt the DSDT or
@@ -368,7 +368,7 @@ AcpiTbGetRootTableEntry (
*
* FUNCTION: AcpiTbParseRootTable
*
- * PARAMETERS: Rsdp - Pointer to the RSDP
+ * PARAMETERS: RsdpAddress - Pointer to the RSDP
*
* RETURN: Status
*
@@ -559,14 +559,19 @@ AcpiTbGetTable (
}
}
- TableDesc->ValidationCount++;
- if (TableDesc->ValidationCount == 0)
+ if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
{
- ACPI_ERROR ((AE_INFO,
- "Table %p, Validation count is zero after increment\n",
- TableDesc));
- TableDesc->ValidationCount--;
- return_ACPI_STATUS (AE_LIMIT);
+ TableDesc->ValidationCount++;
+
+ /*
+ * Detect ValidationCount overflows to ensure that the warning
+ * message will only be printed once.
+ */
+ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
+ {
+ ACPI_WARNING((AE_INFO,
+ "Table %p, Validation count overflows\n", TableDesc));
+ }
}
*OutTable = TableDesc->Pointer;
@@ -597,14 +602,21 @@ AcpiTbPutTable (
ACPI_FUNCTION_TRACE (AcpiTbPutTable);
- if (TableDesc->ValidationCount == 0)
+ if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
{
- ACPI_WARNING ((AE_INFO,
- "Table %p, Validation count is zero before decrement\n",
- TableDesc));
- return_VOID;
+ TableDesc->ValidationCount--;
+
+ /*
+ * Detect ValidationCount underflows to ensure that the warning
+ * message will only be printed once.
+ */
+ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "Table %p, Validation count underflows\n", TableDesc));
+ return_VOID;
+ }
}
- TableDesc->ValidationCount--;
if (TableDesc->ValidationCount == 0)
{
diff --git a/sys/contrib/dev/acpica/components/tables/tbxface.c b/sys/contrib/dev/acpica/components/tables/tbxface.c
index d7d8aed..09e99eb 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxface.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxface.c
@@ -292,7 +292,8 @@ AcpiReallocateRootTable (
void)
{
ACPI_STATUS Status;
- UINT32 i;
+ ACPI_TABLE_DESC *TableDesc;
+ UINT32 i, j;
ACPI_FUNCTION_TRACE (AcpiReallocateRootTable);
@@ -307,6 +308,8 @@ AcpiReallocateRootTable (
return_ACPI_STATUS (AE_SUPPORT);
}
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
/*
* Ensure OS early boot logic, which is required by some hosts. If the
* table state is reported to be wrong, developers should fix the
@@ -315,17 +318,41 @@ AcpiReallocateRootTable (
*/
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
{
- if (AcpiGbl_RootTableList.Tables[i].Pointer)
+ TableDesc = &AcpiGbl_RootTableList.Tables[i];
+ if (TableDesc->Pointer)
{
ACPI_ERROR ((AE_INFO,
"Table [%4.4s] is not invalidated during early boot stage",
- AcpiGbl_RootTableList.Tables[i].Signature.Ascii));
+ TableDesc->Signature.Ascii));
}
}
- AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE;
+ if (!AcpiGbl_EnableTableValidation)
+ {
+ /*
+ * Now it's safe to do full table validation. We can do deferred
+ * table initilization here once the flag is set.
+ */
+ AcpiGbl_EnableTableValidation = TRUE;
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+ {
+ TableDesc = &AcpiGbl_RootTableList.Tables[i];
+ if (!(TableDesc->Flags & ACPI_TABLE_IS_VERIFIED))
+ {
+ Status = AcpiTbVerifyTempTable (TableDesc, NULL, &j);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiTbUninstallTable (TableDesc);
+ }
+ }
+ }
+ }
+ AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE;
Status = AcpiTbResizeRootTableList ();
+ AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (Status);
}
@@ -522,6 +549,11 @@ AcpiPutTable (
ACPI_FUNCTION_TRACE (AcpiPutTable);
+ if (!Table)
+ {
+ return_VOID;
+ }
+
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
/* Walk the root table list */
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfload.c b/sys/contrib/dev/acpica/components/tables/tbxfload.c
index 2bc34dc..f035de6 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfload.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfload.c
@@ -336,11 +336,11 @@ AcpiTbLoadNamespace (
{
Table = &AcpiGbl_RootTableList.Tables[i];
- if (!AcpiGbl_RootTableList.Tables[i].Address ||
+ if (!Table->Address ||
(!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) &&
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) &&
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) ||
- ACPI_FAILURE (AcpiTbValidateTable (Table)))
+ ACPI_FAILURE (AcpiTbValidateTable (Table)))
{
continue;
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c
index aa1b854..726853d 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdecode.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c
@@ -629,8 +629,9 @@ static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1]
/* 09 */ "Device PLD Check",
/* 0A */ "Reserved",
/* 0B */ "System Locality Update",
- /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */
- /* 0D */ "System Resource Affinity Update"
+ /* 0C */ "Reserved (was previously Shutdown Request)", /* Reserved in ACPI 6.0 */
+ /* 0D */ "System Resource Affinity Update",
+ /* 0E */ "Heterogeneous Memory Attributes Update" /* ACPI 6.2 */
};
static const char *AcpiGbl_DeviceNotify[5] =
diff --git a/sys/contrib/dev/acpica/components/utilities/uthex.c b/sys/contrib/dev/acpica/components/utilities/uthex.c
index dcee859..6ca8f18 100644
--- a/sys/contrib/dev/acpica/components/utilities/uthex.c
+++ b/sys/contrib/dev/acpica/components/utilities/uthex.c
@@ -183,8 +183,10 @@ AcpiUtHexToAsciiChar (
UINT64 Integer,
UINT32 Position)
{
+ UINT64 Index;
- return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+ AcpiUtShortShiftRight (Integer, Position, &Index);
+ return (AcpiGbl_HexToAscii[Index & 0xF]);
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utmath.c b/sys/contrib/dev/acpica/components/utilities/utmath.c
index 6bc4a8a..da5efbc 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmath.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmath.c
@@ -156,16 +156,6 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utmath")
-/*
- * Optional support for 64-bit double-precision integer divide. This code
- * is configurable and is implemented in order to support 32-bit kernel
- * environments where a 64-bit double-precision math library is not available.
- *
- * Support for a more normal 64-bit divide/modulo (with check for a divide-
- * by-zero) appears after this optional section of code.
- */
-#ifndef ACPI_USE_NATIVE_DIVIDE
-
/* Structures used only for 64-bit divide */
typedef struct uint64_struct
@@ -182,6 +172,257 @@ typedef union uint64_overlay
} UINT64_OVERLAY;
+/*
+ * Optional support for 64-bit double-precision integer multiply and shift.
+ * This code is configurable and is implemented in order to support 32-bit
+ * kernel environments where a 64-bit double-precision math library is not
+ * available.
+ */
+#ifndef ACPI_USE_NATIVE_MATH64
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtShortMultiply
+ *
+ * PARAMETERS: Multiplicand - 64-bit multiplicand
+ * Multiplier - 32-bit multiplier
+ * OutProduct - Pointer to where the product is returned
+ *
+ * DESCRIPTION: Perform a short multiply.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtShortMultiply (
+ UINT64 Multiplicand,
+ UINT32 Multiplier,
+ UINT64 *OutProduct)
+{
+ UINT64_OVERLAY MultiplicandOvl;
+ UINT64_OVERLAY Product;
+ UINT32 Carry32;
+
+
+ ACPI_FUNCTION_TRACE (UtShortMultiply);
+
+
+ MultiplicandOvl.Full = Multiplicand;
+
+ /*
+ * The Product is 64 bits, the carry is always 32 bits,
+ * and is generated by the second multiply.
+ */
+ ACPI_MUL_64_BY_32 (0, MultiplicandOvl.Part.Hi, Multiplier,
+ Product.Part.Hi, Carry32);
+
+ ACPI_MUL_64_BY_32 (0, MultiplicandOvl.Part.Lo, Multiplier,
+ Product.Part.Lo, Carry32);
+
+ Product.Part.Hi += Carry32;
+
+ /* Return only what was requested */
+
+ if (OutProduct)
+ {
+ *OutProduct = Product.Full;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtShortShiftLeft
+ *
+ * PARAMETERS: Operand - 64-bit shift operand
+ * Count - 32-bit shift count
+ * OutResult - Pointer to where the result is returned
+ *
+ * DESCRIPTION: Perform a short left shift.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtShortShiftLeft (
+ UINT64 Operand,
+ UINT32 Count,
+ UINT64 *OutResult)
+{
+ UINT64_OVERLAY OperandOvl;
+
+
+ ACPI_FUNCTION_TRACE (UtShortShiftLeft);
+
+
+ OperandOvl.Full = Operand;
+
+ if ((Count & 63) >= 32)
+ {
+ OperandOvl.Part.Hi = OperandOvl.Part.Lo;
+ OperandOvl.Part.Lo ^= OperandOvl.Part.Lo;
+ Count = (Count & 63) - 32;
+ }
+ ACPI_SHIFT_LEFT_64_BY_32 (OperandOvl.Part.Hi,
+ OperandOvl.Part.Lo, Count);
+
+ /* Return only what was requested */
+
+ if (OutResult)
+ {
+ *OutResult = OperandOvl.Full;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtShortShiftRight
+ *
+ * PARAMETERS: Operand - 64-bit shift operand
+ * Count - 32-bit shift count
+ * OutResult - Pointer to where the result is returned
+ *
+ * DESCRIPTION: Perform a short right shift.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtShortShiftRight (
+ UINT64 Operand,
+ UINT32 Count,
+ UINT64 *OutResult)
+{
+ UINT64_OVERLAY OperandOvl;
+
+
+ ACPI_FUNCTION_TRACE (UtShortShiftRight);
+
+
+ OperandOvl.Full = Operand;
+
+ if ((Count & 63) >= 32)
+ {
+ OperandOvl.Part.Lo = OperandOvl.Part.Hi;
+ OperandOvl.Part.Hi ^= OperandOvl.Part.Hi;
+ Count = (Count & 63) - 32;
+ }
+ ACPI_SHIFT_RIGHT_64_BY_32 (OperandOvl.Part.Hi,
+ OperandOvl.Part.Lo, Count);
+
+ /* Return only what was requested */
+
+ if (OutResult)
+ {
+ *OutResult = OperandOvl.Full;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+#else
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtShortMultiply
+ *
+ * PARAMETERS: See function headers above
+ *
+ * DESCRIPTION: Native version of the UtShortMultiply function.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtShortMultiply (
+ UINT64 Multiplicand,
+ UINT32 Multiplier,
+ UINT64 *OutProduct)
+{
+
+ ACPI_FUNCTION_TRACE (UtShortMultiply);
+
+
+ /* Return only what was requested */
+
+ if (OutProduct)
+ {
+ *OutProduct = Multiplicand * Multiplier;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtShortShiftLeft
+ *
+ * PARAMETERS: See function headers above
+ *
+ * DESCRIPTION: Native version of the UtShortShiftLeft function.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtShortShiftLeft (
+ UINT64 Operand,
+ UINT32 Count,
+ UINT64 *OutResult)
+{
+
+ ACPI_FUNCTION_TRACE (UtShortShiftLeft);
+
+
+ /* Return only what was requested */
+
+ if (OutResult)
+ {
+ *OutResult = Operand << Count;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtShortShiftRight
+ *
+ * PARAMETERS: See function headers above
+ *
+ * DESCRIPTION: Native version of the UtShortShiftRight function.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtShortShiftRight (
+ UINT64 Operand,
+ UINT32 Count,
+ UINT64 *OutResult)
+{
+
+ ACPI_FUNCTION_TRACE (UtShortShiftRight);
+
+
+ /* Return only what was requested */
+
+ if (OutResult)
+ {
+ *OutResult = Operand >> Count;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
+#endif
+
+/*
+ * Optional support for 64-bit double-precision integer divide. This code
+ * is configurable and is implemented in order to support 32-bit kernel
+ * environments where a 64-bit double-precision math library is not available.
+ *
+ * Support for a more normal 64-bit divide/modulo (with check for a divide-
+ * by-zero) appears after this optional section of code.
+ */
+#ifndef ACPI_USE_NATIVE_DIVIDE
+
/*******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/components/utilities/utmisc.c b/sys/contrib/dev/acpica/components/utilities/utmisc.c
index de4635b..2e20603 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmisc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmisc.c
@@ -363,7 +363,7 @@ AcpiUtCreateUpdateStateAndPush (
*
* RETURN: Status
*
- * DESCRIPTION: Walk through a package
+ * DESCRIPTION: Walk through a package, including subpackages
*
******************************************************************************/
@@ -377,8 +377,8 @@ AcpiUtWalkPackageTree (
ACPI_STATUS Status = AE_OK;
ACPI_GENERIC_STATE *StateList = NULL;
ACPI_GENERIC_STATE *State;
- UINT32 ThisIndex;
ACPI_OPERAND_OBJECT *ThisSourceObj;
+ UINT32 ThisIndex;
ACPI_FUNCTION_TRACE (UtWalkPackageTree);
@@ -395,8 +395,10 @@ AcpiUtWalkPackageTree (
/* Get one element of the package */
ThisIndex = State->Pkg.Index;
- ThisSourceObj = (ACPI_OPERAND_OBJECT *)
+ ThisSourceObj =
State->Pkg.SourceObject->Package.Elements[ThisIndex];
+ State->Pkg.ThisTargetObj =
+ &State->Pkg.SourceObject->Package.Elements[ThisIndex];
/*
* Check for:
@@ -412,7 +414,7 @@ AcpiUtWalkPackageTree (
(ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
{
Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
- State, Context);
+ State, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -485,6 +487,9 @@ AcpiUtWalkPackageTree (
/* We should never get here */
+ ACPI_ERROR ((AE_INFO,
+ "State list did not terminate correctly"));
+
return_ACPI_STATUS (AE_AML_INTERNAL);
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utobject.c b/sys/contrib/dev/acpica/components/utilities/utobject.c
index ca4b456..cd05ec3 100644
--- a/sys/contrib/dev/acpica/components/utilities/utobject.c
+++ b/sys/contrib/dev/acpica/components/utilities/utobject.c
@@ -651,6 +651,10 @@ AcpiUtGetSimpleObjectSize (
{
/* A namespace node should never get here */
+ ACPI_ERROR ((AE_INFO,
+ "Received a namespace node [%4.4s] "
+ "where an operand object is required",
+ ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, InternalObject)->Name.Ascii));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utownerid.c b/sys/contrib/dev/acpica/components/utilities/utownerid.c
index 47d3f66..b2b3f09 100644
--- a/sys/contrib/dev/acpica/components/utilities/utownerid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utownerid.c
@@ -225,14 +225,20 @@ AcpiUtAllocateOwnerId (
break;
}
- if (!(AcpiGbl_OwnerIdMask[j] & (1 << k)))
+ /*
+ * Note: the UINT32 cast ensures that 1 is stored as a unsigned
+ * integer. Omitting the cast may result in 1 being stored as an
+ * int. Some compilers or runtime error detection may flag this as
+ * an error.
+ */
+ if (!(AcpiGbl_OwnerIdMask[j] & ((UINT32) 1 << k)))
{
/*
* Found a free ID. The actual ID is the bit index plus one,
* making zero an invalid Owner ID. Save this as the last ID
* allocated and update the global ID mask.
*/
- AcpiGbl_OwnerIdMask[j] |= (1 << k);
+ AcpiGbl_OwnerIdMask[j] |= ((UINT32) 1 << k);
AcpiGbl_LastOwnerIdIndex = (UINT8) j;
AcpiGbl_NextOwnerIdOffset = (UINT8) (k + 1);
@@ -328,7 +334,7 @@ AcpiUtReleaseOwnerId (
/* Decode ID to index/offset pair */
Index = ACPI_DIV_32 (OwnerId);
- Bit = 1 << ACPI_MOD_32 (OwnerId);
+ Bit = (UINT32) 1 << ACPI_MOD_32 (OwnerId);
/* Free the owner ID only if it is valid */
diff --git a/sys/contrib/dev/acpica/components/utilities/utresdecode.c b/sys/contrib/dev/acpica/components/utilities/utresdecode.c
new file mode 100644
index 0000000..0ef693e
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utresdecode.c
@@ -0,0 +1,461 @@
+/*******************************************************************************
+ *
+ * Module Name: utresdecode - Resource descriptor keyword strings
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2017, 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/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acresrc.h>
+
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utresdecode")
+
+
+#if defined (ACPI_DEBUG_OUTPUT) || \
+ defined (ACPI_DISASSEMBLER) || \
+ defined (ACPI_DEBUGGER)
+
+/*
+ * Strings used to decode resource descriptors.
+ * Used by both the disassembler and the debugger resource dump routines
+ */
+const char *AcpiGbl_BmDecode[] =
+{
+ "NotBusMaster",
+ "BusMaster"
+};
+
+const char *AcpiGbl_ConfigDecode[] =
+{
+ "0 - Good Configuration",
+ "1 - Acceptable Configuration",
+ "2 - Suboptimal Configuration",
+ "3 - ***Invalid Configuration***",
+};
+
+const char *AcpiGbl_ConsumeDecode[] =
+{
+ "ResourceProducer",
+ "ResourceConsumer"
+};
+
+const char *AcpiGbl_DecDecode[] =
+{
+ "PosDecode",
+ "SubDecode"
+};
+
+const char *AcpiGbl_HeDecode[] =
+{
+ "Level",
+ "Edge"
+};
+
+const char *AcpiGbl_IoDecode[] =
+{
+ "Decode10",
+ "Decode16"
+};
+
+const char *AcpiGbl_LlDecode[] =
+{
+ "ActiveHigh",
+ "ActiveLow",
+ "ActiveBoth",
+ "Reserved"
+};
+
+const char *AcpiGbl_MaxDecode[] =
+{
+ "MaxNotFixed",
+ "MaxFixed"
+};
+
+const char *AcpiGbl_MemDecode[] =
+{
+ "NonCacheable",
+ "Cacheable",
+ "WriteCombining",
+ "Prefetchable"
+};
+
+const char *AcpiGbl_MinDecode[] =
+{
+ "MinNotFixed",
+ "MinFixed"
+};
+
+const char *AcpiGbl_MtpDecode[] =
+{
+ "AddressRangeMemory",
+ "AddressRangeReserved",
+ "AddressRangeACPI",
+ "AddressRangeNVS"
+};
+
+const char *AcpiGbl_RngDecode[] =
+{
+ "InvalidRanges",
+ "NonISAOnlyRanges",
+ "ISAOnlyRanges",
+ "EntireRange"
+};
+
+const char *AcpiGbl_RwDecode[] =
+{
+ "ReadOnly",
+ "ReadWrite"
+};
+
+const char *AcpiGbl_ShrDecode[] =
+{
+ "Exclusive",
+ "Shared",
+ "ExclusiveAndWake", /* ACPI 5.0 */
+ "SharedAndWake" /* ACPI 5.0 */
+};
+
+const char *AcpiGbl_SizDecode[] =
+{
+ "Transfer8",
+ "Transfer8_16",
+ "Transfer16",
+ "InvalidSize"
+};
+
+const char *AcpiGbl_TrsDecode[] =
+{
+ "DenseTranslation",
+ "SparseTranslation"
+};
+
+const char *AcpiGbl_TtpDecode[] =
+{
+ "TypeStatic",
+ "TypeTranslation"
+};
+
+const char *AcpiGbl_TypDecode[] =
+{
+ "Compatibility",
+ "TypeA",
+ "TypeB",
+ "TypeF"
+};
+
+const char *AcpiGbl_PpcDecode[] =
+{
+ "PullDefault",
+ "PullUp",
+ "PullDown",
+ "PullNone"
+};
+
+const char *AcpiGbl_IorDecode[] =
+{
+ "IoRestrictionNone",
+ "IoRestrictionInputOnly",
+ "IoRestrictionOutputOnly",
+ "IoRestrictionNoneAndPreserve"
+};
+
+const char *AcpiGbl_DtsDecode[] =
+{
+ "Width8bit",
+ "Width16bit",
+ "Width32bit",
+ "Width64bit",
+ "Width128bit",
+ "Width256bit",
+};
+
+/* GPIO connection type */
+
+const char *AcpiGbl_CtDecode[] =
+{
+ "Interrupt",
+ "I/O"
+};
+
+/* Serial bus type */
+
+const char *AcpiGbl_SbtDecode[] =
+{
+ "/* UNKNOWN serial bus type */",
+ "I2C",
+ "SPI",
+ "UART"
+};
+
+/* I2C serial bus access mode */
+
+const char *AcpiGbl_AmDecode[] =
+{
+ "AddressingMode7Bit",
+ "AddressingMode10Bit"
+};
+
+/* I2C serial bus slave mode */
+
+const char *AcpiGbl_SmDecode[] =
+{
+ "ControllerInitiated",
+ "DeviceInitiated"
+};
+
+/* SPI serial bus wire mode */
+
+const char *AcpiGbl_WmDecode[] =
+{
+ "FourWireMode",
+ "ThreeWireMode"
+};
+
+/* SPI serial clock phase */
+
+const char *AcpiGbl_CphDecode[] =
+{
+ "ClockPhaseFirst",
+ "ClockPhaseSecond"
+};
+
+/* SPI serial bus clock polarity */
+
+const char *AcpiGbl_CpoDecode[] =
+{
+ "ClockPolarityLow",
+ "ClockPolarityHigh"
+};
+
+/* SPI serial bus device polarity */
+
+const char *AcpiGbl_DpDecode[] =
+{
+ "PolarityLow",
+ "PolarityHigh"
+};
+
+/* UART serial bus endian */
+
+const char *AcpiGbl_EdDecode[] =
+{
+ "LittleEndian",
+ "BigEndian"
+};
+
+/* UART serial bus bits per byte */
+
+const char *AcpiGbl_BpbDecode[] =
+{
+ "DataBitsFive",
+ "DataBitsSix",
+ "DataBitsSeven",
+ "DataBitsEight",
+ "DataBitsNine",
+ "/* UNKNOWN Bits per byte */",
+ "/* UNKNOWN Bits per byte */",
+ "/* UNKNOWN Bits per byte */"
+};
+
+/* UART serial bus stop bits */
+
+const char *AcpiGbl_SbDecode[] =
+{
+ "StopBitsZero",
+ "StopBitsOne",
+ "StopBitsOnePlusHalf",
+ "StopBitsTwo"
+};
+
+/* UART serial bus flow control */
+
+const char *AcpiGbl_FcDecode[] =
+{
+ "FlowControlNone",
+ "FlowControlHardware",
+ "FlowControlXON",
+ "/* UNKNOWN flow control keyword */"
+};
+
+/* UART serial bus parity type */
+
+const char *AcpiGbl_PtDecode[] =
+{
+ "ParityTypeNone",
+ "ParityTypeEven",
+ "ParityTypeOdd",
+ "ParityTypeMark",
+ "ParityTypeSpace",
+ "/* UNKNOWN parity keyword */",
+ "/* UNKNOWN parity keyword */",
+ "/* UNKNOWN parity keyword */"
+};
+
+/* PinConfig type */
+
+const char *AcpiGbl_PtypDecode[] =
+{
+ "Default",
+ "Bias Pull-up",
+ "Bias Pull-down",
+ "Bias Default",
+ "Bias Disable",
+ "Bias High Impedance",
+ "Bias Bus Hold",
+ "Drive Open Drain",
+ "Drive Open Source",
+ "Drive Push Pull",
+ "Drive Strength",
+ "Slew Rate",
+ "Input Debounce",
+ "Input Schmitt Trigger",
+};
+
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utresrc.c b/sys/contrib/dev/acpica/components/utilities/utresrc.c
index baae466..02b2175 100644
--- a/sys/contrib/dev/acpica/components/utilities/utresrc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utresrc.c
@@ -158,287 +158,6 @@
ACPI_MODULE_NAME ("utresrc")
-#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
-
-/*
- * Strings used to decode resource descriptors.
- * Used by both the disassembler and the debugger resource dump routines
- */
-const char *AcpiGbl_BmDecode[] =
-{
- "NotBusMaster",
- "BusMaster"
-};
-
-const char *AcpiGbl_ConfigDecode[] =
-{
- "0 - Good Configuration",
- "1 - Acceptable Configuration",
- "2 - Suboptimal Configuration",
- "3 - ***Invalid Configuration***",
-};
-
-const char *AcpiGbl_ConsumeDecode[] =
-{
- "ResourceProducer",
- "ResourceConsumer"
-};
-
-const char *AcpiGbl_DecDecode[] =
-{
- "PosDecode",
- "SubDecode"
-};
-
-const char *AcpiGbl_HeDecode[] =
-{
- "Level",
- "Edge"
-};
-
-const char *AcpiGbl_IoDecode[] =
-{
- "Decode10",
- "Decode16"
-};
-
-const char *AcpiGbl_LlDecode[] =
-{
- "ActiveHigh",
- "ActiveLow",
- "ActiveBoth",
- "Reserved"
-};
-
-const char *AcpiGbl_MaxDecode[] =
-{
- "MaxNotFixed",
- "MaxFixed"
-};
-
-const char *AcpiGbl_MemDecode[] =
-{
- "NonCacheable",
- "Cacheable",
- "WriteCombining",
- "Prefetchable"
-};
-
-const char *AcpiGbl_MinDecode[] =
-{
- "MinNotFixed",
- "MinFixed"
-};
-
-const char *AcpiGbl_MtpDecode[] =
-{
- "AddressRangeMemory",
- "AddressRangeReserved",
- "AddressRangeACPI",
- "AddressRangeNVS"
-};
-
-const char *AcpiGbl_RngDecode[] =
-{
- "InvalidRanges",
- "NonISAOnlyRanges",
- "ISAOnlyRanges",
- "EntireRange"
-};
-
-const char *AcpiGbl_RwDecode[] =
-{
- "ReadOnly",
- "ReadWrite"
-};
-
-const char *AcpiGbl_ShrDecode[] =
-{
- "Exclusive",
- "Shared",
- "ExclusiveAndWake", /* ACPI 5.0 */
- "SharedAndWake" /* ACPI 5.0 */
-};
-
-const char *AcpiGbl_SizDecode[] =
-{
- "Transfer8",
- "Transfer8_16",
- "Transfer16",
- "InvalidSize"
-};
-
-const char *AcpiGbl_TrsDecode[] =
-{
- "DenseTranslation",
- "SparseTranslation"
-};
-
-const char *AcpiGbl_TtpDecode[] =
-{
- "TypeStatic",
- "TypeTranslation"
-};
-
-const char *AcpiGbl_TypDecode[] =
-{
- "Compatibility",
- "TypeA",
- "TypeB",
- "TypeF"
-};
-
-const char *AcpiGbl_PpcDecode[] =
-{
- "PullDefault",
- "PullUp",
- "PullDown",
- "PullNone"
-};
-
-const char *AcpiGbl_IorDecode[] =
-{
- "IoRestrictionNone",
- "IoRestrictionInputOnly",
- "IoRestrictionOutputOnly",
- "IoRestrictionNoneAndPreserve"
-};
-
-const char *AcpiGbl_DtsDecode[] =
-{
- "Width8bit",
- "Width16bit",
- "Width32bit",
- "Width64bit",
- "Width128bit",
- "Width256bit",
-};
-
-/* GPIO connection type */
-
-const char *AcpiGbl_CtDecode[] =
-{
- "Interrupt",
- "I/O"
-};
-
-/* Serial bus type */
-
-const char *AcpiGbl_SbtDecode[] =
-{
- "/* UNKNOWN serial bus type */",
- "I2C",
- "SPI",
- "UART"
-};
-
-/* I2C serial bus access mode */
-
-const char *AcpiGbl_AmDecode[] =
-{
- "AddressingMode7Bit",
- "AddressingMode10Bit"
-};
-
-/* I2C serial bus slave mode */
-
-const char *AcpiGbl_SmDecode[] =
-{
- "ControllerInitiated",
- "DeviceInitiated"
-};
-
-/* SPI serial bus wire mode */
-
-const char *AcpiGbl_WmDecode[] =
-{
- "FourWireMode",
- "ThreeWireMode"
-};
-
-/* SPI serial clock phase */
-
-const char *AcpiGbl_CphDecode[] =
-{
- "ClockPhaseFirst",
- "ClockPhaseSecond"
-};
-
-/* SPI serial bus clock polarity */
-
-const char *AcpiGbl_CpoDecode[] =
-{
- "ClockPolarityLow",
- "ClockPolarityHigh"
-};
-
-/* SPI serial bus device polarity */
-
-const char *AcpiGbl_DpDecode[] =
-{
- "PolarityLow",
- "PolarityHigh"
-};
-
-/* UART serial bus endian */
-
-const char *AcpiGbl_EdDecode[] =
-{
- "LittleEndian",
- "BigEndian"
-};
-
-/* UART serial bus bits per byte */
-
-const char *AcpiGbl_BpbDecode[] =
-{
- "DataBitsFive",
- "DataBitsSix",
- "DataBitsSeven",
- "DataBitsEight",
- "DataBitsNine",
- "/* UNKNOWN Bits per byte */",
- "/* UNKNOWN Bits per byte */",
- "/* UNKNOWN Bits per byte */"
-};
-
-/* UART serial bus stop bits */
-
-const char *AcpiGbl_SbDecode[] =
-{
- "StopBitsZero",
- "StopBitsOne",
- "StopBitsOnePlusHalf",
- "StopBitsTwo"
-};
-
-/* UART serial bus flow control */
-
-const char *AcpiGbl_FcDecode[] =
-{
- "FlowControlNone",
- "FlowControlHardware",
- "FlowControlXON",
- "/* UNKNOWN flow control keyword */"
-};
-
-/* UART serial bus parity type */
-
-const char *AcpiGbl_PtDecode[] =
-{
- "ParityTypeNone",
- "ParityTypeEven",
- "ParityTypeOdd",
- "ParityTypeMark",
- "ParityTypeSpace",
- "/* UNKNOWN parity keyword */",
- "/* UNKNOWN parity keyword */",
- "/* UNKNOWN parity keyword */"
-};
-
-#endif
-
-
/*
* Base sizes of the raw AML resource descriptors, indexed by resource type.
* Zero indicates a reserved (and therefore invalid) resource type.
@@ -479,8 +198,12 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] =
ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS64),
ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64),
ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO),
- 0,
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_FUNCTION),
ACPI_AML_SIZE_LARGE (AML_RESOURCE_COMMON_SERIALBUS),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_CONFIG),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_FUNCTION),
+ ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_CONFIG),
};
const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[] =
@@ -534,8 +257,12 @@ static const UINT8 AcpiGbl_ResourceTypes[] =
ACPI_VARIABLE_LENGTH, /* 0A Qword* address */
ACPI_FIXED_LENGTH, /* 0B Extended* address */
ACPI_VARIABLE_LENGTH, /* 0C Gpio* */
- 0,
- ACPI_VARIABLE_LENGTH /* 0E *SerialBus */
+ ACPI_VARIABLE_LENGTH, /* 0D PinFunction */
+ ACPI_VARIABLE_LENGTH, /* 0E *SerialBus */
+ ACPI_VARIABLE_LENGTH, /* 0F PinConfig */
+ ACPI_VARIABLE_LENGTH, /* 10 PinGroup */
+ ACPI_VARIABLE_LENGTH, /* 11 PinGroupFunction */
+ ACPI_VARIABLE_LENGTH, /* 12 PinGroupConfig */
};
@@ -576,10 +303,8 @@ AcpiUtWalkAmlResources (
ACPI_FUNCTION_TRACE (UtWalkAmlResources);
- /*
- * The absolute minimum resource template is one EndTag descriptor.
- * However, we will treat a lone EndTag as just a simple buffer.
- */
+ /* The absolute minimum resource template is one EndTag descriptor */
+
if (AmlLength < sizeof (AML_RESOURCE_END_TAG))
{
return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
@@ -613,8 +338,8 @@ AcpiUtWalkAmlResources (
if (UserFunction)
{
- Status = UserFunction (Aml, Length, Offset,
- ResourceIndex, Context);
+ Status = UserFunction (
+ Aml, Length, Offset, ResourceIndex, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -635,14 +360,11 @@ AcpiUtWalkAmlResources (
}
/*
- * The EndTag opcode must be followed by a zero byte.
- * Although this byte is technically defined to be a checksum,
- * in practice, all ASL compilers set this byte to zero.
+ * Don't attempt to perform any validation on the 2nd byte.
+ * Although all known ASL compilers insert a zero for the 2nd
+ * byte, it can also be a checksum (as per the ACPI spec),
+ * and this is occasionally seen in the field. July 2017.
*/
- if (*(Aml + 1) != 0)
- {
- return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
- }
/* Return the pointer to the EndTag if requested */
@@ -651,13 +373,6 @@ AcpiUtWalkAmlResources (
*Context = Aml;
}
- /* Check if buffer is defined to be longer than the resource length */
-
- if (AmlLength > (Offset + Length))
- {
- return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
- }
-
/* Normal exit */
return_ACPI_STATUS (AE_OK);
diff --git a/sys/contrib/dev/acpica/components/utilities/utstate.c b/sys/contrib/dev/acpica/components/utilities/utstate.c
index 1c1f278f7..fa9ec20 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstate.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstate.c
@@ -363,7 +363,7 @@ ACPI_GENERIC_STATE *
AcpiUtCreatePkgState (
void *InternalObject,
void *ExternalObject,
- UINT16 Index)
+ UINT32 Index)
{
ACPI_GENERIC_STATE *State;
diff --git a/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c b/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
index 5e9a180..faee601 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c
@@ -419,8 +419,8 @@ AcpiUtStrtoulBase10 (
/* Convert and insert (add) the decimal digit */
- NextValue =
- (ReturnValue * 10) + (AsciiDigit - ACPI_ASCII_ZERO);
+ AcpiUtShortMultiply (ReturnValue, 10, &NextValue);
+ NextValue += (AsciiDigit - ACPI_ASCII_ZERO);
/* Check for overflow (32 or 64 bit) - return current converted value */
@@ -486,8 +486,8 @@ AcpiUtStrtoulBase16 (
/* Convert and insert the hex digit */
- ReturnValue =
- (ReturnValue << 4) | AcpiUtAsciiCharToHex (AsciiDigit);
+ AcpiUtShortShiftLeft (ReturnValue, 4, &ReturnValue);
+ ReturnValue |= AcpiUtAsciiCharToHex (AsciiDigit);
String++;
ValidDigits++;
diff --git a/sys/contrib/dev/acpica/components/utilities/uttrack.c b/sys/contrib/dev/acpica/components/utilities/uttrack.c
index ba1eeb2..41538b5 100644
--- a/sys/contrib/dev/acpica/components/utilities/uttrack.c
+++ b/sys/contrib/dev/acpica/components/utilities/uttrack.c
@@ -776,6 +776,11 @@ AcpiUtDumpAllocations (
return_VOID;
}
+ if (!AcpiGbl_GlobalList)
+ {
+ goto Exit;
+ }
+
Element = AcpiGbl_GlobalList->ListHead;
while (Element)
{
@@ -787,7 +792,7 @@ AcpiUtDumpAllocations (
if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
{
- AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u "
+ AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u "
"[Not a Descriptor - too small]\n",
Descriptor, Element->Size, Element->Module,
Element->Line);
@@ -799,7 +804,7 @@ AcpiUtDumpAllocations (
if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) !=
ACPI_DESC_TYPE_CACHED)
{
- AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
+ AcpiOsPrintf ("%p Length 0x%04X %9.9s-%4.4u [%s] ",
Descriptor, Element->Size, Element->Module,
Element->Line, AcpiUtGetDescriptorName (Descriptor));
@@ -875,6 +880,7 @@ AcpiUtDumpAllocations (
Element = Element->Next;
}
+Exit:
(void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);
/* Print summary */
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
index b8a1e6d..d4a7d21 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
@@ -277,6 +277,8 @@ AcpiAcquireMutex (
return (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiAcquireMutex)
+
/*******************************************************************************
*
@@ -317,3 +319,5 @@ AcpiReleaseMutex (
AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex);
return (AE_OK);
}
+
+ACPI_EXPORT_SYMBOL (AcpiReleaseMutex)
diff --git a/sys/contrib/dev/acpica/include/acapps.h b/sys/contrib/dev/acpica/include/acapps.h
index 6ceb0f2..4ca3e80 100644
--- a/sys/contrib/dev/acpica/include/acapps.h
+++ b/sys/contrib/dev/acpica/include/acapps.h
@@ -226,6 +226,10 @@ AcGetAllTablesFromFile (
UINT8 GetOnlyAmlTables,
ACPI_NEW_TABLE_DESC **ReturnListHead);
+void
+AcDeleteTableList (
+ ACPI_NEW_TABLE_DESC *ListHead);
+
BOOLEAN
AcIsFileBinary (
FILE *File);
@@ -294,7 +298,7 @@ AcpiDmFinishNamespaceLoad (
ACPI_OWNER_ID OwnerId);
void
-AcpiDmConvertResourceIndexes (
+AcpiDmConvertParseObjects (
ACPI_PARSE_OBJECT *ParseTreeRoot,
ACPI_NAMESPACE_NODE *NamespaceRoot);
diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h
index 73c2313..5d7140f 100644
--- a/sys/contrib/dev/acpica/include/acdisasm.h
+++ b/sys/contrib/dev/acpica/include/acdisasm.h
@@ -207,6 +207,11 @@ typedef enum
ACPI_DMT_FLAGS1,
ACPI_DMT_FLAGS2,
ACPI_DMT_FLAGS4,
+ ACPI_DMT_FLAGS4_0,
+ ACPI_DMT_FLAGS4_4,
+ ACPI_DMT_FLAGS4_8,
+ ACPI_DMT_FLAGS4_12,
+ ACPI_DMT_FLAGS16_16,
ACPI_DMT_UINT8,
ACPI_DMT_UINT16,
ACPI_DMT_UINT24,
@@ -257,6 +262,7 @@ typedef enum
ACPI_DMT_HEST,
ACPI_DMT_HESTNTFY,
ACPI_DMT_HESTNTYP,
+ ACPI_DMT_HMAT,
ACPI_DMT_IORTMEM,
ACPI_DMT_IVRS,
ACPI_DMT_LPIT,
@@ -264,6 +270,8 @@ typedef enum
ACPI_DMT_NFIT,
ACPI_DMT_PCCT,
ACPI_DMT_PMTT,
+ ACPI_DMT_PPTT,
+ ACPI_DMT_SDEI,
ACPI_DMT_SLIC,
ACPI_DMT_SRAT,
@@ -412,12 +420,22 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest11[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1b[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat1c[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmat2a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoHmatHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[];
@@ -495,6 +513,13 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct4[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt0a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPptt2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPpttHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRasf[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
@@ -503,6 +528,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSdei[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
@@ -513,6 +539,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoStao[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[];
@@ -529,6 +556,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoWsmt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2];
@@ -641,6 +669,10 @@ AcpiDmDumpHest (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpHmat (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpIort (
ACPI_TABLE_HEADER *Table);
@@ -684,6 +716,10 @@ void
AcpiDmDumpPmtt (
ACPI_TABLE_HEADER *Table);
+void
+AcpiDmDumpPptt (
+ ACPI_TABLE_HEADER *Table);
+
UINT32
AcpiDmDumpRsdp (
ACPI_TABLE_HEADER *Table);
@@ -759,10 +795,6 @@ AcpiDmDisassembleOneOp (
ACPI_OP_WALK_INFO *Info,
ACPI_PARSE_OBJECT *Op);
-BOOLEAN
-AcpiDmIsTempName (
- ACPI_PARSE_OBJECT *Op);
-
UINT32
AcpiDmListType (
ACPI_PARSE_OBJECT *Op);
@@ -888,6 +920,12 @@ AcpiDmAddOpToExternalList (
UINT16 Flags);
void
+AcpiDmCreateSubobjectForExternal (
+ UINT8 Type,
+ ACPI_NAMESPACE_NODE **Node,
+ UINT32 Value);
+
+void
AcpiDmAddNodeToExternalList (
ACPI_NAMESPACE_NODE *Node,
UINT8 Type,
@@ -895,11 +933,17 @@ AcpiDmAddNodeToExternalList (
UINT16 Flags);
void
-AcpiDmAddExternalsToNamespace (
+AcpiDmAddExternalListToNamespace (
void);
+void
+AcpiDmAddOneExternalToNamespace (
+ char *Path,
+ UINT8 Type,
+ UINT32 Value);
+
UINT32
-AcpiDmGetExternalMethodCount (
+AcpiDmGetUnresolvedExternalMethodCount (
void);
void
@@ -923,6 +967,11 @@ void
AcpiDmGetExternalsFromFile (
void);
+void
+AcpiDmMarkExternalConflict (
+ ACPI_NAMESPACE_NODE *Node);
+
+
/*
* dmresrc
*/
@@ -1048,6 +1097,41 @@ AcpiDmGpioDescriptor (
UINT32 Level);
void
+AcpiDmPinFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
+AcpiDmPinConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
+AcpiDmPinGroupDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
+AcpiDmPinGroupFunctionDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
+AcpiDmPinGroupConfigDescriptor (
+ ACPI_OP_WALK_INFO *Info,
+ AML_RESOURCE *Resource,
+ UINT32 Length,
+ UINT32 Level);
+
+void
AcpiDmSerialBusDescriptor (
ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
@@ -1171,6 +1255,17 @@ AcpiDmCloseOperator (
/*
* dmtables
*/
+ACPI_STATUS
+AcpiDmProcessSwitch (
+ ACPI_PARSE_OBJECT *Op);
+
+void
+AcpiDmClearTempList(
+ void);
+
+/*
+ * dmtables
+ */
void
AdDisassemblerHeader (
char *Filename,
diff --git a/sys/contrib/dev/acpica/include/acdispat.h b/sys/contrib/dev/acpica/include/acdispat.h
index 1c294c3..bae3d79 100644
--- a/sys/contrib/dev/acpica/include/acdispat.h
+++ b/sys/contrib/dev/acpica/include/acdispat.h
@@ -409,6 +409,12 @@ AcpiDsInitializeObjects (
* dsobject - Parser/Interpreter interface - object initialization and conversion
*/
ACPI_STATUS
+AcpiDsBuildInternalObject (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_OPERAND_OBJECT **ObjDescPtr);
+
+ACPI_STATUS
AcpiDsBuildInternalBufferObj (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
@@ -437,6 +443,17 @@ AcpiDsCreateNode (
/*
+ * dspkginit - Package object initialization
+ */
+ACPI_STATUS
+AcpiDsInitPackageElement (
+ UINT8 ObjectType,
+ ACPI_OPERAND_OBJECT *SourceObject,
+ ACPI_GENERIC_STATE *State,
+ void *Context);
+
+
+/*
* dsutils - Parser/Interpreter interface utility routines
*/
void
diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h
index edb696a..686dcd8 100644
--- a/sys/contrib/dev/acpica/include/acglobal.h
+++ b/sys/contrib/dev/acpica/include/acglobal.h
@@ -427,6 +427,7 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmEmitExternalOpcodes, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DoDisassemblerOptimizations, TRUE);
+ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT_LIST, *AcpiGbl_TempListHead, NULL);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing);
@@ -480,6 +481,8 @@ ACPI_GLOBAL (const char, *AcpiGbl_PldVerticalPositionList[]);
ACPI_GLOBAL (const char, *AcpiGbl_PldHorizontalPositionList[]);
ACPI_GLOBAL (const char, *AcpiGbl_PldShapeList[]);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DisasmFlag, FALSE);
+
#endif
/*
diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h
index 92eb49a..00be20e 100644
--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -328,6 +328,7 @@ typedef struct acpi_namespace_node
#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */
+#define IMPLICIT_EXTERNAL 0x02 /* iASL only: This object created implicitly via External */
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
@@ -812,7 +813,7 @@ typedef struct acpi_update_state
typedef struct acpi_pkg_state
{
ACPI_STATE_COMMON
- UINT16 Index;
+ UINT32 Index;
union acpi_operand_object *SourceObject;
union acpi_operand_object *DestObject;
struct acpi_walk_state *WalkState;
@@ -1136,7 +1137,7 @@ typedef struct acpi_parse_obj_common
typedef struct acpi_parse_obj_named
{
ACPI_PARSE_COMMON
- UINT8 *Path;
+ char *Path;
UINT8 *Data; /* AML body or bytelist data */
UINT32 Length; /* AML length */
UINT32 Name; /* 4-byte name or zero if no name */
@@ -1146,7 +1147,7 @@ typedef struct acpi_parse_obj_named
/* This version is used by the iASL compiler only */
-#define ACPI_MAX_PARSEOP_NAME 20
+#define ACPI_MAX_PARSEOP_NAME 20
typedef struct acpi_parse_obj_asl
{
@@ -1190,11 +1191,12 @@ typedef union acpi_parse_object
typedef struct asl_comment_state
{
- UINT8 CommentType;
- UINT32 SpacesBefore;
- ACPI_PARSE_OBJECT *Latest_Parse_Node;
- ACPI_PARSE_OBJECT *ParsingParenBraceNode;
- BOOLEAN CaptureComments;
+ UINT8 CommentType;
+ UINT32 SpacesBefore;
+ ACPI_PARSE_OBJECT *LatestParseOp;
+ ACPI_PARSE_OBJECT *ParsingParenBraceNode;
+ BOOLEAN CaptureComments;
+
} ASL_COMMENT_STATE;
@@ -1444,8 +1446,13 @@ typedef struct acpi_port_info
#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
#define ACPI_RESOURCE_NAME_GPIO 0x8C
+#define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D
#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
-#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
+#define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F
+#define ACPI_RESOURCE_NAME_PIN_GROUP 0x90
+#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91
+#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92
+#define ACPI_RESOURCE_NAME_LARGE_MAX 0x92
/*****************************************************************************
@@ -1482,6 +1489,7 @@ typedef struct acpi_external_list
#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
#define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */
+#define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */
typedef struct acpi_external_file
@@ -1492,6 +1500,13 @@ typedef struct acpi_external_file
} ACPI_EXTERNAL_FILE;
+typedef struct acpi_parse_object_list
+{
+ ACPI_PARSE_OBJECT *Op;
+ struct acpi_parse_object_list *Next;
+
+} ACPI_PARSE_OBJECT_LIST;
+
/*****************************************************************************
*
* Debugger
diff --git a/sys/contrib/dev/acpica/include/acnames.h b/sys/contrib/dev/acpica/include/acnames.h
index 27b0b97..69f8884 100644
--- a/sys/contrib/dev/acpica/include/acnames.h
+++ b/sys/contrib/dev/acpica/include/acnames.h
@@ -162,6 +162,7 @@
#define METHOD_NAME__CLS "_CLS"
#define METHOD_NAME__CRS "_CRS"
#define METHOD_NAME__DDN "_DDN"
+#define METHOD_NAME__DMA "_DMA"
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__INI "_INI"
#define METHOD_NAME__PLD "_PLD"
diff --git a/sys/contrib/dev/acpica/include/acobject.h b/sys/contrib/dev/acpica/include/acobject.h
index 25d7496..7dce4ce 100644
--- a/sys/contrib/dev/acpica/include/acobject.h
+++ b/sys/contrib/dev/acpica/include/acobject.h
@@ -241,7 +241,9 @@ typedef struct acpi_object_integer
UINT32 Length;
-typedef struct acpi_object_string /* Null terminated, ASCII characters only */
+/* Null terminated, ASCII characters only */
+
+typedef struct acpi_object_string
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */
@@ -359,8 +361,9 @@ typedef struct acpi_object_method
union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\
union acpi_operand_object *Handler; /* Handler for Address space */
+/* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
-typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
+typedef struct acpi_object_notify_common
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
@@ -431,8 +434,9 @@ typedef struct acpi_object_thermal_zone
UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
UINT8 AccessLength; /* For serial regions/fields */
+/* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
-typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
+typedef struct acpi_object_field_common
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
@@ -542,11 +546,12 @@ typedef struct acpi_object_reference
ACPI_OBJECT_COMMON_HEADER
UINT8 Class; /* Reference Class */
UINT8 TargetType; /* Used for Index Op */
- UINT8 Reserved;
+ UINT8 Resolved; /* Reference has been resolved to a value */
void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */
union acpi_operand_object **Where; /* Target of Index */
UINT8 *IndexPointer; /* Used for Buffers and Strings */
+ UINT8 *Aml; /* Used for deferred resolution of the ref */
UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */
} ACPI_OBJECT_REFERENCE;
@@ -567,7 +572,6 @@ typedef enum
} ACPI_REFERENCE_CLASSES;
-
/*
* Extra object is used as additional storage for types that
* have AML code in their declarations (TermArgs) that must be
diff --git a/sys/contrib/dev/acpica/include/acopcode.h b/sys/contrib/dev/acpica/include/acopcode.h
index b0cc4b1..3ce2772 100644
--- a/sys/contrib/dev/acpica/include/acopcode.h
+++ b/sys/contrib/dev/acpica/include/acopcode.h
@@ -221,7 +221,7 @@
#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
-#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA)
+#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAME, ARGP_BYTEDATA, ARGP_BYTEDATA)
#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
diff --git a/sys/contrib/dev/acpica/include/acpi.h b/sys/contrib/dev/acpica/include/acpi.h
index 2ee9b0c..37bff7d 100644
--- a/sys/contrib/dev/acpica/include/acpi.h
+++ b/sys/contrib/dev/acpica/include/acpi.h
@@ -162,14 +162,14 @@
* Note: The order of these include files is important.
*/
#include <contrib/dev/acpica/include/platform/acenv.h> /* Environment-specific items */
-#include <contrib/dev/acpica/include/acnames.h> /* Common ACPI names and strings */
#include <contrib/dev/acpica/include/actypes.h> /* ACPICA data types and structures */
+#include <contrib/dev/acpica/include/platform/acenvex.h> /* Extra environment-specific items */
+#include <contrib/dev/acpica/include/acnames.h> /* Common ACPI names and strings */
#include <contrib/dev/acpica/include/acexcep.h> /* ACPICA exceptions */
#include <contrib/dev/acpica/include/actbl.h> /* ACPI table definitions */
#include <contrib/dev/acpica/include/acoutput.h> /* Error output and Debug macros */
#include <contrib/dev/acpica/include/acrestyp.h> /* Resource Descriptor structs */
#include <contrib/dev/acpica/include/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */
#include <contrib/dev/acpica/include/acpixf.h> /* ACPI core subsystem external interfaces */
-#include <contrib/dev/acpica/include/platform/acenvex.h> /* Extra environment-specific items */
#endif /* __ACPI_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h
index a762ba8..fc486d5 100644
--- a/sys/contrib/dev/acpica/include/acpixf.h
+++ b/sys/contrib/dev/acpica/include/acpixf.h
@@ -154,7 +154,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20170303
+#define ACPI_CA_VERSION 0x20170728
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>
@@ -270,13 +270,14 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
/*
- * Whether or not to verify the table checksum before installation. Set
- * this to TRUE to verify the table checksum before install it to the table
- * manager. Note that enabling this option causes errors to happen in some
- * OSPMs during early initialization stages. Default behavior is to do such
- * verification.
+ * Whether or not to validate (map) an entire table to verify
+ * checksum/duplication in early stage before install. Set this to TRUE to
+ * allow early table validation before install it to the table manager.
+ * Note that enabling this option causes errors to happen in some OSPMs
+ * during early initialization stages. Default behavior is to allow such
+ * validation.
*/
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_VerifyTableChecksum, TRUE);
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableTableValidation, TRUE);
/*
* Optionally enable output from the AML Debug Object.
diff --git a/sys/contrib/dev/acpica/include/acpredef.h b/sys/contrib/dev/acpica/include/acpredef.h
index 5adc110..95a18a4 100644
--- a/sys/contrib/dev/acpica/include/acpredef.h
+++ b/sys/contrib/dev/acpica/include/acpredef.h
@@ -682,6 +682,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_HID", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}},
+ {{"_HMA", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
+
{{"_HOT", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
@@ -726,6 +729,17 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3,
ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 10,0),
+ {{"_LSI", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}},
+ PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0,0,0),
+
+ {{"_LSR", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}},
+ PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1, ACPI_RTYPE_BUFFER, 1,0),
+
+ {{"_LSW", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER),
+ METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+
{{"_MAT", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
diff --git a/sys/contrib/dev/acpica/include/acresrc.h b/sys/contrib/dev/acpica/include/acresrc.h
index 45b280b..c526107 100644
--- a/sys/contrib/dev/acpica/include/acresrc.h
+++ b/sys/contrib/dev/acpica/include/acresrc.h
@@ -264,7 +264,9 @@ typedef enum
ACPI_RSD_UINT16,
ACPI_RSD_UINT32,
ACPI_RSD_UINT64,
- ACPI_RSD_WORDLIST
+ ACPI_RSD_WORDLIST,
+ ACPI_RSD_LABEL,
+ ACPI_RSD_SOURCE_LABEL,
} ACPI_RSDUMP_OPCODES;
@@ -496,6 +498,11 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[];
+extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[];
/* These resources require separate get/set tables */
@@ -540,12 +547,17 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[];
extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[];
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[];
extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[];
+extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[];
#endif
#endif /* __ACRESRC_H__ */
diff --git a/sys/contrib/dev/acpica/include/acrestyp.h b/sys/contrib/dev/acpica/include/acrestyp.h
index 7df5a63..0057722 100644
--- a/sys/contrib/dev/acpica/include/acrestyp.h
+++ b/sys/contrib/dev/acpica/include/acrestyp.h
@@ -435,6 +435,13 @@ typedef union acpi_resource_attribute
} ACPI_RESOURCE_ATTRIBUTE;
+typedef struct acpi_resource_label
+{
+ UINT16 StringLength;
+ char *StringPtr;
+
+} ACPI_RESOURCE_LABEL;
+
typedef struct acpi_resource_source
{
UINT8 Index;
@@ -725,6 +732,90 @@ typedef struct acpi_resource_uart_serialbus
#define ACPI_UART_CLEAR_TO_SEND (1<<6)
#define ACPI_UART_REQUEST_TO_SEND (1<<7)
+typedef struct acpi_resource_pin_function
+{
+ UINT8 RevisionId;
+ UINT8 PinConfig;
+ UINT8 Sharable; /* For values, see Interrupt Attributes above */
+ UINT16 FunctionNumber;
+ UINT16 PinTableLength;
+ UINT16 VendorLength;
+ ACPI_RESOURCE_SOURCE ResourceSource;
+ UINT16 *PinTable;
+ UINT8 *VendorData;
+
+} ACPI_RESOURCE_PIN_FUNCTION;
+
+typedef struct acpi_resource_pin_config
+{
+ UINT8 RevisionId;
+ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
+ UINT8 Sharable; /* For values, see Interrupt Attributes above */
+ UINT8 PinConfigType;
+ UINT32 PinConfigValue;
+ UINT16 PinTableLength;
+ UINT16 VendorLength;
+ ACPI_RESOURCE_SOURCE ResourceSource;
+ UINT16 *PinTable;
+ UINT8 *VendorData;
+
+} ACPI_RESOURCE_PIN_CONFIG;
+
+/* Values for PinConfigType field above */
+
+#define ACPI_PIN_CONFIG_DEFAULT 0
+#define ACPI_PIN_CONFIG_BIAS_PULL_UP 1
+#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2
+#define ACPI_PIN_CONFIG_BIAS_DEFAULT 3
+#define ACPI_PIN_CONFIG_BIAS_DISABLE 4
+#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5
+#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6
+#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7
+#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8
+#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9
+#define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10
+#define ACPI_PIN_CONFIG_SLEW_RATE 11
+#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12
+#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13
+
+typedef struct acpi_resource_pin_group
+{
+ UINT8 RevisionId;
+ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
+ UINT16 PinTableLength;
+ UINT16 VendorLength;
+ UINT16 *PinTable;
+ ACPI_RESOURCE_LABEL ResourceLabel;
+ UINT8 *VendorData;
+
+} ACPI_RESOURCE_PIN_GROUP;
+
+typedef struct acpi_resource_pin_group_function
+{
+ UINT8 RevisionId;
+ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
+ UINT8 Sharable; /* For values, see Interrupt Attributes above */
+ UINT16 FunctionNumber;
+ UINT16 VendorLength;
+ ACPI_RESOURCE_SOURCE ResourceSource;
+ ACPI_RESOURCE_LABEL ResourceSourceLabel;
+ UINT8 *VendorData;
+
+} ACPI_RESOURCE_PIN_GROUP_FUNCTION;
+
+typedef struct acpi_resource_pin_group_config
+{
+ UINT8 RevisionId;
+ UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
+ UINT8 Sharable; /* For values, see Interrupt Attributes above */
+ UINT8 PinConfigType; /* For values, see PinConfigType above */
+ UINT32 PinConfigValue;
+ UINT16 VendorLength;
+ ACPI_RESOURCE_SOURCE ResourceSource;
+ ACPI_RESOURCE_LABEL ResourceSourceLabel;
+ UINT8 *VendorData;
+
+} ACPI_RESOURCE_PIN_GROUP_CONFIG;
/* ACPI_RESOURCE_TYPEs */
@@ -748,7 +839,12 @@ typedef struct acpi_resource_uart_serialbus
#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
-#define ACPI_RESOURCE_TYPE_MAX 19
+#define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_MAX 24
/* Master union for resource descriptors */
@@ -777,6 +873,11 @@ typedef union acpi_resource_data
ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;
ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;
ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
+ ACPI_RESOURCE_PIN_FUNCTION PinFunction;
+ ACPI_RESOURCE_PIN_CONFIG PinConfig;
+ ACPI_RESOURCE_PIN_GROUP PinGroup;
+ ACPI_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction;
+ ACPI_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig;
/* Common fields */
diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h
index 8f5a394..05a69ff 100644
--- a/sys/contrib/dev/acpica/include/actables.h
+++ b/sys/contrib/dev/acpica/include/actables.h
@@ -206,7 +206,8 @@ AcpiTbValidateTempTable (
ACPI_STATUS
AcpiTbVerifyTempTable (
ACPI_TABLE_DESC *TableDesc,
- char *Signature);
+ char *Signature,
+ UINT32 *TableIndex);
BOOLEAN
AcpiTbIsTableLoaded (
@@ -303,6 +304,11 @@ AcpiTbUnloadTable (
UINT32 TableIndex);
void
+AcpiTbNotifyTable (
+ UINT32 Event,
+ void *Table);
+
+void
AcpiTbTerminate (
void);
diff --git a/sys/contrib/dev/acpica/include/actbl.h b/sys/contrib/dev/acpica/include/actbl.h
index bc779bb..f6875e5 100644
--- a/sys/contrib/dev/acpica/include/actbl.h
+++ b/sys/contrib/dev/acpica/include/actbl.h
@@ -517,12 +517,27 @@ typedef struct acpi_table_desc
} ACPI_TABLE_DESC;
+/*
+ * Maximum value of the ValidationCount field in ACPI_TABLE_DESC.
+ * When reached, ValidationCount cannot be changed any more and the table will
+ * be permanently regarded as validated.
+ *
+ * This is to prevent situations in which unbalanced table get/put operations
+ * may cause premature table unmapping in the OS to happen.
+ *
+ * The maximum validation count can be defined to any value, but should be
+ * greater than the maximum number of OS early stage mapping slots to avoid
+ * leaking early stage table mappings to the late stage.
+ */
+#define ACPI_MAX_TABLE_VALIDATIONS ACPI_UINT16_MAX
+
/* Masks for Flags field above */
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */
#define ACPI_TABLE_ORIGIN_MASK (3)
+#define ACPI_TABLE_IS_VERIFIED (4)
#define ACPI_TABLE_IS_LOADED (8)
diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h
index b7119fa..da6b561 100644
--- a/sys/contrib/dev/acpica/include/actbl1.h
+++ b/sys/contrib/dev/acpica/include/actbl1.h
@@ -175,9 +175,11 @@
#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
+#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
+#define ACPI_SIG_PPTT "PPTT" /* Processor Properties Topology Table */
#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
@@ -600,7 +602,8 @@ enum AcpiHestTypes
ACPI_HEST_TYPE_AER_BRIDGE = 8,
ACPI_HEST_TYPE_GENERIC_ERROR = 9,
ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
- ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */
+ ACPI_HEST_TYPE_IA32_DEFERRED_CHECK = 11,
+ ACPI_HEST_TYPE_RESERVED = 12 /* 12 and greater are reserved */
};
@@ -652,6 +655,7 @@ typedef struct acpi_hest_aer_common
#define ACPI_HEST_FIRMWARE_FIRST (1)
#define ACPI_HEST_GLOBAL (1<<1)
+#define ACPI_HEST_GHES_ASSIST (1<<2)
/*
* Macros to access the bus/segment numbers in Bus field above:
@@ -682,18 +686,19 @@ typedef struct acpi_hest_notify
enum AcpiHestNotifyTypes
{
- ACPI_HEST_NOTIFY_POLLED = 0,
- ACPI_HEST_NOTIFY_EXTERNAL = 1,
- ACPI_HEST_NOTIFY_LOCAL = 2,
- ACPI_HEST_NOTIFY_SCI = 3,
- ACPI_HEST_NOTIFY_NMI = 4,
- ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
- ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
- ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
- ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
- ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
- ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
- ACPI_HEST_NOTIFY_RESERVED = 11 /* 11 and greater are reserved */
+ ACPI_HEST_NOTIFY_POLLED = 0,
+ ACPI_HEST_NOTIFY_EXTERNAL = 1,
+ ACPI_HEST_NOTIFY_LOCAL = 2,
+ ACPI_HEST_NOTIFY_SCI = 3,
+ ACPI_HEST_NOTIFY_NMI = 4,
+ ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
+ ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
+ ACPI_HEST_NOTIFY_GPIO = 7, /* ACPI 6.0 */
+ ACPI_HEST_NOTIFY_SEA = 8, /* ACPI 6.1 */
+ ACPI_HEST_NOTIFY_SEI = 9, /* ACPI 6.1 */
+ ACPI_HEST_NOTIFY_GSIV = 10, /* ACPI 6.1 */
+ ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11, /* ACPI 6.2 */
+ ACPI_HEST_NOTIFY_RESERVED = 12 /* 12 and greater are reserved */
};
/* Values for ConfigWriteEnable bitfield above */
@@ -716,7 +721,7 @@ typedef struct acpi_hest_ia_machine_check
{
ACPI_HEST_HEADER Header;
UINT16 Reserved1;
- UINT8 Flags;
+ UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
UINT8 Enabled;
UINT32 RecordsToPreallocate;
UINT32 MaxSectionsPerRecord;
@@ -734,7 +739,7 @@ typedef struct acpi_hest_ia_corrected
{
ACPI_HEST_HEADER Header;
UINT16 Reserved1;
- UINT8 Flags;
+ UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
UINT8 Enabled;
UINT32 RecordsToPreallocate;
UINT32 MaxSectionsPerRecord;
@@ -899,6 +904,155 @@ typedef struct acpi_hest_generic_data_v300
#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)
+/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
+
+typedef struct acpi_hest_ia_deferred_check
+{
+ ACPI_HEST_HEADER Header;
+ UINT16 Reserved1;
+ UINT8 Flags; /* See flags ACPI_HEST_GLOBAL, etc. above */
+ UINT8 Enabled;
+ UINT32 RecordsToPreallocate;
+ UINT32 MaxSectionsPerRecord;
+ ACPI_HEST_NOTIFY Notify;
+ UINT8 NumHardwareBanks;
+ UINT8 Reserved2[3];
+
+} ACPI_HEST_IA_DEFERRED_CHECK;
+
+
+/*******************************************************************************
+ *
+ * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_hmat
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 Reserved;
+
+} ACPI_TABLE_HMAT;
+
+
+/* Values for HMAT structure types */
+
+enum AcpiHmatType
+{
+ ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
+ ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
+ ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
+ ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+};
+
+typedef struct acpi_hmat_structure
+{
+ UINT16 Type;
+ UINT16 Reserved;
+ UINT32 Length;
+
+} ACPI_HMAT_STRUCTURE;
+
+
+/*
+ * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
+ */
+
+/* 0: Memory subystem address range */
+
+typedef struct acpi_hmat_address_range
+{
+ ACPI_HMAT_STRUCTURE Header;
+ UINT16 Flags;
+ UINT16 Reserved1;
+ UINT32 ProcessorPD; /* Processor proximity domain */
+ UINT32 MemoryPD; /* Memory proximity domain */
+ UINT32 Reserved2;
+ UINT64 PhysicalAddressBase; /* Physical address range base */
+ UINT64 PhysicalAddressLength; /* Physical address range length */
+
+} ACPI_HMAT_ADDRESS_RANGE;
+
+/* Masks for Flags field above */
+
+#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: ProcessorPD field is valid */
+#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: MemoryPD field is valid */
+#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */
+
+
+/* 1: System locality latency and bandwidth information */
+
+typedef struct acpi_hmat_locality
+{
+ ACPI_HMAT_STRUCTURE Header;
+ UINT8 Flags;
+ UINT8 DataType;
+ UINT16 Reserved1;
+ UINT32 NumberOfInitiatorPDs;
+ UINT32 NumberOfTargetPDs;
+ UINT32 Reserved2;
+ UINT64 EntryBaseUnit;
+
+} ACPI_HMAT_LOCALITY;
+
+/* Masks for Flags field above */
+
+#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
+
+/* Values for Memory Hierarchy flag */
+
+#define ACPI_HMAT_MEMORY 0
+#define ACPI_HMAT_LAST_LEVEL_CACHE 1
+#define ACPI_HMAT_1ST_LEVEL_CACHE 2
+#define ACPI_HMAT_2ND_LEVEL_CACHE 3
+#define ACPI_HMAT_3RD_LEVEL_CACHE 4
+
+/* Values for DataType field above */
+
+#define ACPI_HMAT_ACCESS_LATENCY 0
+#define ACPI_HMAT_READ_LATENCY 1
+#define ACPI_HMAT_WRITE_LATENCY 2
+#define ACPI_HMAT_ACCESS_BANDWIDTH 3
+#define ACPI_HMAT_READ_BANDWIDTH 4
+#define ACPI_HMAT_WRITE_BANDWIDTH 5
+
+
+/* 2: Memory side cache information */
+
+typedef struct acpi_hmat_cache
+{
+ ACPI_HMAT_STRUCTURE Header;
+ UINT32 MemoryPD;
+ UINT32 Reserved1;
+ UINT64 CacheSize;
+ UINT32 CacheAttributes;
+ UINT16 Reserved2;
+ UINT16 NumberOfSMBIOSHandles;
+
+} ACPI_HMAT_CACHE;
+
+/* Masks for CacheAttributes field above */
+
+#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
+#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
+#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
+#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
+#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)
+
+/* Values for cache associativity flag */
+
+#define ACPI_HMAT_CA_NONE (0)
+#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
+#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)
+
+/* Values for write policy flag */
+
+#define ACPI_HMAT_CP_NONE (0)
+#define ACPI_HMAT_CP_WB (1)
+#define ACPI_HMAT_CP_WT (2)
+
+
/*******************************************************************************
*
* MADT - Multiple APIC Description Table
@@ -920,8 +1074,8 @@ typedef struct acpi_table_madt
/* Values for PCATCompat flag */
-#define ACPI_MADT_DUAL_PIC 0
-#define ACPI_MADT_MULTIPLE_APIC 1
+#define ACPI_MADT_DUAL_PIC 1
+#define ACPI_MADT_MULTIPLE_APIC 0
/* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
@@ -1448,6 +1602,95 @@ typedef struct acpi_nfit_flush_address
/*******************************************************************************
*
+ * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ * Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_pptt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_PPTT;
+
+/* Values for Type field above */
+
+enum AcpiPpttType
+{
+ ACPI_PPTT_TYPE_PROCESSOR = 0,
+ ACPI_PPTT_TYPE_CACHE = 1,
+ ACPI_PPTT_TYPE_ID = 2,
+ ACPI_PPTT_TYPE_RESERVED = 3
+};
+
+
+/* 0: Processor Hierarchy Node Structure */
+
+typedef struct acpi_pptt_processor {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved;
+ UINT32 Flags;
+ UINT32 Parent;
+ UINT32 AcpiProcessorId;
+ UINT32 NumberOfPrivResources;
+
+} ACPI_PPTT_PROCESSOR;
+
+/* Flags */
+
+#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
+
+
+/* 1: Cache Type Structure */
+
+typedef struct acpi_pptt_cache {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved;
+ UINT32 Flags;
+ UINT32 NextLevelOfCache;
+ UINT32 Size;
+ UINT32 NumberOfSets;
+ UINT8 Associativity;
+ UINT8 Attributes;
+ UINT16 LineSize;
+
+} ACPI_PPTT_CACHE;
+
+/* Flags */
+
+#define ACPI_PPTT_SIZE_PROPERTY_VALID (1) /* Physical property valid */
+#define ACPI_PPTT_NUMBER_OF_SETS_VALID (1<<1) /* Number of sets valid */
+#define ACPI_PPTT_ASSOCIATIVITY_VALID (1<<2) /* Associativity valid */
+#define ACPI_PPTT_ALLOCATION_TYPE_VALID (1<<3) /* Allocation type valid */
+#define ACPI_PPTT_CACHE_TYPE_VALID (1<<4) /* Cache type valid */
+#define ACPI_PPTT_WRITE_POLICY_VALID (1<<5) /* Write policy valid */
+#define ACPI_PPTT_LINE_SIZE_VALID (1<<6) /* Line size valid */
+
+/* Masks for Attributes */
+
+#define ACPI_PPTT_MASK_ALLOCATION_TYPE (0x03) /* Allocation type */
+#define ACPI_PPTT_MASK_CACHE_TYPE (0x0C) /* Cache type */
+#define ACPI_PPTT_MASK_WRITE_POLICY (0x10) /* Write policy */
+
+
+/* 2: ID Structure */
+
+typedef struct acpi_pptt_id {
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved;
+ UINT32 VendorId;
+ UINT64 Level1Id;
+ UINT64 Level2Id;
+ UINT16 MajorRev;
+ UINT16 MinorRev;
+ UINT16 SpinRev;
+
+} ACPI_PPTT_ID;
+
+
+/*******************************************************************************
+ *
* SBST - Smart Battery Specification Table
* Version 1
*
@@ -1502,7 +1745,8 @@ enum AcpiSratType
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
- ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
+ ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
+ ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};
/*
@@ -1586,6 +1830,18 @@ typedef struct acpi_srat_gicc_affinity
#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
+/* 4: GCC ITS Affinity (ACPI 6.2) */
+
+typedef struct acpi_srat_gic_its_affinity
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 ProximityDomain;
+ UINT16 Reserved;
+ UINT32 ItsId;
+
+} ACPI_SRAT_GIC_ITS_AFFINITY;
+
+
/* Reset to default packing */
#pragma pack()
diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h
index 4655b1b..18cfdd4 100644
--- a/sys/contrib/dev/acpica/include/actbl2.h
+++ b/sys/contrib/dev/acpica/include/actbl2.h
@@ -186,6 +186,7 @@
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
+#define ACPI_SIG_SDEI "SDEI" /* Software Delegated Exception Interface Table */
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
@@ -197,6 +198,7 @@
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
+#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations Table */
#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */
#ifdef ACPI_UNDEFINED_TABLES
@@ -873,7 +875,7 @@ typedef struct acpi_ibft_target
* IORT - IO Remapping Table
*
* Conforms to "IO Remapping Table System Software on ARM Platforms",
- * Document number: ARM DEN 0049B, October 2015
+ * Document number: ARM DEN 0049C, May 2017
*
******************************************************************************/
@@ -1012,6 +1014,8 @@ typedef struct acpi_iort_smmu
#define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */
#define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */
#define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */
+#define ACPI_IORT_SMMU_CORELINK_MMU401 0x00000004 /* ARM Corelink MMU-401 */
+#define ACPI_IORT_SMMU_CAVIUM_THUNDERX 0x00000005 /* Cavium ThunderX SMMUv2 */
/* Masks for Flags field above */
@@ -1035,18 +1039,28 @@ typedef struct acpi_iort_smmu_v3
UINT32 Flags;
UINT32 Reserved;
UINT64 VatosAddress;
- UINT32 Model; /* O: generic SMMUv3 */
+ UINT32 Model;
UINT32 EventGsiv;
UINT32 PriGsiv;
UINT32 GerrGsiv;
UINT32 SyncGsiv;
+ UINT8 Pxm;
+ UINT8 Reserved1;
+ UINT16 Reserved2;
} ACPI_IORT_SMMU_V3;
+/* Values for Model field above */
+
+#define ACPI_IORT_SMMU_V3_GENERIC 0x00000000 /* Generic SMMUv3 */
+#define ACPI_IORT_SMMU_V3_HISILICON_HI161X 0x00000001 /* HiSilicon Hi161x SMMUv3 */
+#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x00000002 /* Cavium CN99xx SMMUv3 */
+
/* Masks for Flags field above */
#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1)
#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1)
+#define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3)
/*******************************************************************************
@@ -1409,6 +1423,21 @@ typedef struct acpi_mtmr_entry
} ACPI_MTMR_ENTRY;
+/*******************************************************************************
+ *
+ * SDEI - Software Delegated Exception Interface Descriptor Table
+ *
+ * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
+ * May 8th, 2017. Copyright 2017 ARM Ltd.
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_sdei
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_SDEI;
+
/*******************************************************************************
*
@@ -1521,7 +1550,8 @@ enum AcpiSpmiInterfaceTypes
* Version 2
*
* Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
- * December 19, 2014
+ * Version 1.2, Revision 8
+ * February 27, 2017
*
* NOTE: There are two versions of the table with the same signature --
* the client version and the server version. The common PlatformClass
@@ -1592,7 +1622,8 @@ typedef struct acpi_table_tcpa_server
* Version 4
*
* Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
- * December 19, 2014
+ * Version 1.2, Revision 8
+ * February 27, 2017
*
******************************************************************************/
@@ -1615,6 +1646,42 @@ typedef struct acpi_table_tpm2
#define ACPI_TPM2_MEMORY_MAPPED 6
#define ACPI_TPM2_COMMAND_BUFFER 7
#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8
+#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */
+
+
+/* Trailer appears after any StartMethod subtables */
+
+typedef struct acpi_tpm2_trailer
+{
+ UINT32 MinimumLogLength; /* Minimum length for the event log area */
+ UINT64 LogAddress; /* Address of the event log area */
+
+} ACPI_TPM2_TRAILER;
+
+
+/*
+ * Subtables (StartMethod-specific)
+ */
+
+/* 11: Start Method for ARM SMC (V1.2 Rev 8) */
+
+typedef struct acpi_tpm2_arm_smc
+{
+ UINT32 GlobalInterrupt;
+ UINT8 InterruptFlags;
+ UINT8 OperationFlags;
+ UINT16 Reserved;
+ UINT32 FunctionId;
+
+} ACPI_TPM2_ARM_SMC;
+
+/* Values for InterruptFlags above */
+
+#define ACPI_TPM2_INTERRUPT_SUPPORT (1)
+
+/* Values for OperationFlags above */
+
+#define ACPI_TPM2_IDLE_SUPPORT (1)
/*******************************************************************************
@@ -1834,6 +1901,30 @@ typedef struct acpi_table_wdrt
} ACPI_TABLE_WDRT;
+/*******************************************************************************
+ *
+ * WSMT - Windows SMM Security Migrations Table
+ * Version 1
+ *
+ * Conforms to "Windows SMM Security Migrations Table",
+ * Version 1.0, April 18, 2016
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_wsmt
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT32 ProtectionFlags;
+
+} ACPI_TABLE_WSMT;
+
+/* Flags for ProtectionFlags field above */
+
+#define ACPI_WSMT_FIXED_COMM_BUFFERS (1)
+#define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2)
+#define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION (4)
+
+
/* Reset to default packing */
#pragma pack()
diff --git a/sys/contrib/dev/acpica/include/actbl3.h b/sys/contrib/dev/acpica/include/actbl3.h
index cb9910d..80b6ae1 100644
--- a/sys/contrib/dev/acpica/include/actbl3.h
+++ b/sys/contrib/dev/acpica/include/actbl3.h
@@ -229,6 +229,11 @@ typedef struct acpi_table_bgrt
} ACPI_TABLE_BGRT;
+/* Flags for Status field above */
+
+#define ACPI_BGRT_DISPLAYED (1)
+#define ACPI_BGRT_ORIENTATION_OFFSET (3 << 1)
+
/*******************************************************************************
*
@@ -651,7 +656,7 @@ typedef struct acpi_mpst_shared
/*******************************************************************************
*
* PCCT - Platform Communications Channel Table (ACPI 5.0)
- * Version 1
+ * Version 2 (ACPI 6.2)
*
******************************************************************************/
@@ -674,7 +679,9 @@ enum AcpiPcctType
ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
- ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+ ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
+ ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
+ ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};
/*
@@ -704,7 +711,7 @@ typedef struct acpi_pcct_subspace
typedef struct acpi_pcct_hw_reduced
{
ACPI_SUBTABLE_HEADER Header;
- UINT32 DoorbellInterrupt;
+ UINT32 PlatformInterrupt;
UINT8 Flags;
UINT8 Reserved;
UINT64 BaseAddress;
@@ -724,7 +731,7 @@ typedef struct acpi_pcct_hw_reduced
typedef struct acpi_pcct_hw_reduced_type2
{
ACPI_SUBTABLE_HEADER Header;
- UINT32 DoorbellInterrupt;
+ UINT32 PlatformInterrupt;
UINT8 Flags;
UINT8 Reserved;
UINT64 BaseAddress;
@@ -735,13 +742,75 @@ typedef struct acpi_pcct_hw_reduced_type2
UINT32 Latency;
UINT32 MaxAccessRate;
UINT16 MinTurnaroundTime;
- ACPI_GENERIC_ADDRESS DoorbellAckRegister;
+ ACPI_GENERIC_ADDRESS PlatformAckRegister;
UINT64 AckPreserveMask;
UINT64 AckWriteMask;
} ACPI_PCCT_HW_REDUCED_TYPE2;
+/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_master
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 PlatformInterrupt;
+ UINT8 Flags;
+ UINT8 Reserved1;
+ UINT64 BaseAddress;
+ UINT32 Length;
+ ACPI_GENERIC_ADDRESS DoorbellRegister;
+ UINT64 PreserveMask;
+ UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT32 MinTurnaroundTime;
+ ACPI_GENERIC_ADDRESS PlatformAckRegister;
+ UINT64 AckPreserveMask;
+ UINT64 AckSetMask;
+ UINT64 Reserved2;
+ ACPI_GENERIC_ADDRESS CmdCompleteRegister;
+ UINT64 CmdCompleteMask;
+ ACPI_GENERIC_ADDRESS CmdUpdateRegister;
+ UINT64 CmdUpdatePreserveMask;
+ UINT64 CmdUpdateSetMask;
+ ACPI_GENERIC_ADDRESS ErrorStatusRegister;
+ UINT64 ErrorStatusMask;
+
+} ACPI_PCCT_EXT_PCC_MASTER;
+
+
+/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_slave
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 PlatformInterrupt;
+ UINT8 Flags;
+ UINT8 Reserved1;
+ UINT64 BaseAddress;
+ UINT32 Length;
+ ACPI_GENERIC_ADDRESS DoorbellRegister;
+ UINT64 PreserveMask;
+ UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT32 MinTurnaroundTime;
+ ACPI_GENERIC_ADDRESS PlatformAckRegister;
+ UINT64 AckPreserveMask;
+ UINT64 AckSetMask;
+ UINT64 Reserved2;
+ ACPI_GENERIC_ADDRESS CmdCompleteRegister;
+ UINT64 CmdCompleteMask;
+ ACPI_GENERIC_ADDRESS CmdUpdateRegister;
+ UINT64 CmdUpdatePreserveMask;
+ UINT64 CmdUpdateSetMask;
+ ACPI_GENERIC_ADDRESS ErrorStatusRegister;
+ UINT64 ErrorStatusMask;
+
+} ACPI_PCCT_EXT_PCC_SLAVE;
+
+
/* Values for doorbell flags above */
#define ACPI_PCCT_INTERRUPT_POLARITY (1)
@@ -763,6 +832,18 @@ typedef struct acpi_pcct_shared_memory
} ACPI_PCCT_SHARED_MEMORY;
+/* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_shared_memory
+{
+ UINT32 Signature;
+ UINT32 Flags;
+ UINT32 Length;
+ UINT32 Command;
+
+} ACPI_PCCT_EXT_PCC_SHARED_MEMORY;
+
+
/*******************************************************************************
*
* PMTT - Platform Memory Topology Table (ACPI 5.0)
diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h
index 787ceee..1839f93 100644
--- a/sys/contrib/dev/acpica/include/actypes.h
+++ b/sys/contrib/dev/acpica/include/actypes.h
@@ -155,9 +155,9 @@
/* acpisrc:StructDefs -- for acpisrc conversion */
/*
- * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
- * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
- * 12/2006.
+ * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent
+ * header and must be either 32 or 64. 16-bit ACPICA is no longer
+ * supported, as of 12/2006.
*/
#ifndef ACPI_MACHINE_WIDTH
#error ACPI_MACHINE_WIDTH not defined
@@ -196,9 +196,9 @@
* INT64 64-bit (8 byte) signed value
*
* COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
- * compiler-dependent header(s) and were introduced because there is no common
- * 64-bit integer type across the various compilation models, as shown in
- * the table below.
+ * compiler-dependent header(s) and were introduced because there is no
+ * common 64-bit integer type across the various compilation models, as
+ * shown in the table below.
*
* Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit
* char 8 8 8 8 8 8
@@ -215,10 +215,10 @@
* 2) These types represent the native word size of the target mode of the
* processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
* usually used for memory allocation, efficient loop counters, and array
- * indexes. The types are similar to the size_t type in the C library and are
- * required because there is no C type that consistently represents the native
- * data width. ACPI_SIZE is needed because there is no guarantee that a
- * kernel-level C library is present.
+ * indexes. The types are similar to the size_t type in the C library and
+ * are required because there is no C type that consistently represents the
+ * native data width. ACPI_SIZE is needed because there is no guarantee
+ * that a kernel-level C library is present.
*
* ACPI_SIZE 16/32/64-bit unsigned value
* ACPI_NATIVE_INT 16/32/64-bit signed value
@@ -276,12 +276,14 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#define ACPI_MAX_PTR ACPI_UINT64_MAX
#define ACPI_SIZE_MAX ACPI_UINT64_MAX
#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
+#define ACPI_USE_NATIVE_MATH64 /* Has native 64-bit integer support */
/*
* In the case of the Itanium Processor Family (IPF), the hardware does not
- * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
- * to indicate that special precautions must be taken to avoid alignment faults.
- * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
+ * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
+ * flag to indicate that special precautions must be taken to avoid alignment
+ * faults. (IA64 or ia64 is currently used by existing compilers to indicate
+ * IPF.)
*
* Note: EM64T and other X86-64 processors support misaligned transfers,
* so there is no need to define this flag.
@@ -422,8 +424,8 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#endif
/*
- * Some compilers complain about unused variables. Sometimes we don't want to
- * use all the variables (for example, _AcpiModuleName). This allows us
+ * Some compilers complain about unused variables. Sometimes we don't want
+ * to use all the variables (for example, _AcpiModuleName). This allows us
* to tell the compiler in a per-variable manner that a variable
* is unused
*/
@@ -432,8 +434,9 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#endif
/*
- * All ACPICA external functions that are available to the rest of the kernel
- * are tagged with thes macros which can be defined as appropriate for the host.
+ * All ACPICA external functions that are available to the rest of the
+ * kernel are tagged with these macros which can be defined as appropriate
+ * for the host.
*
* Notes:
* ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
@@ -498,7 +501,8 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
/******************************************************************************
*
- * ACPI Specification constants (Do not change unless the specification changes)
+ * ACPI Specification constants (Do not change unless the specification
+ * changes)
*
*****************************************************************************/
@@ -604,10 +608,10 @@ typedef UINT8 ACPI_OWNER_ID;
#define ACPI_DO_NOT_WAIT 0
/*
- * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits.
- * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this
- * pertains to the ACPI integer type only, not to other integers used in the
- * implementation of the ACPICA subsystem.
+ * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are
+ * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits.
+ * Note that this pertains to the ACPI integer type only, not to other
+ * integers used in the implementation of the ACPICA subsystem.
*
* 01/2010: This type is obsolete and has been removed from the entire ACPICA
* code base. It remains here for compatibility with device drivers that use
@@ -672,6 +676,13 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
+/*
+ * Algorithm to obtain access bit width.
+ * Can be used with AccessWidth of ACPI_GENERIC_ADDRESS and AccessSize of
+ * ACPI_RESOURCE_GENERIC_REGISTER.
+ */
+#define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2))
+
/*******************************************************************************
*
@@ -749,8 +760,9 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
#define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D
+#define ACPI_NOTIFY_MEMORY_UPDATE (UINT8) 0x0E
-#define ACPI_GENERIC_NOTIFY_MAX 0x0D
+#define ACPI_GENERIC_NOTIFY_MAX 0x0E
#define ACPI_SPECIFIC_NOTIFY_MAX 0x84
/*
@@ -787,10 +799,11 @@ typedef UINT32 ACPI_OBJECT_TYPE;
/*
* These are object types that do not map directly to the ACPI
- * ObjectType() operator. They are used for various internal purposes only.
- * If new predefined ACPI_TYPEs are added (via the ACPI specification), these
- * internal types must move upwards. (There is code that depends on these
- * values being contiguous with the external types above.)
+ * ObjectType() operator. They are used for various internal purposes
+ * only. If new predefined ACPI_TYPEs are added (via the ACPI
+ * specification), these internal types must move upwards. (There
+ * is code that depends on these values being contiguous with the
+ * external types above.)
*/
#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
@@ -891,7 +904,7 @@ typedef UINT32 ACPI_EVENT_STATUS;
* | | | | +-- Type of dispatch:to method, handler, notify, or none
* | | | +----- Interrupt type: edge or level triggered
* | | +------- Is a Wake GPE
- * | +--------- Is GPE masked by the software GPE masking machanism
+ * | +--------- Is GPE masked by the software GPE masking mechanism
* +------------ <Reserved>
*/
#define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00
@@ -1037,8 +1050,8 @@ typedef struct acpi_sleep_functions
*/
/*
- * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element
- * or an unresolved named reference.
+ * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package
+ * element or an unresolved named reference.
*/
typedef union acpi_object
{
@@ -1361,7 +1374,7 @@ typedef struct acpi_pnp_device_id_list
/*
* Structure returned from AcpiGetObjectInfo.
- * Optimized for both 32- and 64-bit builds
+ * Optimized for both 32-bit and 64-bit builds.
*/
typedef struct acpi_device_info
{
diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h
index 3ad5341..f6cfe08 100644
--- a/sys/contrib/dev/acpica/include/acutils.h
+++ b/sys/contrib/dev/acpica/include/acutils.h
@@ -194,6 +194,7 @@ extern const char *AcpiGbl_BpbDecode[];
extern const char *AcpiGbl_SbDecode[];
extern const char *AcpiGbl_FcDecode[];
extern const char *AcpiGbl_PtDecode[];
+extern const char *AcpiGbl_PtypDecode[];
#endif
/*
@@ -844,7 +845,7 @@ ACPI_GENERIC_STATE *
AcpiUtCreatePkgState (
void *InternalObject,
void *ExternalObject,
- UINT16 Index);
+ UINT32 Index);
ACPI_STATUS
AcpiUtCreateUpdateStateAndPush (
@@ -878,6 +879,24 @@ AcpiUtShortDivide (
UINT64 *OutQuotient,
UINT32 *OutRemainder);
+ACPI_STATUS
+AcpiUtShortMultiply (
+ UINT64 InMultiplicand,
+ UINT32 Multiplier,
+ UINT64 *Outproduct);
+
+ACPI_STATUS
+AcpiUtShortShiftLeft (
+ UINT64 Operand,
+ UINT32 Count,
+ UINT64 *OutResult);
+
+ACPI_STATUS
+AcpiUtShortShiftRight (
+ UINT64 Operand,
+ UINT32 Count,
+ UINT64 *OutResult);
+
/*
* utmisc
diff --git a/sys/contrib/dev/acpica/include/acuuid.h b/sys/contrib/dev/acpica/include/acuuid.h
index 407fcb6..ff0f012 100644
--- a/sys/contrib/dev/acpica/include/acuuid.h
+++ b/sys/contrib/dev/acpica/include/acuuid.h
@@ -186,6 +186,11 @@
#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9"
#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d"
+/* Processor Properties (ACPI 6.2) */
+
+#define UUID_CACHE_PROPERTIES "6DC63E77-257E-4E78-A973-A21F2796898D"
+#define UUID_PHYSICAL_PROPERTY "DDE4D59A-AA42-4349-B407-EA40F57D9FB7"
+
/* Miscellaneous */
#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
diff --git a/sys/contrib/dev/acpica/include/amlcode.h b/sys/contrib/dev/acpica/include/amlcode.h
index 4576c7d..9236eed 100644
--- a/sys/contrib/dev/acpica/include/amlcode.h
+++ b/sys/contrib/dev/acpica/include/amlcode.h
@@ -427,6 +427,11 @@
* #A is the number of required arguments
* #T is the number of target operands
* #R indicates whether there is a return value
+ *
+ * These types are used for the top-level dispatch of the AML
+ * opcode. They group similar operators that can share common
+ * front-end code before dispatch to the final code that implements
+ * the operator.
*/
/*
@@ -468,42 +473,42 @@
* The opcode Type is used in a dispatch table, do not change
* or add anything new without updating the table.
*/
-#define AML_TYPE_EXEC_0A_0T_1R 0x00
-#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */
-#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */
-#define AML_TYPE_EXEC_1A_1T_0R 0x03
-#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* Monadic2R */
-#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */
-#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */
-#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* Dyadic2R */
-#define AML_TYPE_EXEC_2A_2T_1R 0x08
-#define AML_TYPE_EXEC_3A_0T_0R 0x09
-#define AML_TYPE_EXEC_3A_1T_1R 0x0A
-#define AML_TYPE_EXEC_6A_0T_1R 0x0B
+#define AML_TYPE_EXEC_0A_0T_1R 0x00 /* 0 Args, 0 Target, 1 RetVal */
+#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* 1 Args, 0 Target, 0 RetVal */
+#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* 1 Args, 0 Target, 1 RetVal */
+#define AML_TYPE_EXEC_1A_1T_0R 0x03 /* 1 Args, 1 Target, 0 RetVal */
+#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* 1 Args, 1 Target, 1 RetVal */
+#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* 2 Args, 0 Target, 0 RetVal */
+#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* 2 Args, 0 Target, 1 RetVal */
+#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* 2 Args, 1 Target, 1 RetVal */
+#define AML_TYPE_EXEC_2A_2T_1R 0x08 /* 2 Args, 2 Target, 1 RetVal */
+#define AML_TYPE_EXEC_3A_0T_0R 0x09 /* 3 Args, 0 Target, 0 RetVal */
+#define AML_TYPE_EXEC_3A_1T_1R 0x0A /* 3 Args, 1 Target, 1 RetVal */
+#define AML_TYPE_EXEC_6A_0T_1R 0x0B /* 6 Args, 0 Target, 1 RetVal */
/* End of types used in dispatch table */
-#define AML_TYPE_LITERAL 0x0B
-#define AML_TYPE_CONSTANT 0x0C
-#define AML_TYPE_METHOD_ARGUMENT 0x0D
-#define AML_TYPE_LOCAL_VARIABLE 0x0E
-#define AML_TYPE_DATA_TERM 0x0F
+#define AML_TYPE_LITERAL 0x0C
+#define AML_TYPE_CONSTANT 0x0D
+#define AML_TYPE_METHOD_ARGUMENT 0x0E
+#define AML_TYPE_LOCAL_VARIABLE 0x0F
+#define AML_TYPE_DATA_TERM 0x10
/* Generic for an op that returns a value */
-#define AML_TYPE_METHOD_CALL 0x10
+#define AML_TYPE_METHOD_CALL 0x11
/* Miscellaneous types */
-#define AML_TYPE_CREATE_FIELD 0x11
-#define AML_TYPE_CREATE_OBJECT 0x12
-#define AML_TYPE_CONTROL 0x13
-#define AML_TYPE_NAMED_NO_OBJ 0x14
-#define AML_TYPE_NAMED_FIELD 0x15
-#define AML_TYPE_NAMED_SIMPLE 0x16
-#define AML_TYPE_NAMED_COMPLEX 0x17
-#define AML_TYPE_RETURN 0x18
-#define AML_TYPE_UNDEFINED 0x19
-#define AML_TYPE_BOGUS 0x1A
+#define AML_TYPE_CREATE_FIELD 0x12
+#define AML_TYPE_CREATE_OBJECT 0x13
+#define AML_TYPE_CONTROL 0x14
+#define AML_TYPE_NAMED_NO_OBJ 0x15
+#define AML_TYPE_NAMED_FIELD 0x16
+#define AML_TYPE_NAMED_SIMPLE 0x17
+#define AML_TYPE_NAMED_COMPLEX 0x18
+#define AML_TYPE_RETURN 0x19
+#define AML_TYPE_UNDEFINED 0x1A
+#define AML_TYPE_BOGUS 0x1B
/* AML Package Length encodings */
diff --git a/sys/contrib/dev/acpica/include/amlresrc.h b/sys/contrib/dev/acpica/include/amlresrc.h
index aee0a05..5f0bcc4 100644
--- a/sys/contrib/dev/acpica/include/amlresrc.h
+++ b/sys/contrib/dev/acpica/include/amlresrc.h
@@ -174,6 +174,7 @@
#define ACPI_RESTAG_DRIVESTRENGTH "_DRS"
#define ACPI_RESTAG_ENDIANNESS "_END"
#define ACPI_RESTAG_FLOWCONTROL "_FLC"
+#define ACPI_RESTAG_FUNCTION "_FUN"
#define ACPI_RESTAG_GRANULARITY "_GRA"
#define ACPI_RESTAG_INTERRUPT "_INT"
#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */
@@ -193,6 +194,8 @@
#define ACPI_RESTAG_PHASE "_PHA"
#define ACPI_RESTAG_PIN "_PIN"
#define ACPI_RESTAG_PINCONFIG "_PPI"
+#define ACPI_RESTAG_PINCONFIG_TYPE "_TYP"
+#define ACPI_RESTAG_PINCONFIG_VALUE "_VAL"
#define ACPI_RESTAG_POLARITY "_POL"
#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
@@ -636,6 +639,116 @@ typedef struct aml_resource_uart_serialbus
#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_UART_MIN_DATA_LEN 10
+typedef struct aml_resource_pin_function
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ UINT8 RevisionId;
+ UINT16 Flags;
+ UINT8 PinConfig;
+ UINT16 FunctionNumber;
+ UINT16 PinTableOffset;
+ UINT8 ResSourceIndex;
+ UINT16 ResSourceOffset;
+ UINT16 VendorOffset;
+ UINT16 VendorLength;
+ /*
+ * Optional fields follow immediately:
+ * 1) PIN list (Words)
+ * 2) Resource Source String
+ * 3) Vendor Data bytes
+ */
+
+} AML_RESOURCE_PIN_FUNCTION;
+
+#define AML_RESOURCE_PIN_FUNCTION_REVISION 1 /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_config
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ UINT8 RevisionId;
+ UINT16 Flags;
+ UINT8 PinConfigType;
+ UINT32 PinConfigValue;
+ UINT16 PinTableOffset;
+ UINT8 ResSourceIndex;
+ UINT16 ResSourceOffset;
+ UINT16 VendorOffset;
+ UINT16 VendorLength;
+ /*
+ * Optional fields follow immediately:
+ * 1) PIN list (Words)
+ * 2) Resource Source String
+ * 3) Vendor Data bytes
+ */
+
+} AML_RESOURCE_PIN_CONFIG;
+
+#define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_group
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ UINT8 RevisionId;
+ UINT16 Flags;
+ UINT16 PinTableOffset;
+ UINT16 LabelOffset;
+ UINT16 VendorOffset;
+ UINT16 VendorLength;
+ /*
+ * Optional fields follow immediately:
+ * 1) PIN list (Words)
+ * 2) Resource Label String
+ * 3) Vendor Data bytes
+ */
+
+} AML_RESOURCE_PIN_GROUP;
+
+#define AML_RESOURCE_PIN_GROUP_REVISION 1 /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_group_function
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ UINT8 RevisionId;
+ UINT16 Flags;
+ UINT16 FunctionNumber;
+ UINT8 ResSourceIndex;
+ UINT16 ResSourceOffset;
+ UINT16 ResSourceLabelOffset;
+ UINT16 VendorOffset;
+ UINT16 VendorLength;
+ /*
+ * Optional fields follow immediately:
+ * 1) Resource Source String
+ * 2) Resource Source Label String
+ * 3) Vendor Data bytes
+ */
+
+} AML_RESOURCE_PIN_GROUP_FUNCTION;
+
+#define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION 1 /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_group_config
+{
+ AML_RESOURCE_LARGE_HEADER_COMMON
+ UINT8 RevisionId;
+ UINT16 Flags;
+ UINT8 PinConfigType;
+ UINT32 PinConfigValue;
+ UINT8 ResSourceIndex;
+ UINT16 ResSourceOffset;
+ UINT16 ResSourceLabelOffset;
+ UINT16 VendorOffset;
+ UINT16 VendorLength;
+ /*
+ * Optional fields follow immediately:
+ * 1) Resource Source String
+ * 2) Resource Source Label String
+ * 3) Vendor Data bytes
+ */
+
+} AML_RESOURCE_PIN_GROUP_CONFIG;
+
+#define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION 1 /* ACPI 6.2 */
/* restore default alignment */
@@ -680,6 +793,11 @@ typedef union aml_resource
AML_RESOURCE_SPI_SERIALBUS SpiSerialBus;
AML_RESOURCE_UART_SERIALBUS UartSerialBus;
AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
+ AML_RESOURCE_PIN_FUNCTION PinFunction;
+ AML_RESOURCE_PIN_CONFIG PinConfig;
+ AML_RESOURCE_PIN_GROUP PinGroup;
+ AML_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction;
+ AML_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig;
/* Utility overlays */
diff --git a/sys/contrib/dev/acpica/include/platform/acenv.h b/sys/contrib/dev/acpica/include/platform/acenv.h
index 8f224fe..c37ba81 100644
--- a/sys/contrib/dev/acpica/include/platform/acenv.h
+++ b/sys/contrib/dev/acpica/include/platform/acenv.h
@@ -398,6 +398,11 @@
#define ACPI_INLINE
#endif
+/* Use ordered initialization if compiler doesn't support designated. */
+#ifndef ACPI_STRUCT_INIT
+#define ACPI_STRUCT_INIT(field, value) value
+#endif
+
/*
* Configurable calling conventions:
*
diff --git a/sys/contrib/dev/acpica/include/platform/acfreebsd.h b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
index 40e58ab..dc8aaa0 100644
--- a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
+++ b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
@@ -169,6 +169,7 @@
#define ACPI_USE_DO_WHILE_0
#define ACPI_USE_LOCAL_CACHE
#define ACPI_USE_NATIVE_DIVIDE
+#define ACPI_USE_NATIVE_MATH64
#define ACPI_USE_SYSTEM_CLIBRARY
#ifdef _KERNEL
diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h
index 84c278d..fcb1fa6 100644
--- a/sys/contrib/dev/acpica/include/platform/acgcc.h
+++ b/sys/contrib/dev/acpica/include/platform/acgcc.h
@@ -157,8 +157,18 @@
* Use compiler specific <stdarg.h> is a good practice for even when
* -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
*/
+#ifndef va_arg
+#ifdef ACPI_USE_BUILTIN_STDARG
+typedef __builtin_va_list va_list;
+#define va_start(v, l) __builtin_va_start(v, l)
+#define va_end(v) __builtin_va_end(v)
+#define va_arg(v, l) __builtin_va_arg(v, l)
+#define va_copy(d, s) __builtin_va_copy(d, s)
+#else
#include <stdarg.h>
#endif
+#endif
+#endif
#define ACPI_INLINE __inline__
@@ -184,4 +194,8 @@
#define COMPILER_VA_MACRO 1
+/* GCC supports native multiply/shift on 32-bit platforms */
+
+#define ACPI_USE_NATIVE_MATH64
+
#endif /* __ACGCC_H__ */
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
index 8bba7e7..1b96e88 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
@@ -984,9 +984,9 @@ AcpiOsWaitSemaphore (
{
ACPI_STATUS Status = AE_OK;
sem_t *Sem = (sem_t *) Handle;
+ int RetVal;
#ifndef ACPI_USE_ALTERNATE_TIMEOUT
struct timespec Time;
- int RetVal;
#endif
@@ -1016,12 +1016,17 @@ AcpiOsWaitSemaphore (
case ACPI_WAIT_FOREVER:
- if (sem_wait (Sem))
+ while (((RetVal = sem_wait (Sem)) == -1) && (errno == EINTR))
+ {
+ continue; /* Restart if interrupted */
+ }
+ if (RetVal != 0)
{
Status = (AE_TIME);
}
break;
+
/* Wait with MsecTimeout */
default:
@@ -1075,7 +1080,8 @@ AcpiOsWaitSemaphore (
while (((RetVal = sem_timedwait (Sem, &Time)) == -1) && (errno == EINTR))
{
- continue;
+ continue; /* Restart if interrupted */
+
}
if (RetVal != 0)
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index cbba9bf..ec6b0db 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -339,6 +339,15 @@ acpi_Startup(void)
started = 1;
/*
+ * Initialize the ACPICA subsystem.
+ */
+ if (ACPI_FAILURE(status = AcpiInitializeSubsystem())) {
+ printf("ACPI: Could not initialize Subsystem: %s\n",
+ AcpiFormatException(status));
+ return_VALUE (status);
+ }
+
+ /*
* Pre-allocate space for RSDT/XSDT and DSDT tables and allow resizing
* if more tables exist.
*/
@@ -485,14 +494,6 @@ acpi_attach(device_t dev)
AcpiDbgLevel = 0;
#endif
- /* Start up the ACPI CA subsystem. */
- status = AcpiInitializeSubsystem();
- if (ACPI_FAILURE(status)) {
- device_printf(dev, "Could not initialize Subsystem: %s\n",
- AcpiFormatException(status));
- goto out;
- }
-
/* Override OS interfaces if the user requested. */
acpi_reset_interfaces(dev);
diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile
index a2f486d..2f24d80 100644
--- a/usr.sbin/acpi/acpidb/Makefile
+++ b/usr.sbin/acpi/acpidb/Makefile
@@ -18,8 +18,9 @@ SRCS+= dmbuffer.c dmcstyle.c dmdeferred.c dmnames.c dmopcode.c \
# components/dispatcher
SRCS+= dsargs.c dscontrol.c dsdebug.c dsfield.c dsinit.c \
- dsmethod.c dsmthdat.c dsobject.c dsopcode.c dsutils.c \
- dswexec.c dswload.c dswload2.c dswscope.c dswstate.c
+ dsmethod.c dsmthdat.c dsobject.c dsopcode.c dspkginit.c \
+ dsutils.c dswexec.c dswload.c dswload2.c dswscope.c \
+ dswstate.c
# components/events
SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c \
@@ -64,9 +65,9 @@ SRCS+= utaddress.c utalloc.c utascii.c utbuffer.c utcache.c \
utcopy.c utdebug.c utdecode.c utdelete.c uterror.c \
uteval.c utexcep.c utglobal.c uthex.c utids.c utinit.c \
utlock.c utmath.c utmisc.c utmutex.c utnonansi.c \
- utobject.c utosi.c utownerid.c utpredef.c utresrc.c \
- utstate.c utstring.c utstrtoul64.c uttrack.c utuuid.c \
- utxface.c utxferror.c utxfinit.c
+ utobject.c utosi.c utownerid.c utpredef.c utresdecode.c \
+ utresrc.c utstate.c utstring.c utstrtoul64.c uttrack.c \
+ utuuid.c utxface.c utxferror.c utxfinit.c
# os_specific/service_layers
SRCS+= osgendbg.c osunixxf.c
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index 91f50f0..77a13ec 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -5,8 +5,8 @@ PROG= iasl
# common
SRCS= acfileio.c adfile.c adisasm.c adwalk.c ahids.c \
ahpredef.c ahtable.c ahuuids.c cmfsize.c dmextern.c \
- dmrestag.c dmtable.c dmtables.c dmtbdump.c dmtbinfo.c \
- getopt.c
+ dmrestag.c dmswitch.c dmtable.c dmtables.c dmtbdump.c \
+ dmtbinfo.c getopt.c
# compiler
SRCS+= aslanalyze.c aslascii.c aslbtypes.c aslcodegen.c \
@@ -17,18 +17,19 @@ SRCS+= aslanalyze.c aslascii.c aslbtypes.c aslcodegen.c \
asllookup.c aslmain.c aslmap.c aslmapenter.c \
aslmapoutput.c aslmaputils.c aslmessages.c aslmethod.c \
aslnamesp.c asloffset.c aslopcodes.c asloperands.c \
- aslopt.c asloptions.c aslpld.c aslpredef.c aslprepkg.c \
- aslprintf.c aslprune.c aslresource.c aslrestype1.c \
- aslrestype1i.c aslrestype2.c aslrestype2d.c \
- aslrestype2e.c aslrestype2q.c aslrestype2s.c \
- aslrestype2w.c aslstartup.c aslstubs.c asltransform.c \
- asltree.c aslutils.c asluuid.c aslwalks.c aslxref.c \
- aslxrefout.c cvcompiler.c cvdisasm.c cvparser.c \
- dtcompile.c dtexpress.c dtfield.c dtio.c dtparser.y.h \
- dtparserlex.c dtparserparse.c dtsubtable.c dttable.c \
- dttable1.c dttable2.c dttemplate.c dtutils.c \
- prexpress.c prmacros.c prparser.y.h prparserlex.c \
- prparserparse.c prscan.c prutils.c
+ aslopt.c asloptions.c aslparseop.c aslpld.c aslpredef.c \
+ aslprepkg.c aslprintf.c aslprune.c aslresource.c \
+ aslrestype1.c aslrestype1i.c aslrestype2.c \
+ aslrestype2d.c aslrestype2e.c aslrestype2q.c \
+ aslrestype2s.c aslrestype2w.c aslstartup.c aslstubs.c \
+ asltransform.c asltree.c aslutils.c asluuid.c \
+ aslwalks.c aslxref.c aslxrefout.c cvcompiler.c \
+ cvdisasm.c cvparser.c dtcompile.c dtexpress.c dtfield.c \
+ dtio.c dtparser.y.h dtparserlex.c dtparserparse.c \
+ dtsubtable.c dttable.c dttable1.c dttable2.c \
+ dttemplate.c dtutils.c prexpress.c prmacros.c \
+ prparser.y.h prparserlex.c prparserparse.c prscan.c \
+ prutils.c
# components/debugger
SRCS+= dbfileio.c
@@ -40,8 +41,8 @@ SRCS+= dmbuffer.c dmcstyle.c dmdeferred.c dmnames.c dmopcode.c \
# components/dispatcher
SRCS+= dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c \
- dsutils.c dswexec.c dswload.c dswload2.c dswscope.c \
- dswstate.c
+ dspkginit.c dsutils.c dswexec.c dswload.c dswload2.c \
+ dswscope.c dswstate.c
# components/executer
SRCS+= exconcat.c exconvrt.c excreate.c exdump.c exmisc.c \
@@ -66,8 +67,8 @@ SRCS+= utaddress.c utalloc.c utascii.c utbuffer.c utcache.c \
utcopy.c utdebug.c utdecode.c utdelete.c uterror.c \
utexcep.c utglobal.c uthex.c utinit.c utlock.c utmath.c \
utmisc.c utmutex.c utnonansi.c utobject.c utownerid.c \
- utpredef.c utresrc.c utstate.c utstring.c utstrtoul64.c \
- utuuid.c utxface.c utxferror.c
+ utpredef.c utresdecode.c utresrc.c utstate.c utstring.c \
+ utstrtoul64.c utuuid.c utxface.c utxferror.c
# os_specific/service_layers
SRCS+= osunixxf.c
OpenPOWER on IntegriCloud