--- sys/conf/files 2011-11-23 15:26:53.000000000 -0500 +++ sys/conf/files 2011-11-23 18:34:10.000000000 -0500 @@ -172,6 +172,7 @@ contrib/dev/acpica/disassembler/dmobject.c optional acpi acpi_debug contrib/dev/acpica/disassembler/dmresrc.c optional acpi acpi_debug contrib/dev/acpica/disassembler/dmresrcl.c optional acpi acpi_debug +contrib/dev/acpica/disassembler/dmresrcl2.c optional acpi acpi_debug contrib/dev/acpica/disassembler/dmresrcs.c optional acpi acpi_debug contrib/dev/acpica/disassembler/dmutils.c optional acpi acpi_debug contrib/dev/acpica/disassembler/dmwalk.c optional acpi acpi_debug @@ -272,6 +273,7 @@ contrib/dev/acpica/resources/rslist.c optional acpi contrib/dev/acpica/resources/rsmemory.c optional acpi contrib/dev/acpica/resources/rsmisc.c optional acpi +contrib/dev/acpica/resources/rsserial.c optional acpi contrib/dev/acpica/resources/rsutils.c optional acpi contrib/dev/acpica/resources/rsxface.c optional acpi contrib/dev/acpica/tables/tbfadt.c optional acpi @@ -300,6 +302,7 @@ contrib/dev/acpica/utilities/utstate.c optional acpi contrib/dev/acpica/utilities/utxface.c optional acpi contrib/dev/acpica/utilities/utxferror.c optional acpi +contrib/dev/acpica/utilities/utxfmutex.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ --- sys/contrib/dev/acpica/acpica_prep.sh 2011-04-18 12:32:27.000000000 -0400 +++ sys/contrib/dev/acpica/acpica_prep.sh 2011-11-23 18:32:20.000000000 -0500 @@ -15,16 +15,14 @@ # files that should keep their full directory path fulldirs="common compiler debugger disassembler dispatcher events \ - executer hardware include namespace parser resources tables \ - tools utilities" + executer hardware include namespace os_specific parser \ + resources tables utilities" # files to remove -stripdirs="acpinames acpisrc acpixtract examples generate os_specific \ - tests" +stripdirs="generate tests tools" stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ - acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \ - aehandlers.c aemain.c aetables.c aetables.h osunixdir.c \ - readme.txt utclib.c" + acos2.h accygwin.h acefi.h acwin.h acwin64.h osunixdir.c \ + oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" # include files to canonify src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \ @@ -32,7 +30,7 @@ aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \ acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \ acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ - actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ + actbl2.h actbl3.h actypes.h acutils.h amlcode.h amlresrc.h \ platform/acenv.h platform/acfreebsd.h platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ asltypes.h dtcompiler.h dttemplate.h" @@ -84,7 +82,7 @@ rm -rf ${wrk} # assist the developer in generating a diff -echo "Directories you may want to 'cvs diff':" +echo "Directories you may want to 'svn diff':" echo " src/sys/contrib/dev/acpica src/sys/dev/acpica \\" echo " src/sys/amd64/acpica src/sys/i386/acpica src/sys/ia64/acpica \\" echo " src/sys/amd64/include src/sys/i386/include src/sys/ia64/include \\" --- sys/contrib/dev/acpica/changes.txt 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/changes.txt 2011-11-23 13:29:28.000000000 -0500 @@ -1,7 +1,356 @@ ---------------------------------------- -27 May 2011. Summary of changes for version 20110527: +23 November 2011. Summary of changes for version 20111123: This release is available at www.acpica.org/downloads +The ACPI 5.0 specification is available at www.acpi.info + +0) ACPI 5.0 Support: + +This release contains full support for the ACPI 5.0 specification, as +summarized below. + +Reduced Hardware Support: +------------------------- + +This support allows for ACPI systems without the usual ACPI hardware. This +support is enabled by a flag in the revision 5 FADT. If it is set, ACPICA will +not attempt to initialize or use any of the usual ACPI hardware. Note, when +this flag is set, all of the following ACPI hardware is assumed to be not +present and is not initialized or accessed: + + General Purpose Events (GPEs) + Fixed Events (PM1a/PM1b and PM Control) + Power Management Timer and Console Buttons (power/sleep) + Real-time Clock Alarm + Global Lock + System Control Interrupt (SCI) + The FACS is assumed to be non-existent + +ACPI Tables: +------------ + +All new tables and updates to existing tables are fully supported in the +ACPICA headers (for use by device drivers), the disassembler, and the iASL +Data Table Compiler. ACPI 5.0 defines these new tables: + + BGRT /* Boot Graphics Resource Table */ + DRTM /* Dynamic Root of Trust for Measurement table */ + FPDT /* Firmware Performance Data Table */ + GTDT /* Generic Timer Description Table */ + MPST /* Memory Power State Table */ + PCCT /* Platform Communications Channel Table */ + PMTT /* Platform Memory Topology Table */ + RASF /* RAS Feature table */ + +Operation Regions/SpaceIDs: +--------------------------- + +All new operation regions are fully supported by the iASL compiler, the +disassembler, and the ACPICA runtime code (for dispatch to region handlers.) +The new operation region Space IDs are: + + GeneralPurposeIo + GenericSerialBus + +Resource Descriptors: +--------------------- + +All new ASL resource descriptors are fully supported by the iASL compiler, the +ASL/AML disassembler, and the ACPICA runtime Resource Manager code (including +all new predefined resource tags). New descriptors are: + + FixedDma + GpioIo + GpioInt + I2cSerialBus + SpiSerialBus + UartSerialBus + +ASL/AML Operators, New and Modified: +------------------------------------ + +One new operator is added, the Connection operator, which is used to associate +a GeneralPurposeIo or GenericSerialBus resource descriptor with individual +field objects within an operation region. Several new protocols are associated +with the AccessAs operator. All are fully supported by the iASL compiler, +disassembler, and runtime ACPICA AML interpreter: + + Connection // Declare Field Connection attributes + AccessAs: AttribBytes (n) // Read/Write N-Bytes Protocol + AccessAs: AttribRawBytes (n) // Raw Read/Write N-Bytes Protocol + AccessAs: AttribRawProcessBytes (n) // Raw Process Call Protocol + RawDataBuffer // Data type for Vendor Data fields + +Predefined ASL/AML Objects: +--------------------------- + +All new predefined objects/control-methods are supported by the iASL compiler +and the ACPICA runtime validation/repair (arguments and return values.) New +predefined names include the following: + +Standard Predefined Names (Objects or Control Methods): + _AEI, _CLS, _CPC, _CWS, _DEP, + _DLM, _EVT, _GCP, _CRT, _GWS, + _HRV, _PRE, _PSE, _SRT, _SUB. + +Resource Tags (Names used to access individual fields within resource +descriptors): + _DBT, _DPL, _DRS, _END, _FLC, + _IOR, _LIN, _MOD, _PAR, _PHA, + _PIN, _PPI, _POL, _RXL, _SLV, + _SPE, _STB, _TXL, _VEN. + +ACPICA External Interfaces: +--------------------------- + +Several new interfaces have been defined for use by ACPI-related device +drivers and other host OS services: + +AcpiAcquireMutex and AcpiReleaseMutex: These interfaces allow the host OS to +acquire and release AML mutexes that are defined in the DSDT/SSDT tables +provided by the BIOS. They are intended to be used in conjunction with the +ACPI 5.0 _DLM (Device Lock Method) in order to provide transaction-level +mutual exclusion with the AML code/interpreter. + +AcpiGetEventResources: Returns the (formatted) resource descriptors as defined +by the ACPI 5.0 _AEI object (ACPI Event Information). This object provides +resource descriptors associated with hardware-reduced platform events, similar +to the AcpiGetCurrentResources interface. + +Operation Region Handlers: For General Purpose IO and Generic Serial Bus +operation regions, information about the Connection() object and any optional +length information is passed to the region handler within the Context +parameter. + +AcpiBufferToResource: This interface converts a raw AML buffer containing a +resource template or resource descriptor to the ACPI_RESOURCE internal format +suitable for use by device drivers. Can be used by an operation region handler +to convert the Connection() buffer object into a ACPI_RESOURCE. + +Miscellaneous/Tools/TestSuites: +------------------------------- + +Support for extended _HID names (Four alpha characters instead of three). +Support for ACPI 5.0 features in the AcpiExec and AcpiHelp utilities. +Support for ACPI 5.0 features in the ASLTS test suite. +Fully updated documentation (ACPICA and iASL reference documents.) + +ACPI Table Definition Language: +------------------------------- + +Support for this language was implemented and released as a subsystem of the +iASL compiler in 2010. (See the iASL compiler User Guide.) + + +Non-ACPI 5.0 changes for this release: +-------------------------------------- + +1) ACPICA Core Subsystem: + +Fix a problem with operation region declarations where a failure can occur if +the region name and an argument that evaluates to an object (such as the +region address) are in different namespace scopes. Lin Ming, ACPICA BZ 937. + +Do not abort an ACPI table load if an invalid space ID is found within. This +will be caught later if the offending method is executed. ACPICA BZ 925. + +Fixed an issue with the FFixedHW space ID where the ID was not always +recognized properly (Both ACPICA and iASL). ACPICA BZ 926. + +Fixed a problem with the 32-bit generation of the unix-specific OSL +(osunixxf.c). Lin Ming, ACPICA BZ 936. + +Several changes made to enable generation with the GCC 4.6 compiler. ACPICA BZ +935. + +New error messages: Unsupported I/O requests (not 8/16/32 bit), and Index/Bank +field registers out-of-range. + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented the __PATH__ operator, which returns the full pathname of +the current source file. + +AcpiHelp: Automatically display expanded keyword information for all ASL +operators. + +Debugger: Add "Template" command to disassemble/dump resource template +buffers. + +Added a new master script to generate and execute the ASLTS test suite. +Automatically handles 32- and 64-bit generation. See tests/aslts.sh + +iASL: Fix problem with listing generation during processing of the Switch() +operator where AML listing was disabled until the entire Switch block was +completed. + +iASL: Improve support for semicolon statement terminators. Fix "invalid +character" message for some cases when the semicolon is used. Semicolons are +now allowed after every grammar element. ACPICA BZ 927. + +iASL: Fixed some possible aliasing warnings during generation. ACPICA BZ 923. + +Disassembler: Fix problem with disassembly of the DataTableRegion operator +where an inadvertent "Unhandled deferred opcode" message could be generated. + +3) 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. + + Previous Release: + Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + Current Release: + Non-Debug Version: 92.3K Code, 24.9K Data, 117.2K Total + Debug Version: 170.8K Code, 72.6K Data, 243.4K Total + +---------------------------------------- +22 September 2011. Summary of changes for version 20110922: + +0) ACPI 5.0 News: + +Support for ACPI 5.0 in ACPICA has been underway for several months and will +be released at the same time that ACPI 5.0 is officially released. + +The ACPI 5.0 specification is on track for release in the next few months. + +1) ACPICA Core Subsystem: + +Fixed a problem where the maximum sleep time for the Sleep() operator was +intended to be limited to two seconds, but was inadvertently limited to 20 +seconds instead. + +Linux and Unix makefiles: Added header file dependencies to ensure correct +generation of ACPICA core code and utilities. Also simplified the makefiles +considerably through the use of the vpath variable to specify search paths. +ACPICA BZ 924. + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented support to check the access length for all fields created to +access named Resource Descriptor fields. For example, if a resource field is +defined to be two bits, a warning is issued if a CreateXxxxField() is used +with an incorrect bit length. This is implemented for all current resource +descriptor names. ACPICA BZ 930. + +Disassembler: Fixed a byte ordering problem with the output of 24-bit and 56- +bit integers. + +iASL: Fixed a couple of issues associated with variable-length package +objects. 1) properly handle constants like One, Ones, Zero -- do not make a +VAR_PACKAGE when these are used as a package length. 2) Allow the VAR_PACKAGE +opcode (in addition to PACKAGE) when validating object types for predefined +names. + +iASL: Emit statistics for all output files (instead of just the ASL input and +AML output). Includes listings, hex files, etc. + +iASL: Added -G option to the table compiler to allow the compilation of custom +ACPI tables. The only part of a table that is required is the standard 36-byte +ACPI header. + +AcpiXtract: Ported to the standard ACPICA environment (with ACPICA headers), +which also adds correct 64-bit support. Also, now all output filenames are +completely lower case. + +AcpiExec: Ignore any non-AML tables (tables other than DSDT or SSDT) when +loading table files. A warning is issued for any such tables. The only +exception is an FADT. This also fixes a possible fault when attempting to load +non-AML tables. ACPICA BZ 932. + +AcpiHelp: Added the AccessAs and Offset operators. Fixed a problem where a +missing table terminator could cause a fault when using the -p option. + +AcpiSrc: Fixed a possible divide-by-zero fault when generating file +statistics. + +3) 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. + + Previous Release (VC 9.0): + Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + Current Release (VC 9.0): + Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + + +---------------------------------------- +23 June 2011. Summary of changes for version 20110623: + +1) ACPI CA Core Subsystem: + +Updated the predefined name repair mechanism to not attempt repair of a _TSS +return object if a _PSS object is present. We can only sort the _TSS return +package if there is no _PSS within the same scope. This is because if _PSS is +present, the ACPI specification dictates that the _TSS Power Dissipation field +is to be ignored, and therefore some BIOSs leave garbage values in the _TSS +Power field(s). In this case, it is best to just return the _TSS package as- +is. Reported by, and fixed with assistance from Fenghua Yu. + +Added an option to globally disable the control method return value validation +and repair. This runtime option can be used to disable return value repair if +this is causing a problem on a particular machine. Also added an option to +AcpiExec (-dr) to set this disable flag. + +All makefiles and project files: Major changes to improve generation of ACPICA +tools. ACPICA BZ 912: + Reduce default optimization levels to improve compatibility + For Linux, add strict-aliasing=0 for gcc 4 + Cleanup and simplify use of command line defines + Cleanup multithread library support + Improve usage messages + +Linux-specific header: update handling of THREAD_ID and pthread. For the 32- +bit case, improve casting to eliminate possible warnings, especially with the +acpica tools. + +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. + + Previous Release (VC 9.0): + Non-Debug Version: 90.1K Code, 23.9K Data, 114.0K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + Current Release (VC 9.0): + Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + +2) iASL Compiler/Disassembler and Tools: + +With this release, a new utility named "acpihelp" has been added to the ACPICA +package. This utility summarizes the ACPI specification chapters for the ASL +and AML languages. It generates under Linux/Unix as well as Windows, and +provides the following functionality: + Find/display ASL operator(s) -- with description and syntax. + Find/display ASL keyword(s) -- with exact spelling and descriptions. + Find/display ACPI predefined name(s) -- with description, number + of arguments, and the return value data type. + Find/display AML opcode name(s) -- with opcode, arguments, and grammar. + Decode/display AML opcode -- with opcode name, arguments, and grammar. + +Service Layers: Make multi-thread support configurable. Conditionally compile +the multi-thread support so that threading libraries will not be linked if not +necessary. The only tool that requires multi-thread support is AcpiExec. + +iASL: Update yyerrror/AslCompilerError for "const" errors. Newer versions of +Bison appear to want the interface to yyerror to be a const char * (or at +least this is a problem when generating iASL on some systems.) ACPICA BZ 923 +Pierre Lejeune. + +Tools: Fix for systems where O_BINARY is not defined. Only used for Windows +versions of the tools. + +---------------------------------------- +27 May 2011. Summary of changes for version 20110527: 1) ACPI CA Core Subsystem: --- sys/contrib/dev/acpica/common/adisasm.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/common/adisasm.c 2011-11-23 13:29:28.000000000 -0500 @@ -868,6 +868,7 @@ break; case AML_REGION_OP: + case AML_DATA_REGION_OP: case AML_CREATE_QWORD_FIELD_OP: case AML_CREATE_DWORD_FIELD_OP: case AML_CREATE_WORD_FIELD_OP: --- sys/contrib/dev/acpica/common/adwalk.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/common/adwalk.c 2011-11-23 13:29:29.000000000 -0500 @@ -378,6 +378,10 @@ AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer); break; + case AML_QWORD_OP: + AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); + break; + case AML_INT_NAMEPATH_OP: if (Op->Common.Value.String) { --- sys/contrib/dev/acpica/common/dmrestag.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/common/dmrestag.c 2011-11-23 13:29:29.000000000 -0500 @@ -63,7 +63,7 @@ static char * AcpiDmSearchTagList ( UINT32 BitIndex, - ACPI_RESOURCE_TAG *TagList); + const ACPI_RESOURCE_TAG *TagList); static char * AcpiDmGetResourceTag ( @@ -108,7 +108,7 @@ * ******************************************************************************/ -static ACPI_RESOURCE_TAG AcpiDmIrqTags[] = +static const ACPI_RESOURCE_TAG AcpiDmIrqTags[] = { {( 1 * 8), ACPI_RESTAG_INTERRUPT}, {( 3 * 8) + 0, ACPI_RESTAG_INTERRUPTTYPE}, @@ -117,7 +117,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmDmaTags[] = +static const ACPI_RESOURCE_TAG AcpiDmDmaTags[] = { {( 1 * 8), ACPI_RESTAG_DMA}, {( 2 * 8) + 0, ACPI_RESTAG_XFERTYPE}, @@ -126,7 +126,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmIoTags[] = +static const ACPI_RESOURCE_TAG AcpiDmIoTags[] = { {( 1 * 8) + 0, ACPI_RESTAG_DECODE}, {( 2 * 8), ACPI_RESTAG_MINADDR}, @@ -136,14 +136,22 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmFixedIoTags[] = +static const ACPI_RESOURCE_TAG AcpiDmFixedIoTags[] = { {( 1 * 8), ACPI_RESTAG_BASEADDRESS}, {( 3 * 8), ACPI_RESTAG_LENGTH}, {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmFixedDmaTags[] = +{ + {( 1 * 8), ACPI_RESTAG_DMA}, + {( 3 * 8), ACPI_RESTAG_DMATYPE}, + {( 5 * 8), ACPI_RESTAG_XFERTYPE}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] = { {( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 4 * 8), ACPI_RESTAG_MINADDR}, @@ -153,7 +161,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmRegisterTags[] = +static const ACPI_RESOURCE_TAG AcpiDmRegisterTags[] = { {( 3 * 8), ACPI_RESTAG_ADDRESSSPACE}, {( 4 * 8), ACPI_RESTAG_REGISTERBITWIDTH}, @@ -163,7 +171,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] = { {( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 4 * 8), ACPI_RESTAG_MINADDR}, @@ -173,7 +181,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] = { {( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 4 * 8), ACPI_RESTAG_BASEADDRESS}, @@ -181,7 +189,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmInterruptTags[] = +static const ACPI_RESOURCE_TAG AcpiDmInterruptTags[] = { {( 3 * 8) + 1, ACPI_RESTAG_INTERRUPTTYPE}, {( 3 * 8) + 2, ACPI_RESTAG_INTERRUPTLEVEL}, @@ -190,7 +198,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -203,7 +211,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -216,7 +224,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] = +static const ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -229,7 +237,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] = +static const ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] = { {( 4 * 8) + 1, ACPI_RESTAG_DECODE}, {( 4 * 8) + 2, ACPI_RESTAG_MINTYPE}, @@ -243,9 +251,71 @@ {0, NULL} }; -/* Special-case tables for the type-specific flags */ +/* Subtype tables for GPIO descriptors */ + +static const ACPI_RESOURCE_TAG AcpiDmGpioIntTags[] = +{ + {( 7 * 8) + 0, ACPI_RESTAG_MODE}, + {( 7 * 8) + 1, ACPI_RESTAG_POLARITY}, + {( 7 * 8) + 3, ACPI_RESTAG_INTERRUPTSHARE}, + {( 9 * 8), ACPI_RESTAG_PINCONFIG}, + {(10 * 8), ACPI_RESTAG_DRIVESTRENGTH}, + {(12 * 8), ACPI_RESTAG_DEBOUNCETIME}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmGpioIoTags[] = +{ + {( 7 * 8) + 0, ACPI_RESTAG_IORESTRICTION}, + {( 7 * 8) + 3, ACPI_RESTAG_INTERRUPTSHARE}, + {( 9 * 8), ACPI_RESTAG_PINCONFIG}, + {(10 * 8), ACPI_RESTAG_DRIVESTRENGTH}, + {(12 * 8), ACPI_RESTAG_DEBOUNCETIME}, + {0, NULL} +}; + +/* Subtype tables for SerialBus descriptors */ + +static const ACPI_RESOURCE_TAG AcpiDmI2cSerialBusTags[] = +{ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, + {( 7 * 8) + 0, ACPI_RESTAG_MODE}, + {(12 * 8), ACPI_RESTAG_SPEED}, + {(16 * 8), ACPI_RESTAG_ADDRESS}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmSpiSerialBusTags[] = +{ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, + {( 7 * 8) + 0, ACPI_RESTAG_MODE}, + {( 7 * 8) + 1, ACPI_RESTAG_DEVICEPOLARITY}, + {(12 * 8), ACPI_RESTAG_SPEED}, + {(16 * 8), ACPI_RESTAG_LENGTH}, + {(17 * 8), ACPI_RESTAG_PHASE}, + {(18 * 8), ACPI_RESTAG_POLARITY}, + {(19 * 8), ACPI_RESTAG_ADDRESS}, + {0, NULL} +}; + +static const ACPI_RESOURCE_TAG AcpiDmUartSerialBusTags[] = +{ + {( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */ + {( 7 * 8) + 0, ACPI_RESTAG_FLOWCONTROL}, + {( 7 * 8) + 2, ACPI_RESTAG_STOPBITS}, + {( 7 * 8) + 4, ACPI_RESTAG_LENGTH}, + {( 7 * 8) + 7, ACPI_RESTAG_ENDIANNESS}, + {(12 * 8), ACPI_RESTAG_SPEED}, + {(16 * 8), ACPI_RESTAG_LENGTH_RX}, + {(18 * 8), ACPI_RESTAG_LENGTH_TX}, + {(20 * 8), ACPI_RESTAG_PARITY}, + {(21 * 8), ACPI_RESTAG_LINE}, + {0, NULL} +}; + +/* Subtype tables for Address descriptor type-specific flags */ -static ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] = +static const ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] = { {( 5 * 8) + 0, ACPI_RESTAG_READWRITETYPE}, {( 5 * 8) + 1, ACPI_RESTAG_MEMTYPE}, @@ -254,7 +324,7 @@ {0, NULL} }; -static ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] = +static const ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] = { {( 5 * 8) + 0, ACPI_RESTAG_RANGETYPE}, {( 5 * 8) + 4, ACPI_RESTAG_TYPE}, @@ -263,9 +333,15 @@ }; -/* Dispatch table used to obtain the correct tag table for a descriptor */ - -static ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags [] = +/* + * Dispatch table used to obtain the correct tag table for a descriptor. + * + * A NULL in this table means one of three things: + * 1) The descriptor ID is reserved and invalid + * 2) The descriptor has no tags associated with it + * 3) The descriptor has subtypes and a separate table will be used. + */ +static const ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags[] = { /* Small descriptors */ @@ -279,7 +355,7 @@ NULL, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ AcpiDmIoTags, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */ AcpiDmFixedIoTags, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */ - NULL, /* 0x0A, Reserved */ + AcpiDmFixedDmaTags, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */ NULL, /* 0x0B, Reserved */ NULL, /* 0x0C, Reserved */ NULL, /* 0x0D, Reserved */ @@ -299,9 +375,29 @@ AcpiDmAddress16Tags, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */ AcpiDmInterruptTags, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */ AcpiDmAddress64Tags, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */ - AcpiDmExtendedAddressTags /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_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 */ +}; + +/* GPIO Subtypes */ + +static const ACPI_RESOURCE_TAG *AcpiGbl_GpioResourceTags[] = +{ + AcpiDmGpioIntTags, /* 0x00 Interrupt Connection */ + AcpiDmGpioIoTags /* 0x01 I/O Connection */ }; +/* Serial Bus Subtypes */ + +static const ACPI_RESOURCE_TAG *AcpiGbl_SerialResourceTags[] = +{ + NULL, /* 0x00 Reserved */ + AcpiDmI2cSerialBusTags, /* 0x01 I2C SerialBus */ + AcpiDmSpiSerialBusTags, /* 0x02 SPI SerialBus */ + AcpiDmUartSerialBusTags /* 0x03 UART SerialBus */ +}; /* * Globals used to generate unique resource descriptor names. We use names that @@ -666,6 +762,9 @@ * * DESCRIPTION: Convert a BitIndex into a symbolic resource tag. * + * Note: ResourceIndex should be previously validated and guaranteed to ve + * valid. + * ******************************************************************************/ static char * @@ -674,23 +773,16 @@ AML_RESOURCE *Resource, UINT8 ResourceIndex) { - ACPI_RESOURCE_TAG *TagList; + const ACPI_RESOURCE_TAG *TagList; char *Tag = NULL; /* Get the tag list for this resource descriptor type */ TagList = AcpiGbl_ResourceTags[ResourceIndex]; - if (!TagList) - { - /* There are no tags for this resource type */ - - return (NULL); - } /* - * Handle the type-specific flags field for the address descriptors. - * Kindof brute force, but just blindly search for an index match. + * Handle descriptors that have multiple subtypes */ switch (Resource->DescriptorType) { @@ -699,6 +791,10 @@ case ACPI_RESOURCE_NAME_ADDRESS64: case ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64: + /* + * Subtype differentiation is the flags. + * Kindof brute force, but just blindly search for an index match + */ if (Resource->Address.ResourceType == ACPI_ADDRESS_TYPE_MEMORY_RANGE) { Tag = AcpiDmSearchTagList (BitIndex, AcpiDmMemoryFlagTags); @@ -716,13 +812,42 @@ } break; + case ACPI_RESOURCE_NAME_GPIO: + + /* GPIO connection has 2 subtypes: Interrupt and I/O */ + + if (Resource->Gpio.ConnectionType > AML_RESOURCE_MAX_GPIOTYPE) + { + return (NULL); + } + + TagList = AcpiGbl_GpioResourceTags[Resource->Gpio.ConnectionType]; + break; + + case ACPI_RESOURCE_NAME_SERIAL_BUS: + + /* SerialBus has 3 subtypes: I2C, SPI, and UART */ + + if ((Resource->CommonSerialBus.Type == 0) || + (Resource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)) + { + return (NULL); + } + + TagList = AcpiGbl_SerialResourceTags[Resource->CommonSerialBus.Type]; + break; + default: break; } - /* Search the tag list for this descriptor type */ + /* Search for a match against the BitIndex */ + + if (TagList) + { + Tag = AcpiDmSearchTagList (BitIndex, TagList); + } - Tag = AcpiDmSearchTagList (BitIndex, TagList); return (Tag); } @@ -744,7 +869,7 @@ static char * AcpiDmSearchTagList ( UINT32 BitIndex, - ACPI_RESOURCE_TAG *TagList) + const ACPI_RESOURCE_TAG *TagList) { /* --- sys/contrib/dev/acpica/common/dmtable.c 2011-04-18 12:32:27.000000000 -0400 +++ sys/contrib/dev/acpica/common/dmtable.c 2011-11-23 13:29:29.000000000 -0500 @@ -196,6 +196,16 @@ "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */ "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */ "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */ + "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */ + "Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */ + "Unknown SubTable Type" /* Reserved */ +}; + +static const char *AcpiDmPmttSubnames[] = +{ + "Socket", /* ACPI_PMTT_TYPE_SOCKET */ + "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */ + "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ "Unknown SubTable Type" /* Reserved */ }; @@ -268,6 +278,7 @@ {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"}, {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt, "Boot Graphics Resource Table"}, {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, @@ -275,14 +286,20 @@ {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"}, {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"}, + {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"}, + {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"}, {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, + {ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"}, {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, + {ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"}, + {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"}, + {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt, "S3 Performance Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"}, @@ -400,7 +417,7 @@ /* * Handle tables that don't use the common ACPI table header structure. - * Currently, these are the FACS and RSDP. + * Currently, these are the FACS, RSDP, and S3PT. */ if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) { @@ -411,6 +428,10 @@ { Length = AcpiDmDumpRsdp (Table); } + else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT)) + { + Length = AcpiDmDumpS3pt (Table); + } else { /* @@ -646,6 +667,7 @@ case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: case ACPI_DMT_MADT: + case ACPI_DMT_PMTT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -670,6 +692,10 @@ case ACPI_DMT_SLIC: ByteLength = 4; break; + case ACPI_DMT_UINT40: + ByteLength = 5; + break; + case ACPI_DMT_UINT48: case ACPI_DMT_NAME6: ByteLength = 6; break; @@ -718,6 +744,12 @@ return (AE_BAD_DATA); } + if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) + { + AcpiOsPrintf ("%s", Info->Name); + continue; + } + /* Start a new line and decode the opcode */ AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name); @@ -745,49 +777,42 @@ AcpiOsPrintf ("%1.1X\n", *Target & 0x03); break; - case ACPI_DMT_FLAGS2: + case ACPI_DMT_FLAGS1: - AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03); + AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03); break; - /* Standard Data Types */ - - case ACPI_DMT_UINT8: + case ACPI_DMT_FLAGS2: - AcpiOsPrintf ("%2.2X\n", *Target); + AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03); break; - case ACPI_DMT_UINT16: + case ACPI_DMT_FLAGS4: - AcpiOsPrintf ("%4.4X\n", ACPI_GET16 (Target)); + AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03); break; - case ACPI_DMT_UINT24: - - AcpiOsPrintf ("%2.2X%2.2X%2.2X\n", - *Target, *(Target + 1), *(Target + 2)); - break; + /* Integer Data Types */ + case ACPI_DMT_UINT8: + case ACPI_DMT_UINT16: + case ACPI_DMT_UINT24: case ACPI_DMT_UINT32: - - AcpiOsPrintf ("%8.8X\n", ACPI_GET32 (Target)); - break; - + case ACPI_DMT_UINT40: + case ACPI_DMT_UINT48: case ACPI_DMT_UINT56: - - for (Temp8 = 0; Temp8 < 7; Temp8++) + case ACPI_DMT_UINT64: + /* + * Dump bytes - high byte first, low byte last. + * Note: All ACPI tables are little-endian. + */ + for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--) { - AcpiOsPrintf ("%2.2X", Target[Temp8]); + AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]); } AcpiOsPrintf ("\n"); break; - case ACPI_DMT_UINT64: - - AcpiOsPrintf ("%8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (ACPI_GET64 (Target))); - break; - case ACPI_DMT_BUF7: case ACPI_DMT_BUF16: case ACPI_DMT_BUF128: @@ -1040,6 +1065,19 @@ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]); break; + case ACPI_DMT_PMTT: + + /* PMTT subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_PMTT_TYPE_RESERVED) + { + Temp8 = ACPI_PMTT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]); + break; + case ACPI_DMT_SLIC: /* SLIC subtable types */ --- sys/contrib/dev/acpica/common/dmtbdump.c 2011-04-18 12:32:27.000000000 -0400 +++ sys/contrib/dev/acpica/common/dmtbdump.c 2011-11-23 13:29:29.000000000 -0500 @@ -230,11 +230,18 @@ AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2); } - /* Check for FADT revision 3 fields and up (ACPI 2.0+ extended data) */ + /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */ else if (Table->Length > ACPI_FADT_V2_SIZE) { AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3); + + /* Check for FADT revision 5 fields and up (ACPI 5.0+) */ + + if (Table->Length > ACPI_FADT_V3_SIZE) + { + AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5); + } } /* Validate various fields in the FADT, including length */ @@ -290,6 +297,10 @@ ExpectedLength = ACPI_FADT_V3_SIZE; break; + case 5: + ExpectedLength = ACPI_FADT_V5_SIZE; + break; + default: return; } @@ -751,6 +762,84 @@ /******************************************************************************* * + * FUNCTION: AcpiDmDumpFpdt + * + * PARAMETERS: Table - A FPDT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a FPDT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpFpdt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_FPDT_HEADER *SubTable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_FPDT); + ACPI_DMTABLE_INFO *InfoTable; + + + /* There is no main table (other than the standard ACPI header) */ + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoFpdtHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (SubTable->Type) + { + case ACPI_FPDT_TYPE_BOOT: + InfoTable = AcpiDmTableInfoFpdt0; + break; + case ACPI_FPDT_TYPE_S3PERF: + InfoTable = AcpiDmTableInfoFpdt1; + break; + default: + AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type); + + /* Attempt to continue */ + + if (!SubTable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } + goto NextSubTable; + } + + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + +NextSubTable: + /* Point to next sub-table */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpHest * * PARAMETERS: Table - A HEST table @@ -1134,6 +1223,12 @@ case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: InfoTable = AcpiDmTableInfoMadt10; break; + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + InfoTable = AcpiDmTableInfoMadt11; + break; + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + InfoTable = AcpiDmTableInfoMadt12; + break; default: AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type); @@ -1223,6 +1318,150 @@ /******************************************************************************* * + * FUNCTION: AcpiDmDumpMpst + * + * PARAMETERS: Table - A MPST Table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a MPST table + * + ******************************************************************************/ + +void +AcpiDmDumpMpst ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_MPST); + ACPI_MPST_POWER_NODE *SubTable0; + ACPI_MPST_POWER_STATE *SubTable0A; + ACPI_MPST_COMPONENT *SubTable0B; + ACPI_MPST_DATA_HDR *SubTable1; + ACPI_MPST_POWER_DATA *SubTable2; + UINT16 SubtableCount; + UINT8 PowerStateCount; + UINT8 ComponentCount; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Subtable: Memory Power Node(s) */ + + SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount; + SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset); + + while ((Offset < Table->Length) && SubtableCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0, + sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Extract the sub-subtable counts */ + + PowerStateCount = SubTable0->NumPowerStates; + ComponentCount = SubTable0->NumPhysicalComponents; + Offset += sizeof (ACPI_MPST_POWER_NODE); + + /* Sub-subtables - Memory Power State Structure(s) */ + + SubTable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, SubTable0, + sizeof (ACPI_MPST_POWER_NODE)); + + while (PowerStateCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A, + sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A); + if (ACPI_FAILURE (Status)) + { + return; + } + + SubTable0A++; + PowerStateCount--; + Offset += sizeof (ACPI_MPST_POWER_STATE); + } + + /* Sub-subtables - Physical Component ID Structure(s) */ + + SubTable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, SubTable0A); + + if (ComponentCount) + { + AcpiOsPrintf ("\n"); + } + + while (ComponentCount) + { + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B, + sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B); + if (ACPI_FAILURE (Status)) + { + return; + } + + SubTable0B++; + ComponentCount--; + Offset += sizeof (ACPI_MPST_COMPONENT); + } + + /* Point to next Memory Power Node subtable */ + + SubtableCount--; + SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, SubTable0, + sizeof (ACPI_MPST_POWER_NODE) + + (sizeof (ACPI_MPST_POWER_STATE) * SubTable0->NumPowerStates) + + (sizeof (ACPI_MPST_COMPONENT) * SubTable0->NumPhysicalComponents)); + } + + /* Subtable: Count of Memory Power State Characteristic structures */ + + AcpiOsPrintf ("\n"); + SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1, + sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1); + if (ACPI_FAILURE (Status)) + { + return; + } + + SubtableCount = SubTable1->CharacteristicsCount; + Offset += sizeof (ACPI_MPST_DATA_HDR); + + /* Subtable: Memory Power State Characteristics structure(s) */ + + SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1, sizeof (ACPI_MPST_DATA_HDR)); + + while ((Offset < Table->Length) && SubtableCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2, + sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2); + if (ACPI_FAILURE (Status)) + { + return; + } + + SubTable2++; + SubtableCount--; + Offset += sizeof (ACPI_MPST_POWER_DATA); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpMsct * * PARAMETERS: Table - A MSCT table @@ -1275,6 +1514,349 @@ /******************************************************************************* * + * FUNCTION: AcpiDmDumpPcct + * + * PARAMETERS: Table - A PCCT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a PCCT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpPcct ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_PCCT_SUBSPACE *SubTable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_PCCT); + + + /* Main table */ + + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset); + while (Offset < Table->Length) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Header.Length, AcpiDmTableInfoPcct0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += SubTable->Header.Length; + SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable, + SubTable->Header.Length); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpPmtt + * + * PARAMETERS: Table - A PMTT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a PMTT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpPmtt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_PMTT_HEADER *SubTable; + ACPI_PMTT_HEADER *MemSubTable; + ACPI_PMTT_HEADER *DimmSubTable; + ACPI_PMTT_DOMAIN *DomainArray; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_PMTT); + UINT32 MemOffset; + UINT32 DimmOffset; + UINT32 DomainOffset; + UINT32 DomainCount; + + + /* Main table */ + + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Subtables */ + + SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common subtable header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoPmttHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Only Socket subtables are expected at this level */ + + if (SubTable->Type != ACPI_PMTT_TYPE_SOCKET) + { + AcpiOsPrintf ( + "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", + SubTable->Type); + return; + } + + /* Dump the fixed-length portion of the subtable */ + + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoPmtt0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Walk the memory controller subtables */ + + MemOffset = sizeof (ACPI_PMTT_SOCKET); + MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable, + sizeof (ACPI_PMTT_SOCKET)); + + while (((Offset + MemOffset) < Table->Length) && + (MemOffset < SubTable->Length)) + { + /* Common subtable header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, + Offset + MemOffset, MemSubTable, + MemSubTable->Length, AcpiDmTableInfoPmttHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Only memory controller subtables are expected at this level */ + + if (MemSubTable->Type != ACPI_PMTT_TYPE_CONTROLLER) + { + AcpiOsPrintf ( + "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", + MemSubTable->Type); + return; + } + + /* Dump the fixed-length portion of the controller subtable */ + + Status = AcpiDmDumpTable (Length, + Offset + MemOffset, MemSubTable, + MemSubTable->Length, AcpiDmTableInfoPmtt1); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Walk the variable count of proximity domains */ + + DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount; + DomainOffset = sizeof (ACPI_PMTT_CONTROLLER); + DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubTable, + sizeof (ACPI_PMTT_CONTROLLER)); + + while (((Offset + MemOffset + DomainOffset) < Table->Length) && + ((MemOffset + DomainOffset) < SubTable->Length) && + DomainCount) + { + Status = AcpiDmDumpTable (Length, + Offset + MemOffset + DomainOffset, DomainArray, + sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a); + if (ACPI_FAILURE (Status)) + { + return; + } + + DomainOffset += sizeof (ACPI_PMTT_DOMAIN); + DomainArray++; + DomainCount--; + } + + if (DomainCount) + { + AcpiOsPrintf ( + "\n**** DomainCount exceeds subtable length\n\n", + MemSubTable->Type); + } + + /* Walk the physical component (DIMM) subtables */ + + DimmOffset = DomainOffset; + DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubTable, + DomainOffset); + + while (((Offset + MemOffset + DimmOffset) < Table->Length) && + (DimmOffset < MemSubTable->Length)) + { + /* Common subtable header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, + Offset + MemOffset + DimmOffset, DimmSubTable, + DimmSubTable->Length, AcpiDmTableInfoPmttHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Only DIMM subtables are expected at this level */ + + if (DimmSubTable->Type != ACPI_PMTT_TYPE_DIMM) + { + AcpiOsPrintf ( + "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", + DimmSubTable->Type); + return; + } + + /* Dump the fixed-length DIMM subtable */ + + Status = AcpiDmDumpTable (Length, + Offset + MemOffset + DimmOffset, DimmSubTable, + DimmSubTable->Length, AcpiDmTableInfoPmtt2); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next DIMM subtable */ + + DimmOffset += DimmSubTable->Length; + DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, + DimmSubTable, DimmSubTable->Length); + } + + /* Point to next Controller subtable */ + + MemOffset += MemSubTable->Length; + MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, + MemSubTable, MemSubTable->Length); + } + + /* Point to next Socket subtable */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, + SubTable, SubTable->Length); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpS3pt + * + * PARAMETERS: Table - A S3PT table + * + * RETURN: Length of the table + * + * DESCRIPTION: Format the contents of a S3PT + * + ******************************************************************************/ + +UINT32 +AcpiDmDumpS3pt ( + ACPI_TABLE_HEADER *Tables) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_S3PT); + ACPI_S3PT_HEADER *SubTable; + ACPI_DMTABLE_INFO *InfoTable; + ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables); + + + /* Main table */ + + Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt); + if (ACPI_FAILURE (Status)) + { + return 0; + } + + SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset); + while (Offset < S3ptTable->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoS3ptHdr); + if (ACPI_FAILURE (Status)) + { + return 0; + } + + switch (SubTable->Type) + { + case ACPI_S3PT_TYPE_RESUME: + InfoTable = AcpiDmTableInfoS3pt0; + break; + case ACPI_S3PT_TYPE_SUSPEND: + InfoTable = AcpiDmTableInfoS3pt1; + break; + default: + AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type); + + /* Attempt to continue */ + + if (!SubTable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return 0; + } + goto NextSubTable; + } + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return 0; + } + +NextSubTable: + /* Point to next sub-table */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length); + } + + return (S3ptTable->Length); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpSlic * * PARAMETERS: Table - A SLIC table --- sys/contrib/dev/acpica/common/dmtbinfo.c 2011-03-17 13:44:51.000000000 -0400 +++ sys/contrib/dev/acpica/common/dmtbinfo.c 2011-11-23 13:29:29.000000000 -0500 @@ -82,21 +82,28 @@ #define ACPI_GAS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f) #define ACPI_HDR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEADER,f) #define ACPI_RSDP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_RSDP,f) -#define ACPI_BOOT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BOOT,f) #define ACPI_BERT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BERT,f) +#define ACPI_BGRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BGRT,f) +#define ACPI_BOOT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BOOT,f) #define ACPI_CPEP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_CPEP,f) #define ACPI_DBGP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DBGP,f) #define ACPI_DMAR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DMAR,f) +#define ACPI_DRTM_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DRTM,f) #define ACPI_ECDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ECDT,f) #define ACPI_EINJ_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_EINJ,f) #define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f) +#define ACPI_GTDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_GTDT,f) #define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f) #define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f) #define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) #define ACPI_MCHI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCHI,f) +#define ACPI_MPST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MPST,f) #define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) +#define ACPI_PCCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_PCCT,f) +#define ACPI_PMTT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_PMTT,f) +#define ACPI_S3PT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_S3PT,f) #define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) #define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f) @@ -126,6 +133,9 @@ #define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) #define ACPI_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_FPDTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_HEADER,f) +#define ACPI_FPDT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_BOOT,f) +#define ACPI_FPDT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f) #define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) #define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) #define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) @@ -153,9 +163,25 @@ #define ACPI_MADT8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f) #define ACPI_MADT9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f) #define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) +#define ACPI_MADT11_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f) +#define ACPI_MADT12_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f) #define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) +#define ACPI_MPST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f) +#define ACPI_MPST0A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f) +#define ACPI_MPST0B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_COMPONENT,f) +#define ACPI_MPST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f) +#define ACPI_MPST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f) #define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) +#define ACPI_PCCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) +#define ACPI_PMTT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) +#define ACPI_PMTT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) +#define ACPI_PMTT1A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f) +#define ACPI_PMTT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) +#define ACPI_PMTTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_HEADER,f) +#define ACPI_S3PTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_HEADER,f) +#define ACPI_S3PT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_RESUME,f) +#define ACPI_S3PT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) #define ACPI_SLICH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f) #define ACPI_SLIC0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f) #define ACPI_SLIC1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f) @@ -178,6 +204,7 @@ #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) +#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o) #define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o) #define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o) #define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o) @@ -187,6 +214,11 @@ #define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o) #define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o) #define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o) +#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o) +#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o) +#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o) +#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,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_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) @@ -198,6 +230,7 @@ * Required terminator for all tables below */ #define ACPI_DMT_TERMINATOR {ACPI_DMT_EXIT, 0, NULL, 0} +#define ACPI_DMT_NEW_LINE {ACPI_DMT_EXTRA_TEXT, 0, "\n", 0} /* @@ -383,6 +416,9 @@ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,2), "Remote Power-on capable (V4)", 0}, {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Cluster Model (V4)", 0}, {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Physical Destination Mode (V4)", 0}, + {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,2), "Hardware Reduced (V5)", 0}, + {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,2), "Prefer S0 Idle (V5)", 0}, + {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use Sleep Register (V5)", 0}, ACPI_DMT_TERMINATOR }; @@ -396,7 +432,7 @@ ACPI_DMT_TERMINATOR }; -/* ACPI 2.0+ Extensions (FADT version 3+) */ +/* ACPI 2.0+ Extensions (FADT version 3 and 4) */ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] = { @@ -416,6 +452,14 @@ ACPI_DMT_TERMINATOR }; +/* ACPI 5.0 Extensions (FADT version 5) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] = +{ + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepRegister), "Sleep Register", 0}, + ACPI_DMT_TERMINATOR +}; + /* * Remaining tables are not consumed directly by the ACPICA subsystem @@ -541,6 +585,24 @@ /******************************************************************************* * + * BGRT - Boot Graphics Resource Table (ACPI 5.0) + * + ******************************************************************************/ + +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 (ImageType), "Image Type", 0}, + {ACPI_DMT_UINT64, ACPI_BGRT_OFFSET (ImageAddress), "Image Address", 0}, + {ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetX), "Image OffsetX", 0}, + {ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetY), "Image OffsetY", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * BOOT - Simple Boot Flag Table * ******************************************************************************/ @@ -672,6 +734,19 @@ /******************************************************************************* * + * DRTM - Dynamic Root of Trust for Measurement table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[] = +{ + + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * ECDT - Embedded Controller Boot Resources Table * ******************************************************************************/ @@ -748,6 +823,82 @@ /******************************************************************************* * + * FPDT - Firmware Performance Data Table (ACPI 5.0) + * + ******************************************************************************/ + +/* Main table consists of only the standard ACPI header - subtables follow */ + +/* FPDT subtable header */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[] = +{ + {ACPI_DMT_UINT16, ACPI_FPDTH_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_FPDTH_OFFSET (Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_FPDTH_OFFSET (Revision), "Revision", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0: Firmware Basic Boot Performance Record */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[] = +{ + {ACPI_DMT_UINT32, ACPI_FPDT0_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ResetEnd), "Reset End", 0}, + {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (LoadStart), "Load Image Start", 0}, + {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (StartupStart), "Start Image Start", 0}, + {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ExitServicesEntry), "Exit Services Entry", 0}, + {ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ExitServicesExit), "Exit Services Exit", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 1: S3 Performance Table Pointer Record */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] = +{ + {ACPI_DMT_UINT32, ACPI_FPDT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_FPDT1_OFFSET (Address), "S3PT Address", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * + * GTDT - Generic Timer Description Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] = +{ + {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (Address), "Timer Address", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (Flags,0), "Memory Present", 0}, + ACPI_DMT_NEW_LINE, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Interrupt), "Secure PL1 Interrupt", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Flags), "SPL1 Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Trigger Mode", 0}, + {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Polarity", 0}, + ACPI_DMT_NEW_LINE, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Interrupt), "Non-Secure PL1 Interrupt", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Flags), "NSPL1 Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0}, + {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0}, + ACPI_DMT_NEW_LINE, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0}, + {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0}, + ACPI_DMT_NEW_LINE, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Interrupt), "Non-Secure PL2 Interrupt", 0}, + {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Flags), "NSPL2 Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0}, + {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * HEST - Hardware Error Source table * ******************************************************************************/ @@ -1190,6 +1341,34 @@ ACPI_DMT_TERMINATOR }; +/* 11: Generic Interrupt Controller (ACPI 5.0) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] = +{ + {ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (GicId), "Local GIC Hardware ID", 0}, + {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0}, + {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0}, + {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0}, + {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0}, + {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0}, + {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 12: Generic Interrupt Distributor (ACPI 5.0) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] = +{ + {ACPI_DMT_UINT16, ACPI_MADT12_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (GicId), "Local GIC Hardware ID", 0}, + {ACPI_DMT_UINT64, ACPI_MADT12_OFFSET (BaseAddress), "Base Address", 0}, + {ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (GlobalIrqBase), "Interrupt Base", 0}, + {ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (Reserved2), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * @@ -1240,6 +1419,87 @@ /******************************************************************************* * + * MPST - Memory Power State Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[] = +{ + {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT8, ACPI_MPST_OFFSET (ChannelId), "Channel ID", 0}, + {ACPI_DMT_UINT8, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (PowerNodeCount), "Power Node Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* MPST subtables */ + +/* 0: Memory Power Node Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[] = +{ + {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Node Enabled", 0}, + {ACPI_DMT_FLAG1, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Power Managed", 0}, + {ACPI_DMT_FLAG2, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Hot Plug Capable", 0}, + + {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (NodeId), "Node ID", 0}, + {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeAddress), "Range Address", 0}, + {ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeLength), "Range Length", 0}, + {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0}, + {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0}, + {ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (Reserved2), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0A: Sub-subtable - Memory Power State Structure (follows Memory Power Node above) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[] = +{ + {ACPI_DMT_UINT8, ACPI_MPST0A_OFFSET (PowerState), "Power State", 0}, + {ACPI_DMT_UINT8, ACPI_MPST0A_OFFSET (InfoIndex), "InfoIndex", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0B: Sub-subtable - Physical Component ID Structure (follows Memory Power State(s) above) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[] = +{ + {ACPI_DMT_UINT16, ACPI_MPST0B_OFFSET (ComponentId), "Component Id", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 01: Power Characteristics Count (follows all Power Node(s) above) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] = +{ + {ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (CharacteristicsCount), "Characteristics Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 02: Memory Power State Characteristics Structure */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[] = +{ + {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Revision), "Revision", 0}, + {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Memory Preserved", 0}, + {ACPI_DMT_FLAG1, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Entry", 0}, + {ACPI_DMT_FLAG2, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Exit", 0}, + + {ACPI_DMT_UINT16, ACPI_MPST2_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_MPST2_OFFSET (AveragePower), "Average Power", 0}, + {ACPI_DMT_UINT32, ACPI_MPST2_OFFSET (PowerSaving), "Power Saving", 0}, + {ACPI_DMT_UINT64, ACPI_MPST2_OFFSET (ExitLatency), "Exit Latency", 0}, + {ACPI_DMT_UINT64, ACPI_MPST2_OFFSET (Reserved2), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * MSCT - Maximum System Characteristics Table (ACPI 4.0) * ******************************************************************************/ @@ -1269,6 +1529,155 @@ /******************************************************************************* * + * PCCT - Platform Communications Channel Table (ACPI 5.0) + * + ******************************************************************************/ + +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_UINT32, ACPI_PCCT_OFFSET (Latency), "Command Latency", 0}, + {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* PCCT subtables */ + +/* 0: Generic Communications Subspace */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] = +{ + {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT48, ACPI_PCCT0_OFFSET (Reserved[0]), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (BaseAddress), "Base Address", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (Length), "Address Length", 0}, + {ACPI_DMT_GAS, ACPI_PCCT0_OFFSET (DoorbellRegister), "Doorbell Register", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (PreserveMask), "Preserve Mask", 0}, + {ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (WriteMask), "Write Mask", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * + * PMTT - Platform Memory Topology Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[] = +{ + {ACPI_DMT_UINT32, ACPI_PMTT_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Common Subtable header (one per Subtable) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[] = +{ + {ACPI_DMT_PMTT, ACPI_PMTTH_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_PMTTH_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Top-level Device", 0}, + {ACPI_DMT_FLAG1, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Physical Element", 0}, + {ACPI_DMT_FLAGS2, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Memory Type", 0}, + {ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Reserved2), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* PMTT Subtables */ + +/* 0: Socket */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[] = +{ + {ACPI_DMT_UINT16, ACPI_PMTT0_OFFSET (SocketId), "Socket ID", 0}, + {ACPI_DMT_UINT16, ACPI_PMTT0_OFFSET (Reserved), "Reserved", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 1: Memory Controller */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[] = +{ + {ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (ReadLatency), "Read Latency", 0}, + {ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (WriteLatency), "Write Latency", 0}, + {ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (ReadBandwidth), "Read Bandwidth", 0}, + {ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (WriteBandwidth), "Write Bandwidth", 0}, + {ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (AccessWidth), "Access Width", 0}, + {ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (Alignment), "Alignment", 0}, + {ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (DomainCount), "Domain Count", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 1a: Proximity Domain */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[] = +{ + {ACPI_DMT_UINT32, ACPI_PMTT1A_OFFSET (ProximityDomain), "Proximity Domain", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 2: Physical Component */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] = +{ + {ACPI_DMT_UINT16, ACPI_PMTT2_OFFSET (ComponentId), "Component ID", 0}, + {ACPI_DMT_UINT16, ACPI_PMTT2_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_PMTT2_OFFSET (MemorySize), "Memory Size", 0}, + {ACPI_DMT_UINT32, ACPI_PMTT2_OFFSET (BiosHandle), "Bios Handle", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * + * S3PT - S3 Performance Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[] = +{ + {ACPI_DMT_SIG, ACPI_S3PT_OFFSET (Signature[0]), "Signature", 0}, + {ACPI_DMT_UINT32, ACPI_S3PT_OFFSET (Length), "Length", DT_LENGTH}, + ACPI_DMT_TERMINATOR +}; + +/* S3PT subtable header */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[] = +{ + {ACPI_DMT_UINT16, ACPI_S3PTH_OFFSET (Type), "Type", 0}, + {ACPI_DMT_UINT8, ACPI_S3PTH_OFFSET (Length), "Length", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_S3PTH_OFFSET (Revision), "Revision", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 0: Basic S3 Resume Performance Record */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[] = +{ + {ACPI_DMT_UINT32, ACPI_S3PT0_OFFSET (ResumeCount), "Resume Count", 0}, + {ACPI_DMT_UINT64, ACPI_S3PT0_OFFSET (FullResume), "Full Resume", 0}, + {ACPI_DMT_UINT64, ACPI_S3PT0_OFFSET (AverageResume), "Average Resume", 0}, + ACPI_DMT_TERMINATOR +}; + +/* 1: Basic S3 Suspend Performance Record */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[] = +{ + {ACPI_DMT_UINT64, ACPI_S3PT1_OFFSET (SuspendStart), "Suspend Start", 0}, + {ACPI_DMT_UINT64, ACPI_S3PT1_OFFSET (SuspendEnd), "Suspend End", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * SBST - Smart Battery Specification Table * ******************************************************************************/ @@ -1609,8 +2018,10 @@ ACPI_DMT_TERMINATOR }; +/*! [Begin] no source code translation */ + /* - * Generic types (used in UEFI) + * Generic types (used in UEFI and custom tables) * * Examples: * @@ -1629,7 +2040,7 @@ * DevicePath : "\PciRoot(0)\Pci(0x1f,1)\Usb(0,0)" */ -#define ACPI_DM_GENERIC_ENTRY(FieldType, FieldName)\ +#define ACPI_DM_GENERIC_ENTRY(FieldType, FieldName) \ {{FieldType, 0, FieldName, 0}, ACPI_DMT_TERMINATOR} ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2] = @@ -1638,6 +2049,8 @@ ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT16, "UINT16"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT24, "UINT24"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT32, "UINT32"), + ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT40, "UINT40"), + ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT48, "UINT48"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT56, "UINT56"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT64, "UINT64"), ACPI_DM_GENERIC_ENTRY (ACPI_DMT_STRING, "String"), @@ -1648,3 +2061,4 @@ ACPI_DM_GENERIC_ENTRY (ACPI_DMT_LABEL, "Label"), {ACPI_DMT_TERMINATOR} }; +/*! [End] no source code translation !*/ --- sys/contrib/dev/acpica/compiler/aslanalyze.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslanalyze.c 2011-11-23 13:29:36.000000000 -0500 @@ -126,7 +126,6 @@ { UINT32 i; ACPI_SIZE Length; - UINT32 AlphaPrefixLength; /* Only care about string versions of _HID/_CID (integers are legal) */ @@ -174,12 +173,18 @@ { AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, Op, Op->Asl.Value.String); - break; + return; } } - /* _HID String must be of the form "XXX####" or "ACPI####" */ - + /* + * _HID String must be one of these forms: + * + * "AAA####" A is an uppercase letter and # is a hex digit + * "ACPI####" # is a hex digit + * "NNNN####" N is an uppercase letter or decimal digit (0-9) + * # is a hex digit (ACPI 5.0) + */ if ((Length < 7) || (Length > 8)) { AslError (ASL_ERROR, ASL_MSG_HID_LENGTH, @@ -187,22 +192,48 @@ return; } - /* _HID Length is valid, now check for uppercase (first 3 or 4 chars) */ + /* _HID Length is valid (7 or 8), now check the prefix (first 3 or 4 chars) */ - AlphaPrefixLength = 3; - if (Length >= 8) + if (Length == 7) { - AlphaPrefixLength = 4; + /* AAA####: Ensure the alphabetic prefix is all uppercase */ + + for (i = 0; i < 3; i++) + { + if (!isupper ((int) Op->Asl.Value.String[i])) + { + AslError (ASL_ERROR, ASL_MSG_UPPER_CASE, + Op, &Op->Asl.Value.String[i]); + return; + } + } + } + else /* Length == 8 */ + { + /* + * ACPI#### or NNNN####: + * Ensure the prefix contains only uppercase alpha or decimal digits + */ + for (i = 0; i < 4; i++) + { + if (!isupper ((int) Op->Asl.Value.String[i]) && + !isdigit ((int) Op->Asl.Value.String[i])) + { + AslError (ASL_ERROR, ASL_MSG_HID_PREFIX, + Op, &Op->Asl.Value.String[i]); + return; + } + } } - /* Ensure the alphabetic prefix is all uppercase */ + /* Remaining characters (suffix) must be hex digits */ - for (i = 0; (i < AlphaPrefixLength) && Op->Asl.Value.String[i]; i++) + for (; i < Length; i++) { - if (!isupper ((int) Op->Asl.Value.String[i])) + if (!isxdigit ((int) Op->Asl.Value.String[i])) { - AslError (ASL_ERROR, ASL_MSG_UPPER_CASE, - Op, &Op->Asl.Value.String[i]); + AslError (ASL_ERROR, ASL_MSG_HID_SUFFIX, + Op, &Op->Asl.Value.String[i]); break; } } --- sys/contrib/dev/acpica/compiler/aslcodegen.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslcodegen.c 2011-11-23 13:29:36.000000000 -0500 @@ -271,12 +271,17 @@ /* Special opcodes for within a field definition */ - Aml.Opcode = 0x00; + Aml.Opcode = AML_FIELD_OFFSET_OP; break; case AML_INT_ACCESSFIELD_OP: - Aml.Opcode = 0x01; + Aml.Opcode = AML_FIELD_ACCESS_OP; + break; + + case AML_INT_CONNECTION_OP: + + Aml.Opcode = AML_FIELD_CONNECTION_OP; break; default: --- sys/contrib/dev/acpica/compiler/aslcompile.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslcompile.c 2011-11-23 13:29:38.000000000 -0500 @@ -472,6 +472,8 @@ if (!RootNode) { + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, + NULL, "- Could not resolve parse tree root node"); CmCleanupAndExit (); return -1; } --- sys/contrib/dev/acpica/compiler/aslcompiler.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslcompiler.h 2011-11-23 13:29:35.000000000 -0500 @@ -289,7 +289,7 @@ int AslCompilererror( - char *s); + const char *s); void AslCommonError ( @@ -829,21 +829,23 @@ UINT32 Size); void -RsCreateBitField ( +RsCreateResourceField ( ACPI_PARSE_OBJECT *Op, char *Name, UINT32 ByteOffset, - UINT32 BitOffset); + UINT32 BitOffset, + UINT32 BitLength); void -RsCreateByteField ( +RsSetFlagBits ( + UINT8 *Flags, ACPI_PARSE_OBJECT *Op, - char *Name, - UINT32 ByteOffset); + UINT8 Position, + UINT8 DefaultBit); void -RsSetFlagBits ( - UINT8 *Flags, +RsSetFlagBits16 ( + UINT16 *Flags, ACPI_PARSE_OBJECT *Op, UINT8 Position, UINT8 DefaultBit); @@ -931,6 +933,11 @@ UINT32 CurrentByteOffset); ASL_RESOURCE_NODE * +RsDoFixedDmaDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * RsDoFixedIoDescriptor ( ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); @@ -969,6 +976,30 @@ ACPI_PARSE_OBJECT *Op, UINT32 CurrentByteOffset); +ASL_RESOURCE_NODE * +RsDoGpioIntDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * +RsDoGpioIoDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * +RsDoI2cSerialBusDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * +RsDoSpiSerialBusDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); + +ASL_RESOURCE_NODE * +RsDoUartSerialBusDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset); /* * aslrestype2d - DWord address descriptors --- sys/contrib/dev/acpica/compiler/aslcompiler.l 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslcompiler.l 2011-11-23 13:29:35.000000000 -0500 @@ -1,8 +1,7 @@ - %{ /****************************************************************************** * - * Module Name: aslcompiler.l - Flex input file + * Module Name: aslcompiler.l - Flex/lex input file * *****************************************************************************/ @@ -60,6 +59,9 @@ #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslscan") + +/* Local prototypes */ + char comment (void); char @@ -74,7 +76,7 @@ /*! [Begin] no source code translation */ %} - + /* Definitions */ LeadNameChar [A-Za-z_] DigitChar [0-9] @@ -94,6 +96,7 @@ NamePathTail [.]{NameSeg} %% + /* Rules */ [ ] { count (0); } [\n] { count (0); } /* Handle files with both LF and CR/LF */ @@ -105,6 +108,7 @@ "//" { if (!comment2 ()) yyterminate (); } "\"" { if (literal ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); } +";" { count (0); return(';'); } 0[xX]{HexDigitChar}+ | @@ -116,73 +120,56 @@ "#line" { count (1); return (PARSEOP_LINE_CSTYLE); } "External" { count (1); return (PARSEOP_EXTERNAL); } + /**************************************************************************** + * + * Main ASL operators + * + ****************************************************************************/ -"Ones" { count (1); return (PARSEOP_ONES); } -"One" { count (1); return (PARSEOP_ONE); } -"Zero" { count (1); return (PARSEOP_ZERO); } -"Revision" { count (1); return (PARSEOP_REVISION); } - -"Offset" { count (1); return (PARSEOP_OFFSET); } "AccessAs" { count (1); return (PARSEOP_ACCESSAS); } -"BankField" { count (2); return (PARSEOP_BANKFIELD); } -"CreateBitField" { count (2); return (PARSEOP_CREATEBITFIELD); } -"CreateByteField" { count (2); return (PARSEOP_CREATEBYTEFIELD); } -"CreateDWordField" { count (2); return (PARSEOP_CREATEDWORDFIELD); } -"CreateField" { count (2); return (PARSEOP_CREATEFIELD); } -"CreateQWordField" { count (2); return (PARSEOP_CREATEQWORDFIELD); } -"CreateWordField" { count (2); return (PARSEOP_CREATEWORDFIELD); } -"DataTableRegion" { count (2); return (PARSEOP_DATATABLEREGION); } -"Device" { count (2); return (PARSEOP_DEVICE); } -"Event" { count (2); return (PARSEOP_EVENT); } -"Field" { count (2); return (PARSEOP_FIELD); } -"Function" { count (2); return (PARSEOP_FUNCTION); } -"IndexField" { count (2); return (PARSEOP_INDEXFIELD); } -"Method" { count (2); return (PARSEOP_METHOD); } -"Mutex" { count (2); return (PARSEOP_MUTEX); } -"OperationRegion" { count (2); return (PARSEOP_OPERATIONREGION); } -"PowerResource" { count (2); return (PARSEOP_POWERRESOURCE); } -"Processor" { count (2); return (PARSEOP_PROCESSOR); } -"ThermalZone" { count (2); return (PARSEOP_THERMALZONE); } +"Acquire" { count (3); return (PARSEOP_ACQUIRE); } +"Add" { count (3); return (PARSEOP_ADD); } "Alias" { count (2); return (PARSEOP_ALIAS); } -"Name" { count (2); return (PARSEOP_NAME); } -"Scope" { count (2); return (PARSEOP_SCOPE); } +"And" { count (3); return (PARSEOP_AND); } +"BankField" { count (2); return (PARSEOP_BANKFIELD); } "Break" { count (3); return (PARSEOP_BREAK); } "BreakPoint" { count (3); return (PARSEOP_BREAKPOINT); } -"Continue" { count (3); return (PARSEOP_CONTINUE); } -"Fatal" { count (3); return (PARSEOP_FATAL); } -"If" { count (3); return (PARSEOP_IF); } -"Else" { count (3); return (PARSEOP_ELSE); } -"ElseIf" { count (3); return (PARSEOP_ELSEIF); } -"Load" { count (3); return (PARSEOP_LOAD); } -"Noop" { count (3); return (PARSEOP_NOOP); } -"Notify" { count (3); return (PARSEOP_NOTIFY); } -"Release" { count (3); return (PARSEOP_RELEASE); } -"Reset" { count (3); return (PARSEOP_RESET); } -"Return" { count (3); return (PARSEOP_RETURN); } -"Signal" { count (3); return (PARSEOP_SIGNAL); } -"Sleep" { count (3); return (PARSEOP_SLEEP); } -"Stall" { count (3); return (PARSEOP_STALL); } -"Switch" { count (3); return (PARSEOP_SWITCH); } +"Buffer" { count (1); return (PARSEOP_BUFFER); } "Case" { count (3); return (PARSEOP_CASE); } -"Default" { count (3); return (PARSEOP_DEFAULT); } -"Unload" { count (3); return (PARSEOP_UNLOAD); } -"While" { count (3); return (PARSEOP_WHILE); } - -"Acquire" { count (3); return (PARSEOP_ACQUIRE); } -"Add" { count (3); return (PARSEOP_ADD); } -"And" { count (3); return (PARSEOP_AND); } "Concatenate" { count (3); return (PARSEOP_CONCATENATE); } "ConcatenateResTemplate" { count (3); return (PARSEOP_CONCATENATERESTEMPLATE); } "CondRefOf" { count (3); return (PARSEOP_CONDREFOF); } +"Connection" { count (2); return (PARSEOP_CONNECTION); } +"Continue" { count (3); return (PARSEOP_CONTINUE); } "CopyObject" { count (3); return (PARSEOP_COPYOBJECT); } +"CreateBitField" { count (2); return (PARSEOP_CREATEBITFIELD); } +"CreateByteField" { count (2); return (PARSEOP_CREATEBYTEFIELD); } +"CreateDWordField" { count (2); return (PARSEOP_CREATEDWORDFIELD); } +"CreateField" { count (2); return (PARSEOP_CREATEFIELD); } +"CreateQWordField" { count (2); return (PARSEOP_CREATEQWORDFIELD); } +"CreateWordField" { count (2); return (PARSEOP_CREATEWORDFIELD); } +"DataTableRegion" { count (2); return (PARSEOP_DATATABLEREGION); } +"Debug" { count (1); return (PARSEOP_DEBUG); } "Decrement" { count (3); return (PARSEOP_DECREMENT); } +"Default" { count (3); return (PARSEOP_DEFAULT); } +"DefinitionBlock" { count (1); return (PARSEOP_DEFINITIONBLOCK); } "DeRefOf" { count (3); return (PARSEOP_DEREFOF); } +"Device" { count (2); return (PARSEOP_DEVICE); } "Divide" { count (3); return (PARSEOP_DIVIDE); } +"Eisaid" { count (1); return (PARSEOP_EISAID); } +"Else" { count (3); return (PARSEOP_ELSE); } +"ElseIf" { count (3); return (PARSEOP_ELSEIF); } +"Event" { count (2); return (PARSEOP_EVENT); } +"Fatal" { count (3); return (PARSEOP_FATAL); } +"Field" { count (2); return (PARSEOP_FIELD); } "FindSetLeftBit" { count (3); return (PARSEOP_FINDSETLEFTBIT); } "FindSetRightBit" { count (3); return (PARSEOP_FINDSETRIGHTBIT); } -"FromBCD" { count (3); return (PARSEOP_FROMBCD); } +"FromBcd" { count (3); return (PARSEOP_FROMBCD); } +"Function" { count (2); return (PARSEOP_FUNCTION); } +"If" { count (3); return (PARSEOP_IF); } "Increment" { count (3); return (PARSEOP_INCREMENT); } "Index" { count (3); return (PARSEOP_INDEX); } +"IndexField" { count (2); return (PARSEOP_INDEXFIELD); } "LAnd" { count (3); return (PARSEOP_LAND); } "LEqual" { count (3); return (PARSEOP_LEQUAL); } "LGreater" { count (3); return (PARSEOP_LGREATER); } @@ -191,32 +178,62 @@ "LLessEqual" { count (3); return (PARSEOP_LLESSEQUAL); } "LNot" { count (3); return (PARSEOP_LNOT); } "LNotEqual" { count (3); return (PARSEOP_LNOTEQUAL); } +"Load" { count (3); return (PARSEOP_LOAD); } "LoadTable" { count (3); return (PARSEOP_LOADTABLE); } "LOr" { count (3); return (PARSEOP_LOR); } "Match" { count (3); return (PARSEOP_MATCH); } +"Method" { count (2); return (PARSEOP_METHOD); } "Mid" { count (3); return (PARSEOP_MID); } "Mod" { count (3); return (PARSEOP_MOD); } "Multiply" { count (3); return (PARSEOP_MULTIPLY); } +"Mutex" { count (2); return (PARSEOP_MUTEX); } +"Name" { count (2); return (PARSEOP_NAME); } "NAnd" { count (3); return (PARSEOP_NAND); } +"Noop" { count (3); return (PARSEOP_NOOP); } "NOr" { count (3); return (PARSEOP_NOR); } "Not" { count (3); return (PARSEOP_NOT); } +"Notify" { count (3); return (PARSEOP_NOTIFY); } "ObjectType" { count (3); return (PARSEOP_OBJECTTYPE); } +"Offset" { count (1); return (PARSEOP_OFFSET); } +"One" { count (1); return (PARSEOP_ONE); } +"Ones" { count (1); return (PARSEOP_ONES); } +"OperationRegion" { count (2); return (PARSEOP_OPERATIONREGION); } "Or" { count (3); return (PARSEOP_OR); } +"Package" { count (1); return (PARSEOP_PACKAGE); } +"PowerResource" { count (2); return (PARSEOP_POWERRESOURCE); } +"Processor" { count (2); return (PARSEOP_PROCESSOR); } "RefOf" { count (3); return (PARSEOP_REFOF); } +"Release" { count (3); return (PARSEOP_RELEASE); } +"Reset" { count (3); return (PARSEOP_RESET); } +"Return" { count (3); return (PARSEOP_RETURN); } +"Revision" { count (1); return (PARSEOP_REVISION); } +"Scope" { count (2); return (PARSEOP_SCOPE); } "ShiftLeft" { count (3); return (PARSEOP_SHIFTLEFT); } "ShiftRight" { count (3); return (PARSEOP_SHIFTRIGHT); } +"Signal" { count (3); return (PARSEOP_SIGNAL); } "SizeOf" { count (3); return (PARSEOP_SIZEOF); } +"Sleep" { count (3); return (PARSEOP_SLEEP); } +"Stall" { count (3); return (PARSEOP_STALL); } "Store" { count (3); return (PARSEOP_STORE); } "Subtract" { count (3); return (PARSEOP_SUBTRACT); } +"Switch" { count (3); return (PARSEOP_SWITCH); } +"ThermalZone" { count (2); return (PARSEOP_THERMALZONE); } "Timer" { count (3); return (PARSEOP_TIMER); } -"ToBCD" { count (3); return (PARSEOP_TOBCD); } +"ToBcd" { count (3); return (PARSEOP_TOBCD); } "ToBuffer" { count (3); return (PARSEOP_TOBUFFER); } "ToDecimalString" { count (3); return (PARSEOP_TODECIMALSTRING); } "ToHexString" { count (3); return (PARSEOP_TOHEXSTRING); } "ToInteger" { count (3); return (PARSEOP_TOINTEGER); } "ToString" { count (3); return (PARSEOP_TOSTRING); } +"ToUuid" { count (1); return (PARSEOP_TOUUID); } +"Unicode" { count (1); return (PARSEOP_UNICODE); } +"Unload" { count (3); return (PARSEOP_UNLOAD); } "Wait" { count (3); return (PARSEOP_WAIT); } +"While" { count (3); return (PARSEOP_WHILE); } "XOr" { count (3); return (PARSEOP_XOR); } +"Zero" { count (1); return (PARSEOP_ZERO); } + + /* Control method arguments and locals */ "Arg0" { count (1); return (PARSEOP_ARG0); } "Arg1" { count (1); return (PARSEOP_ARG1); } @@ -225,7 +242,6 @@ "Arg4" { count (1); return (PARSEOP_ARG4); } "Arg5" { count (1); return (PARSEOP_ARG5); } "Arg6" { count (1); return (PARSEOP_ARG6); } - "Local0" { count (1); return (PARSEOP_LOCAL0); } "Local1" { count (1); return (PARSEOP_LOCAL1); } "Local2" { count (1); return (PARSEOP_LOCAL2); } @@ -235,16 +251,16 @@ "Local6" { count (1); return (PARSEOP_LOCAL6); } "Local7" { count (1); return (PARSEOP_LOCAL7); } -"Debug" { count (1); return (PARSEOP_DEBUG); } -"DefinitionBlock" { count (1); return (PARSEOP_DEFINITIONBLOCK); } -"Buffer" { count (1); return (PARSEOP_BUFFER); } -"Package" { count (1); return (PARSEOP_PACKAGE); } + /**************************************************************************** + * + * Resource Descriptor macros + * + ****************************************************************************/ -"EISAID" { count (1); return (PARSEOP_EISAID); } "ResourceTemplate" { count (1); return (PARSEOP_RESOURCETEMPLATE); } -"ToUUID" { count (1); return (PARSEOP_TOUUID); } -"Unicode" { count (1); return (PARSEOP_UNICODE); } +"RawDataBuffer" { count (1); return (PARSEOP_DATABUFFER); } + "DMA" { count (1); return (PARSEOP_DMA); } "DWordIO" { count (1); return (PARSEOP_DWORDIO); } "DWordMemory" { count (1); return (PARSEOP_DWORDMEMORY); } @@ -253,26 +269,188 @@ "ExtendedIO" { count (1); return (PARSEOP_EXTENDEDIO); } "ExtendedMemory" { count (1); return (PARSEOP_EXTENDEDMEMORY); } "ExtendedSpace" { count (1); return (PARSEOP_EXTENDEDSPACE); } +"FixedDma" { count (1); return (PARSEOP_FIXEDDMA); } "FixedIO" { count (1); return (PARSEOP_FIXEDIO); } +"GpioInt" { count (1); return (PARSEOP_GPIO_INT); } +"GpioIo" { count (1); return (PARSEOP_GPIO_IO); } +"I2cSerialBus" { count (1); return (PARSEOP_I2C_SERIALBUS); } "Interrupt" { count (1); return (PARSEOP_INTERRUPT); } "IO" { count (1); return (PARSEOP_IO); } -"IRQNoFlags" { count (1); return (PARSEOP_IRQNOFLAGS); } "IRQ" { count (1); return (PARSEOP_IRQ); } +"IRQNoFlags" { count (1); return (PARSEOP_IRQNOFLAGS); } "Memory24" { count (1); return (PARSEOP_MEMORY24); } -"Memory32Fixed" { count (1); return (PARSEOP_MEMORY32FIXED); } "Memory32" { count (1); return (PARSEOP_MEMORY32); } +"Memory32Fixed" { count (1); return (PARSEOP_MEMORY32FIXED); } "QWordIO" { count (1); return (PARSEOP_QWORDIO); } "QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); } "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); } "Register" { count (1); return (PARSEOP_REGISTER); } +"SpiSerialBus" { count (1); return (PARSEOP_SPI_SERIALBUS); } "StartDependentFn" { count (1); return (PARSEOP_STARTDEPENDENTFN); } "StartDependentFnNoPri" { count (1); return (PARSEOP_STARTDEPENDENTFN_NOPRI); } +"UartSerialBus" { count (1); return (PARSEOP_UART_SERIALBUS); } "VendorLong" { count (1); return (PARSEOP_VENDORLONG); } "VendorShort" { count (1); return (PARSEOP_VENDORSHORT); } "WordBusNumber" { count (1); return (PARSEOP_WORDBUSNUMBER); } "WordIO" { count (1); return (PARSEOP_WORDIO); } "WordSpace" { count (1); return (PARSEOP_WORDSPACE); } + + /**************************************************************************** + * + * Keywords used as arguments to ASL operators and macros + * + ****************************************************************************/ + + /* AccessAttribKeyword: Serial Bus Attributes (ACPI 5.0) */ + +"AttribQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); } +"AttribSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); } +"AttribByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); } +"AttribWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); } +"AttribBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); } +"AttribProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); } +"AttribBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); } + + /* AccessAttribKeyword: Legacy synonyms for above (pre-ACPI 5.0) */ + +"SMBQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); } +"SMBSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); } +"SMBByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); } +"SMBWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); } +"SMBBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); } +"SMBProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); } +"SMBBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); } + + /* AccessTypeKeyword: Field Access Types */ + +"AnyAcc" { count (0); return (PARSEOP_ACCESSTYPE_ANY); } +"ByteAcc" { count (0); return (PARSEOP_ACCESSTYPE_BYTE); } +"WordAcc" { count (0); return (PARSEOP_ACCESSTYPE_WORD); } +"DWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_DWORD); } +"QWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_QWORD); } +"BufferAcc" { count (0); return (PARSEOP_ACCESSTYPE_BUF); } + + /* AddressingModeKeyword: Mode - Resource Descriptors (ACPI 5.0) */ + +"AddressingMode7Bit" { count (0); return (PARSEOP_ADDRESSINGMODE_7BIT); } +"AddressingMode10Bit" { count (0); return (PARSEOP_ADDRESSINGMODE_10BIT); } + + /* AddressKeyword: ACPI memory range types */ + +"AddressRangeMemory" { count (0); return (PARSEOP_ADDRESSTYPE_MEMORY); } +"AddressRangeReserved" { count (0); return (PARSEOP_ADDRESSTYPE_RESERVED); } +"AddressRangeNVS" { count (0); return (PARSEOP_ADDRESSTYPE_NVS); } +"AddressRangeACPI" { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); } + + /* BusMasterKeyword: DMA Bus Mastering */ + +"BusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_MASTER); } +"NotBusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_NOTMASTER); } + + /* ByteLengthKeyword: Bits per Byte - Resource Descriptors (ACPI 5.0) */ + +"DataBitsFive" { count (0); return (PARSEOP_BITSPERBYTE_FIVE); } +"DataBitsSix" { count (0); return (PARSEOP_BITSPERBYTE_SIX); } +"DataBitsSeven" { count (0); return (PARSEOP_BITSPERBYTE_SEVEN); } +"DataBitsEight" { count (0); return (PARSEOP_BITSPERBYTE_EIGHT); } +"DataBitsNine" { count (0); return (PARSEOP_BITSPERBYTE_NINE); } + + /* ClockPhaseKeyword: Resource Descriptors (ACPI 5.0) */ + +"ClockPhaseFirst" { count (0); return (PARSEOP_CLOCKPHASE_FIRST); } +"ClockPhaseSecond" { count (0); return (PARSEOP_CLOCKPHASE_SECOND); } + + /* ClockPolarityKeyword: Resource Descriptors (ACPI 5.0) */ + +"ClockPolarityLow" { count (0); return (PARSEOP_CLOCKPOLARITY_LOW); } +"ClockPolarityHigh" { count (0); return (PARSEOP_CLOCKPOLARITY_HIGH); } + + /* DecodeKeyword: Type of Memory Decoding - Resource Descriptors */ + +"PosDecode" { count (0); return (PARSEOP_DECODETYPE_POS); } +"SubDecode" { count (0); return (PARSEOP_DECODETYPE_SUB); } + + /* DmaTypeKeyword: DMA Types - DMA Resource Descriptor */ + +"Compatibility" { count (0); return (PARSEOP_DMATYPE_COMPATIBILITY); } +"TypeA" { count (0); return (PARSEOP_DMATYPE_A); } +"TypeB" { count (0); return (PARSEOP_DMATYPE_B); } +"TypeF" { count (0); return (PARSEOP_DMATYPE_F); } + + /* EndianKeyword: Endian type - Resource Descriptor (ACPI 5.0) */ + +"LittleEndian" { count (0); return (PARSEOP_ENDIAN_LITTLE); } +"BigEndian" { count (0); return (PARSEOP_ENDIAN_BIG); } + + /* ExtendedAttribKeyword: Bus attributes, AccessAs operator (ACPI 5.0) */ + +"AttribBytes" { count (0); return (PARSEOP_ACCESSATTRIB_MULTIBYTE); } +"AttribRawBytes" { count (0); return (PARSEOP_ACCESSATTRIB_RAW_BYTES); } +"AttribRawProcessBytes" { count (0); return (PARSEOP_ACCESSATTRIB_RAW_PROCESS); } + + /* FlowControlKeyword: Resource Descriptors (ACPI 5.0) */ + +"FlowControlHardware" { count (0); return (PARSEOP_FLOWCONTROL_HW); } +"FlowControlNone" { count (0); return (PARSEOP_FLOWCONTROL_NONE); } +"FlowControlXon" { count (0); return (PARSEOP_FLOWCONTROL_SW); } + + /* InterruptLevelKeyword: Interrupt Active Types */ + +"ActiveBoth" { count (0); return (PARSEOP_INTLEVEL_ACTIVEBOTH); } +"ActiveHigh" { count (0); return (PARSEOP_INTLEVEL_ACTIVEHIGH); } +"ActiveLow" { count (0); return (PARSEOP_INTLEVEL_ACTIVELOW); } + + /* InterruptTypeKeyword: Interrupt Types */ + +"Edge" { count (0); return (PARSEOP_INTTYPE_EDGE); } +"Level" { count (0); return (PARSEOP_INTTYPE_LEVEL); } + + /* IoDecodeKeyword: Type of Memory Decoding - Resource Descriptors */ + +"Decode10" { count (0); return (PARSEOP_IODECODETYPE_10); } +"Decode16" { count (0); return (PARSEOP_IODECODETYPE_16); } + + /* IoRestrictionKeyword: I/O Restriction - GPIO Resource Descriptors (ACPI 5.0) */ + +"IoRestrictionNone" { count (0); return (PARSEOP_IORESTRICT_NONE); } +"IoRestrictionInputOnly" { count (0); return (PARSEOP_IORESTRICT_IN); } +"IoRestrictionOutputOnly" { count (0); return (PARSEOP_IORESTRICT_OUT); } +"IoRestrictionNoneAndPreserve" { count (0); return (PARSEOP_IORESTRICT_PRESERVE); } + + /* LockRuleKeyword: Global Lock use for Field Operator */ + +"Lock" { count (0); return (PARSEOP_LOCKRULE_LOCK); } +"NoLock" { count (0); return (PARSEOP_LOCKRULE_NOLOCK); } + + /* MatchOpKeyword: Types for Match Operator */ + +"MTR" { count (0); return (PARSEOP_MATCHTYPE_MTR); } +"MEQ" { count (0); return (PARSEOP_MATCHTYPE_MEQ); } +"MLE" { count (0); return (PARSEOP_MATCHTYPE_MLE); } +"MLT" { count (0); return (PARSEOP_MATCHTYPE_MLT); } +"MGE" { count (0); return (PARSEOP_MATCHTYPE_MGE); } +"MGT" { count (0); return (PARSEOP_MATCHTYPE_MGT); } + + /* MaxKeyword: Max Range Type - Resource Descriptors */ + +"MaxFixed" { count (0); return (PARSEOP_MAXTYPE_FIXED); } +"MaxNotFixed" { count (0); return (PARSEOP_MAXTYPE_NOTFIXED); } + + /* MemTypeKeyword: Memory Types - Resource Descriptors */ + +"Cacheable" { count (0); return (PARSEOP_MEMTYPE_CACHEABLE); } +"WriteCombining" { count (0); return (PARSEOP_MEMTYPE_WRITECOMBINING); } +"Prefetchable" { count (0); return (PARSEOP_MEMTYPE_PREFETCHABLE); } +"NonCacheable" { count (0); return (PARSEOP_MEMTYPE_NONCACHEABLE); } + + /* MinKeyword: Min Range Type - Resource Descriptors */ + +"MinFixed" { count (0); return (PARSEOP_MINTYPE_FIXED); } +"MinNotFixed" { count (0); return (PARSEOP_MINTYPE_NOTFIXED); } + + /* ObjectTypeKeyword: ACPI Object Types */ + "UnknownObj" { count (0); return (PARSEOP_OBJECTTYPE_UNK); } "IntObj" { count (0); return (PARSEOP_OBJECTTYPE_INT); } "StrObj" { count (0); return (PARSEOP_OBJECTTYPE_STR); } @@ -290,22 +468,38 @@ "BuffFieldObj" { count (0); return (PARSEOP_OBJECTTYPE_BFF); } "DDBHandleObj" { count (0); return (PARSEOP_OBJECTTYPE_DDB); } -"AnyAcc" { count (0); return (PARSEOP_ACCESSTYPE_ANY); } -"ByteAcc" { count (0); return (PARSEOP_ACCESSTYPE_BYTE); } -"WordAcc" { count (0); return (PARSEOP_ACCESSTYPE_WORD); } -"DWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_DWORD); } -"QWordAcc" { count (0); return (PARSEOP_ACCESSTYPE_QWORD); } -"BufferAcc" { count (0); return (PARSEOP_ACCESSTYPE_BUF); } + /* ParityKeyword: Resource Descriptors (ACPI 5.0) */ -"Lock" { count (0); return (PARSEOP_LOCKRULE_LOCK); } -"NoLock" { count (0); return (PARSEOP_LOCKRULE_NOLOCK); } +"ParityTypeSpace" { count (0); return (PARSEOP_PARITYTYPE_SPACE); } +"ParityTypeMark" { count (0); return (PARSEOP_PARITYTYPE_MARK); } +"ParityTypeOdd" { count (0); return (PARSEOP_PARITYTYPE_ODD); } +"ParityTypeEven" { count (0); return (PARSEOP_PARITYTYPE_EVEN); } +"ParityTypeNone" { count (0); return (PARSEOP_PARITYTYPE_NONE); } -"Preserve" { count (0); return (PARSEOP_UPDATERULE_PRESERVE); } -"WriteAsOnes" { count (0); return (PARSEOP_UPDATERULE_ONES); } -"WriteAsZeros" { count (0); return (PARSEOP_UPDATERULE_ZEROS); } + /* PinConfigKeyword: Pin Configuration - GPIO Resource Descriptors (ACPI 5.0) */ -"Serialized" { count (0); return (PARSEOP_SERIALIZERULE_SERIAL); } -"NotSerialized" { count (0); return (PARSEOP_SERIALIZERULE_NOTSERIAL); } +"PullDefault" { count (0); return (PARSEOP_PIN_PULLDEFAULT); } +"PullUp" { count (0); return (PARSEOP_PIN_PULLUP); } +"PullDown" { count (0); return (PARSEOP_PIN_PULLDOWN); } +"PullNone" { count (0); return (PARSEOP_PIN_NOPULL); } + + /* PolarityKeyword: Resource Descriptors (ACPI 5.0) */ + +"PolarityLow" { count (0); return (PARSEOP_DEVICEPOLARITY_LOW); } +"PolarityHigh" { count (0); return (PARSEOP_DEVICEPOLARITY_HIGH); } + + /* RangeTypeKeyword: I/O Range Types - Resource Descriptors */ + +"ISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_ISAONLY); } +"NonISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_NONISAONLY); } +"EntireRange" { count (0); return (PARSEOP_RANGETYPE_ENTIRE); } + + /* ReadWriteKeyword: Memory Access Types - Resource Descriptors */ + +"ReadWrite" { count (0); return (PARSEOP_READWRITETYPE_BOTH); } +"ReadOnly" { count (0); return (PARSEOP_READWRITETYPE_READONLY); } + + /* RegionSpaceKeyword: Operation Region Address Space Types */ "SystemIO" { count (0); return (PARSEOP_REGIONSPACE_IO); } "SystemMemory" { count (0); return (PARSEOP_REGIONSPACE_MEM); } @@ -315,86 +509,82 @@ "SystemCMOS" { count (0); return (PARSEOP_REGIONSPACE_CMOS); } "PciBarTarget" { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); } "IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } +"GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ +"GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ +"FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } -"FFixedHW" { count (0); return (PARSEOP_ADDRESSSPACE_FFIXEDHW); } - -"SMBQuick" { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); } -"SMBSendReceive" { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); } -"SMBByte" { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); } -"SMBWord" { count (0); return (PARSEOP_ACCESSATTRIB_WORD); } -"SMBBlock" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); } -"SMBProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); } -"SMBBlockProcessCall" { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); } - -"MTR" { count (0); return (PARSEOP_MATCHTYPE_MTR); } -"MEQ" { count (0); return (PARSEOP_MATCHTYPE_MEQ); } -"MLE" { count (0); return (PARSEOP_MATCHTYPE_MLE); } -"MLT" { count (0); return (PARSEOP_MATCHTYPE_MLT); } -"MGE" { count (0); return (PARSEOP_MATCHTYPE_MGE); } -"MGT" { count (0); return (PARSEOP_MATCHTYPE_MGT); } + /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ -"Compatibility" { count (0); return (PARSEOP_DMATYPE_COMPATIBILITY); } -"TypeA" { count (0); return (PARSEOP_DMATYPE_A); } -"TypeB" { count (0); return (PARSEOP_DMATYPE_B); } -"TypeF" { count (0); return (PARSEOP_DMATYPE_F); } +"ResourceConsumer" { count (0); return (PARSEOP_RESOURCETYPE_CONSUMER); } +"ResourceProducer" { count (0); return (PARSEOP_RESOURCETYPE_PRODUCER); } -"BusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_MASTER); } -"NotBusMaster" { count (0); return (PARSEOP_BUSMASTERTYPE_NOTMASTER); } + /* SerializeRuleKeyword: Control Method Serialization */ -"Transfer8" { count (0); return (PARSEOP_XFERTYPE_8); } -"Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); } -"Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); } +"Serialized" { count (0); return (PARSEOP_SERIALIZERULE_SERIAL); } +"NotSerialized" { count (0); return (PARSEOP_SERIALIZERULE_NOTSERIAL); } -"ResourceConsumer" { count (0); return (PARSEOP_RESOURCETYPE_CONSUMER); } -"ResourceProducer" { count (0); return (PARSEOP_RESOURCETYPE_PRODUCER); } + /* ShareTypeKeyword: Interrupt Sharing - Resource Descriptors */ -"MinFixed" { count (0); return (PARSEOP_MINTYPE_FIXED); } -"MinNotFixed" { count (0); return (PARSEOP_MINTYPE_NOTFIXED); } +"Shared" { count (0); return (PARSEOP_SHARETYPE_SHARED); } +"Exclusive" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVE); } +"SharedAndWake" { count (0); return (PARSEOP_SHARETYPE_SHAREDWAKE); } /* ACPI 5.0 */ +"ExclusiveAndWake" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVEWAKE); } /* ACPI 5.0 */ -"MaxFixed" { count (0); return (PARSEOP_MAXTYPE_FIXED); } -"MaxNotFixed" { count (0); return (PARSEOP_MAXTYPE_NOTFIXED); } + /* SlaveModeKeyword: Resource Descriptors (ACPI 5.0) */ -"PosDecode" { count (0); return (PARSEOP_DECODETYPE_POS); } -"SubDecode" { count (0); return (PARSEOP_DECODETYPE_SUB); } +"ControllerInitiated" { count (0); return (PARSEOP_SLAVEMODE_CONTROLLERINIT); } +"DeviceInitiated" { count (0); return (PARSEOP_SLAVEMODE_DEVICEINIT); } -"ISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_ISAONLY); } -"NonISAOnlyRanges" { count (0); return (PARSEOP_RANGETYPE_NONISAONLY); } -"EntireRange" { count (0); return (PARSEOP_RANGETYPE_ENTIRE); } + /* StopBitsKeyword: Resource Descriptors (ACPI 5.0) */ -"Cacheable" { count (0); return (PARSEOP_MEMTYPE_CACHEABLE); } -"WriteCombining" { count (0); return (PARSEOP_MEMTYPE_WRITECOMBINING); } -"Prefetchable" { count (0); return (PARSEOP_MEMTYPE_PREFETCHABLE); } -"NonCacheable" { count (0); return (PARSEOP_MEMTYPE_NONCACHEABLE); } +"StopBitsOne" { count (0); return (PARSEOP_STOPBITS_ONE); } +"StopBitsOnePlusHalf" { count (0); return (PARSEOP_STOPBITS_ONEPLUSHALF); } +"StopBitsTwo" { count (0); return (PARSEOP_STOPBITS_TWO); } +"StopBitsZero" { count (0); return (PARSEOP_STOPBITS_ZERO); } -"ReadWrite" { count (0); return (PARSEOP_READWRITETYPE_BOTH); } -"ReadOnly" { count (0); return (PARSEOP_READWRITETYPE_READONLY); } + /* TransferWidthKeyword: DMA Widths - Fixed DMA Resource Descriptor (ACPI 5.0) */ -"Edge" { count (0); return (PARSEOP_INTTYPE_EDGE); } -"Level" { count (0); return (PARSEOP_INTTYPE_LEVEL); } +"Width8bit" { count (0); return (PARSEOP_XFERSIZE_8); } +"Width16bit" { count (0); return (PARSEOP_XFERSIZE_16); } +"Width32bit" { count (0); return (PARSEOP_XFERSIZE_32); } +"Width64bit" { count (0); return (PARSEOP_XFERSIZE_64); } +"Width128bit" { count (0); return (PARSEOP_XFERSIZE_128); } +"Width256bit" { count (0); return (PARSEOP_XFERSIZE_256); } -"ActiveHigh" { count (0); return (PARSEOP_INTLEVEL_ACTIVEHIGH); } -"ActiveLow" { count (0); return (PARSEOP_INTLEVEL_ACTIVELOW); } + /* TranslationKeyword: Translation Density Types - Resource Descriptors */ -"Shared" { count (0); return (PARSEOP_SHARETYPE_SHARED); } -"Exclusive" { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVE); } +"SparseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_SPARSE); } +"DenseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_DENSE); } -"Decode10" { count (0); return (PARSEOP_IODECODETYPE_10); } -"Decode16" { count (0); return (PARSEOP_IODECODETYPE_16); } + /* TypeKeyword: Translation Types - Resource Descriptors */ "TypeTranslation" { count (0); return (PARSEOP_TYPE_TRANSLATION); } "TypeStatic" { count (0); return (PARSEOP_TYPE_STATIC); } -"SparseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_SPARSE); } -"DenseTranslation" { count (0); return (PARSEOP_TRANSLATIONTYPE_DENSE); } + /* UpdateRuleKeyword: Field Update Rules */ -"AddressRangeMemory" { count (0); return (PARSEOP_ADDRESSTYPE_MEMORY); } -"AddressRangeReserved" { count (0); return (PARSEOP_ADDRESSTYPE_RESERVED); } -"AddressRangeNVS" { count (0); return (PARSEOP_ADDRESSTYPE_NVS); } -"AddressRangeACPI" { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); } +"Preserve" { count (0); return (PARSEOP_UPDATERULE_PRESERVE); } +"WriteAsOnes" { count (0); return (PARSEOP_UPDATERULE_ONES); } +"WriteAsZeros" { count (0); return (PARSEOP_UPDATERULE_ZEROS); } + + /* WireModeKeyword: SPI Wire Mode - Resource Descriptors (ACPI 5.0) */ + +"FourWireMode" { count (0); return (PARSEOP_WIREMODE_FOUR); } +"ThreeWireMode" { count (0); return (PARSEOP_WIREMODE_THREE); } + + /* XferTypeKeyword: DMA Transfer Types */ + +"Transfer8" { count (0); return (PARSEOP_XFERTYPE_8); } +"Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); } +"Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); } + + /* Predefined compiler names */ "__DATE__" { count (0); return (PARSEOP___DATE__); } "__FILE__" { count (0); return (PARSEOP___FILE__); } "__LINE__" { count (0); return (PARSEOP___LINE__); } +"__PATH__" { count (0); return (PARSEOP___PATH__); } + "{" { count (0); return('{'); } "}" { count (0); return('}'); } @@ -402,7 +592,6 @@ "(" { count (0); return('('); } ")" { count (0); return(')'); } - {NameSeg} { char *s; count (0); s=malloc (ACPI_NAME_SIZE + 1); @@ -478,7 +667,6 @@ void) { ASL_FILE_NODE *Fnode; - FILE *InputFile = NULL; Fnode = InputStack; @@ -497,7 +685,6 @@ /* Update the top-of-stack */ InputStack = Fnode->Next; - InputFile = Fnode->File; /* Reset global line counter and filename */ --- sys/contrib/dev/acpica/compiler/aslcompiler.y 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslcompiler.y 2011-11-23 13:29:36.000000000 -0500 @@ -1,8 +1,7 @@ - %{ /****************************************************************************** * - * Module Name: aslcompiler.y - Bison input file (ASL grammar and actions) + * Module Name: aslcompiler.y - Bison/Yacc input file (ASL grammar and actions) * *****************************************************************************/ @@ -106,22 +105,28 @@ * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 60 +%expect 86 -/* +/****************************************************************************** + * * Token types: These are returned by the lexer * * NOTE: This list MUST match the AslKeywordMapping table found * in aslmap.c EXACTLY! Double check any changes! - */ + * + *****************************************************************************/ + %token PARSEOP_ACCESSAS %token PARSEOP_ACCESSATTRIB_BLOCK %token PARSEOP_ACCESSATTRIB_BLOCK_CALL %token PARSEOP_ACCESSATTRIB_BYTE -%token PARSEOP_ACCESSATTRIB_WORD_CALL +%token PARSEOP_ACCESSATTRIB_MULTIBYTE %token PARSEOP_ACCESSATTRIB_QUICK +%token PARSEOP_ACCESSATTRIB_RAW_BYTES +%token PARSEOP_ACCESSATTRIB_RAW_PROCESS %token PARSEOP_ACCESSATTRIB_SND_RCV %token PARSEOP_ACCESSATTRIB_WORD +%token PARSEOP_ACCESSATTRIB_WORD_CALL %token PARSEOP_ACCESSTYPE_ANY %token PARSEOP_ACCESSTYPE_BUF %token PARSEOP_ACCESSTYPE_BYTE @@ -130,7 +135,8 @@ %token PARSEOP_ACCESSTYPE_WORD %token PARSEOP_ACQUIRE %token PARSEOP_ADD -%token PARSEOP_ADDRESSSPACE_FFIXEDHW +%token PARSEOP_ADDRESSINGMODE_7BIT +%token PARSEOP_ADDRESSINGMODE_10BIT %token PARSEOP_ADDRESSTYPE_ACPI %token PARSEOP_ADDRESSTYPE_MEMORY %token PARSEOP_ADDRESSTYPE_NVS @@ -145,6 +151,11 @@ %token PARSEOP_ARG5 %token PARSEOP_ARG6 %token PARSEOP_BANKFIELD +%token PARSEOP_BITSPERBYTE_EIGHT +%token PARSEOP_BITSPERBYTE_FIVE +%token PARSEOP_BITSPERBYTE_NINE +%token PARSEOP_BITSPERBYTE_SEVEN +%token PARSEOP_BITSPERBYTE_SIX %token PARSEOP_BREAK %token PARSEOP_BREAKPOINT %token PARSEOP_BUFFER @@ -152,9 +163,14 @@ %token PARSEOP_BUSMASTERTYPE_NOTMASTER %token PARSEOP_BYTECONST %token PARSEOP_CASE +%token PARSEOP_CLOCKPHASE_FIRST +%token PARSEOP_CLOCKPHASE_SECOND +%token PARSEOP_CLOCKPOLARITY_HIGH +%token PARSEOP_CLOCKPOLARITY_LOW %token PARSEOP_CONCATENATE %token PARSEOP_CONCATENATERESTEMPLATE %token PARSEOP_CONDREFOF +%token PARSEOP_CONNECTION %token PARSEOP_CONTINUE %token PARSEOP_COPYOBJECT %token PARSEOP_CREATEBITFIELD @@ -163,6 +179,7 @@ %token PARSEOP_CREATEFIELD %token PARSEOP_CREATEQWORDFIELD %token PARSEOP_CREATEWORDFIELD +%token PARSEOP_DATABUFFER %token PARSEOP_DATATABLEREGION %token PARSEOP_DEBUG %token PARSEOP_DECODETYPE_POS @@ -173,6 +190,8 @@ %token PARSEOP_DEFINITIONBLOCK %token PARSEOP_DEREFOF %token PARSEOP_DEVICE +%token PARSEOP_DEVICEPOLARITY_HIGH +%token PARSEOP_DEVICEPOLARITY_LOW %token PARSEOP_DIVIDE %token PARSEOP_DMA %token PARSEOP_DMATYPE_A @@ -187,6 +206,8 @@ %token PARSEOP_ELSE %token PARSEOP_ELSEIF %token PARSEOP_ENDDEPENDENTFN +%token PARSEOP_ENDIAN_BIG +%token PARSEOP_ENDIAN_LITTLE %token PARSEOP_ENDTAG %token PARSEOP_ERRORNODE %token PARSEOP_EVENT @@ -198,9 +219,16 @@ %token PARSEOP_FIELD %token PARSEOP_FINDSETLEFTBIT %token PARSEOP_FINDSETRIGHTBIT +%token PARSEOP_FIXEDDMA %token PARSEOP_FIXEDIO +%token PARSEOP_FLOWCONTROL_HW +%token PARSEOP_FLOWCONTROL_NONE +%token PARSEOP_FLOWCONTROL_SW %token PARSEOP_FROMBCD %token PARSEOP_FUNCTION +%token PARSEOP_GPIO_INT +%token PARSEOP_GPIO_IO +%token PARSEOP_I2C_SERIALBUS %token PARSEOP_IF %token PARSEOP_INCLUDE %token PARSEOP_INCLUDE_CSTYLE @@ -210,6 +238,7 @@ %token PARSEOP_INDEXFIELD %token PARSEOP_INTEGER %token PARSEOP_INTERRUPT +%token PARSEOP_INTLEVEL_ACTIVEBOTH %token PARSEOP_INTLEVEL_ACTIVEHIGH %token PARSEOP_INTLEVEL_ACTIVELOW %token PARSEOP_INTTYPE_EDGE @@ -217,6 +246,10 @@ %token PARSEOP_IO %token PARSEOP_IODECODETYPE_10 %token PARSEOP_IODECODETYPE_16 +%token PARSEOP_IORESTRICT_IN +%token PARSEOP_IORESTRICT_NONE +%token PARSEOP_IORESTRICT_OUT +%token PARSEOP_IORESTRICT_PRESERVE %token PARSEOP_IRQ %token PARSEOP_IRQNOFLAGS %token PARSEOP_LAND @@ -297,6 +330,15 @@ %token PARSEOP_OR %token PARSEOP_PACKAGE %token PARSEOP_PACKAGE_LENGTH +%token PARSEOP_PARITYTYPE_EVEN +%token PARSEOP_PARITYTYPE_MARK +%token PARSEOP_PARITYTYPE_NONE +%token PARSEOP_PARITYTYPE_ODD +%token PARSEOP_PARITYTYPE_SPACE +%token PARSEOP_PIN_NOPULL +%token PARSEOP_PIN_PULLDEFAULT +%token PARSEOP_PIN_PULLDOWN +%token PARSEOP_PIN_PULLUP %token PARSEOP_POWERRESOURCE %token PARSEOP_PROCESSOR %token PARSEOP_QWORDCONST @@ -312,6 +354,9 @@ %token PARSEOP_REFOF %token PARSEOP_REGIONSPACE_CMOS %token PARSEOP_REGIONSPACE_EC +%token PARSEOP_REGIONSPACE_FFIXEDHW +%token PARSEOP_REGIONSPACE_GPIO +%token PARSEOP_REGIONSPACE_GSBUS %token PARSEOP_REGIONSPACE_IO %token PARSEOP_REGIONSPACE_IPMI %token PARSEOP_REGIONSPACE_MEM @@ -331,15 +376,24 @@ %token PARSEOP_SERIALIZERULE_NOTSERIAL %token PARSEOP_SERIALIZERULE_SERIAL %token PARSEOP_SHARETYPE_EXCLUSIVE +%token PARSEOP_SHARETYPE_EXCLUSIVEWAKE %token PARSEOP_SHARETYPE_SHARED +%token PARSEOP_SHARETYPE_SHAREDWAKE %token PARSEOP_SHIFTLEFT %token PARSEOP_SHIFTRIGHT %token PARSEOP_SIGNAL %token PARSEOP_SIZEOF +%token PARSEOP_SLAVEMODE_CONTROLLERINIT +%token PARSEOP_SLAVEMODE_DEVICEINIT %token PARSEOP_SLEEP +%token PARSEOP_SPI_SERIALBUS %token PARSEOP_STALL %token PARSEOP_STARTDEPENDENTFN %token PARSEOP_STARTDEPENDENTFN_NOPRI +%token PARSEOP_STOPBITS_ONE +%token PARSEOP_STOPBITS_ONEPLUSHALF +%token PARSEOP_STOPBITS_TWO +%token PARSEOP_STOPBITS_ZERO %token PARSEOP_STORE %token PARSEOP_STRING_LITERAL %token PARSEOP_SUBTRACT @@ -357,6 +411,7 @@ %token PARSEOP_TRANSLATIONTYPE_SPARSE %token PARSEOP_TYPE_STATIC %token PARSEOP_TYPE_TRANSLATION +%token PARSEOP_UART_SERIALBUS %token PARSEOP_UNICODE %token PARSEOP_UNLOAD %token PARSEOP_UPDATERULE_ONES @@ -367,10 +422,18 @@ %token PARSEOP_VENDORSHORT %token PARSEOP_WAIT %token PARSEOP_WHILE +%token PARSEOP_WIREMODE_FOUR +%token PARSEOP_WIREMODE_THREE %token PARSEOP_WORDBUSNUMBER %token PARSEOP_WORDCONST %token PARSEOP_WORDIO %token PARSEOP_WORDSPACE +%token PARSEOP_XFERSIZE_8 +%token PARSEOP_XFERSIZE_16 +%token PARSEOP_XFERSIZE_32 +%token PARSEOP_XFERSIZE_64 +%token PARSEOP_XFERSIZE_128 +%token PARSEOP_XFERSIZE_256 %token PARSEOP_XFERTYPE_8 %token PARSEOP_XFERTYPE_8_16 %token PARSEOP_XFERTYPE_16 @@ -384,64 +447,64 @@ %token PARSEOP___DATE__ %token PARSEOP___FILE__ %token PARSEOP___LINE__ +%token PARSEOP___PATH__ -/* + +/****************************************************************************** + * * Production names - */ + * + *****************************************************************************/ +%type ArgList %type ASLCode -%type DefinitionBlockTerm -%type TermList -%type Term +%type BufferData +%type BufferTermData %type CompilerDirective -%type ObjectList -%type Object %type DataObject -%type BufferData -%type PackageData +%type DefinitionBlockTerm %type IntegerData -%type StringData %type NamedObject %type NameSpaceModifier -%type UserTerm -%type ArgList -%type TermArg -%type Target -%type RequiredTarget -%type SimpleTarget -%type BufferTermData +%type Object +%type ObjectList +%type PackageData %type ParameterTypePackage %type ParameterTypePackageList %type ParameterTypesPackage %type ParameterTypesPackageList +%type RequiredTarget +%type SimpleTarget +%type StringData +%type Target +%type Term +%type TermArg +%type TermList +%type UserTerm + +/* Type4Opcode is obsolete */ %type Type1Opcode -%type Type2Opcode -%type Type2IntegerOpcode -%type Type2StringOpcode %type Type2BufferOpcode %type Type2BufferOrStringOpcode +%type Type2IntegerOpcode +%type Type2Opcode +%type Type2StringOpcode %type Type3Opcode - -/* Obsolete %type Type4Opcode */ - %type Type5Opcode %type Type6Opcode -%type LineTerm -%type IncludeTerm -%type IncludeCStyleTerm +%type AccessAsTerm %type ExternalTerm - -%type FieldUnitList %type FieldUnit %type FieldUnitEntry - +%type FieldUnitList +%type IncludeCStyleTerm +%type IncludeTerm +%type LineTerm %type OffsetTerm -%type AccessAsTerm %type OptionalAccessAttribTerm - /* Named Objects */ %type BankFieldTerm @@ -465,7 +528,6 @@ %type ProcessorTerm %type ThermalZoneTerm - /* Namespace modifiers */ %type AliasTerm @@ -474,13 +536,16 @@ /* Type 1 opcodes */ -%type BreakTerm %type BreakPointTerm +%type BreakTerm +%type CaseDefaultTermList +%type CaseTerm %type ContinueTerm +%type DefaultTerm +%type ElseTerm %type FatalTerm %type IfElseTerm %type IfTerm -%type ElseTerm %type LoadTerm %type NoOpTerm %type NotifyTerm @@ -491,20 +556,17 @@ %type SleepTerm %type StallTerm %type SwitchTerm -%type CaseDefaultTermList -//%type CaseTermList -%type CaseTerm -%type DefaultTerm %type UnloadTerm %type WhileTerm +//%type CaseTermList /* Type 2 opcodes */ %type AcquireTerm %type AddTerm %type AndTerm -%type ConcatTerm %type ConcatResTerm +%type ConcatTerm %type CondRefOfTerm %type CopyObjectTerm %type DecTerm @@ -517,12 +579,12 @@ %type IndexTerm %type LAndTerm %type LEqualTerm -%type LGreaterTerm %type LGreaterEqualTerm -%type LLessTerm +%type LGreaterTerm %type LLessEqualTerm -%type LNotTerm +%type LLessTerm %type LNotEqualTerm +%type LNotTerm %type LoadTableTerm %type LOrTerm %type MatchTerm @@ -550,39 +612,49 @@ %type WaitTerm %type XOrTerm -%type OptionalTermArg -%type OptionalReturnArg -%type OptionalListString - - /* Keywords */ -%type ObjectTypeKeyword -%type AccessTypeKeyword %type AccessAttribKeyword -%type LockRuleKeyword -%type UpdateRuleKeyword -%type RegionSpaceKeyword +%type AccessTypeKeyword +%type AddressingModeKeyword +%type AddressKeyword %type AddressSpaceKeyword -%type MatchOpKeyword -%type SerializeRuleKeyword +%type BitsPerByteKeyword +%type ClockPhaseKeyword +%type ClockPolarityKeyword +%type DecodeKeyword +%type DevicePolarityKeyword %type DMATypeKeyword -%type OptionalBusMasterKeyword -%type XferTypeKeyword -%type ResourceTypeKeyword -%type MinKeyword +%type EndianKeyword +%type FlowControlKeyword +%type InterruptLevel +%type InterruptTypeKeyword +%type IODecodeKeyword +%type IoRestrictionKeyword +%type LockRuleKeyword +%type MatchOpKeyword %type MaxKeyword -%type DecodeKeyword -%type RangeTypeKeyword %type MemTypeKeyword +%type MinKeyword +%type ObjectTypeKeyword +%type OptionalBusMasterKeyword %type OptionalReadWriteKeyword -%type InterruptTypeKeyword -%type InterruptLevel +%type ParityTypeKeyword +%type PinConfigByte +%type PinConfigKeyword +%type RangeTypeKeyword +%type RegionSpaceKeyword +%type ResourceTypeKeyword +%type SerializeRuleKeyword %type ShareTypeKeyword -%type IODecodeKeyword -%type TypeKeyword +%type SlaveModeKeyword +%type StopBitsKeyword %type TranslationKeyword -%type AddressKeyword +%type TypeKeyword +%type UpdateRuleKeyword +%type WireModeKeyword +%type XferSizeKeyword +%type XferTypeKeyword /* Types */ @@ -599,31 +671,34 @@ %type String %type ConstTerm +%type ConstExprTerm %type ByteConstExpr %type WordConstExpr %type DWordConstExpr %type QWordConstExpr -%type ConstExprTerm +%type DWordList %type BufferTerm %type ByteList -%type DWordList -%type PackageTerm -%type PackageList %type PackageElement - +%type PackageList +%type PackageTerm %type VarPackageLengthTerm /* Macros */ %type EISAIDTerm +%type ResourceMacroList +%type ResourceMacroTerm %type ResourceTemplateTerm %type ToUUIDTerm %type UnicodeTerm -%type ResourceMacroList -%type ResourceMacroTerm +/* Resource Descriptors */ + +%type ConnectionTerm +%type DataBufferTerm %type DMATerm %type DWordIOTerm %type DWordMemoryTerm @@ -632,7 +707,11 @@ %type ExtendedIOTerm %type ExtendedMemoryTerm %type ExtendedSpaceTerm +%type FixedDmaTerm %type FixedIOTerm +%type GpioIntTerm +%type GpioIoTerm +%type I2cSerialBusTerm %type InterruptTerm %type IOTerm %type IRQNoFlagsTerm @@ -640,59 +719,75 @@ %type Memory24Term %type Memory32FixedTerm %type Memory32Term +%type NameSeg +%type NameString %type QWordIOTerm %type QWordMemoryTerm %type QWordSpaceTerm %type RegisterTerm -%type StartDependentFnTerm +%type SpiSerialBusTerm %type StartDependentFnNoPriTerm +%type StartDependentFnTerm +%type UartSerialBusTerm %type VendorLongTerm %type VendorShortTerm %type WordBusNumberTerm %type WordIOTerm %type WordSpaceTerm -%type NameString -%type NameSeg - - /* Local types that help construct the AML, not in ACPI spec */ -%type IncludeEndTerm %type AmlPackageLengthTerm +%type IncludeEndTerm +%type NameStringItem +%type TermArgItem + +%type OptionalAccessSize +%type OptionalAddressingMode +%type OptionalAddressRange +%type OptionalBitsPerByte +%type OptionalBuffer_Last %type OptionalByteConstExpr +%type OptionalCount +%type OptionalDecodeType +%type OptionalDevicePolarity %type OptionalDWordConstExpr -%type OptionalQWordConstExpr -%type OptionalSerializeRuleKeyword -%type OptionalResourceType_First -%type OptionalResourceType -%type OptionalMinType +%type OptionalEndian +%type OptionalFlowControl +%type OptionalIoRestriction +%type OptionalListString %type OptionalMaxType %type OptionalMemType -%type OptionalCount -%type OptionalDecodeType -%type OptionalRangeType -%type OptionalShareType -%type OptionalType -%type OptionalType_Last -%type OptionalTranslationType_Last -%type OptionalStringData +%type OptionalMinType %type OptionalNameString %type OptionalNameString_First %type OptionalNameString_Last -%type OptionalAddressRange %type OptionalObjectTypeKeyword %type OptionalParameterTypePackage %type OptionalParameterTypesPackage +%type OptionalParityType +%type OptionalQWordConstExpr +%type OptionalRangeType %type OptionalReference -%type OptionalAccessSize - -%type TermArgItem -%type NameStringItem +%type OptionalResourceType +%type OptionalResourceType_First +%type OptionalReturnArg +%type OptionalSerializeRuleKeyword +%type OptionalShareType +%type OptionalShareType_First +%type OptionalSlaveMode +%type OptionalStopBits +%type OptionalStringData +%type OptionalTermArg +%type OptionalTranslationType_Last +%type OptionalType +%type OptionalType_Last +%type OptionalWireMode +%type OptionalWordConst +%type OptionalWordConstExpr +%type OptionalXferSize %% - - /******************************************************************************* * * Production rules start here @@ -745,7 +840,9 @@ 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);} ; Term @@ -1107,6 +1204,7 @@ : FieldUnitEntry {} | OffsetTerm {} | AccessAsTerm {} + | ConnectionTerm {} ; FieldUnitEntry @@ -1132,6 +1230,21 @@ error ')' {$$ = AslDoError(); yyclearin;} ; +ConnectionTerm + : PARSEOP_CONNECTION '(' + NameString + ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} + | PARSEOP_CONNECTION '(' {$$ = TrCreateLeafNode (PARSEOP_CONNECTION);} + ResourceMacroTerm + ')' {$$ = TrLinkChildren ($3, 1, + TrLinkChildren (TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + $4));} + | PARSEOP_CONNECTION '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + CreateBitFieldTerm : PARSEOP_CREATEBITFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg @@ -2052,23 +2165,23 @@ /******* Keywords *************************************************************/ -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);} +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_MULTIBYTE '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} + ByteConst + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} + ByteConst + ')' {$$ = TrLinkChildren ($3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} + ByteConst + ')' {$$ = TrLinkChildren ($3,1,$4);} ; AccessTypeKeyword @@ -2080,58 +2193,49 @@ | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} ; -AccessAttribKeyword - : PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} - | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} - | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} - | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} - | PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} - | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} - | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} - ; - -LockRuleKeyword - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} - ; - -UpdateRuleKeyword - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} +AddressingModeKeyword + : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} + | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} ; - -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);} +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);} ; AddressSpaceKeyword : ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} | RegionSpaceKeyword {} - | PARSEOP_ADDRESSSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_ADDRESSSPACE_FFIXEDHW);} ; +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);} + ; + +ClockPhaseKeyword + : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} + | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} + ; + +ClockPolarityKeyword + : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} + | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} + ; -SerializeRuleKeyword - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} +DecodeKeyword + : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} + | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} ; -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);} +DevicePolarityKeyword + : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} + | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} ; DMATypeKeyword @@ -2141,36 +2245,57 @@ | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} ; -XferTypeKeyword - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} +EndianKeyword + : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} + | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} ; -ResourceTypeKeyword - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} +FlowControlKeyword + : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} + | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} + | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} ; -MinKeyword - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} +InterruptLevel + : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} + | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} + | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} ; -MaxKeyword - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} +InterruptTypeKeyword + : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} + | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} ; -DecodeKeyword - : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} - | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} +IODecodeKeyword + : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} + | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} ; -RangeTypeKeyword - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} +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);} + ; + +LockRuleKeyword + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (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);} + ; + +MaxKeyword + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} ; MemTypeKeyword @@ -2180,30 +2305,102 @@ | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} ; -OptionalReadWriteKeyword - : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} +MinKeyword + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} ; -InterruptTypeKeyword - : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} - | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} +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);} ; -InterruptLevel - : PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} - | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} +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);} + ; + +PinConfigByte + : PinConfigKeyword {$$ = $1;} + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} + ; + +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);} + ; + +RangeTypeKeyword + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (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_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} + ; + +ResourceTypeKeyword + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} + ; + +SerializeRuleKeyword + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (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);} + ; + +SlaveModeKeyword + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} ; -IODecodeKeyword - : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} - | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} +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);} + ; + +TranslationKeyword + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} ; TypeKeyword @@ -2211,16 +2408,30 @@ | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} ; -TranslationKeyword - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} +UpdateRuleKeyword + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} ; -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);} +WireModeKeyword + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (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);} + ; + +XferTypeKeyword + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} ; @@ -2291,6 +2502,16 @@ | PARSEOP_REVISION {$$ = TrCreateLeafNode (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__);} + ; + ByteConstExpr : Type3Opcode {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} @@ -2319,15 +2540,6 @@ | QWordConst {} ; -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__);} - ; - /* OptionalCount must appear before ByteList or an incorrect reduction will result */ OptionalCount @@ -2336,7 +2548,6 @@ | ',' TermArg {$$ = $2;} ; - BufferTerm : PARSEOP_BUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} OptionalTermArg @@ -2359,6 +2570,15 @@ ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} ; +DataBufferTerm + : PARSEOP_DATABUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + OptionalWordConst + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} + | PARSEOP_DATABUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + DWordList : {$$ = NULL;} | DWordConstExpr @@ -2376,11 +2596,6 @@ error ')' {$$ = AslDoError(); yyclearin;} ; -VarPackageLengthTerm - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | TermArg {$$ = $1;} - ; - PackageList : {$$ = NULL;} | PackageElement @@ -2394,6 +2609,15 @@ | NameString {} ; +VarPackageLengthTerm + : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} + | TermArg {$$ = $1;} + ; + + +/******* Macros ***********************************************/ + + EISAIDTerm : PARSEOP_EISAID '(' StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} @@ -2401,6 +2625,14 @@ error ')' {$$ = AslDoError(); yyclearin;} ; +UnicodeTerm + : PARSEOP_UNICODE '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} + StringData + ')' {$$ = TrLinkChildren ($3,2,0,$4);} + | PARSEOP_UNICODE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + /******* Resources and Memory ***********************************************/ @@ -2419,14 +2651,6 @@ TrCreateLeafNode (PARSEOP_ENDTAG));} ; -UnicodeTerm - : PARSEOP_UNICODE '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} - StringData - ')' {$$ = TrLinkChildren ($3,2,0,$4);} - | PARSEOP_UNICODE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - ResourceMacroList : {$$ = NULL;} | ResourceMacroList @@ -2442,7 +2666,11 @@ | ExtendedIOTerm {} | ExtendedMemoryTerm {} | ExtendedSpaceTerm {} + | FixedDmaTerm {} | FixedIOTerm {} + | GpioIntTerm {} + | GpioIoTerm {} + | I2cSerialBusTerm {} | InterruptTerm {} | IOTerm {} | IRQNoFlagsTerm {} @@ -2454,8 +2682,10 @@ | QWordMemoryTerm {} | QWordSpaceTerm {} | RegisterTerm {} - | StartDependentFnTerm {} + | SpiSerialBusTerm {} | StartDependentFnNoPriTerm {} + | StartDependentFnTerm {} + | UartSerialBusTerm {} | VendorLongTerm {} | VendorShortTerm {} | WordBusNumberTerm {} @@ -2612,6 +2842,17 @@ error ')' {$$ = AslDoError(); yyclearin;} ; +FixedDmaTerm + : PARSEOP_FIXEDDMA '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} + WordConstExpr // 04: DMA RequestLines + ',' WordConstExpr // 06: DMA Channels + OptionalXferSize // 07: DMA TransferSize + OptionalNameString // 08: DescriptorName + ')' {$$ = TrLinkChildren ($3,4,$4,$6,$7,$8);} + | PARSEOP_FIXEDDMA '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + FixedIOTerm : PARSEOP_FIXEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} WordConstExpr @@ -2622,6 +2863,58 @@ error ')' {$$ = AslDoError(); yyclearin;} ; +GpioIntTerm + : PARSEOP_GPIO_INT '(' {$$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} + InterruptTypeKeyword // 04: InterruptType + ',' InterruptLevel // 06: InterruptLevel + OptionalShareType // 07: SharedType + ',' PinConfigByte // 09: PinConfig + OptionalWordConstExpr // 10: DebounceTimeout + ',' StringData // 12: ResourceSource + OptionalByteConstExpr // 13: ResourceSourceIndex + OptionalResourceType // 14: ResourceType + OptionalNameString // 15: DescriptorName + OptionalBuffer_Last // 16: VendorData + ')' '{' + DWordConstExpr '}' {$$ = TrLinkChildren ($3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} + | PARSEOP_GPIO_INT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +GpioIoTerm + : PARSEOP_GPIO_IO '(' {$$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} + OptionalShareType_First // 04: SharedType + ',' PinConfigByte // 06: PinConfig + OptionalWordConstExpr // 07: DebounceTimeout + OptionalWordConstExpr // 08: DriveStrength + OptionalIoRestriction // 09: IoRestriction + ',' StringData // 11: ResourceSource + OptionalByteConstExpr // 12: ResourceSourceIndex + OptionalResourceType // 13: ResourceType + OptionalNameString // 14: DescriptorName + OptionalBuffer_Last // 15: VendorData + ')' '{' + DWordList '}' {$$ = TrLinkChildren ($3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} + | PARSEOP_GPIO_IO '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +I2cSerialBusTerm + : PARSEOP_I2C_SERIALBUS '(' {$$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} + WordConstExpr // 04: SlaveAddress + OptionalSlaveMode // 05: SlaveMode + ',' DWordConstExpr // 07: ConnectionSpeed + OptionalAddressingMode // 08: AddressingMode + ',' StringData // 10: ResourceSource + OptionalByteConstExpr // 11: ResourceSourceIndex + OptionalResourceType // 12: ResourceType + OptionalNameString // 13: DescriptorName + OptionalBuffer_Last // 14: VendorData + ')' {$$ = TrLinkChildren ($3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} + | PARSEOP_I2C_SERIALBUS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + InterruptTerm : PARSEOP_INTERRUPT '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} OptionalResourceType_First @@ -2787,6 +3080,34 @@ error ')' {$$ = AslDoError(); yyclearin;} ; +SpiSerialBusTerm + : PARSEOP_SPI_SERIALBUS '(' {$$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} + WordConstExpr // 04: DeviceSelection + OptionalDevicePolarity // 05: DevicePolarity + OptionalWireMode // 06: WireMode + ',' ByteConstExpr // 08: DataBitLength + OptionalSlaveMode // 09: SlaveMode + ',' DWordConstExpr // 11: ConnectionSpeed + ',' ClockPolarityKeyword // 13: ClockPolarity + ',' ClockPhaseKeyword // 15: ClockPhase + ',' StringData // 17: ResourceSource + OptionalByteConstExpr // 18: ResourceSourceIndex + OptionalResourceType // 19: ResourceType + OptionalNameString // 20: DescriptorName + OptionalBuffer_Last // 21: VendorData + ')' {$$ = TrLinkChildren ($3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} + | PARSEOP_SPI_SERIALBUS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +StartDependentFnNoPriTerm + : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + ')' '{' + ResourceMacroList '}' {$$ = TrLinkChildren ($3,1,$6);} + | PARSEOP_STARTDEPENDENTFN_NOPRI '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + StartDependentFnTerm : PARSEOP_STARTDEPENDENTFN '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} ByteConstExpr @@ -2797,11 +3118,24 @@ error ')' {$$ = AslDoError(); yyclearin;} ; -StartDependentFnNoPriTerm - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} - ')' '{' - ResourceMacroList '}' {$$ = TrLinkChildren ($3,1,$6);} - | PARSEOP_STARTDEPENDENTFN_NOPRI '(' +UartSerialBusTerm + : PARSEOP_UART_SERIALBUS '(' {$$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} + DWordConstExpr // 04: ConnectionSpeed + OptionalBitsPerByte // 05: BitsPerByte + OptionalStopBits // 06: StopBits + ',' ByteConstExpr // 08: LinesInUse + OptionalEndian // 09: Endianess + OptionalParityType // 10: Parity + OptionalFlowControl // 11: FlowControl + ',' WordConstExpr // 13: Rx BufferSize + ',' WordConstExpr // 15: Tx BufferSize + ',' StringData // 17: ResourceSource + OptionalByteConstExpr // 18: ResourceSourceIndex + OptionalResourceType // 19: ResourceType + OptionalNameString // 20: DescriptorName + OptionalBuffer_Last // 21: VendorData + ')' {$$ = TrLinkChildren ($3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} + | PARSEOP_UART_SERIALBUS '(' error ')' {$$ = AslDoError(); yyclearin;} ; @@ -2910,6 +3244,16 @@ : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} ; +NameStringItem + : ',' NameString {$$ = $2;} + | ',' error {$$ = AslDoError (); yyclearin;} + ; + +TermArgItem + : ',' TermArg {$$ = $2;} + | ',' error {$$ = AslDoError (); yyclearin;} + ; + OptionalBusMasterKeyword : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} @@ -2929,12 +3273,28 @@ | ',' ByteConstExpr {$$ = $2;} ; +OptionalAddressingMode + : ',' {$$ = NULL;} + | ',' AddressingModeKeyword {$$ = $2;} + ; + OptionalAddressRange : {$$ = NULL;} | ',' {$$ = NULL;} | ',' AddressKeyword {$$ = $2;} ; +OptionalBitsPerByte + : ',' {$$ = NULL;} + | ',' BitsPerByteKeyword {$$ = $2;} + ; + +OptionalBuffer_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' DataBufferTerm {$$ = $2;} + ; + OptionalByteConstExpr : {$$ = NULL;} | ',' {$$ = NULL;} @@ -2946,12 +3306,32 @@ | ',' DecodeKeyword {$$ = $2;} ; +OptionalDevicePolarity + : ',' {$$ = NULL;} + | ',' DevicePolarityKeyword {$$ = $2;} + ; + OptionalDWordConstExpr : {$$ = NULL;} | ',' {$$ = NULL;} | ',' DWordConstExpr {$$ = $2;} ; +OptionalEndian + : ',' {$$ = NULL;} + | ',' EndianKeyword {$$ = $2;} + ; + +OptionalFlowControl + : ',' {$$ = NULL;} + | ',' FlowControlKeyword {$$ = $2;} + ; + +OptionalIoRestriction + : ',' {$$ = NULL;} + | ',' IoRestrictionKeyword {$$ = $2;} + ; + OptionalListString : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ @@ -2995,6 +3375,11 @@ | ',' ObjectTypeKeyword {$$ = $2;} ; +OptionalParityType + : ',' {$$ = NULL;} + | ',' ParityTypeKeyword {$$ = $2;} + ; + OptionalQWordConstExpr : {$$ = NULL;} | ',' {$$ = NULL;} @@ -3006,6 +3391,12 @@ | ',' RangeTypeKeyword {$$ = $2;} ; +OptionalReadWriteKeyword + : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} + | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} + | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} + ; + OptionalReference : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ @@ -3013,27 +3404,48 @@ ; OptionalResourceType_First - : {$$ = NULL;} + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} | ResourceTypeKeyword {$$ = $1;} ; OptionalResourceType - : ',' {$$ = NULL;} + : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} | ',' ResourceTypeKeyword {$$ = $2;} ; +OptionalReturnArg + : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ + | TermArg {$$ = $1;} + ; + OptionalSerializeRuleKeyword : {$$ = NULL;} | ',' {$$ = NULL;} | ',' SerializeRuleKeyword {$$ = $2;} ; +OptionalSlaveMode + : ',' {$$ = NULL;} + | ',' SlaveModeKeyword {$$ = $2;} + ; + OptionalShareType : {$$ = NULL;} | ',' {$$ = NULL;} | ',' ShareTypeKeyword {$$ = $2;} ; +OptionalShareType_First + : {$$ = NULL;} + | ShareTypeKeyword {$$ = $1;} + ; + +OptionalStopBits + : ',' {$$ = NULL;} + | ',' StopBitsKeyword {$$ = $2;} + ; + OptionalStringData : {$$ = NULL;} | ',' {$$ = NULL;} @@ -3045,11 +3457,6 @@ | TermArg {$$ = $1;} ; -OptionalReturnArg - : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ - | TermArg {$$ = $1;} - ; - OptionalType : {$$ = NULL;} | ',' {$$ = NULL;} @@ -3068,23 +3475,33 @@ | ',' TranslationKeyword {$$ = $2;} ; - -TermArgItem - : ',' TermArg {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} +OptionalWireMode + : ',' {$$ = NULL;} + | ',' WireModeKeyword {$$ = $2;} ; -NameStringItem - : ',' NameString {$$ = $2;} - | ',' error {$$ = AslDoError (); yyclearin;} +OptionalWordConst + : {$$ = NULL;} + | WordConst {$$ = $1;} ; -%% +OptionalWordConstExpr + : ',' {$$ = NULL;} + | ',' WordConstExpr {$$ = $2;} + ; +OptionalXferSize + : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | ',' XferSizeKeyword {$$ = $2;} + ; -/* +%% +/****************************************************************************** + * * Local support functions - */ + * + *****************************************************************************/ int AslCompilerwrap(void) --- sys/contrib/dev/acpica/compiler/asldefine.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/asldefine.h 2011-11-23 13:29:36.000000000 -0500 @@ -56,7 +56,7 @@ #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 4.0a" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0" /* Configuration constants */ @@ -153,5 +153,25 @@ #define POSITIVE 0 +/* Helper macros for resource tag creation */ + +#define RsCreateMultiBitField \ + RsCreateResourceField + +#define RsCreateBitField(Op, Name, ByteOffset, BitOffset) \ + RsCreateResourceField (Op, Name, ByteOffset, BitOffset, 1) + +#define RsCreateByteField(Op, Name, ByteOffset) \ + RsCreateResourceField (Op, Name, ByteOffset, 0, 8); + +#define RsCreateWordField(Op, Name, ByteOffset) \ + RsCreateResourceField (Op, Name, ByteOffset, 0, 16); + +#define RsCreateDwordField(Op, Name, ByteOffset) \ + RsCreateResourceField (Op, Name, ByteOffset, 0, 32); + +#define RsCreateQwordField(Op, Name, ByteOffset) \ + RsCreateResourceField (Op, Name, ByteOffset, 0, 64); + #endif /* ASLDEFINE.H */ --- sys/contrib/dev/acpica/compiler/aslerror.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslerror.c 2011-11-23 13:29:38.000000000 -0500 @@ -319,10 +319,23 @@ if (Enode->LineNumber) { + /* Main message: try to use string from AslMessages first */ + + if (!MainMessage) + { + MainMessage = ""; + } + MsgLength = strlen (MainMessage); if (MsgLength == 0) { + /* Use the secondary/extra message as main message */ + MainMessage = Enode->Message; + if (!MainMessage) + { + MainMessage = ""; + } MsgLength = strlen (MainMessage); ExtraMessage = NULL; @@ -620,13 +633,13 @@ int AslCompilererror ( - char *CompilerMessage) + const char *CompilerMessage) { AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber, - Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, - Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, - CompilerMessage); + Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, + Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, + ACPI_CAST_PTR (char, CompilerMessage)); return 0; } --- sys/contrib/dev/acpica/compiler/aslfiles.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslfiles.c 2011-11-23 13:29:34.000000000 -0500 @@ -174,14 +174,18 @@ { FILE *fp; UINT32 FileSize; + long Offset; fp = Gbl_Files[FileId].Handle; + Offset = ftell (fp); fseek (fp, 0, SEEK_END); FileSize = (UINT32) ftell (fp); - fseek (fp, 0, SEEK_SET); + /* Restore file pointer */ + + fseek (fp, Offset, SEEK_SET); return (FileSize); } --- sys/contrib/dev/acpica/compiler/aslglobal.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslglobal.h 2011-11-23 13:29:34.000000000 -0500 @@ -128,6 +128,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); #define HEX_OUTPUT_NONE 0 --- sys/contrib/dev/acpica/compiler/asllisting.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/asllisting.c 2011-11-23 13:29:34.000000000 -0500 @@ -850,9 +850,9 @@ FlPrintFile (FileId, "\n\nSummary of errors and warnings\n\n"); AePrintErrorLog (FileId); - FlPrintFile (FileId, "\n\n"); + FlPrintFile (FileId, "\n"); UtDisplaySummary (FileId); - FlPrintFile (FileId, "\n\n"); + FlPrintFile (FileId, "\n"); } } @@ -1309,6 +1309,7 @@ /* Get AML size, seek back to start */ AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); + FlSeekFile (ASL_FILE_AML_OUTPUT, 0); FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n"); FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", @@ -1365,7 +1366,6 @@ } FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n"); - FlCloseFile (ASL_FILE_HEX_OUTPUT); } @@ -1397,6 +1397,7 @@ /* Get AML size, seek back to start */ AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); + FlSeekFile (ASL_FILE_AML_OUTPUT, 0); FlPrintFile (ASL_FILE_HEX_OUTPUT, " * ASL source code output\n"); FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", @@ -1453,7 +1454,6 @@ } FlPrintFile (ASL_FILE_HEX_OUTPUT, " })\n"); - FlCloseFile (ASL_FILE_HEX_OUTPUT); } @@ -1485,6 +1485,7 @@ /* Get AML size, seek back to start */ AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); + FlSeekFile (ASL_FILE_AML_OUTPUT, 0); FlPrintFile (ASL_FILE_HEX_OUTPUT, "; Assembly code source output\n"); FlPrintFile (ASL_FILE_HEX_OUTPUT, "; AML code block contains 0x%X bytes\n;\n", @@ -1536,7 +1537,6 @@ } FlPrintFile (ASL_FILE_HEX_OUTPUT, "\n"); - FlCloseFile (ASL_FILE_HEX_OUTPUT); } --- sys/contrib/dev/acpica/compiler/aslload.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslload.c 2011-11-23 13:29:37.000000000 -0500 @@ -189,7 +189,7 @@ { case AML_INT_RESERVEDFIELD_OP: case AML_INT_ACCESSFIELD_OP: - + case AML_INT_CONNECTION_OP: break; default: @@ -224,8 +224,10 @@ } break; } + Child = Child->Asl.Next; } + return (AE_OK); } @@ -290,7 +292,6 @@ InitializerOp = ASL_GET_CHILD_NODE (Op); while (InitializerOp) { - if (InitializerOp->Asl.ExternalName) { Status = AcpiNsLookup (WalkState->ScopeInfo, @@ -305,20 +306,15 @@ } /* - * Store the field offset in the namespace node so it - * can be used when the field is referenced + * Store the field offset and length in the namespace node + * so it can be used when the field is referenced */ - Node->Value = (UINT32) InitializerOp->Asl.Value.Integer; + Node->Value = InitializerOp->Asl.Value.Tag.BitOffset; + Node->Length = InitializerOp->Asl.Value.Tag.BitLength; InitializerOp->Asl.Node = Node; Node->Op = InitializerOp; - - /* Pass thru the field type (Bitfield or Bytefield) */ - - if (InitializerOp->Asl.CompileFlags & NODE_IS_BIT_OFFSET) - { - Node->Flags |= ANOBJ_IS_BIT_OFFSET; - } } + InitializerOp = ASL_GET_PEER_NODE (InitializerOp); } --- sys/contrib/dev/acpica/compiler/asllookup.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/asllookup.c 2011-11-23 13:29:34.000000000 -0500 @@ -822,7 +822,10 @@ ACPI_PARSE_OBJECT *OwningOp; ACPI_PARSE_OBJECT *SpaceIdOp; UINT32 MinimumLength; - UINT32 Temp; + UINT32 Offset; + UINT32 FieldBitLength; + UINT32 TagBitLength; + UINT8 Message = 0; const ACPI_OPCODE_INFO *OpInfo; UINT32 Flags; @@ -1026,74 +1029,106 @@ /* 2) Check for a reference to a resource descriptor */ if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) || - (Node->Type == ACPI_TYPE_LOCAL_RESOURCE)) + (Node->Type == ACPI_TYPE_LOCAL_RESOURCE)) { /* - * This was a reference to a field within a resource descriptor. Extract - * the associated field offset (either a bit or byte offset depending on - * the field type) and change the named reference into an integer for - * AML code generation + * This was a reference to a field within a resource descriptor. + * Extract the associated field offset (either a bit or byte + * offset depending on the field type) and change the named + * reference into an integer for AML code generation */ - Temp = Node->Value; - if (Node->Flags & ANOBJ_IS_BIT_OFFSET) - { - Op->Asl.CompileFlags |= NODE_IS_BIT_OFFSET; - } - - /* Perform BitOffset <--> ByteOffset conversion if necessary */ + Offset = Node->Value; + TagBitLength = Node->Length; + /* + * If a field is being created, generate the length (in bits) of + * the field. Note: Opcodes other than CreateXxxField and Index + * can come through here. For other opcodes, we just need to + * convert the resource tag reference to an integer offset. + */ switch (Op->Asl.Parent->Asl.AmlOpcode) { - case AML_CREATE_FIELD_OP: + case AML_CREATE_FIELD_OP: /* Variable "Length" field, in bits */ + /* + * We know the length operand is an integer constant because + * we know that it contains a reference to a resource + * descriptor tag. + */ + FieldBitLength = (UINT32) Op->Asl.Next->Asl.Value.Integer; + break; - /* We allow a Byte offset to Bit Offset conversion for this op */ + case AML_CREATE_BIT_FIELD_OP: + FieldBitLength = 1; + break; - if (!(Op->Asl.CompileFlags & NODE_IS_BIT_OFFSET)) - { - /* Simply multiply byte offset times 8 to get bit offset */ + case AML_CREATE_BYTE_FIELD_OP: + case AML_INDEX_OP: + FieldBitLength = 8; + break; - Temp = ACPI_MUL_8 (Temp); - } + case AML_CREATE_WORD_FIELD_OP: + FieldBitLength = 16; break; + case AML_CREATE_DWORD_FIELD_OP: + FieldBitLength = 32; + break; - case AML_CREATE_BIT_FIELD_OP: + case AML_CREATE_QWORD_FIELD_OP: + FieldBitLength = 64; + break; + + default: + FieldBitLength = 0; + break; + } - /* This op requires a Bit Offset */ + /* Check the field length against the length of the resource tag */ - if (!(Op->Asl.CompileFlags & NODE_IS_BIT_OFFSET)) + if (FieldBitLength) + { + if (TagBitLength < FieldBitLength) { - AslError (ASL_ERROR, ASL_MSG_BYTES_TO_BITS, Op, NULL); + Message = ASL_MSG_TAG_SMALLER; } - break; + else if (TagBitLength > FieldBitLength) + { + Message = ASL_MSG_TAG_LARGER; + } + + if (Message) + { + sprintf (MsgBuffer, "Tag: %u bit%s, Field: %u bit%s", + TagBitLength, (TagBitLength > 1) ? "s" : "", + FieldBitLength, (FieldBitLength > 1) ? "s" : ""); + AslError (ASL_WARNING, Message, Op, MsgBuffer); + } + } + /* Convert the BitOffset to a ByteOffset for certain opcodes */ + + switch (Op->Asl.Parent->Asl.AmlOpcode) + { case AML_CREATE_BYTE_FIELD_OP: case AML_CREATE_WORD_FIELD_OP: case AML_CREATE_DWORD_FIELD_OP: case AML_CREATE_QWORD_FIELD_OP: case AML_INDEX_OP: - /* These Ops require Byte offsets */ - - if (Op->Asl.CompileFlags & NODE_IS_BIT_OFFSET) - { - AslError (ASL_ERROR, ASL_MSG_BITS_TO_BYTES, Op, NULL); - } + Offset = ACPI_DIV_8 (Offset); break; - default: - /* Nothing to do for other opcodes */ break; } /* Now convert this node to an integer whose value is the field offset */ - Op->Asl.AmlLength = 0; - Op->Asl.ParseOpcode = PARSEOP_INTEGER; - Op->Asl.Value.Integer = (UINT64) Temp; - Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; + Op->Asl.AmlLength = 0; + Op->Asl.ParseOpcode = PARSEOP_INTEGER; + Op->Asl.Value.Integer = (UINT64) Offset; + Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; OpcGenerateAmlOpcode (Op); } @@ -1253,6 +1288,7 @@ { case ACPI_ADR_SPACE_EC: case ACPI_ADR_SPACE_CMOS: + case ACPI_ADR_SPACE_GPIO: if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BYTE) { @@ -1262,6 +1298,7 @@ case ACPI_ADR_SPACE_SMBUS: case ACPI_ADR_SPACE_IPMI: + case ACPI_ADR_SPACE_GSBUS: if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER) { --- sys/contrib/dev/acpica/compiler/aslmain.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslmain.c 2011-11-23 13:29:35.000000000 -0500 @@ -96,7 +96,7 @@ #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:T:v:w:x:z" +#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^mno:p:r:s:t:T:G^v:w:x:z" /******************************************************************************* @@ -116,55 +116,57 @@ void) { - printf ("Global:\n"); - printf (" -@ Specify command file\n"); - printf (" -I Specify additional include directory\n"); + printf ("\nGlobal:\n"); + ACPI_OPTION ("-@ ", "Specify command file"); + ACPI_OPTION ("-I ", "Specify additional include directory"); printf ("\nGeneral Output:\n"); - printf (" -p Specify path/filename prefix for all output files\n"); - printf (" -va Disable all errors and warnings (summary only)\n"); - printf (" -vi Less verbose errors and warnings for use with IDEs\n"); - printf (" -vo Enable optimization comments\n"); - printf (" -vr Disable remarks\n"); - printf (" -vs Disable signon\n"); - printf (" -w<1|2|3> Set warning reporting level\n"); + ACPI_OPTION ("-p ", "Specify path/filename prefix for all output files"); + ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)"); + ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs"); + ACPI_OPTION ("-vo", "Enable optimization comments"); + ACPI_OPTION ("-vr", "Disable remarks"); + ACPI_OPTION ("-vs", "Disable signon"); + ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level"); printf ("\nAML Output Files:\n"); - printf (" -s Create AML in assembler or C source file (*.asm or *.c)\n"); - printf (" -i Create assembler or C include file (*.inc or *.h)\n"); - printf (" -t Create AML in assembler, C, or ASL hex table (*.hex)\n"); + ACPI_OPTION ("-s ", "Create AML in assembler or C source file (*.asm or *.c)"); + ACPI_OPTION ("-i ", "Create assembler or C include file (*.inc or *.h)"); + ACPI_OPTION ("-t ", "Create AML in assembler, C, or ASL hex table (*.hex)"); printf ("\nAML Code Generation:\n"); - printf (" -oa Disable all optimizations (compatibility mode)\n"); - printf (" -of Disable constant folding\n"); - printf (" -oi Disable integer optimization to Zero/One/Ones\n"); - printf (" -on Disable named reference string optimization\n"); - printf (" -cr Disable Resource Descriptor error checking\n"); - printf (" -r Override table header Revision (1-255)\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"); + ACPI_OPTION ("-on", "Disable named reference string optimization"); + ACPI_OPTION ("-cr", "Disable Resource Descriptor error checking"); + ACPI_OPTION ("-r ", "Override table header Revision (1-255)"); printf ("\nASL Listing Files:\n"); - printf (" -l Create mixed listing file (ASL source and AML) (*.lst)\n"); - printf (" -ln Create namespace file (*.nsp)\n"); - printf (" -ls Create combined source file (expanded includes) (*.src)\n"); + ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)"); + ACPI_OPTION ("-ln", "Create namespace file (*.nsp)"); + ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)"); printf ("\nACPI Data Tables:\n"); - printf (" -T |ALL|* Create table template file(s) for \n"); - printf (" -vt Create verbose templates (full disassembly)\n"); + ACPI_OPTION ("-G", "Compile custom table containing generic operators"); + ACPI_OPTION ("-T |ALL|*", "Create table template file(s) for "); + ACPI_OPTION ("-vt", "Create verbose templates (full disassembly)"); printf ("\nAML Disassembler:\n"); - printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n"); - printf (" -da [f1,f2] Disassemble multiple tables from single namespace\n"); - printf (" -dc [file] Disassemble AML and immediately compile it\n"); - printf (" (Obtain DSDT from current system if no input file)\n"); - printf (" -e [f1,f2] Include ACPI table(s) for external symbol resolution\n"); - printf (" -2 Emit ACPI 2.0 compatible ASL code\n"); - printf (" -g Get ACPI tables and write to files (*.dat)\n"); + ACPI_OPTION ("-d [file]", "Disassemble or decode binary ACPI table to file (*.dsl)"); + ACPI_OPTION ("-da [f1,f2]", "Disassemble multiple tables from single namespace"); + ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it"); + ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)"); + ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution"); + ACPI_OPTION ("-m", "Do not translate Buffers to Resource Templates"); + ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code"); + ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); printf ("\nHelp:\n"); - printf (" -h Additional help and compiler debug options\n"); - printf (" -hc Display operators allowed in constant expressions\n"); - printf (" -hr Display ACPI reserved method names\n"); - printf (" -ht Display currently supported ACPI table names\n"); + ACPI_OPTION ("-h", "Additional help and compiler debug options"); + ACPI_OPTION ("-hc", "Display operators allowed in constant expressions"); + ACPI_OPTION ("-hr", "Display ACPI reserved method names"); + ACPI_OPTION ("-ht", "Display currently supported ACPI table names"); } @@ -185,7 +187,7 @@ void) { - printf ("AML output filename generation:\n"); + printf ("\nAML output filename generation:\n"); printf (" Output filenames are generated by appending an extension to a common\n"); printf (" filename prefix. The filename prefix is obtained via one of the\n"); printf (" following methods (in priority order):\n"); @@ -197,13 +199,13 @@ Options (); printf ("\nCompiler/Disassembler Debug Options:\n"); - printf (" -b Create compiler debug/trace file (*.txt)\n"); - printf (" Types: Parse/Tree/Both\n"); - printf (" -f Ignore errors, force creation of AML output file(s)\n"); - printf (" -n Parse only, no output generation\n"); - printf (" -ot Display compile times\n"); - printf (" -x Set debug level for trace output\n"); - printf (" -z Do not insert new compiler ID for DataTables\n"); + ACPI_OPTION ("-b", "Create compiler debug/trace file (*.txt)"); + ACPI_OPTION ("", "Types: Parse/Tree/Both"); + ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); + ACPI_OPTION ("-n", "Parse only, no output generation"); + ACPI_OPTION ("-ot", "Display compile times"); + ACPI_OPTION ("-x", "Set debug level for trace output"); + ACPI_OPTION ("-z", "Do not insert new compiler ID for DataTables"); } @@ -224,8 +226,8 @@ void) { - printf ("%s\n", ASL_COMPLIANCE); - printf ("Usage: %s [Options] [Files]\n\n", ASL_INVOCATION_NAME); + printf ("%s\n\n", ASL_COMPLIANCE); + ACPI_USAGE_HEADER ("iasl [Options] [Files]"); Options (); } @@ -600,6 +602,20 @@ break; + case 'm': + + AcpiGbl_NoResourceDisassembly = TRUE; + break; + + + case 'n': + + /* Parse only */ + + Gbl_ParseOnlyFlag = TRUE; + break; + + case 'o': switch (AcpiGbl_Optarg[0]) @@ -648,14 +664,6 @@ break; - case 'n': - - /* Parse only */ - - Gbl_ParseOnlyFlag = TRUE; - break; - - case 'p': /* Override default AML output filename */ @@ -720,6 +728,11 @@ break; + case 'G': + Gbl_CompileGeneric = TRUE; + break; + + case 'T': Gbl_DoTemplates = TRUE; Gbl_TemplateSignature = AcpiGbl_Optarg; --- sys/contrib/dev/acpica/compiler/aslmap.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslmap.c 2011-11-23 13:29:35.000000000 -0500 @@ -126,13 +126,16 @@ /* ACCESSAS */ OP_TABLE_ENTRY (AML_INT_ACCESSFIELD_OP, 0, 0, 0), -/* ACCESSATTRIB_BLOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_BLOCK, 0, 0), -/* ACCESSATTRIB_BLOCK_CALL */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_BLOCK_CALL,0, 0), -/* ACCESSATTRIB_BYTE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_BYTE, 0, 0), -/* ACCESSATTRIB_WORD_CALL */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_WORD_CALL, 0, 0), -/* ACCESSATTRIB_QUICK */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_QUICK, 0, 0), -/* ACCESSATTRIB_SND_RCV */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_SEND_RCV, 0, 0), -/* ACCESSATTRIB_WORD */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SMB_WORD, 0, 0), +/* ACCESSATTRIB_BLOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_BLOCK, 0, 0), +/* ACCESSATTRIB_BLOCK_CALL */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_BLOCK_CALL, 0, 0), +/* ACCESSATTRIB_BYTE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_BYTE, 0, 0), +/* ACCESSATTRIB_MULTIBYTE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_MULTIBYTE, 0, 0), +/* ACCESSATTRIB_QUICK */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_QUICK, 0, 0), +/* ACCESSATTRIB_RAW_BYTES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_RAW_BYTES, 0, 0), +/* ACCESSATTRIB_RAW_PROCESS */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_RAW_PROCESS, 0, 0), +/* ACCESSATTRIB_SND_RCV */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_SEND_RCV, 0, 0), +/* ACCESSATTRIB_WORD */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_WORD, 0, 0), +/* ACCESSATTRIB_WORD_CALL */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ATTRIB_WORD_CALL, 0, 0), /* ACCESSTYPE_ANY */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ACCESS_ANY, 0, 0), /* ACCESSTYPE_BUF */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ACCESS_BUFFER, 0, 0), /* ACCESSTYPE_BYTE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ACCESS_BYTE, 0, 0), @@ -141,7 +144,8 @@ /* ACCESSTYPE_WORD */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_ACCESS_WORD, 0, 0), /* ACQUIRE */ OP_TABLE_ENTRY (AML_ACQUIRE_OP, 0, 0, ACPI_BTYPE_INTEGER), /* ADD */ OP_TABLE_ENTRY (AML_ADD_OP, 0, 0, ACPI_BTYPE_INTEGER), -/* ADDRESSSPACE_FFIXEDHW */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_ADR_SPACE_FIXED_HARDWARE, 0, 0), +/* ADDRESSINGMODE_7BIT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* ADDRESSINGMODE_10BIT */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* ADDRESSTYPE_ACPI */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* ADDRESSTYPE_MEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* ADDRESSTYPE_NVS */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), @@ -156,6 +160,11 @@ /* 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), +/* 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), +/* BITSPERBYTE_SEVEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), +/* 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_BREAK_POINT_OP, 0, 0, 0), /* BUFFER */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_BUFFER), @@ -163,9 +172,14 @@ /* BUSMASTERTYPE_NOTMASTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* BYTECONST */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, 0, 0, ACPI_BTYPE_INTEGER), /* CASE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* CLOCKPHASE_FIRST */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* CLOCKPHASE_SECOND */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* CLOCKPOLARITY_HIGH */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* CLOCKPOLARITY_LOW */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* CONCATENATE */ OP_TABLE_ENTRY (AML_CONCAT_OP, 0, 0, ACPI_BTYPE_COMPUTE_DATA), /* CONCATENATERESTEMPLATE */ OP_TABLE_ENTRY (AML_CONCAT_RES_OP, 0, 0, ACPI_BTYPE_BUFFER), /* CONDREFOF */ OP_TABLE_ENTRY (AML_COND_REF_OF_OP, 0, 0, ACPI_BTYPE_INTEGER), +/* CONNECTION */ OP_TABLE_ENTRY (AML_INT_CONNECTION_OP, 0, 0, 0), /* CONTINUE */ OP_TABLE_ENTRY (AML_CONTINUE_OP, 0, 0, 0), /* COPY */ OP_TABLE_ENTRY (AML_COPY_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE), /* CREATEBITFIELD */ OP_TABLE_ENTRY (AML_CREATE_BIT_FIELD_OP, 0, 0, 0), @@ -174,6 +188,7 @@ /* CREATEFIELD */ OP_TABLE_ENTRY (AML_CREATE_FIELD_OP, 0, 0, 0), /* CREATEQWORDFIELD */ OP_TABLE_ENTRY (AML_CREATE_QWORD_FIELD_OP, 0, 0, 0), /* CREATEWORDFIELD */ OP_TABLE_ENTRY (AML_CREATE_WORD_FIELD_OP, 0, 0, 0), +/* DATABUFFER */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DATATABLEREGION */ OP_TABLE_ENTRY (AML_DATA_REGION_OP, 0, 0, 0), /* DEBUG */ OP_TABLE_ENTRY (AML_DEBUG_OP, 0, 0, ACPI_BTYPE_DEBUG_OBJECT), /* DECODETYPE_POS */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), @@ -184,6 +199,8 @@ /* 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), +/* 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), /* DMA */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* DMATYPE_A */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), @@ -198,6 +215,8 @@ /* 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), /* 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), /* ENDTAG */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* ERRORNODE */ OP_TABLE_ENTRY (AML_NOOP_OP, 0, 0, 0), /* EVENT */ OP_TABLE_ENTRY (AML_EVENT_OP, 0, 0, 0), @@ -209,9 +228,16 @@ /* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0), /* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* 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), /* FIXEDIO */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* FLOWCONTROL_HW */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* 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), +/* 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), /* IF */ OP_TABLE_ENTRY (AML_IF_OP, 0, NODE_AML_PACKAGE, 0), /* INCLUDE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* INCLUDE_CSTYLE */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), @@ -221,6 +247,7 @@ /* INDEXFIELD */ OP_TABLE_ENTRY (AML_INDEX_FIELD_OP, 0, NODE_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), /* INTLEVEL_ACTIVEHIGH */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* INTLEVEL_ACTIVELOW */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* INTTYPE_EDGE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), @@ -228,6 +255,10 @@ /* IO */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* IODECODETYPE_10 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* IODECODETYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* IORESTRICT_IN */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* IORESTRICT_NONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* IORESTRICT_OUT */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), +/* IORESTRICT_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* IRQ */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* IRQNOFLAGS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* LAND */ OP_TABLE_ENTRY (AML_LAND_OP, 0, 0, ACPI_BTYPE_INTEGER), @@ -308,6 +339,15 @@ /* 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), +/* 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), +/* 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_RES_OP, 0, NODE_AML_PACKAGE, 0), /* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, NODE_AML_PACKAGE, 0), /* QWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER), @@ -323,6 +363,9 @@ /* REFOF */ OP_TABLE_ENTRY (AML_REF_OF_OP, 0, 0, ACPI_BTYPE_REFERENCE), /* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_CMOS, 0, 0), /* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_EC, 0, 0), +/* REGIONSPACE_FFIXEDHW */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_FIXED_HARDWARE, 0, 0), +/* REGIONSPACE_GPIO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_GPIO, 0, 0), +/* REGIONSPACE_GSBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_GSBUS, 0, 0), /* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_IO, 0, 0), /* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_IPMI, 0, 0), /* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SYSTEM_MEMORY, 0, 0), @@ -342,15 +385,24 @@ /* 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), +/* SHARETYPE_EXCLUSIVEWAKE */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* SHARETYPE_SHARED */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* SHARETYPE_SHAREDWAKE */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), /* SHIFTLEFT */ OP_TABLE_ENTRY (AML_SHIFT_LEFT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* SHIFTRIGHT */ OP_TABLE_ENTRY (AML_SHIFT_RIGHT_OP, 0, 0, ACPI_BTYPE_INTEGER), /* SIGNAL */ OP_TABLE_ENTRY (AML_SIGNAL_OP, 0, 0, 0), /* SIZEOF */ OP_TABLE_ENTRY (AML_SIZE_OF_OP, 0, 0, ACPI_BTYPE_INTEGER), +/* SLAVEMODE_CONTROLLERINIT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* SLAVEMODE_DEVICEINIT */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* SLEEP */ OP_TABLE_ENTRY (AML_SLEEP_OP, 0, 0, 0), +/* SPISERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* STALL */ OP_TABLE_ENTRY (AML_STALL_OP, 0, 0, 0), /* STARTDEPENDENTFN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* STARTDEPENDENTFN_NOPRI */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* STOPBITS_ONE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* STOPBITS_ONEPLUSHALF */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), +/* STOPBITS_TWO */ OP_TABLE_ENTRY (AML_BYTE_OP, 3, 0, 0), +/* STOPBITS_ZERO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* STORE */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE), /* 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), @@ -368,6 +420,7 @@ /* 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), /* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, NODE_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), @@ -378,10 +431,18 @@ /* 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), +/* 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), /* WORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_WORD, 0, 0, ACPI_BTYPE_INTEGER), /* WORDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* WORDSPACE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* XFERSIZE_8 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* XFERSIZE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* XFERSIZE_32 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* XFERSIZE_64 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* XFERSIZE_256 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* XFERTYPE_8 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* XFERTYPE_8_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), --- sys/contrib/dev/acpica/compiler/aslmessages.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslmessages.h 2011-11-23 13:29:35.000000000 -0500 @@ -61,17 +61,20 @@ typedef enum { ASL_MSG_RESERVED = 0, + + ASL_MSG_ALIGNMENT, ASL_MSG_ALPHANUMERIC_STRING, ASL_MSG_AML_NOT_IMPLEMENTED, ASL_MSG_ARG_COUNT_HI, ASL_MSG_ARG_COUNT_LO, ASL_MSG_ARG_INIT, ASL_MSG_BACKWARDS_OFFSET, - ASL_MSG_BITS_TO_BYTES, ASL_MSG_BUFFER_LENGTH, - ASL_MSG_BYTES_TO_BITS, ASL_MSG_CLOSE, ASL_MSG_COMPILER_INTERNAL, + ASL_MSG_COMPILER_RESERVED, + ASL_MSG_CONNECTION_MISSING, + ASL_MSG_CONNECTION_INVALID, ASL_MSG_CONSTANT_EVALUATION, ASL_MSG_CONSTANT_FOLDED, ASL_MSG_CORE_EXCEPTION, @@ -90,15 +93,26 @@ ASL_MSG_FIELD_ACCESS_WIDTH, ASL_MSG_FIELD_UNIT_ACCESS_WIDTH, ASL_MSG_FIELD_UNIT_OFFSET, + ASL_MSG_GPE_NAME_CONFLICT, + ASL_MSG_HID_LENGTH, + ASL_MSG_HID_PREFIX, + ASL_MSG_HID_SUFFIX, ASL_MSG_INCLUDE_FILE_OPEN, ASL_MSG_INPUT_FILE_OPEN, ASL_MSG_INTEGER_LENGTH, ASL_MSG_INTEGER_OPTIMIZATION, ASL_MSG_INTERRUPT_LIST, ASL_MSG_INTERRUPT_NUMBER, + ASL_MSG_INVALID_ACCESS_SIZE, + ASL_MSG_INVALID_ADDR_FLAGS, ASL_MSG_INVALID_CONSTANT_OP, ASL_MSG_INVALID_EISAID, ASL_MSG_INVALID_ESCAPE, + ASL_MSG_INVALID_GRAN_FIXED, + ASL_MSG_INVALID_GRANULARITY, + ASL_MSG_INVALID_LENGTH, + ASL_MSG_INVALID_LENGTH_FIXED, + ASL_MSG_INVALID_MIN_MAX, ASL_MSG_INVALID_OPERAND, ASL_MSG_INVALID_PERFORMANCE, ASL_MSG_INVALID_PRIORITY, @@ -107,28 +121,38 @@ ASL_MSG_INVALID_TIME, ASL_MSG_INVALID_TYPE, ASL_MSG_INVALID_UUID, + ASL_MSG_ISA_ADDRESS, + ASL_MSG_LEADING_ASTERISK, ASL_MSG_LIST_LENGTH_LONG, ASL_MSG_LIST_LENGTH_SHORT, ASL_MSG_LISTING_FILE_OPEN, ASL_MSG_LISTING_FILENAME, ASL_MSG_LOCAL_INIT, + ASL_MSG_LOCAL_OUTSIDE_METHOD, ASL_MSG_LONG_LINE, ASL_MSG_MEMORY_ALLOCATION, ASL_MSG_MISSING_ENDDEPENDENT, ASL_MSG_MISSING_STARTDEPENDENT, + ASL_MSG_MULTIPLE_DEFAULT, ASL_MSG_MULTIPLE_TYPES, ASL_MSG_NAME_EXISTS, ASL_MSG_NAME_OPTIMIZATION, + ASL_MSG_NAMED_OBJECT_IN_WHILE, ASL_MSG_NESTED_COMMENT, ASL_MSG_NO_CASES, + ASL_MSG_NO_REGION, ASL_MSG_NO_RETVAL, ASL_MSG_NO_WHILE, ASL_MSG_NON_ASCII, + ASL_MSG_NON_ZERO, ASL_MSG_NOT_EXIST, ASL_MSG_NOT_FOUND, ASL_MSG_NOT_METHOD, ASL_MSG_NOT_PARAMETER, ASL_MSG_NOT_REACHABLE, + ASL_MSG_NOT_REFERENCED, + ASL_MSG_NULL_DESCRIPTOR, + ASL_MSG_NULL_STRING, ASL_MSG_OPEN, ASL_MSG_OUTPUT_FILE_OPEN, ASL_MSG_OUTPUT_FILENAME, @@ -140,6 +164,7 @@ ASL_MSG_RESERVED_ARG_COUNT_HI, ASL_MSG_RESERVED_ARG_COUNT_LO, ASL_MSG_RESERVED_METHOD, + ASL_MSG_RESERVED_NO_RETURN_VAL, ASL_MSG_RESERVED_OPERAND_TYPE, ASL_MSG_RESERVED_RETURN_VALUE, ASL_MSG_RESERVED_USE, @@ -148,63 +173,45 @@ ASL_MSG_RESOURCE_INDEX, ASL_MSG_RESOURCE_LIST, ASL_MSG_RESOURCE_SOURCE, + ASL_MSG_RESULT_NOT_USED, ASL_MSG_RETURN_TYPES, ASL_MSG_SCOPE_FWD_REF, ASL_MSG_SCOPE_TYPE, ASL_MSG_SEEK, + ASL_MSG_SERIALIZED, ASL_MSG_SINGLE_NAME_OPTIMIZATION, ASL_MSG_SOME_NO_RETVAL, + ASL_MSG_STRING_LENGTH, ASL_MSG_SWITCH_TYPE, ASL_MSG_SYNC_LEVEL, ASL_MSG_SYNTAX, ASL_MSG_TABLE_SIGNATURE, + ASL_MSG_TAG_LARGER, + ASL_MSG_TAG_SMALLER, + ASL_MSG_TIMEOUT, ASL_MSG_TOO_MANY_TEMPS, ASL_MSG_UNKNOWN_RESERVED_NAME, ASL_MSG_UNREACHABLE_CODE, ASL_MSG_UNSUPPORTED, + ASL_MSG_UPPER_CASE, ASL_MSG_VENDOR_LIST, ASL_MSG_WRITE, - ASL_MSG_MULTIPLE_DEFAULT, - ASL_MSG_TIMEOUT, - ASL_MSG_RESULT_NOT_USED, - ASL_MSG_NOT_REFERENCED, - ASL_MSG_NON_ZERO, - ASL_MSG_STRING_LENGTH, - ASL_MSG_SERIALIZED, - ASL_MSG_COMPILER_RESERVED, - ASL_MSG_NAMED_OBJECT_IN_WHILE, - ASL_MSG_LOCAL_OUTSIDE_METHOD, - ASL_MSG_ALIGNMENT, - ASL_MSG_ISA_ADDRESS, - ASL_MSG_INVALID_MIN_MAX, - ASL_MSG_INVALID_LENGTH, - ASL_MSG_INVALID_LENGTH_FIXED, - ASL_MSG_INVALID_GRANULARITY, - ASL_MSG_INVALID_GRAN_FIXED, - ASL_MSG_INVALID_ACCESS_SIZE, - ASL_MSG_INVALID_ADDR_FLAGS, - ASL_MSG_NULL_DESCRIPTOR, - ASL_MSG_UPPER_CASE, - ASL_MSG_HID_LENGTH, - ASL_MSG_NULL_STRING, - ASL_MSG_LEADING_ASTERISK, - ASL_MSG_RESERVED_NO_RETURN_VAL, - ASL_MSG_GPE_NAME_CONFLICT, - ASL_MSG_NO_REGION, - ASL_MSG_INVALID_FIELD_NAME, - ASL_MSG_INTEGER_SIZE, - ASL_MSG_INVALID_HEX_INTEGER, +/* These messages are used by the data table compiler only */ + ASL_MSG_BUFFER_ELEMENT, - ASL_MSG_RESERVED_VALUE, + ASL_MSG_DIVIDE_BY_ZERO, ASL_MSG_FLAG_VALUE, - ASL_MSG_ZERO_VALUE, - ASL_MSG_UNKNOWN_TABLE, - ASL_MSG_UNKNOWN_SUBTABLE, + ASL_MSG_INTEGER_SIZE, + ASL_MSG_INVALID_EXPRESSION, + ASL_MSG_INVALID_FIELD_NAME, + ASL_MSG_INVALID_HEX_INTEGER, ASL_MSG_OEM_TABLE, + ASL_MSG_RESERVED_VALUE, ASL_MSG_UNKNOWN_LABEL, - ASL_MSG_INVALID_EXPRESSION, - ASL_MSG_DIVIDE_BY_ZERO + ASL_MSG_UNKNOWN_SUBTABLE, + ASL_MSG_UNKNOWN_TABLE, + ASL_MSG_ZERO_VALUE } ASL_MESSAGE_IDS; @@ -215,17 +222,19 @@ char *AslMessages [] = { /* The zeroth message is reserved */ "", +/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value", /* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric", /* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator", /* ASL_MSG_ARG_COUNT_HI */ "Too many arguments", /* ASL_MSG_ARG_COUNT_LO */ "Too few arguments", /* ASL_MSG_ARG_INIT */ "Method argument is not initialized", /* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset", -/* ASL_MSG_BITS_TO_BYTES */ "Field offset is in bits, but a byte offset is required", /* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero", -/* ASL_MSG_BYTES_TO_BITS */ "Field offset is in bytes, but a bit offset is required", /* ASL_MSG_CLOSE */ "Could not close file", /* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error", +/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name", +/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId", +/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator", /* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression", /* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced", /* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem", @@ -244,15 +253,26 @@ /* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size", /* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit", /* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit", +/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method", +/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters", +/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits", +/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits", /* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file", /* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file", /* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating", /* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode", /* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)", /* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)", +/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)", +/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags", /* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)", /* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)", /* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence", +/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max", +/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one", +/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window", +/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window", +/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max", /* ASL_MSG_INVALID_OPERAND */ "Invalid operand", /* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value", /* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value", @@ -261,28 +281,38 @@ /* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)", /* ASL_MSG_INVALID_TYPE */ "Invalid type", /* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", +/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)", +/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk", /* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length", /* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length", /* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file", /* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename", /* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized", +/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method", /* ASL_MSG_LONG_LINE */ "Splitting long input line", /* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure", /* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list", /* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list", +/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct", /* ASL_MSG_MULTIPLE_TYPES */ "Multiple types", /* ASL_MSG_NAME_EXISTS */ "Name already exists in scope", /* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized", +/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop", /* ASL_MSG_NESTED_COMMENT */ "Nested comment found", /* ASL_MSG_NO_CASES */ "No Case statements under Switch", +/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region", /* ASL_MSG_NO_RETVAL */ "Called method returns no value", /* ASL_MSG_NO_WHILE */ "No enclosing While statement", /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", +/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", /* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", /* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", /* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", +/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", +/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag", +/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string", /* ASL_MSG_OPEN */ "Could not open file", /* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file", /* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename", @@ -294,6 +324,7 @@ /* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments", /* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments", /* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method", +/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value", /* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name", /* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value", /* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name", @@ -302,65 +333,45 @@ /* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)", /* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)", /* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)", +/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect", /* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value", /* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed", /* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator", /* ASL_MSG_SEEK */ "Could not seek file", +/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized", /* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)", /* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value", +/* ASL_MSG_STRING_LENGTH */ "String literal too long", /* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer", /* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15", /* ASL_MSG_SYNTAX */ "", /* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature", +/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field", +/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field", +/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed", /* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)", /* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name", /* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable", /* ASL_MSG_UNSUPPORTED */ "Unsupported feature", +/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case", /* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)", /* ASL_MSG_WRITE */ "Could not write file", -/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct", -/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed", -/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect", -/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", -/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", -/* ASL_MSG_STRING_LENGTH */ "String literal too long", -/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized", -/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name", -/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop", -/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method", -/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value", -/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)", -/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max", -/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window", -/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window", -/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one", -/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max", -/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)", -/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags", -/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag", -/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case", -/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters", -/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string", -/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk", -/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value", -/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method", -/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region", /* These messages are used by the data table compiler only */ -/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", -/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target", -/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", /* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list", -/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", +/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero", /* ASL_MSG_FLAG_VALUE */ "Flag value is too large", -/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero", -/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", -/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", +/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target", +/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression", +/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", +/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", /* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents", +/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", /* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined", -/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression", -/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero" +/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", +/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", +/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero" }; --- sys/contrib/dev/acpica/compiler/aslopcodes.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslopcodes.c 2011-11-23 13:29:36.000000000 -0500 @@ -58,6 +58,10 @@ ACPI_PARSE_OBJECT *Op); static void +OpcDoConnection ( + ACPI_PARSE_OBJECT *Op); + +static void OpcDoUnicode ( ACPI_PARSE_OBJECT *Op); @@ -321,26 +325,128 @@ OpcDoAccessAs ( ACPI_PARSE_OBJECT *Op) { - ACPI_PARSE_OBJECT *Next; + ACPI_PARSE_OBJECT *TypeOp; + ACPI_PARSE_OBJECT *AttribOp; + ACPI_PARSE_OBJECT *LengthOp; + UINT8 Attribute; Op->Asl.AmlOpcodeLength = 1; - Next = Op->Asl.Child; + TypeOp = Op->Asl.Child; /* First child is the access type */ - Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE; - Next->Asl.ParseOpcode = PARSEOP_RAW_DATA; + TypeOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE; + TypeOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; /* Second child is the optional access attribute */ - Next = Next->Asl.Next; - if (Next->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + AttribOp = TypeOp->Asl.Next; + if (AttribOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + AttribOp->Asl.Value.Integer = 0; + } + AttribOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE; + AttribOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; + + /* Only a few AccessAttributes support AccessLength */ + + Attribute = (UINT8) AttribOp->Asl.Value.Integer; + if ((Attribute != AML_FIELD_ATTRIB_MULTIBYTE) && + (Attribute != AML_FIELD_ATTRIB_RAW_BYTES) && + (Attribute != AML_FIELD_ATTRIB_RAW_PROCESS)) + { + return; + } + + Op->Asl.AmlOpcode = AML_FIELD_EXT_ACCESS_OP; + + /* + * Child of Attributes is the AccessLength (required for Multibyte, + * RawBytes, RawProcess.) + */ + LengthOp = AttribOp->Asl.Child; + if (!LengthOp) + { + return; + } + + /* TBD: probably can remove */ + + if (LengthOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) { - Next->Asl.Value.Integer = 0; + LengthOp->Asl.Value.Integer = 16; } - Next->Asl.AmlOpcode = AML_RAW_DATA_BYTE; - Next->Asl.ParseOpcode = PARSEOP_RAW_DATA; + + LengthOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE; + LengthOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; +} + + +/******************************************************************************* + * + * FUNCTION: OpcDoConnection + * + * PARAMETERS: Op - Parse node + * + * RETURN: None + * + * DESCRIPTION: Implement the Connection ASL keyword. + * + ******************************************************************************/ + +static void +OpcDoConnection ( + ACPI_PARSE_OBJECT *Op) +{ + ASL_RESOURCE_NODE *Rnode; + ACPI_PARSE_OBJECT *BufferOp; + ACPI_PARSE_OBJECT *BufferLengthOp; + ACPI_PARSE_OBJECT *BufferDataOp; + UINT8 State; + + + Op->Asl.AmlOpcodeLength = 1; + + if (Op->Asl.Child->Asl.AmlOpcode == AML_INT_NAMEPATH_OP) + { + return; + } + + BufferOp = Op->Asl.Child; + BufferLengthOp = BufferOp->Asl.Child; + BufferDataOp = BufferLengthOp->Asl.Next; + + State = ACPI_RSTATE_NORMAL; + Rnode = RsDoOneResourceDescriptor (BufferDataOp->Asl.Next, 0, &State); + if (!Rnode) + { + return; /* error */ + } + + /* + * Transform the nodes into the following + * + * Op -> AML_BUFFER_OP + * First Child -> BufferLength + * Second Child -> Descriptor Buffer (raw byte data) + */ + BufferOp->Asl.ParseOpcode = PARSEOP_BUFFER; + BufferOp->Asl.AmlOpcode = AML_BUFFER_OP; + BufferOp->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; + UtSetParseOpName (BufferOp); + + BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; + BufferLengthOp->Asl.Value.Integer = Rnode->BufferLength; + (void) OpcSetOptimalIntegerSize (BufferLengthOp); + UtSetParseOpName (BufferLengthOp); + + BufferDataOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; + BufferDataOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN; + BufferDataOp->Asl.AmlOpcodeLength = 0; + BufferDataOp->Asl.AmlLength = Rnode->BufferLength; + BufferDataOp->Asl.Value.Buffer = (UINT8 *) Rnode; + UtSetParseOpName (BufferDataOp); } @@ -545,7 +651,7 @@ /******************************************************************************* * - * FUNCTION: OpcDoUiId + * FUNCTION: OpcDoUuId * * PARAMETERS: Op - Parse node * @@ -665,6 +771,11 @@ OpcDoAccessAs (Op); break; + case PARSEOP_CONNECTION: + + OpcDoConnection (Op); + break; + case PARSEOP_EISAID: OpcDoEisaId (Op); --- sys/contrib/dev/acpica/compiler/asloperands.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/asloperands.c 2011-11-23 13:29:37.000000000 -0500 @@ -761,6 +761,7 @@ if ((PackageLengthOp->Asl.ParseOpcode == PARSEOP_INTEGER) || (PackageLengthOp->Asl.ParseOpcode == PARSEOP_QWORDCONST) || + (PackageLengthOp->Asl.ParseOpcode == PARSEOP_ZERO) || (PackageLengthOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)) { if (!PackageLength) @@ -778,8 +779,11 @@ * If the PackageLength is a constant <= 255, we can change the * AML opcode from VarPackage to a simple (ACPI 1.0) Package opcode. */ - if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) && - (Op->Asl.Child->Asl.Value.Integer <= 255)) + if (((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) && + (Op->Asl.Child->Asl.Value.Integer <= 255)) || + (Op->Asl.Child->Asl.ParseOpcode == PARSEOP_ONE) || + (Op->Asl.Child->Asl.ParseOpcode == PARSEOP_ONES)|| + (Op->Asl.Child->Asl.ParseOpcode == PARSEOP_ZERO)) { Op->Asl.AmlOpcode = AML_PACKAGE_OP; Op->Asl.ParseOpcode = PARSEOP_PACKAGE; --- sys/contrib/dev/acpica/compiler/aslpredef.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslpredef.c 2011-11-23 13:29:37.000000000 -0500 @@ -100,30 +100,49 @@ {{"_ATT", 0, 0}}, {{"_BAS", 0, 0}}, {{"_BM_", 0, 0}}, + {{"_DBT", 0, 0}}, /* Acpi 5.0 */ {{"_DEC", 0, 0}}, + {{"_DPL", 0, 0}}, /* Acpi 5.0 */ + {{"_DRS", 0, 0}}, /* Acpi 5.0 */ + {{"_END", 0, 0}}, /* Acpi 5.0 */ + {{"_FLC", 0, 0}}, /* Acpi 5.0 */ {{"_GRA", 0, 0}}, {{"_HE_", 0, 0}}, {{"_INT", 0, 0}}, + {{"_IOR", 0, 0}}, /* Acpi 5.0 */ {{"_LEN", 0, 0}}, + {{"_LIN", 0, 0}}, /* Acpi 5.0 */ {{"_LL_", 0, 0}}, {{"_MAF", 0, 0}}, {{"_MAX", 0, 0}}, {{"_MEM", 0, 0}}, {{"_MIF", 0, 0}}, {{"_MIN", 0, 0}}, + {{"_MOD", 0, 0}}, /* Acpi 5.0 */ {{"_MTP", 0, 0}}, + {{"_PAR", 0, 0}}, /* Acpi 5.0 */ + {{"_PHA", 0, 0}}, /* Acpi 5.0 */ + {{"_PIN", 0, 0}}, /* Acpi 5.0 */ + {{"_PPI", 0, 0}}, /* Acpi 5.0 */ + {{"_POL", 0, 0}}, /* Acpi 5.0 */ {{"_RBO", 0, 0}}, {{"_RBW", 0, 0}}, {{"_RNG", 0, 0}}, {{"_RT_", 0, 0}}, /* Acpi 3.0 */ {{"_RW_", 0, 0}}, + {{"_RXL", 0, 0}}, /* Acpi 5.0 */ {{"_SHR", 0, 0}}, {{"_SIZ", 0, 0}}, + {{"_SLV", 0, 0}}, /* Acpi 5.0 */ + {{"_SPE", 0, 0}}, /* Acpi 5.0 */ + {{"_STB", 0, 0}}, /* Acpi 5.0 */ {{"_TRA", 0, 0}}, {{"_TRS", 0, 0}}, {{"_TSF", 0, 0}}, /* Acpi 3.0 */ {{"_TTP", 0, 0}}, + {{"_TXL", 0, 0}}, /* Acpi 5.0 */ {{"_TYP", 0, 0}}, + {{"_VEN", 0, 0}}, /* Acpi 5.0 */ {{{0,0,0,0}, 0, 0}} /* Table terminator */ }; @@ -658,6 +677,7 @@ break; case PARSEOP_PACKAGE: + case PARSEOP_VAR_PACKAGE: ReturnBtype = ACPI_RTYPE_PACKAGE; break; @@ -817,4 +837,3 @@ ThisRtype <<= 1; /* Next Rtype */ } } - --- sys/contrib/dev/acpica/compiler/aslresource.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslresource.c 2011-11-23 13:29:37.000000000 -0500 @@ -437,13 +437,14 @@ /******************************************************************************* * - * FUNCTION: RsCreateBitField + * FUNCTION: RsCreateResourceField * * PARAMETERS: Op - Resource field node * Name - Name of the field (Used only to reference * the field in the ASL, not in the AML) * ByteOffset - Offset from the field start * BitOffset - Additional bit offset + * BitLength - Number of bits in the field * * RETURN: None, sets fields within the input node * @@ -454,46 +455,20 @@ ******************************************************************************/ void -RsCreateBitField ( +RsCreateResourceField ( ACPI_PARSE_OBJECT *Op, char *Name, UINT32 ByteOffset, - UINT32 BitOffset) + UINT32 BitOffset, + UINT32 BitLength) { - Op->Asl.ExternalName = Name; - Op->Asl.Value.Integer = ((UINT64) ByteOffset * 8) + BitOffset; - Op->Asl.CompileFlags |= (NODE_IS_RESOURCE_FIELD | NODE_IS_BIT_OFFSET); -} - - -/******************************************************************************* - * - * FUNCTION: RsCreateByteField - * - * PARAMETERS: Op - Resource field node - * Name - Name of the field (Used only to reference - * the field in the ASL, not in the AML) - * ByteOffset - Offset from the field start - * - * RETURN: None, sets fields within the input node - * - * DESCRIPTION: Utility function to generate a named byte field within a - * resource descriptor. Mark a node as 1) a field in a resource - * descriptor, and 2) set the value to be a BYTE offset - * - ******************************************************************************/ + Op->Asl.ExternalName = Name; + Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; -void -RsCreateByteField ( - ACPI_PARSE_OBJECT *Op, - char *Name, - UINT32 ByteOffset) -{ - Op->Asl.ExternalName = Name; - Op->Asl.Value.Integer = ByteOffset; - Op->Asl.CompileFlags |= NODE_IS_RESOURCE_FIELD; + Op->Asl.Value.Tag.BitOffset = (ByteOffset * 8) + BitOffset; + Op->Asl.Value.Tag.BitLength = BitLength; } @@ -538,6 +513,29 @@ } +void +RsSetFlagBits16 ( + UINT16 *Flags, + ACPI_PARSE_OBJECT *Op, + UINT8 Position, + UINT8 DefaultBit) +{ + + if (Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + /* Use the default bit */ + + *Flags |= (DefaultBit << Position); + } + else + { + /* Use the bit specified in the initialization node */ + + *Flags |= (((UINT16) Op->Asl.Value.Integer) << Position); + } +} + + /******************************************************************************* * * FUNCTION: RsCompleteNodeAndGetNext @@ -662,6 +660,11 @@ CurrentByteOffset); break; + case PARSEOP_FIXEDDMA: + Rnode = RsDoFixedDmaDescriptor (DescriptorTypeOp, + CurrentByteOffset); + break; + case PARSEOP_DWORDIO: Rnode = RsDoDwordIoDescriptor (DescriptorTypeOp, CurrentByteOffset); @@ -845,6 +848,31 @@ CurrentByteOffset); break; + case PARSEOP_GPIO_INT: + Rnode = RsDoGpioIntDescriptor (DescriptorTypeOp, + CurrentByteOffset); + break; + + case PARSEOP_GPIO_IO: + Rnode = RsDoGpioIoDescriptor (DescriptorTypeOp, + CurrentByteOffset); + break; + + case PARSEOP_I2C_SERIALBUS: + Rnode = RsDoI2cSerialBusDescriptor (DescriptorTypeOp, + CurrentByteOffset); + break; + + case PARSEOP_SPI_SERIALBUS: + Rnode = RsDoSpiSerialBusDescriptor (DescriptorTypeOp, + CurrentByteOffset); + break; + + case PARSEOP_UART_SERIALBUS: + Rnode = RsDoUartSerialBusDescriptor (DescriptorTypeOp, + CurrentByteOffset); + break; + case PARSEOP_DEFAULT_ARG: /* Just ignore any of these, they are used as fillers/placeholders */ break; @@ -1019,10 +1047,12 @@ Op->Asl.ParseOpcode = PARSEOP_BUFFER; Op->Asl.AmlOpcode = AML_BUFFER_OP; Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; + UtSetParseOpName (Op); BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; BufferLengthOp->Asl.Value.Integer = CurrentByteOffset; (void) OpcSetOptimalIntegerSize (BufferLengthOp); + UtSetParseOpName (BufferLengthOp); BufferOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; BufferOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN; @@ -1030,8 +1060,7 @@ BufferOp->Asl.AmlLength = CurrentByteOffset; BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next; BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA; + UtSetParseOpName (BufferOp); return; } - - --- sys/contrib/dev/acpica/compiler/aslrestype1.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype1.c 2011-11-23 13:29:35.000000000 -0500 @@ -179,7 +179,7 @@ case 1: /* Min Address */ Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum)); MinOp = InitializerOp; break; @@ -187,7 +187,7 @@ case 2: /* Max Address */ Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum)); MaxOp = InitializerOp; break; @@ -195,14 +195,14 @@ case 3: /* Alignment */ Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_ALIGNMENT, + RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment)); break; case 4: /* Length */ Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength)); LengthOp = InitializerOp; break; @@ -286,7 +286,7 @@ case 1: /* Min Address */ Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum)); MinOp = InitializerOp; break; @@ -294,7 +294,7 @@ case 2: /* Max Address */ Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum)); MaxOp = InitializerOp; break; @@ -302,7 +302,7 @@ case 3: /* Alignment */ Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_ALIGNMENT, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment)); AlignOp = InitializerOp; break; @@ -310,7 +310,7 @@ case 4: /* Length */ Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength)); LengthOp = InitializerOp; break; @@ -390,14 +390,14 @@ case 1: /* Address */ Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_BASEADDRESS, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS, CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address)); break; case 2: /* Length */ Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength)); break; --- sys/contrib/dev/acpica/compiler/aslrestype1i.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype1i.c 2011-11-23 13:29:35.000000000 -0500 @@ -53,6 +53,7 @@ * This module contains the I/O-related small resource descriptors: * * DMA + * FixedDMA * FixedIO * IO * IRQ @@ -102,8 +103,8 @@ case 0: /* DMA type */ RsSetFlagBits (&Descriptor->Dma.Flags, InitializerOp, 5, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_DMATYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 5); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_DMATYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 5, 2); break; case 1: /* Bus Master */ @@ -116,8 +117,8 @@ case 2: /* Xfer Type (transfer width) */ RsSetFlagBits (&Descriptor->Dma.Flags, InitializerOp, 0, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_XFERTYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_XFERTYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Dma.Flags), 0, 2); break; case 3: /* Name */ @@ -182,6 +183,81 @@ /******************************************************************************* * + * FUNCTION: RsDoFixedDmaDescriptor + * + * PARAMETERS: Op - Parent resource descriptor parse node + * CurrentByteOffset - Offset into the resource template AML + * buffer (to track references to the desc) + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a short "FixedDMA" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoFixedDmaDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + UINT32 i; + + + InitializerOp = Op->Asl.Child; + Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_DMA)); + + Descriptor = Rnode->Buffer; + Descriptor->FixedDma.DescriptorType = + ACPI_RESOURCE_NAME_FIXED_DMA | ASL_RDESC_FIXED_DMA_SIZE; + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* DMA Request Lines [WORD] (_DMA) */ + + Descriptor->FixedDma.RequestLines = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_DMA, + CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.RequestLines)); + break; + + case 1: /* DMA Channel [WORD] (_TYP) */ + + Descriptor->FixedDma.Channels = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_DMATYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.Channels)); + break; + + case 2: /* Transfer Width [BYTE] (_SIZ) */ + + Descriptor->FixedDma.Width = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_XFERTYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.Width)); + break; + + case 3: /* Descriptor Name (optional) */ + + UtAttachNamepathToOwner (Op, InitializerOp); + break; + + default: /* Ignore any extra nodes */ + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * * FUNCTION: RsDoFixedIoDescriptor * * PARAMETERS: Op - Parent resource descriptor parse node @@ -223,7 +299,7 @@ Descriptor->FixedIo.Address = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_BASEADDRESS, + RsCreateWordField (InitializerOp, ACPI_RESTAG_BASEADDRESS, CurrentByteOffset + ASL_RESDESC_OFFSET (FixedIo.Address)); AddressOp = InitializerOp; break; @@ -314,7 +390,7 @@ Descriptor->Io.Minimum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Minimum)); MinOp = InitializerOp; break; @@ -323,7 +399,7 @@ Descriptor->Io.Maximum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Maximum)); MaxOp = InitializerOp; break; @@ -480,7 +556,7 @@ /* Create a named field at the start of the list */ - RsCreateByteField (InitializerOp, ACPI_RESTAG_INTERRUPT, + RsCreateWordField (InitializerOp, ACPI_RESTAG_INTERRUPT, CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.IrqMask)); } break; @@ -580,7 +656,7 @@ /* Create a named field at the start of the list */ - RsCreateByteField (InitializerOp, ACPI_RESTAG_INTERRUPT, + RsCreateWordField (InitializerOp, ACPI_RESTAG_INTERRUPT, CurrentByteOffset + ASL_RESDESC_OFFSET (Irq.IrqMask)); } break; --- sys/contrib/dev/acpica/compiler/aslrestype2.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype2.c 2011-11-23 13:29:35.000000000 -0500 @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: aslrestype2 - Miscellaneous Large resource descriptors @@ -120,7 +119,7 @@ case 3: /* Register Address */ Descriptor->GenericReg.Address = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_ADDRESS, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_ADDRESS, CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.Address)); break; @@ -354,7 +353,7 @@ /* Create a named field at the start of the list */ - RsCreateByteField (InitializerOp, ACPI_RESTAG_INTERRUPT, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_INTERRUPT, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0])); } --- sys/contrib/dev/acpica/compiler/aslrestype2d.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype2d.c 2011-11-23 13:29:37.000000000 -0500 @@ -144,15 +144,15 @@ case 4: /* Range Type */ RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 0, 3); - RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 0, 2); break; case 5: /* Address Granularity */ Descriptor->Address32.Granularity = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity)); GranOp = InitializerOp; break; @@ -161,7 +161,7 @@ Descriptor->Address32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum)); MinOp = InitializerOp; break; @@ -170,7 +170,7 @@ Descriptor->Address32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum)); MaxOp = InitializerOp; break; @@ -179,7 +179,7 @@ Descriptor->Address32.TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset)); break; @@ -187,7 +187,7 @@ Descriptor->Address32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength)); LengthOp = InitializerOp; break; @@ -376,8 +376,8 @@ case 4: /* Memory Type */ RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 1, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 1); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 1, 2); break; case 5: /* Read/Write Type */ @@ -391,7 +391,7 @@ Descriptor->Address32.Granularity = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity)); GranOp = InitializerOp; break; @@ -400,7 +400,7 @@ Descriptor->Address32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum)); MinOp = InitializerOp; break; @@ -409,7 +409,7 @@ Descriptor->Address32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum)); MaxOp = InitializerOp; break; @@ -418,7 +418,7 @@ Descriptor->Address32.TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset)); break; @@ -426,7 +426,7 @@ Descriptor->Address32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength)); LengthOp = InitializerOp; break; @@ -488,8 +488,8 @@ case 14: /* Address Range */ RsSetFlagBits (&Descriptor->Address32.SpecificFlags, InitializerOp, 3, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 3); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.SpecificFlags), 3, 2); break; case 15: /* Type */ @@ -623,7 +623,7 @@ Descriptor->Address32.Granularity = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity)); GranOp = InitializerOp; break; @@ -632,7 +632,7 @@ Descriptor->Address32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum)); MinOp = InitializerOp; break; @@ -641,7 +641,7 @@ Descriptor->Address32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum)); MaxOp = InitializerOp; break; @@ -650,7 +650,7 @@ Descriptor->Address32.TranslationOffset = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset)); break; @@ -658,7 +658,7 @@ Descriptor->Address32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength)); LengthOp = InitializerOp; break; --- sys/contrib/dev/acpica/compiler/aslrestype2e.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype2e.c 2011-11-23 13:29:37.000000000 -0500 @@ -136,14 +136,14 @@ case 4: /* Range Type */ RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 0, 3); - RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 0, 2); break; case 5: /* Address Granularity */ Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity)); GranOp = InitializerOp; break; @@ -151,7 +151,7 @@ case 6: /* Address Min */ Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum)); MinOp = InitializerOp; break; @@ -159,7 +159,7 @@ case 7: /* Address Max */ Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum)); MaxOp = InitializerOp; break; @@ -167,14 +167,14 @@ case 8: /* Translation Offset */ Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset)); break; case 9: /* Address Length */ Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength)); LengthOp = InitializerOp; break; @@ -182,7 +182,7 @@ case 10: /* Type-Specific Attributes */ Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific)); break; @@ -309,8 +309,8 @@ case 4: /* Memory Type */ RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 1, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 1); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 1, 2); break; case 5: /* Read/Write Type */ @@ -323,7 +323,7 @@ case 6: /* Address Granularity */ Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity)); GranOp = InitializerOp; break; @@ -331,7 +331,7 @@ case 7: /* Min Address */ Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum)); MinOp = InitializerOp; break; @@ -339,7 +339,7 @@ case 8: /* Max Address */ Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum)); MaxOp = InitializerOp; break; @@ -347,14 +347,14 @@ case 9: /* Translation Offset */ Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset)); break; case 10: /* Address Length */ Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength)); LengthOp = InitializerOp; break; @@ -362,7 +362,7 @@ case 11: /* Type-Specific Attributes */ Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific)); break; @@ -375,8 +375,8 @@ case 13: /* Address Range */ RsSetFlagBits (&Descriptor->ExtAddress64.SpecificFlags, InitializerOp, 3, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, - CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 3); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, + CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.SpecificFlags), 3, 2); break; case 14: /* Type */ @@ -501,7 +501,7 @@ case 6: /* Address Granularity */ Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity)); GranOp = InitializerOp; break; @@ -509,7 +509,7 @@ case 7: /* Min Address */ Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum)); MinOp = InitializerOp; break; @@ -517,7 +517,7 @@ case 8: /* Max Address */ Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum)); MaxOp = InitializerOp; break; @@ -525,14 +525,14 @@ case 9: /* Translation Offset */ Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset)); break; case 10: /* Address Length */ Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength)); LengthOp = InitializerOp; break; @@ -540,7 +540,7 @@ case 11: /* Type-Specific Attributes */ Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES, CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific)); break; --- sys/contrib/dev/acpica/compiler/aslrestype2q.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype2q.c 2011-11-23 13:29:33.000000000 -0500 @@ -144,14 +144,14 @@ case 4: /* Range Type */ RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 0, 3); - RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 0, 2); break; case 5: /* Address Granularity */ Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity)); GranOp = InitializerOp; break; @@ -159,7 +159,7 @@ case 6: /* Address Min */ Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum)); MinOp = InitializerOp; break; @@ -167,7 +167,7 @@ case 7: /* Address Max */ Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum)); MaxOp = InitializerOp; break; @@ -182,7 +182,7 @@ case 9: /* Address Length */ Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength)); LengthOp = InitializerOp; break; @@ -366,8 +366,8 @@ case 4: /* Memory Type */ RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 1, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 1); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMTYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 1, 2); break; case 5: /* Read/Write Type */ @@ -380,7 +380,7 @@ case 6: /* Address Granularity */ Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity)); GranOp = InitializerOp; break; @@ -388,7 +388,7 @@ case 7: /* Min Address */ Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum)); MinOp = InitializerOp; break; @@ -396,7 +396,7 @@ case 8: /* Max Address */ Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum)); MaxOp = InitializerOp; break; @@ -404,14 +404,14 @@ case 9: /* Translation Offset */ Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset)); break; case 10: /* Address Length */ Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength)); LengthOp = InitializerOp; break; @@ -473,8 +473,8 @@ case 14: /* Address Range */ RsSetFlagBits (&Descriptor->Address64.SpecificFlags, InitializerOp, 3, 0); - RsCreateBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 3); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_MEMATTRIBUTES, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.SpecificFlags), 3, 2); break; case 15: /* Type */ @@ -607,7 +607,7 @@ case 6: /* Address Granularity */ Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity)); GranOp = InitializerOp; break; @@ -615,7 +615,7 @@ case 7: /* Min Address */ Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum)); MinOp = InitializerOp; break; @@ -623,7 +623,7 @@ case 8: /* Max Address */ Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum)); MaxOp = InitializerOp; break; @@ -631,14 +631,14 @@ case 9: /* Translation Offset */ Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset)); break; case 10: /* Address Length */ Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength)); LengthOp = InitializerOp; break; --- sys/contrib/dev/acpica/compiler/aslrestype2s.c 1969-12-31 19:00:00.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype2s.c 2011-11-23 13:47:04.000000000 -0500 @@ -0,0 +1,1187 @@ +/****************************************************************************** + * + * Module Name: aslrestype2s - Serial Large resource descriptors + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2011, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + + +#include +#include "aslcompiler.y.h" +#include + +#define _COMPONENT ACPI_COMPILER + ACPI_MODULE_NAME ("aslrestype2s") + + +static UINT16 +RsGetBufferDataLength ( + ACPI_PARSE_OBJECT *InitializerOp); + +static UINT16 +RsGetInterruptDataLength ( + ACPI_PARSE_OBJECT *InitializerOp); + +static BOOLEAN +RsGetVendorData ( + ACPI_PARSE_OBJECT *InitializerOp, + UINT8 *VendorData, + ACPI_SIZE DescriptorOffset); + +/* + * This module contains descriptors for serial buses and GPIO: + * + * GpioInt + * GpioIo + * I2cSerialBus + * SpiSerialBus + * UartSerialBus + */ + + +/******************************************************************************* + * + * FUNCTION: RsGetBufferDataLength + * + * PARAMETERS: InitializerOp - Current parse op, start of the resource + * descriptor + * + * RETURN: Length of the data buffer + * + * DESCRIPTION: Get the length of a RawDataBuffer, used for vendor data. + * + ******************************************************************************/ + +static UINT16 +RsGetBufferDataLength ( + ACPI_PARSE_OBJECT *InitializerOp) +{ + UINT16 ExtraDataSize = 0; + ACPI_PARSE_OBJECT *DataList; + + + /* Find the byte-initializer list */ + + while (InitializerOp) + { + if (InitializerOp->Asl.ParseOpcode == PARSEOP_DATABUFFER) + { + /* First child is the optional length (ignore it here) */ + + DataList = InitializerOp->Asl.Child; + DataList = ASL_GET_PEER_NODE (DataList); + + /* Count the data items (each one is a byte of data) */ + + while (DataList) + { + ExtraDataSize++; + DataList = ASL_GET_PEER_NODE (DataList); + } + + return (ExtraDataSize); + } + + InitializerOp = ASL_GET_PEER_NODE (InitializerOp); + } + + return (ExtraDataSize); +} + + +/******************************************************************************* + * + * FUNCTION: RsGetInterruptDataLength + * + * PARAMETERS: InitializerOp - Current parse op, start of the resource + * descriptor + * + * RETURN: Length of the interrupt data list + * + * DESCRIPTION: Get the length of a list of interrupt DWORDs for the GPIO + * descriptors. + * + ******************************************************************************/ + +static UINT16 +RsGetInterruptDataLength ( + ACPI_PARSE_OBJECT *InitializerOp) +{ + UINT16 InterruptLength; + UINT32 i; + + + /* Count the interrupt numbers */ + + InterruptLength = 0; + for (i = 0; InitializerOp; i++) + { + InitializerOp = ASL_GET_PEER_NODE (InitializerOp); + + /* Interrupt list starts at offset 10 (Gpio descriptors) */ + + if (i >= 10) + { + InterruptLength += 2; + } + } + + return (InterruptLength); +} + + +/******************************************************************************* + * + * FUNCTION: RsGetVendorData + * + * PARAMETERS: InitializerOp - Current parse op, start of the resource + * descriptor. + * VendorData - Where the vendor data is returned + * DescriptorOffset - Where vendor data begins in descriptor + * + * RETURN: TRUE if valid vendor data was returned, FALSE otherwise. + * + * DESCRIPTION: Extract the vendor data and construct a vendor data buffer. + * + ******************************************************************************/ + +static BOOLEAN +RsGetVendorData ( + ACPI_PARSE_OBJECT *InitializerOp, + UINT8 *VendorData, + ACPI_SIZE DescriptorOffset) +{ + ACPI_PARSE_OBJECT *BufferOp; + UINT32 SpecifiedLength = ACPI_UINT32_MAX; + UINT16 ActualLength = 0; + + + /* VendorData field is always optional */ + + if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + return (FALSE); + } + + BufferOp = InitializerOp->Asl.Child; + if (!BufferOp) + { + AslError (ASL_ERROR, ASL_MSG_SYNTAX, InitializerOp, ""); + return (FALSE); + } + + /* First child is the optional buffer length (WORD) */ + + if (BufferOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + SpecifiedLength = (UINT16) BufferOp->Asl.Value.Integer; + } + + /* Insert field tag _VEN */ + + RsCreateByteField (InitializerOp, ACPI_RESTAG_VENDORDATA, + (UINT16) DescriptorOffset); + + /* Walk the list of buffer initializers (each is one byte) */ + + BufferOp = RsCompleteNodeAndGetNext (BufferOp); + if (BufferOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + while (BufferOp) + { + *VendorData = (UINT8) BufferOp->Asl.Value.Integer; + VendorData++; + ActualLength++; + BufferOp = RsCompleteNodeAndGetNext (BufferOp); + } + } + + /* Length validation. Buffer cannot be of zero length */ + + if ((SpecifiedLength == 0) || + ((SpecifiedLength == ACPI_UINT32_MAX) && (ActualLength == 0))) + { + AslError (ASL_ERROR, ASL_MSG_BUFFER_LENGTH, InitializerOp, NULL); + return (FALSE); + } + + if (SpecifiedLength != ACPI_UINT32_MAX) + { + /* ActualLength > SpecifiedLength -> error */ + + if (ActualLength > SpecifiedLength) + { + AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG, InitializerOp, NULL); + return (FALSE); + } + + /* ActualLength < SpecifiedLength -> remark */ + + else if (ActualLength < SpecifiedLength) + { + AslError (ASL_REMARK, ASL_MSG_LIST_LENGTH_SHORT, InitializerOp, NULL); + return (FALSE); + } + } + + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoGpioIntDescriptor + * + * PARAMETERS: Op - Parent resource descriptor parse node + * CurrentByteOffset - Offset into the resource template AML + * buffer (to track references to the desc) + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "GpioInt" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoGpioIntDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 *InterruptList = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 InterruptLength; + UINT16 DescriptorSize; + UINT32 i; + + + InitializerOp = Op->Asl.Child; + + /* + * 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); + InterruptLength = RsGetInterruptDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) + + ResSourceLength + VendorLength + InterruptLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->Gpio.ResourceLength = DescriptorSize; + Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO; + Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION; + Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_INT; + + /* Build pointers to optional areas */ + + InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO)); + ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength); + VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength); + + /* Setup offsets within the descriptor */ + + Descriptor->Gpio.PinTableOffset = (UINT16) + ACPI_PTR_DIFF (InterruptList, Descriptor); + + Descriptor->Gpio.ResSourceOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSource, Descriptor); + + DbgPrint (ASL_DEBUG_OUTPUT, + "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, IntLen: %.2X\n", + "GpioInt", Descriptor->Gpio.ResourceLength, (UINT16) sizeof (AML_RESOURCE_GPIO), + ResSourceLength, VendorLength, InterruptLength); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Interrupt Mode - edge/level [Flag] (_MOD) */ + + RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0); + break; + + case 1: /* Interrupt Polarity - Active high/low [Flags] (_POL) */ + + RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 1, 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_POLARITY, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 1, 2); + break; + + case 2: /* Share Type - Default: exclusive (0) [Flags] (_SHR) */ + + RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3, 2); + break; + + case 3: /* Pin Config [BYTE] (_PPI) */ + + Descriptor->Gpio.PinConfig = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.PinConfig)); + break; + + case 4: /* DebounceTimeout [WORD] (_DBT) */ + + Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout)); + break; + + case 5: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, + InitializerOp->Asl.Value.String); + } + break; + + case 6: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->Gpio.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 7: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1); + break; + + case 8: /* ResourceTag (Descriptor Name) */ + + UtAttachNamepathToOwner (Op, InitializerOp); + break; + + case 9: /* 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->Gpio.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->Gpio.VendorOffset))) + { + Descriptor->Gpio.VendorLength = VendorLength; + } + break; + + default: + /* + * PINs come through here, repeatedly. Each PIN must be a DWORD. + * 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 + */ + *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer; + InterruptList++; + + /* Case 10: First interrupt number in list */ + + if (i == 10) + { + 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 */ + + RsCreateDwordField (InitializerOp, ACPI_RESTAG_PIN, + CurrentByteOffset + Descriptor->Gpio.PinTableOffset); + } + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoGpioIoDescriptor + * + * PARAMETERS: Op - Parent resource descriptor parse node + * CurrentByteOffset - Offset into the resource template AML + * buffer (to track references to the desc) + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "GpioIo" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoGpioIoDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 *InterruptList = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 InterruptLength; + UINT16 DescriptorSize; + UINT32 i; + + + InitializerOp = Op->Asl.Child; + + /* + * 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); + InterruptLength = RsGetInterruptDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) + + ResSourceLength + VendorLength + InterruptLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->Gpio.ResourceLength = DescriptorSize; + Descriptor->Gpio.DescriptorType = ACPI_RESOURCE_NAME_GPIO; + Descriptor->Gpio.RevisionId = AML_RESOURCE_GPIO_REVISION; + Descriptor->Gpio.ConnectionType = AML_RESOURCE_GPIO_TYPE_IO; + + /* Build pointers to optional areas */ + + InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO)); + ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength); + VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength); + + /* Setup offsets within the descriptor */ + + Descriptor->Gpio.PinTableOffset = (UINT16) + ACPI_PTR_DIFF (InterruptList, Descriptor); + + Descriptor->Gpio.ResSourceOffset = (UINT16) + ACPI_PTR_DIFF (ResourceSource, Descriptor); + + DbgPrint (ASL_DEBUG_OUTPUT, + "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, IntLen: %.2X\n", + "GpioIo", Descriptor->Gpio.ResourceLength, (UINT16) sizeof (AML_RESOURCE_GPIO), + ResSourceLength, VendorLength, InterruptLength); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Share Type [Flags] (_SHR) */ + + RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 3, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_INTERRUPTSHARE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 3); + break; + + case 1: /* Pin Config [BYTE] (_PPI) */ + + Descriptor->Gpio.PinConfig = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PINCONFIG, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.PinConfig)); + break; + + case 2: /* DebounceTimeout [WORD] (_DBT) */ + + Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DebounceTimeout)); + break; + + case 3: /* Drive Strength [WORD] (_DRS) */ + + Descriptor->Gpio.DriveStrength = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_DRIVESTRENGTH, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.DriveStrength)); + break; + + case 4: /* I/O Restriction [Flag] (_IOR) */ + + RsSetFlagBits16 (&Descriptor->Gpio.IntFlags, InitializerOp, 0, 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_IORESTRICTION, + CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.IntFlags), 0, 2); + break; + + case 5: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, + InitializerOp->Asl.Value.String); + } + break; + + case 6: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->Gpio.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 7: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1); + break; + + case 8: /* ResourceTag (Descriptor Name) */ + + UtAttachNamepathToOwner (Op, InitializerOp); + break; + + case 9: /* 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->Gpio.VendorOffset = (UINT16) + ACPI_PTR_DIFF (VendorData, Descriptor); + + if (RsGetVendorData (InitializerOp, VendorData, + (CurrentByteOffset + Descriptor->Gpio.VendorOffset))) + { + Descriptor->Gpio.VendorLength = VendorLength; + } + break; + + default: + /* + * PINs come through here, repeatedly. Each PIN must be a DWORD. + * 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 + */ + *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer; + InterruptList++; + + /* Case 10: First interrupt number in list */ + + if (i == 10) + { + 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 */ + + RsCreateDwordField (InitializerOp, ACPI_RESTAG_PIN, + CurrentByteOffset + Descriptor->Gpio.PinTableOffset); + } + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoI2cSerialBusDescriptor + * + * PARAMETERS: Op - Parent resource descriptor parse node + * CurrentByteOffset - Offset into the resource template AML + * buffer (to track references to the desc) + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "I2cSerialBus" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoI2cSerialBusDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 DescriptorSize; + UINT32 i; + + + InitializerOp = Op->Asl.Child; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Vendor Data buffer + */ + ResSourceLength = RsGetStringDataLength (InitializerOp); + VendorLength = RsGetBufferDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_I2C_SERIALBUS) + + ResSourceLength + VendorLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->I2cSerialBus.ResourceLength = DescriptorSize; + Descriptor->I2cSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS; + Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION; + Descriptor->I2cSerialBus.TypeRevisionId = AML_RESOURCE_I2C_TYPE_REVISION; + Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE; + Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength; + + /* Build pointers to optional areas */ + + VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_I2C_SERIALBUS)); + ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength); + + DbgPrint (ASL_DEBUG_OUTPUT, + "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n", + "I2cSerialBus", Descriptor->I2cSerialBus.ResourceLength, + (UINT16) sizeof (AML_RESOURCE_I2C_SERIALBUS), ResSourceLength, + VendorLength, Descriptor->I2cSerialBus.TypeDataLength); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Slave Address [WORD] (_ADR) */ + + Descriptor->I2cSerialBus.SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS, + CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.SlaveAddress)); + break; + + case 1: /* Slave Mode [Flag] (_SLV) */ + + RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_SLAVEMODE, + CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.Flags), 0); + break; + + case 2: /* ConnectionSpeed [DWORD] (_SPE) */ + + Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED, + CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed)); + break; + + case 3: /* Addresssing Mode [Flag] (_MOD) */ + + RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE, + CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.TypeSpecificFlags), 0); + break; + + case 4: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, + InitializerOp->Asl.Value.String); + } + break; + + case 5: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->I2cSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 6: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 1, 1); + break; + + case 7: /* ResourceTag (Descriptor Name) */ + + UtAttachNamepathToOwner (Op, InitializerOp); + break; + + case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + + RsGetVendorData (InitializerOp, VendorData, + CurrentByteOffset + sizeof (AML_RESOURCE_I2C_SERIALBUS)); + break; + + default: /* Ignore any extra nodes */ + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoSpiSerialBusDescriptor + * + * PARAMETERS: Op - Parent resource descriptor parse node + * CurrentByteOffset - Offset into the resource template AML + * buffer (to track references to the desc) + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "SPI Serial Bus" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoSpiSerialBusDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 DescriptorSize; + UINT32 i; + + + InitializerOp = Op->Asl.Child; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Vendor Data buffer + */ + ResSourceLength = RsGetStringDataLength (InitializerOp); + VendorLength = RsGetBufferDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_SPI_SERIALBUS) + + ResSourceLength + VendorLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->SpiSerialBus.ResourceLength = DescriptorSize; + Descriptor->SpiSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS; + Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION; + Descriptor->SpiSerialBus.TypeRevisionId = AML_RESOURCE_SPI_TYPE_REVISION; + Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE; + Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength; + + /* Build pointers to optional areas */ + + VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_SPI_SERIALBUS)); + ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength); + + DbgPrint (ASL_DEBUG_OUTPUT, + "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n", + "SpiSerialBus", Descriptor->SpiSerialBus.ResourceLength, + (UINT16) sizeof (AML_RESOURCE_SPI_SERIALBUS), ResSourceLength, + VendorLength, Descriptor->SpiSerialBus.TypeDataLength); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* Device Selection [WORD] (_ADR) */ + + Descriptor->SpiSerialBus.DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DeviceSelection)); + break; + + case 1: /* Device Polarity [Flag] (_DPL) */ + + RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 1, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_DEVICEPOLARITY, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 1); + break; + + case 2: /* Wire Mode [Flag] (_MOD) */ + + RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 0); + break; + + case 3: /* Device Bit Length [BYTE] (_LEN) */ + + Descriptor->SpiSerialBus.DataBitLength = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DataBitLength)); + break; + + case 4: /* Slave Mode [Flag] (_SLV) */ + + RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 0, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_SLAVEMODE, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.Flags), 0); + break; + + case 5: /* ConnectionSpeed [DWORD] (_SPE) */ + + Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ConnectionSpeed)); + break; + + case 6: /* Clock Polarity [BYTE] (_POL) */ + + Descriptor->SpiSerialBus.ClockPolarity = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_POLARITY, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ClockPolarity)); + break; + + case 7: /* Clock Phase [BYTE] (_PHA) */ + + Descriptor->SpiSerialBus.ClockPhase = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PHASE, + CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ClockPhase)); + break; + + case 8: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, + InitializerOp->Asl.Value.String); + } + break; + + case 9: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->SpiSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 10: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 1, 1); + break; + + case 11: /* ResourceTag (Descriptor Name) */ + + UtAttachNamepathToOwner (Op, InitializerOp); + break; + + case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + + RsGetVendorData (InitializerOp, VendorData, + CurrentByteOffset + sizeof (AML_RESOURCE_SPI_SERIALBUS)); + break; + + default: /* Ignore any extra nodes */ + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + + +/******************************************************************************* + * + * FUNCTION: RsDoUartSerialBusDescriptor + * + * PARAMETERS: Op - Parent resource descriptor parse node + * CurrentByteOffset - Offset into the resource template AML + * buffer (to track references to the desc) + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "UART Serial Bus" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoUartSerialBusDescriptor ( + ACPI_PARSE_OBJECT *Op, + UINT32 CurrentByteOffset) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSource = NULL; + UINT8 *VendorData = NULL; + UINT16 ResSourceLength; + UINT16 VendorLength; + UINT16 DescriptorSize; + UINT32 i; + + + InitializerOp = Op->Asl.Child; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + * 2) Vendor Data buffer + */ + ResSourceLength = RsGetStringDataLength (InitializerOp); + VendorLength = RsGetBufferDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_UART_SERIALBUS) + + ResSourceLength + VendorLength; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->UartSerialBus.ResourceLength = DescriptorSize; + Descriptor->UartSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS; + Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION; + Descriptor->UartSerialBus.TypeRevisionId = AML_RESOURCE_UART_TYPE_REVISION; + Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE; + Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength; + + /* Build pointers to optional areas */ + + VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_UART_SERIALBUS)); + ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength); + + DbgPrint (ASL_DEBUG_OUTPUT, + "%16s - Actual: %.2X, Base: %.2X, ResLen: %.2X, VendLen: %.2X, TypLen: %.2X\n", + "UartSerialBus", Descriptor->UartSerialBus.ResourceLength, + (UINT16) sizeof (AML_RESOURCE_UART_SERIALBUS), ResSourceLength, + VendorLength, Descriptor->UartSerialBus.TypeDataLength); + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: /* ConnectionSpeed (Baud Rate) [DWORD] (_SPE) */ + + Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.DefaultBaudRate)); + break; + + case 1: /* Bits Per Byte [Flags] (_LEN) */ + + RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 4, 3); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LENGTH, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 4, 3); + break; + + case 2: /* Stop Bits [Flags] (_STB) */ + + RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 2, 1); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_STOPBITS, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 2, 2); + break; + + case 3: /* Lines In Use [BYTE] (_LIN) */ + + Descriptor->UartSerialBus.LinesEnabled = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_LINE, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.LinesEnabled)); + break; + + case 4: /* Endianness [Flag] (_END) */ + + RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 7, 0); + RsCreateBitField (InitializerOp, ACPI_RESTAG_ENDIANNESS, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 7); + break; + + case 5: /* Parity [BYTE] (_PAR) */ + + Descriptor->UartSerialBus.Parity = (UINT8) InitializerOp->Asl.Value.Integer; + RsCreateByteField (InitializerOp, ACPI_RESTAG_PARITY, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Parity)); + break; + + case 6: /* Flow Control [Flags] (_FLC) */ + + RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 0, 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_FLOWCONTROL, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 0, 2); + break; + + case 7: /* Rx Buffer Size [WORD] (_RXL) */ + + Descriptor->UartSerialBus.RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_RX, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.RxFifoSize)); + break; + + case 8: /* Tx Buffer Size [WORD] (_TXL) */ + + Descriptor->UartSerialBus.TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_TX, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TxFifoSize)); + break; + + case 9: /* ResSource [Optional Field - STRING] */ + + if (ResSourceLength) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSource, + InitializerOp->Asl.Value.String); + } + break; + + case 10: /* Resource Index */ + + if (InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + Descriptor->UartSerialBus.ResSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + case 11: /* Resource Usage (consumer/producer) */ + + RsSetFlagBits (&Descriptor->UartSerialBus.Flags, InitializerOp, 1, 1); + + /* + * Slave Mode [Flag] (_SLV) + * + * Note: There is no SlaveMode argument to the UartSerialBus macro, but + * we add this name anyway to allow the flag to be set by ASL in the + * rare case where there is a slave mode associated with the UART. + */ + RsCreateBitField (InitializerOp, ACPI_RESTAG_SLAVEMODE, + CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Flags), 0); + break; + + case 12: /* ResourceTag (Descriptor Name) */ + + UtAttachNamepathToOwner (Op, InitializerOp); + break; + + case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */ + + RsGetVendorData (InitializerOp, VendorData, + CurrentByteOffset + sizeof (AML_RESOURCE_UART_SERIALBUS)); + break; + + default: /* Ignore any extra nodes */ + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} --- sys/contrib/dev/acpica/compiler/aslrestype2w.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslrestype2w.c 2011-11-23 13:29:34.000000000 -0500 @@ -144,14 +144,14 @@ case 4: /* Range Type */ RsSetFlagBits (&Descriptor->Address16.SpecificFlags, InitializerOp, 0, 3); - RsCreateBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, - CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 0); + RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_RANGETYPE, + CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.SpecificFlags), 0, 2); break; case 5: /* Address Granularity */ Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity)); GranOp = InitializerOp; break; @@ -159,7 +159,7 @@ case 6: /* Address Min */ Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum)); MinOp = InitializerOp; break; @@ -167,7 +167,7 @@ case 7: /* Address Max */ Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum)); MaxOp = InitializerOp; break; @@ -175,14 +175,14 @@ case 8: /* Translation Offset */ Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset)); break; case 9: /* Address Length */ Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength)); LengthOp = InitializerOp; break; @@ -367,7 +367,7 @@ Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity)); GranOp = InitializerOp; break; @@ -376,7 +376,7 @@ Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum)); MinOp = InitializerOp; break; @@ -385,7 +385,7 @@ Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum)); MaxOp = InitializerOp; break; @@ -394,7 +394,7 @@ Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset)); break; @@ -402,7 +402,7 @@ Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength)); LengthOp = InitializerOp; break; @@ -584,7 +584,7 @@ Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_GRANULARITY, + RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity)); GranOp = InitializerOp; break; @@ -593,7 +593,7 @@ Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MINADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum)); MinOp = InitializerOp; break; @@ -602,7 +602,7 @@ Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_MAXADDR, + RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum)); MaxOp = InitializerOp; break; @@ -611,7 +611,7 @@ Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION, + RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset)); break; @@ -619,7 +619,7 @@ Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer; - RsCreateByteField (InitializerOp, ACPI_RESTAG_LENGTH, + RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH, CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength)); LengthOp = InitializerOp; break; --- sys/contrib/dev/acpica/compiler/aslstubs.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/aslstubs.c 2011-11-23 13:29:36.000000000 -0500 @@ -232,3 +232,20 @@ return (AE_SUPPORT); } +/* OSL interfaces */ + +ACPI_THREAD_ID +AcpiOsGetThreadId ( + void) +{ + return (0xFFFF); +} + +ACPI_STATUS +AcpiOsExecute ( + ACPI_EXECUTE_TYPE Type, + ACPI_OSD_EXEC_CALLBACK Function, + void *Context) +{ + return (AE_SUPPORT); +} --- sys/contrib/dev/acpica/compiler/asltransform.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/asltransform.c 2011-11-23 13:29:34.000000000 -0500 @@ -398,6 +398,7 @@ ACPI_PARSE_OBJECT *MethodOp; ACPI_PARSE_OBJECT *StoreOp; ACPI_PARSE_OBJECT *BreakOp; + ACPI_PARSE_OBJECT *BufferOp; char *PredicateValueName; UINT16 Index; UINT32 Btype; @@ -647,6 +648,7 @@ Predicate = StartNode->Asl.Child; NewOp = TrCreateLeafNode (PARSEOP_NAME); + TrAmlInitLineNumbers (NewOp, StartNode); /* Find the parent method */ @@ -690,6 +692,7 @@ NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (UINT64) ACPI_TO_INTEGER (PredicateValueName)); + TrAmlInitLineNumbers (NewOp2, NewOp); NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION; NewOp->Asl.Child = NewOp2; @@ -700,21 +703,27 @@ case ACPI_BTYPE_INTEGER: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO, (UINT64) 0); + TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); break; case ACPI_BTYPE_STRING: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (UINT64) ACPI_TO_INTEGER ("")); + TrAmlInitLineNumbers (NewOp2->Asl.Next, NewOp); break; case ACPI_BTYPE_BUFFER: (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER, (UINT64) 0)); Next = NewOp2->Asl.Next; + TrAmlInitLineNumbers (Next, NewOp2); (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO, (UINT64) 1)); - (void) TrLinkPeerNode (Next->Asl.Child, - TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0)); + TrAmlInitLineNumbers (Next->Asl.Child, Next); + + BufferOp = TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0); + TrAmlInitLineNumbers (BufferOp, Next->Asl.Child); + (void) TrLinkPeerNode (Next->Asl.Child, BufferOp); TrAmlSetSubtreeParent (Next->Asl.Child, Next); break; @@ -733,6 +742,7 @@ */ TrAmlInitNode (StartNode, PARSEOP_WHILE); NewOp = TrCreateLeafNode (PARSEOP_ONE); + TrAmlInitLineNumbers (NewOp, StartNode); NewOp->Asl.Next = Predicate->Asl.Next; NewOp->Asl.Parent = StartNode; StartNode->Asl.Child = NewOp; @@ -740,6 +750,7 @@ /* Create a Store() node */ StoreOp = TrCreateLeafNode (PARSEOP_STORE); + TrAmlInitLineNumbers (StoreOp, NewOp); StoreOp->Asl.Parent = StartNode; TrAmlInsertPeer (NewOp, StoreOp); @@ -750,6 +761,7 @@ NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (UINT64) ACPI_TO_INTEGER (PredicateValueName)); + TrAmlInitLineNumbers (NewOp, StoreOp); NewOp->Asl.Parent = StoreOp; Predicate->Asl.Next = NewOp; @@ -762,6 +774,7 @@ } BreakOp = TrCreateLeafNode (PARSEOP_BREAK); + TrAmlInitLineNumbers (BreakOp, NewOp); BreakOp->Asl.Parent = StartNode; TrAmlInsertPeer (Conditional, BreakOp); } --- sys/contrib/dev/acpica/compiler/asltree.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/compiler/asltree.c 2011-11-23 13:47:04.000000000 -0500 @@ -45,6 +45,7 @@ #include #include "aslcompiler.y.h" +#include #include #define _COMPONENT ACPI_COMPILER @@ -287,9 +288,6 @@ case NODE_METHOD_TYPED: return ("NODE_METHOD_TYPED"); - case NODE_IS_BIT_OFFSET: - return ("NODE_IS_BIT_OFFSET"); - case NODE_COMPILE_TIME_CONST: return ("NODE_COMPILE_TIME_CONST"); @@ -428,6 +426,8 @@ time_t CurrentTime; char *StaticTimeString; char *TimeString; + char *Path; + char *Filename; switch (ParseOpcode) @@ -437,7 +437,7 @@ Op->Asl.Value.Integer = Op->Asl.LineNumber; break; - case PARSEOP___FILE__: + case PARSEOP___PATH__: Op = TrAllocateNode (PARSEOP_STRING_LITERAL); /* Op.Asl.Filename contains the full pathname to the file */ @@ -445,7 +445,17 @@ Op->Asl.Value.String = Op->Asl.Filename; break; - case PARSEOP___DATE__: + case PARSEOP___FILE__: + Op = TrAllocateNode (PARSEOP_STRING_LITERAL); + + /* Get the simple filename from the full path */ + + FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename); + ACPI_FREE (Path); + Op->Asl.Value.String = Filename; + break; + + case PARSEOP___DATE__: Op = TrAllocateNode (PARSEOP_STRING_LITERAL); /* Get a copy of the current time */ --- sys/contrib/dev/acpica/compiler/asltypes.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/asltypes.h 2011-11-23 13:29:37.000000000 -0500 @@ -68,7 +68,7 @@ #define NODE_METHOD_SOME_NO_RETVAL 0x00000200 #define NODE_RESULT_NOT_USED 0x00000400 #define NODE_METHOD_TYPED 0x00000800 -#define NODE_IS_BIT_OFFSET 0x00001000 +#define NODE_UNUSED_FLAG 0x00001000 #define NODE_COMPILE_TIME_CONST 0x00002000 #define NODE_IS_TERM_ARG 0x00004000 #define NODE_WAS_ONES_OP 0x00008000 @@ -144,8 +144,10 @@ } ASL_FILE_STATUS; -/* File types */ - +/* + * File types. Note: Any changes to this table must also be reflected + * in the AslFileTypeNames array. + */ typedef enum { ASL_FILE_STDOUT = 0, --- sys/contrib/dev/acpica/compiler/aslutils.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslutils.c 2011-11-23 13:36:17.000000000 -0500 @@ -53,11 +53,31 @@ #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslutils") + char AslHexLookup[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; +/* Table below must match ASL_FILE_TYPES in asltypes.h */ + +static const char *AslFileTypeNames [ASL_NUM_FILES] = +{ + "stdout: ", + "stderr: ", + "Table Input: ", + "Binary Output:", + "Source Output:", + "Listing File: ", + "Hex Dump: ", + "Namespace: ", + "Debug File: ", + "ASM Source: ", + "C Source: ", + "ASM Include: ", + "C Include: " +}; + /* Local prototypes */ @@ -451,35 +471,40 @@ UtDisplaySummary ( UINT32 FileId) { + UINT32 i; + if (FileId != ASL_FILE_STDOUT) { /* Compiler name and version number */ - FlPrintFile (FileId, "%s version %X%s\n", + FlPrintFile (FileId, "%s version %X%s\n\n", ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, ACPI_WIDTH); } + /* Summary of main input and output files */ + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) { FlPrintFile (FileId, - "Table Input: %s - %u lines, %u bytes, %u fields\n", + "%-14s %s - %u lines, %u bytes, %u fields\n", + "Table Input:", Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber, Gbl_InputByteCount, Gbl_InputFieldCount); if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) { FlPrintFile (FileId, - "Binary Output: %s - %u bytes\n\n", + "%-14s %s - %u bytes\n", + "Binary Output:", Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength); } } else { - /* Input/Output summary */ - FlPrintFile (FileId, - "ASL Input: %s - %u lines, %u bytes, %u keywords\n", + "%-14s %s - %u lines, %u bytes, %u keywords\n", + "ASL Input:", Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber, Gbl_InputByteCount, TotalKeywords); @@ -488,16 +513,38 @@ if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) { FlPrintFile (FileId, - "AML Output: %s - %u bytes, %u named objects, %u executable opcodes\n\n", + "%-14s %s - %u bytes, %u named objects, %u executable opcodes\n", + "AML Output:", Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, TotalNamedObjects, TotalExecutableOpcodes); } } + /* Display summary of any optional files */ + + for (i = ASL_FILE_SOURCE_OUTPUT; i <= ASL_MAX_FILE_TYPE; i++) + { + if (!Gbl_Files[i].Filename || !Gbl_Files[i].Handle) + { + continue; + } + + /* .SRC is a temp file unless specifically requested */ + + if ((i == ASL_FILE_SOURCE_OUTPUT) && (!Gbl_SourceOutputFlag)) + { + continue; + } + + FlPrintFile (FileId, "%14s %s - %u bytes\n", + AslFileTypeNames [i], + Gbl_Files[i].Filename, FlGetFileSize (i)); + } + /* Error summary */ FlPrintFile (FileId, - "Compilation complete. %u Errors, %u Warnings, %u Remarks", + "\nCompilation complete. %u Errors, %u Warnings, %u Remarks", Gbl_ExceptionCount[ASL_ERROR], Gbl_ExceptionCount[ASL_WARNING] + Gbl_ExceptionCount[ASL_WARNING2] + --- sys/contrib/dev/acpica/compiler/aslwalks.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/aslwalks.c 2011-11-23 13:29:35.000000000 -0500 @@ -1032,6 +1032,7 @@ ACPI_PARSE_OBJECT *ArgNode; ACPI_PARSE_OBJECT *PrevArgNode = NULL; const ACPI_OPCODE_INFO *OpInfo; + ACPI_NAMESPACE_NODE *Node; OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); @@ -1156,6 +1157,78 @@ } break; + case PARSEOP_CONNECTION: + /* + * Ensure that the referenced operation region has the correct SPACE_ID. + * From the grammar/parser, we know the parent is a FIELD definition. + */ + ArgNode = Op->Asl.Parent; /* Field definition */ + ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ + Node = ArgNode->Asl.Node; /* OpRegion namespace node */ + + ArgNode = Node->Op; /* OpRegion definition */ + ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ + ArgNode = ArgNode->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ + + /* + * The Connection() operator is only valid for the following operation + * region SpaceIds: GeneralPurposeIo and GenericSerialBus. + */ + if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && + (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) + { + AslError (ASL_ERROR, ASL_MSG_CONNECTION_INVALID, Op, NULL); + } + break; + + case PARSEOP_FIELD: + /* + * Ensure that fields for GeneralPurposeIo and GenericSerialBus + * contain at least one Connection() operator + */ + ArgNode = Op->Asl.Child; /* 1st child is the OpRegion Name */ + Node = ArgNode->Asl.Node; /* OpRegion namespace node */ + if (!Node) + { + break; + } + + ArgNode = Node->Op; /* OpRegion definition */ + ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */ + ArgNode = ArgNode->Asl.Next; /* Next peer is the SPACE_ID (what we want) */ + + /* We are only interested in GeneralPurposeIo and GenericSerialBus */ + + if ((ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GPIO) && + (ArgNode->Asl.Value.Integer != ACPI_ADR_SPACE_GSBUS)) + { + break; + } + + ArgNode = Op->Asl.Child; /* 1st child is the OpRegion Name */ + ArgNode = ArgNode->Asl.Next; /* AccessType */ + ArgNode = ArgNode->Asl.Next; /* LockRule */ + ArgNode = ArgNode->Asl.Next; /* UpdateRule */ + ArgNode = ArgNode->Asl.Next; /* Start of FieldUnitList */ + + /* Walk the FieldUnitList */ + + while (ArgNode) + { + if (ArgNode->Asl.ParseOpcode == PARSEOP_CONNECTION) + { + break; + } + else if (ArgNode->Asl.ParseOpcode == PARSEOP_NAMESEG) + { + AslError (ASL_ERROR, ASL_MSG_CONNECTION_MISSING, ArgNode, NULL); + break; + } + + ArgNode = ArgNode->Asl.Next; + } + break; + default: break; } --- sys/contrib/dev/acpica/compiler/dtcompile.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dtcompile.c 2011-11-23 13:29:37.000000000 -0500 @@ -310,6 +310,17 @@ Status = DtCompileRsdp (FieldList); return (Status); } + else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_S3PT)) + { + Status = DtCompileS3pt (FieldList); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtSetTableLength (); + return (Status); + } /* * All other tables must use the common ACPI table header. Insert the @@ -329,7 +340,7 @@ /* Validate the signature via the ACPI table list */ TableData = AcpiDmGetTableData (Signature); - if (!TableData) + if (!TableData || Gbl_CompileGeneric) { DtCompileGeneric ((void **) FieldList); goto Out; @@ -411,6 +422,7 @@ UINT8 FieldType; UINT8 *Buffer; UINT8 *FlagBuffer = NULL; + UINT32 CurrentFlagByteOffset = 0; ACPI_STATUS Status; @@ -442,6 +454,11 @@ */ for (; Info->Name; Info++) { + if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) + { + continue; + } + if (!LocalField) { sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed", @@ -472,6 +489,7 @@ *Field = LocalField; FlagBuffer = Buffer; + CurrentFlagByteOffset = Info->Offset; break; case DT_FIELD_TYPE_FLAG: @@ -480,6 +498,14 @@ if (FlagBuffer) { + /* + * We must increment the FlagBuffer when we have crossed + * into the next flags byte within the flags field + * of type DT_FIELD_TYPE_FLAGS_INTEGER. + */ + FlagBuffer += (Info->Offset - CurrentFlagByteOffset); + CurrentFlagByteOffset = Info->Offset; + DtCompileFlag (FlagBuffer, LocalField, Info); } else --- sys/contrib/dev/acpica/compiler/dtcompiler.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dtcompiler.h 2011-11-23 13:29:34.000000000 -0500 @@ -399,6 +399,10 @@ void **PFieldList); ACPI_STATUS +DtCompileFpdt ( + void **PFieldList); + +ACPI_STATUS DtCompileHest ( void **PFieldList); @@ -415,14 +419,26 @@ void **PFieldList); ACPI_STATUS +DtCompileMpst ( + void **PFieldList); + +ACPI_STATUS DtCompileMsct ( void **PFieldList); ACPI_STATUS +DtCompilePmtt ( + void **PFieldList); + +ACPI_STATUS DtCompileRsdt ( void **PFieldList); ACPI_STATUS +DtCompileS3pt ( + DT_FIELD **PFieldList); + +ACPI_STATUS DtCompileSlic ( void **PFieldList); @@ -459,6 +475,7 @@ extern const unsigned char TemplateAsf[]; extern const unsigned char TemplateBoot[]; extern const unsigned char TemplateBert[]; +extern const unsigned char TemplateBgrt[]; extern const unsigned char TemplateCpep[]; extern const unsigned char TemplateDbgp[]; extern const unsigned char TemplateDmar[]; @@ -466,14 +483,19 @@ extern const unsigned char TemplateEinj[]; extern const unsigned char TemplateErst[]; extern const unsigned char TemplateFadt[]; +extern const unsigned char TemplateFpdt[]; +extern const unsigned char TemplateGtdt[]; extern const unsigned char TemplateHest[]; extern const unsigned char TemplateHpet[]; extern const unsigned char TemplateIvrs[]; extern const unsigned char TemplateMadt[]; extern const unsigned char TemplateMcfg[]; extern const unsigned char TemplateMchi[]; +extern const unsigned char TemplateMpst[]; extern const unsigned char TemplateMsct[]; +extern const unsigned char TemplatePmtt[]; extern const unsigned char TemplateRsdt[]; +extern const unsigned char TemplateS3pt[]; extern const unsigned char TemplateSbst[]; extern const unsigned char TemplateSlic[]; extern const unsigned char TemplateSlit[]; --- sys/contrib/dev/acpica/compiler/dtfield.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dtfield.c 2011-11-23 13:29:34.000000000 -0500 @@ -523,12 +523,25 @@ break; + case ACPI_DMT_FLAGS1: + + BitPosition = 1; + BitLength = 2; + break; + + case ACPI_DMT_FLAGS2: BitPosition = 2; BitLength = 2; break; + case ACPI_DMT_FLAGS4: + + BitPosition = 4; + BitLength = 2; + break; + default: DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid flag opcode"); --- sys/contrib/dev/acpica/compiler/dtsubtable.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dtsubtable.c 2011-11-23 13:29:38.000000000 -0500 @@ -296,6 +296,11 @@ for (; Info->Name; Info++) { + if (Info->Opcode == ACPI_DMT_EXTRA_TEXT) + { + continue; + } + if (!Field) { goto Error; --- sys/contrib/dev/acpica/compiler/dttable.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dttable.c 2011-11-23 13:29:35.000000000 -0500 @@ -660,6 +660,90 @@ } DtInsertSubtable (ParentTable, Subtable); + + if (Revision >= 5) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt5, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + } + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: DtCompileFpdt + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile FPDT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileFpdt ( + void **List) +{ + ACPI_STATUS Status; + ACPI_FPDT_HEADER *FpdtHeader; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + ACPI_DMTABLE_INFO *InfoTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_FIELD *SubtableStart; + + + while (*PFieldList) + { + SubtableStart = *PFieldList; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer); + + switch (FpdtHeader->Type) + { + case ACPI_FPDT_TYPE_BOOT: + InfoTable = AcpiDmTableInfoFpdt0; + break; + + case ACPI_FPDT_TYPE_S3PERF: + InfoTable = AcpiDmTableInfoFpdt1; + break; + + default: + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT"); + return (AE_ERROR); + break; + } + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPopSubtable (); } return (AE_OK); @@ -1025,6 +1109,12 @@ case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: InfoTable = AcpiDmTableInfoMadt10; break; + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + InfoTable = AcpiDmTableInfoMadt11; + break; + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + InfoTable = AcpiDmTableInfoMadt12; + break; default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT"); return (AE_ERROR); @@ -1072,6 +1162,143 @@ /****************************************************************************** * + * FUNCTION: DtCompileMpst + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile MPST. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileMpst ( + void **List) +{ + ACPI_STATUS Status; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + ACPI_MPST_CHANNEL *MpstChannelInfo; + ACPI_MPST_POWER_NODE *MpstPowerNode; + ACPI_MPST_DATA_HDR *MpstDataHeader; + UINT16 SubtableCount; + UINT8 PowerStateCount; + UINT8 ComponentCount; + + + /* Main table */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer); + SubtableCount = MpstChannelInfo->PowerNodeCount; + + while (*PFieldList && SubtableCount) + { + /* Subtable: Memory Power Node(s) */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer); + PowerStateCount = MpstPowerNode->NumPowerStates; + ComponentCount = MpstPowerNode->NumPhysicalComponents; + + ParentTable = DtPeekSubtable (); + + /* Sub-subtables - Memory Power State Structure(s) */ + + while (*PFieldList && PowerStateCount) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0A, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + PowerStateCount--; + } + + /* Sub-subtables - Physical Component ID Structure(s) */ + + while (*PFieldList && ComponentCount) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0B, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + ComponentCount--; + } + + SubtableCount--; + DtPopSubtable (); + } + + /* Subtable: Count of Memory Power State Characteristic structures */ + + DtPopSubtable (); + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst1, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer); + SubtableCount = MpstDataHeader->CharacteristicsCount; + + ParentTable = DtPeekSubtable (); + + /* Subtable: Memory Power State Characteristics structure(s) */ + + while (*PFieldList && SubtableCount) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst2, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + SubtableCount--; + } + + DtPopSubtable (); + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileMsct * * PARAMETERS: List - Current field list pointer @@ -1097,6 +1324,147 @@ /****************************************************************************** * + * FUNCTION: DtCompilePmtt + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile PMTT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompilePmtt ( + void **List) +{ + ACPI_STATUS Status; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_FIELD *SubtableStart; + ACPI_PMTT_HEADER *PmttHeader; + ACPI_PMTT_CONTROLLER *PmttController; + UINT16 DomainCount; + UINT8 PrevType = ACPI_PMTT_TYPE_SOCKET; + + + /* Main table */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + while (*PFieldList) + { + SubtableStart = *PFieldList; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmttHdr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + PmttHeader = ACPI_CAST_PTR (ACPI_PMTT_HEADER, Subtable->Buffer); + while (PrevType >= PmttHeader->Type) + { + DtPopSubtable (); + + if (PrevType == ACPI_PMTT_TYPE_SOCKET) + { + break; + } + PrevType--; + } + PrevType = PmttHeader->Type; + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + switch (PmttHeader->Type) + { + case ACPI_PMTT_TYPE_SOCKET: + + /* Subtable: Socket Structure */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt0, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + break; + + case ACPI_PMTT_TYPE_CONTROLLER: + + /* Subtable: Memory Controller Structure */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER, + (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER))); + DomainCount = PmttController->DomainCount; + + while (DomainCount) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1a, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtInsertSubtable (ParentTable, Subtable); + DomainCount--; + } + break; + + case ACPI_PMTT_TYPE_DIMM: + + /* Subtable: Physical Component Structure */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt2, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + break; + + default: + + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PMTT"); + return (AE_ERROR); + } + } + + return (Status); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileRsdt * * PARAMETERS: List - Current field list pointer @@ -1134,6 +1502,85 @@ /****************************************************************************** * + * FUNCTION: DtCompileS3pt + * + * PARAMETERS: PFieldList - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile S3PT (Pointed to by FPDT) + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileS3pt ( + DT_FIELD **PFieldList) +{ + ACPI_STATUS Status; + ACPI_S3PT_HEADER *S3ptHeader; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + ACPI_DMTABLE_INFO *InfoTable; + DT_FIELD *SubtableStart; + + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt, + &Gbl_RootTable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DtPushSubtable (Gbl_RootTable); + + while (*PFieldList) + { + SubtableStart = *PFieldList; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3ptHdr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + S3ptHeader = ACPI_CAST_PTR (ACPI_S3PT_HEADER, Subtable->Buffer); + + switch (S3ptHeader->Type) + { + case ACPI_S3PT_TYPE_RESUME: + InfoTable = AcpiDmTableInfoS3pt0; + break; + + case ACPI_S3PT_TYPE_SUSPEND: + InfoTable = AcpiDmTableInfoS3pt1; + break; + + default: + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "S3PT"); + return (AE_ERROR); + } + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPopSubtable (); + } + + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileSlic * * PARAMETERS: List - Current field list pointer --- sys/contrib/dev/acpica/compiler/dttemplate.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dttemplate.h 2011-11-23 13:29:37.000000000 -0500 @@ -87,6 +87,17 @@ 0x01,0x00 /* 00000070 ".." */ }; +const unsigned char TemplateBgrt[] = +{ + 0x42,0x47,0x52,0x54,0x38,0x00,0x00,0x00, /* 00000000 "BGRT8..." */ + 0x01,0x0D,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" */ + 0x23,0x06,0x11,0x20,0x01,0x00,0x00,0x00, /* 00000020 "#.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */ +}; + const unsigned char TemplateBert[] = { 0x42,0x45,0x52,0x54,0x30,0x00,0x00,0x00, /* 00000000 "BERT0..." */ @@ -326,6 +337,37 @@ 0x00,0x00,0x00,0x00 /* 000000F0 "...." */ }; +const unsigned char TemplateFpdt[] = +{ + 0x46,0x50,0x44,0x54,0x64,0x00,0x00,0x00, /* 00000000 "FPDTd..." */ + 0x01,0xBD,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" */ + 0x04,0x08,0x11,0x20,0x00,0x00,0x30,0x01, /* 00000020 "... ..0." */ + 0x00,0x00,0x00,0x00,0x00,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 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x10,0x01, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00 /* 00000060 "...." */ +}; + +const unsigned char TemplateGtdt[] = +{ + 0x47,0x54,0x44,0x54,0x50,0x00,0x00,0x00, /* 00000000 "GTDTP..." */ + 0x01,0xF1,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" */ + 0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */ + 0x00,0x00,0x00,0x00,0x01,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 "........" */ +}; + const unsigned char TemplateHest[] = { 0x48,0x45,0x53,0x54,0xD4,0x01,0x00,0x00, /* 00000000 "HEST...." */ @@ -428,13 +470,15 @@ 0x00,0x00,0x00,0x00 /* 000000B8 "...." */ }; +/* MADT with ACPI 5.0 subtables */ + const unsigned char TemplateMadt[] = { - 0x41,0x50,0x49,0x43,0xB6,0x00,0x00,0x00, /* 00000000 "APIC...." */ - 0x01,0x45,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".EINTEL " */ + 0x41,0x50,0x49,0x43,0xF6,0x00,0x00,0x00, /* 00000000 "APIC...." */ + 0x01,0xB0,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" */ - 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */ 0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ 0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ @@ -452,7 +496,15 @@ 0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ 0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B0 "......" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x28, /* 000000B0 ".......(" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ + 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, /* 000000D8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000F0 "......" */ }; const unsigned char TemplateMcfg[] = @@ -480,6 +532,24 @@ 0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */ }; +const unsigned char TemplateMpst[] = +{ + 0x4D,0x50,0x53,0x54,0x6E,0x00,0x00,0x00, /* 00000000 "MPSTn..." */ + 0x01,0x98,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" */ + 0x04,0x08,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x02,0x03,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ + 0x01,0x00,0x41,0x00,0x00,0x00,0x00,0x00, /* 00000050 "..A....." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00 /* 00000068 "......" */ +}; + const unsigned char TemplateMsct[] = { 0x4D,0x53,0x43,0x54,0x90,0x00,0x00,0x00, /* 00000000 "MSCT...." */ @@ -502,6 +572,33 @@ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */ }; +const unsigned char TemplatePmtt[] = +{ + 0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "PMTT...." */ + 0x01,0x3A,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" */ + 0x26,0x08,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "&.. ...." */ + 0x00,0x00,0x80,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x54,0x00, /* 00000030 "......T." */ + 0x05,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 "........" */ + 0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x02,0x00,0x14,0x00,0x02,0x00,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ + 0x00,0x00,0x00,0x00,0x02,0x00,0x14,0x00, /* 00000070 "........" */ + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x01,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000088 ".. ....." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0x00,0x00,0x0C,0x00,0x01,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x00,0x00,0x00,0x00 /* 000000B0 "...." */ +}; + const unsigned char TemplateRsdp[] = { 0x52,0x53,0x44,0x20,0x50,0x54,0x52,0x20, /* 00000000 "RSD PTR " */ @@ -524,6 +621,17 @@ 0x80,0x00,0x00,0x00 /* 00000040 "...." */ }; +const unsigned char TemplateS3pt[] = +{ + 0x53,0x33,0x50,0x54,0x34,0x00,0x00,0x00, /* 00000000 "S3PT4..." */ + 0x00,0x00,0x18,0x01,0x00,0x00,0x00,0x00, /* 00000008 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000010 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */ + 0x01,0x00,0x14,0x01,0x00,0x00,0x00,0x00, /* 00000020 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00 /* 00000030 "...." */ +}; + const unsigned char TemplateSbst[] = { 0x53,0x42,0x53,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SBST0..." */ --- sys/contrib/dev/acpica/compiler/dtutils.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/compiler/dtutils.c 2011-11-23 13:29:36.000000000 -0500 @@ -384,7 +384,9 @@ case ACPI_DMT_FLAG6: case ACPI_DMT_FLAG7: case ACPI_DMT_FLAGS0: + case ACPI_DMT_FLAGS1: case ACPI_DMT_FLAGS2: + case ACPI_DMT_FLAGS4: Type = DT_FIELD_TYPE_FLAG; break; @@ -510,8 +512,11 @@ case ACPI_DMT_FLAG6: case ACPI_DMT_FLAG7: case ACPI_DMT_FLAGS0: + case ACPI_DMT_FLAGS1: case ACPI_DMT_FLAGS2: + case ACPI_DMT_FLAGS4: case ACPI_DMT_LABEL: + case ACPI_DMT_EXTRA_TEXT: ByteLength = 0; break; @@ -521,6 +526,7 @@ case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: case ACPI_DMT_MADT: + case ACPI_DMT_PMTT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -550,6 +556,11 @@ ByteLength = 4; break; + case ACPI_DMT_UINT40: + ByteLength = 5; + break; + + case ACPI_DMT_UINT48: case ACPI_DMT_NAME6: ByteLength = 6; break; --- sys/contrib/dev/acpica/debugger/dbcmds.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/debugger/dbcmds.c 2011-11-23 13:33:43.000000000 -0500 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -69,6 +70,18 @@ ACPI_NAMESPACE_NODE *Node, char *Name); +static ACPI_STATUS +AcpiDbResourceCallback ( + ACPI_RESOURCE *Resource, + void *Context); + +static ACPI_STATUS +AcpiDbDeviceResources ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue); + /******************************************************************************* * @@ -456,6 +469,78 @@ /******************************************************************************* * + * FUNCTION: AcpiDbDisplayTemplate + * + * PARAMETERS: BufferArg - Buffer name or addrss + * + * RETURN: None + * + * DESCRIPTION: Dump a buffer that contains a resource template + * + ******************************************************************************/ + +void +AcpiDbDisplayTemplate ( + char *BufferArg) +{ + ACPI_NAMESPACE_NODE *Node; + ACPI_STATUS Status; + ACPI_BUFFER ReturnObj; + + + /* Translate BufferArg to an Named object */ + + Node = AcpiDbConvertToNode (BufferArg); + if (!Node || (Node == AcpiGbl_RootNode)) + { + AcpiOsPrintf ("Invalid argument: %s\n", BufferArg); + return; + } + + /* We must have a buffer object */ + + if (Node->Type != ACPI_TYPE_BUFFER) + { + AcpiOsPrintf ("Not a Buffer object, cannot be a template: %s\n", + BufferArg); + return; + } + + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + ReturnObj.Pointer = AcpiGbl_DbBuffer; + + /* Attempt to convert the raw buffer to a resource list */ + + Status = AcpiRsCreateResourceList (Node->Object, &ReturnObj); + + AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); + AcpiDbgLevel |= ACPI_LV_RESOURCES; + + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n", + BufferArg, AcpiFormatException (Status)); + goto DumpBuffer; + } + + /* Now we can dump the resource list */ + + AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, + ReturnObj.Pointer)); + +DumpBuffer: + AcpiOsPrintf ("\nRaw data buffer:\n"); + AcpiUtDumpBuffer ((UINT8 *) Node->Object->Buffer.Pointer, + Node->Object->Buffer.Length, + DB_BYTE_DISPLAY, ACPI_UINT32_MAX); + + AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); + return; +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmCompareAmlResources * * PARAMETERS: Aml1Buffer - Contains first resource list @@ -479,11 +564,14 @@ { UINT8 *Aml1; UINT8 *Aml2; + UINT8 *Aml1End; + UINT8 *Aml2End; ACPI_RSDESC_SIZE Aml1Length; ACPI_RSDESC_SIZE Aml2Length; ACPI_RSDESC_SIZE Offset = 0; UINT8 ResourceType; UINT32 Count = 0; + UINT32 i; /* Compare overall buffer sizes (may be different due to size rounding) */ @@ -491,16 +579,18 @@ if (Aml1BufferLength != Aml2BufferLength) { AcpiOsPrintf ( - "**** Buffer length mismatch in converted AML: original %X new %X ****\n", + "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n", Aml1BufferLength, Aml2BufferLength); } Aml1 = Aml1Buffer; Aml2 = Aml2Buffer; + Aml1End = Aml1Buffer + Aml1BufferLength; + Aml2End = Aml2Buffer + Aml2BufferLength; /* Walk the descriptor lists, comparing each descriptor */ - while (Aml1 < (Aml1Buffer + Aml1BufferLength)) + while ((Aml1 < Aml1End) && (Aml2 < Aml2End)) { /* Get the lengths of each descriptor */ @@ -513,7 +603,7 @@ if (Aml1Length != Aml2Length) { AcpiOsPrintf ( - "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X L1 %X L2 %X ****\n", + "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n", Count, ResourceType, Offset, Aml1Length, Aml2Length); } @@ -524,6 +614,15 @@ AcpiOsPrintf ( "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n", Count, ResourceType, Offset); + + for (i = 0; i < Aml1Length; i++) + { + if (Aml1[i] != Aml2[i]) + { + AcpiOsPrintf ("Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n", + i, Aml2[i], Aml1[i]); + } + } } /* Exit on EndTag descriptor */ @@ -626,157 +725,297 @@ /******************************************************************************* * - * FUNCTION: AcpiDbDisplayResources + * FUNCTION: AcpiDbResourceCallback * - * PARAMETERS: ObjectArg - String with hex value of the object + * PARAMETERS: ACPI_WALK_RESOURCE_CALLBACK * - * RETURN: None + * RETURN: Status * - * DESCRIPTION: Display the resource objects associated with a device. + * DESCRIPTION: Simple callback to exercise AcpiWalkResources * ******************************************************************************/ -void -AcpiDbDisplayResources ( - char *ObjectArg) +static ACPI_STATUS +AcpiDbResourceCallback ( + ACPI_RESOURCE *Resource, + void *Context) +{ + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbDeviceResources + * + * PARAMETERS: ACPI_WALK_CALLBACK + * + * RETURN: Status + * + * DESCRIPTION: Display the _PRT/_CRS/_PRS resources for a device object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbDeviceResources ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) { ACPI_NAMESPACE_NODE *Node; - ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *PrtNode = NULL; + ACPI_NAMESPACE_NODE *CrsNode = NULL; + ACPI_NAMESPACE_NODE *PrsNode = NULL; + ACPI_NAMESPACE_NODE *AeiNode = NULL; + char *ParentPath; ACPI_BUFFER ReturnObj; + ACPI_STATUS Status; - AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); - AcpiDbgLevel |= ACPI_LV_RESOURCES; + Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); + ParentPath = AcpiNsGetExternalPathname (Node); + if (!ParentPath) + { + return (AE_NO_MEMORY); + } - /* Convert string to object pointer */ + /* Get handles to the resource methods for this device */ - Node = AcpiDbConvertToNode (ObjectArg); - if (!Node) + (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + if (!PrtNode && !CrsNode && !PrsNode && !AeiNode) { - return; + goto Cleanup; /* Nothing to do */ } + AcpiOsPrintf ("\nDevice: %s\n", ParentPath); + /* Prepare for a return object of arbitrary size */ ReturnObj.Pointer = AcpiGbl_DbBuffer; ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + /* _PRT */ - AcpiOsPrintf ("Evaluating _PRT\n"); + if (PrtNode) + { + AcpiOsPrintf ("Evaluating _PRT\n"); - /* Check if _PRT exists */ + Status = AcpiEvaluateObject (PrtNode, NULL, NULL, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not evaluate _PRT: %s\n", + AcpiFormatException (Status)); + goto GetCrs; + } - Status = AcpiEvaluateObject (Node, METHOD_NAME__PRT, NULL, &ReturnObj); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not obtain _PRT: %s\n", - AcpiFormatException (Status)); - goto GetCrs; - } + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; - ReturnObj.Pointer = AcpiGbl_DbBuffer; - ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + Status = AcpiGetIrqRoutingTable (Node, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n", + AcpiFormatException (Status)); + goto GetCrs; + } - Status = AcpiGetIrqRoutingTable (Node, &ReturnObj); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("GetIrqRoutingTable failed: %s\n", - AcpiFormatException (Status)); - goto GetCrs; + AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer)); } - AcpiRsDumpIrqList (ACPI_CAST_PTR (UINT8, AcpiGbl_DbBuffer)); - /* _CRS */ GetCrs: - AcpiOsPrintf ("Evaluating _CRS\n"); + if (CrsNode) + { + AcpiOsPrintf ("Evaluating _CRS\n"); - ReturnObj.Pointer = AcpiGbl_DbBuffer; - ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; - /* Check if _CRS exists */ + Status = AcpiEvaluateObject (CrsNode, NULL, NULL, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not evaluate _CRS: %s\n", + AcpiFormatException (Status)); + goto GetPrs; + } - Status = AcpiEvaluateObject (Node, METHOD_NAME__CRS, NULL, &ReturnObj); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not obtain _CRS: %s\n", - AcpiFormatException (Status)); - goto GetPrs; - } + /* This code is here to exercise the AcpiWalkResources interface */ - /* Get the _CRS resource list */ + Status = AcpiWalkResources (Node, METHOD_NAME__CRS, + AcpiDbResourceCallback, NULL); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("AcpiWalkResources failed: %s\n", + AcpiFormatException (Status)); + goto GetPrs; + } - ReturnObj.Pointer = AcpiGbl_DbBuffer; - ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + /* Get the _CRS resource list */ - Status = AcpiGetCurrentResources (Node, &ReturnObj); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n", - AcpiFormatException (Status)); - goto GetPrs; - } + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; - /* Dump the _CRS resource list */ + Status = AcpiGetCurrentResources (Node, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("AcpiGetCurrentResources failed: %s\n", + AcpiFormatException (Status)); + goto GetPrs; + } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, - ReturnObj.Pointer)); + /* Dump the _CRS resource list */ - /* - * Perform comparison of original AML to newly created AML. This tests both - * the AML->Resource conversion and the Resource->Aml conversion. - */ - Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS); + AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, + ReturnObj.Pointer)); - /* Execute _SRS with the resource list */ + /* + * Perform comparison of original AML to newly created AML. This tests both + * the AML->Resource conversion and the Resource->Aml conversion. + */ + Status = AcpiDmTestResourceConversion (Node, METHOD_NAME__CRS); - Status = AcpiSetCurrentResources (Node, &ReturnObj); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n", - AcpiFormatException (Status)); - goto GetPrs; + /* Execute _SRS with the resource list */ + + Status = AcpiSetCurrentResources (Node, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("AcpiSetCurrentResources failed: %s\n", + AcpiFormatException (Status)); + goto GetPrs; + } } /* _PRS */ GetPrs: - AcpiOsPrintf ("Evaluating _PRS\n"); + if (PrsNode) + { + AcpiOsPrintf ("Evaluating _PRS\n"); - ReturnObj.Pointer = AcpiGbl_DbBuffer; - ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + + Status = AcpiEvaluateObject (PrsNode, NULL, NULL, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not evaluate _PRS: %s\n", + AcpiFormatException (Status)); + goto GetAei; + } - /* Check if _PRS exists */ + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; - Status = AcpiEvaluateObject (Node, METHOD_NAME__PRS, NULL, &ReturnObj); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not obtain _PRS: %s\n", - AcpiFormatException (Status)); - goto Cleanup; + Status = AcpiGetPossibleResources (Node, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n", + AcpiFormatException (Status)); + goto GetAei; + } + + AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); } - ReturnObj.Pointer = AcpiGbl_DbBuffer; - ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; - Status = AcpiGetPossibleResources (Node, &ReturnObj); - if (ACPI_FAILURE (Status)) + /* _AEI */ + +GetAei: + if (AeiNode) { - AcpiOsPrintf ("AcpiGetPossibleResources failed: %s\n", - AcpiFormatException (Status)); - goto Cleanup; + AcpiOsPrintf ("Evaluating _AEI\n"); + + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + + Status = AcpiEvaluateObject (AeiNode, NULL, NULL, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not evaluate _AEI: %s\n", + AcpiFormatException (Status)); + goto Cleanup; + } + + ReturnObj.Pointer = AcpiGbl_DbBuffer; + ReturnObj.Length = ACPI_DEBUG_BUFFER_SIZE; + + Status = AcpiGetEventResources (Node, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("AcpiGetEventResources failed: %s\n", + AcpiFormatException (Status)); + goto Cleanup; + } + + AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); Cleanup: + ACPI_FREE (ParentPath); + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbDisplayResources + * + * PARAMETERS: ObjectArg - String object name or object pointer. + * "*" means "display resources for all devices" + * + * RETURN: None + * + * DESCRIPTION: Display the resource objects associated with a device. + * + ******************************************************************************/ + +void +AcpiDbDisplayResources ( + char *ObjectArg) +{ + ACPI_NAMESPACE_NODE *Node; + + + AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); + AcpiDbgLevel |= ACPI_LV_RESOURCES; + + /* Asterisk means "display resources for all devices" */ + + if (!ACPI_STRCMP (ObjectArg, "*")) + { + (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); + } + else + { + /* Convert string to object pointer */ + + Node = AcpiDbConvertToNode (ObjectArg); + if (Node) + { + if (Node->Type != ACPI_TYPE_DEVICE) + { + AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n", + Node->Name.Ascii, AcpiUtGetTypeName (Node->Type)); + } + else + { + (void) AcpiDbDeviceResources (Node, 0, NULL, NULL); + } + } + } AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); - return; } --- sys/contrib/dev/acpica/debugger/dbdisply.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/debugger/dbdisply.c 2011-11-23 13:29:26.000000000 -0500 @@ -90,6 +90,8 @@ ACPI_ADR_SPACE_CMOS, ACPI_ADR_SPACE_PCI_BAR_TARGET, ACPI_ADR_SPACE_IPMI, + ACPI_ADR_SPACE_GPIO, + ACPI_ADR_SPACE_GSBUS, ACPI_ADR_SPACE_DATA_TABLE, ACPI_ADR_SPACE_FIXED_HARDWARE }; @@ -971,7 +973,7 @@ while (HandlerObj) { - if (i == HandlerObj->AddressSpace.SpaceId) + if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId) { AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, (HandlerObj->AddressSpace.HandlerFlags & @@ -989,6 +991,24 @@ FoundHandler:; } + + /* Find all handlers for user-defined SpaceIDs */ + + HandlerObj = ObjDesc->Device.Handler; + while (HandlerObj) + { + if (HandlerObj->AddressSpace.SpaceId >= ACPI_USER_REGION_BEGIN) + { + AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, + "User-defined ID", HandlerObj->AddressSpace.SpaceId); + AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, + (HandlerObj->AddressSpace.HandlerFlags & + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + HandlerObj->AddressSpace.Handler); + } + + HandlerObj = HandlerObj->AddressSpace.Next; + } } /* Fixed event handlers */ --- sys/contrib/dev/acpica/debugger/dbfileio.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/debugger/dbfileio.c 2011-11-23 13:29:26.000000000 -0500 @@ -271,10 +271,11 @@ fseek (fp, 0, SEEK_SET); - /* The RSDT and FACS tables do not have standard ACPI headers */ + /* The RSDT, FACS and S3PT tables do not have standard ACPI headers */ if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ") || - ACPI_COMPARE_NAME (TableHeader.Signature, "FACS")) + ACPI_COMPARE_NAME (TableHeader.Signature, "FACS") || + ACPI_COMPARE_NAME (TableHeader.Signature, "S3PT")) { *TableLength = FileSize; StandardHeader = FALSE; --- sys/contrib/dev/acpica/debugger/dbinput.c 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/debugger/dbinput.c 2011-11-23 13:29:26.000000000 -0500 @@ -131,6 +131,7 @@ CMD_STATS, CMD_STOP, CMD_TABLES, + CMD_TEMPLATE, CMD_TERMINATE, CMD_THREADS, CMD_TRACE, @@ -199,6 +200,7 @@ {"STATS", 0}, {"STOP", 0}, {"TABLES", 0}, + {"TEMPLATE", 1}, {"TERMINATE", 0}, {"THREADS", 3}, {"TRACE", 1}, @@ -268,9 +270,10 @@ AcpiOsPrintf (" Predefined Check all predefined names\n"); AcpiOsPrintf (" Prefix [] Set or Get current execution prefix\n"); AcpiOsPrintf (" References Find all references to object at addr\n"); - AcpiOsPrintf (" Resources Get and display Device resources\n"); + AcpiOsPrintf (" Resources Display Device resources (* = all devices)\n"); AcpiOsPrintf (" Set N Set value for named integer\n"); AcpiOsPrintf (" Sleep Simulate sleep/wake sequence\n"); + AcpiOsPrintf (" Template Format/dump a Buffer/ResourceTemplate\n"); AcpiOsPrintf (" Terminate Delete namespace and all internal objects\n"); AcpiOsPrintf (" Type Display object type\n"); @@ -854,6 +857,10 @@ AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]); break; + case CMD_TEMPLATE: + AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]); + break; + case CMD_TERMINATE: AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); AcpiUtSubsystemShutdown (); --- sys/contrib/dev/acpica/debugger/dbutils.c 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/debugger/dbutils.c 2011-11-23 13:29:26.000000000 -0500 @@ -208,7 +208,7 @@ AcpiOsPrintf ("\n"); } AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), - ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); + ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT); } else { --- sys/contrib/dev/acpica/disassembler/dmbuffer.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmbuffer.c 2011-11-23 13:29:39.000000000 -0500 @@ -108,19 +108,19 @@ } AcpiDmIndent (Level); - if (ByteCount > 7) + if (ByteCount > 8) { - AcpiOsPrintf ("/* %04X */ ", i); + AcpiOsPrintf ("/* %04X */ ", i); } } - AcpiOsPrintf ("0x%2.2X", (UINT32) ByteData[i]); + AcpiOsPrintf (" 0x%2.2X", (UINT32) ByteData[i]); /* Add comma if there are more bytes to display */ if (i < (ByteCount -1)) { - AcpiOsPrintf (", "); + AcpiOsPrintf (","); } } --- sys/contrib/dev/acpica/disassembler/dmopcode.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmopcode.c 2011-11-23 13:29:39.000000000 -0500 @@ -303,6 +303,7 @@ UINT32 Length; ACPI_PARSE_OBJECT *Child; ACPI_STATUS Status; + UINT8 *Aml; if (!Op) @@ -426,16 +427,19 @@ * types of buffers, we have to closely look at the data in the * buffer to determine the type. */ - Status = AcpiDmIsResourceTemplate (Op); - if (ACPI_SUCCESS (Status)) + if (!AcpiGbl_NoResourceDisassembly) { - Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; - AcpiOsPrintf ("ResourceTemplate"); - break; - } - else if (Status == AE_AML_NO_RESOURCE_END_TAG) - { - AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ "); + Status = AcpiDmIsResourceTemplate (Op); + if (ACPI_SUCCESS (Status)) + { + Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; + AcpiOsPrintf ("ResourceTemplate"); + break; + } + else if (Status == AE_AML_NO_RESOURCE_END_TAG) + { + AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ "); + } } if (AcpiDmIsUnicodeBuffer (Op)) @@ -495,7 +499,7 @@ if (Info->BitOffset % 8 == 0) { - AcpiOsPrintf (" Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset)); + AcpiOsPrintf ("Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset)); } else { @@ -507,16 +511,59 @@ case AML_INT_ACCESSFIELD_OP: + case AML_INT_EXTACCESSFIELD_OP: - AcpiOsPrintf (" AccessAs (%s, ", - AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer >> 8) & 0x7]); + AcpiOsPrintf ("AccessAs (%s, ", + AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer & 0x7)]); + + AcpiDmDecodeAttribute ((UINT8) (Op->Common.Value.Integer >> 8)); + + if (Op->Common.AmlOpcode == AML_INT_EXTACCESSFIELD_OP) + { + AcpiOsPrintf (" (0x%2.2X)", (unsigned) ((Op->Common.Value.Integer >> 16) & 0xFF)); + } - AcpiDmDecodeAttribute ((UINT8) Op->Common.Value.Integer); AcpiOsPrintf (")"); AcpiDmCommaIfFieldMember (Op); break; + case AML_INT_CONNECTION_OP: + + /* + * Two types of Connection() - one with a buffer object, the + * other with a namestring that points to a buffer object. + */ + AcpiOsPrintf ("Connection ("); + Child = Op->Common.Value.Arg; + + if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP) + { + AcpiOsPrintf ("\n"); + + Aml = Child->Named.Data; + Length = (UINT32) Child->Common.Value.Integer; + + Info->Level += 1; + Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; + AcpiDmResourceTemplate (Info, Op->Common.Parent, Aml, Length); + + Info->Level -= 1; + AcpiDmIndent (Info->Level); + } + else + { + AcpiDmNamestring (Child->Common.Value.Name); + } + + AcpiOsPrintf (")"); + AcpiDmCommaIfFieldMember (Op); + AcpiOsPrintf ("\n"); + + Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; /* for now, ignore in AcpiDmAscendingOp */ + Child->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + break; + case AML_INT_BYTELIST_OP: AcpiDmByteList (Info, Op); --- sys/contrib/dev/acpica/disassembler/dmresrc.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmresrc.c 2011-11-23 13:29:39.000000000 -0500 @@ -55,12 +55,6 @@ /* Dispatch tables for Resource disassembly functions */ -typedef -void (*ACPI_RESOURCE_HANDLER) ( - AML_RESOURCE *Resource, - UINT32 Length, - UINT32 Level); - static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] = { /* Small descriptors */ @@ -75,7 +69,7 @@ AcpiDmEndDependentDescriptor, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ AcpiDmIoDescriptor, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */ AcpiDmFixedIoDescriptor, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */ - NULL, /* 0x0A, Reserved */ + AcpiDmFixedDmaDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */ NULL, /* 0x0B, Reserved */ NULL, /* 0x0C, Reserved */ NULL, /* 0x0D, Reserved */ @@ -95,7 +89,10 @@ AcpiDmWordDescriptor, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */ AcpiDmInterruptDescriptor, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */ AcpiDmQwordDescriptor, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */ - AcpiDmExtendedDescriptor /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_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 */ }; --- sys/contrib/dev/acpica/disassembler/dmresrcl.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmresrcl.c 2011-11-23 13:29:39.000000000 -0500 @@ -1050,4 +1050,3 @@ } #endif - --- sys/contrib/dev/acpica/disassembler/dmresrcl2.c 1969-12-31 19:00:00.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmresrcl2.c 2011-11-23 13:47:04.000000000 -0500 @@ -0,0 +1,700 @@ +/******************************************************************************* + * + * Module Name: dmresrcl2.c - "Large" Resource Descriptor disassembly (#2) + * + ******************************************************************************/ + +/* + * Copyright (C) 2000 - 2011, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + + +#include +#include +#include + + +#ifdef ACPI_DISASSEMBLER + +#define _COMPONENT ACPI_CA_DEBUGGER + ACPI_MODULE_NAME ("dbresrcl2") + +/* Local prototypes */ + +static void +AcpiDmI2cSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +static void +AcpiDmSpiSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +static void +AcpiDmUartSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +static void +AcpiDmGpioCommon ( + AML_RESOURCE *Resource, + UINT32 Level); + +static void +AcpiDmDumpRawDataBuffer ( + UINT8 *Buffer, + UINT32 Length, + UINT32 Level); + + +/* Dispatch table for the serial bus descriptors */ + +static ACPI_RESOURCE_HANDLER SerialBusResourceDispatch [] = +{ + NULL, + AcpiDmI2cSerialBusDescriptor, + AcpiDmSpiSerialBusDescriptor, + AcpiDmUartSerialBusDescriptor +}; + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpRawDataBuffer + * + * PARAMETERS: Buffer - Pointer to the data bytes + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Dump a data buffer as a RawDataBuffer() object. Used for + * vendor data bytes. + * + ******************************************************************************/ + +static void +AcpiDmDumpRawDataBuffer ( + UINT8 *Buffer, + UINT32 Length, + UINT32 Level) +{ + UINT32 Index; + UINT32 i; + UINT32 j; + + + if (!Length) + { + return; + } + + AcpiOsPrintf ("RawDataBuffer (0x%.2X) // Vendor Data", Length); + + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("{\n"); + AcpiDmIndent (Level + 2); + + for (i = 0; i < Length;) + { + for (j = 0; j < 8; j++) + { + Index = i + j; + if (Index >= Length) + { + goto Finish; + } + + AcpiOsPrintf ("0x%2.2X", Buffer[Index]); + if ((Index + 1) >= Length) + { + goto Finish; + } + + AcpiOsPrintf (", "); + } + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 2); + + i += 8; + } + +Finish: + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("}"); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmGpioCommon + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor + * + ******************************************************************************/ + +static void +AcpiDmGpioCommon ( + AML_RESOURCE *Resource, + UINT32 Level) +{ + UINT32 PinCount; + UINT16 *PinList; + UINT8 *VendorData; + UINT32 i; + + + /* ResourceSource, ResourceSourceIndex, ResourceType */ + + AcpiDmIndent (Level + 1); + if (Resource->Gpio.ResSourceOffset) + { + AcpiUtPrintString ( + ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset), + ACPI_UINT8_MAX); + } + + AcpiOsPrintf (", "); + AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex); + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [(Resource->Gpio.Flags & 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + AcpiOsPrintf (","); + + /* Dump the vendor data */ + + if (Resource->Gpio.VendorOffset) + { + AcpiOsPrintf ("\n"); + AcpiDmIndent (Level + 1); + VendorData = ACPI_ADD_PTR (UINT8, Resource, + Resource->Gpio.VendorOffset); + + AcpiDmDumpRawDataBuffer (VendorData, + Resource->Gpio.VendorLength, Level); + } + + AcpiOsPrintf (")\n"); + + /* Dump the interrupt list */ + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("{ // Pin list\n"); + + PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset - + Resource->Gpio.PinTableOffset)) / + sizeof (UINT16); + + PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource, + Resource->Gpio.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: AcpiDmGpioIntDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a GPIO Interrupt descriptor + * + ******************************************************************************/ + +static void +AcpiDmGpioIntDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + + /* Dump the GpioInt-specific portion of the descriptor */ + + /* EdgeLevel, ActiveLevel, Shared */ + + AcpiDmIndent (Level); + AcpiOsPrintf ("GpioInt (%s, %s, %s, ", + AcpiGbl_HeDecode [(Resource->Gpio.IntFlags & 1)], + AcpiGbl_LlDecode [(Resource->Gpio.IntFlags >> 1) & 1], + AcpiGbl_ShrDecode [(Resource->Gpio.IntFlags >> 3) & 1]); + + /* PinConfig, DebounceTimeout */ + + if (Resource->Gpio.PinConfig <= 3) + { + AcpiOsPrintf ("%s, ", + AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]); + } + else + { + AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig); + } + AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout); + + /* Dump the GpioInt/GpioIo common portion of the descriptor */ + + AcpiDmGpioCommon (Resource, Level); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmGpioIoDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a GPIO Interrupt descriptor + * + ******************************************************************************/ + +static void +AcpiDmGpioIoDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + + /* Dump the GpioIo-specific portion of the descriptor */ + + /* Shared, PinConfig */ + + AcpiDmIndent (Level); + AcpiOsPrintf ("GpioIo (%s, ", + AcpiGbl_ShrDecode [(Resource->Gpio.IntFlags >> 3) & 1]); + + if (Resource->Gpio.PinConfig <= 3) + { + AcpiOsPrintf ("%s, ", + AcpiGbl_PpcDecode[Resource->Gpio.PinConfig]); + } + else + { + AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig); + } + + /* DebounceTimeout, DriveStrength, IoRestriction */ + + AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout); + AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength); + AcpiOsPrintf ("%s,\n", + AcpiGbl_IorDecode [Resource->Gpio.IntFlags & 3]); + + /* Dump the GpioInt/GpioIo common portion of the descriptor */ + + AcpiDmGpioCommon (Resource, Level); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmGpioDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a GpioInt/GpioIo GPIO Interrupt/IO descriptor + * + ******************************************************************************/ + +void +AcpiDmGpioDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT8 ConnectionType; + + + ConnectionType = Resource->Gpio.ConnectionType; + + switch (ConnectionType) + { + case AML_RESOURCE_GPIO_TYPE_INT: + AcpiDmGpioIntDescriptor (Resource, Length, Level); + break; + + case AML_RESOURCE_GPIO_TYPE_IO: + AcpiDmGpioIoDescriptor (Resource, Length, Level); + break; + + default: + AcpiOsPrintf ("Unknown GPIO type\n"); + break; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpSerialBusVendorData + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * + * RETURN: None + * + * DESCRIPTION: Dump optional serial bus vendor data + * + ******************************************************************************/ + +static void +AcpiDmDumpSerialBusVendorData ( + AML_RESOURCE *Resource, + UINT32 Level) +{ + UINT8 *VendorData; + UINT32 VendorLength; + + + /* Get the (optional) vendor data and length */ + + switch (Resource->CommonSerialBus.Type) + { + case AML_RESOURCE_I2C_SERIALBUSTYPE: + + VendorLength = Resource->CommonSerialBus.TypeDataLength - + AML_RESOURCE_I2C_MIN_DATA_LEN; + + VendorData = ACPI_ADD_PTR (UINT8, Resource, + sizeof (AML_RESOURCE_I2C_SERIALBUS)); + break; + + case AML_RESOURCE_SPI_SERIALBUSTYPE: + + VendorLength = Resource->CommonSerialBus.TypeDataLength - + AML_RESOURCE_SPI_MIN_DATA_LEN; + + VendorData = ACPI_ADD_PTR (UINT8, Resource, + sizeof (AML_RESOURCE_SPI_SERIALBUS)); + break; + + case AML_RESOURCE_UART_SERIALBUSTYPE: + + VendorLength = Resource->CommonSerialBus.TypeDataLength - + AML_RESOURCE_UART_MIN_DATA_LEN; + + VendorData = ACPI_ADD_PTR (UINT8, Resource, + sizeof (AML_RESOURCE_UART_SERIALBUS)); + break; + + default: + return; + } + + /* Dump the vendor bytes as a RawDataBuffer object */ + + AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmI2cSerialBusDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a I2C serial bus descriptor + * + ******************************************************************************/ + +static void +AcpiDmI2cSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT32 ResourceSourceOffset; + + + /* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */ + + AcpiDmIndent (Level); + AcpiOsPrintf ("I2cSerialBus (0x%4.4X, %s, 0x%8.8X,\n", + Resource->I2cSerialBus.SlaveAddress, + AcpiGbl_SmDecode [(Resource->I2cSerialBus.Flags & 1)], + Resource->I2cSerialBus.ConnectionSpeed); + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("%s, ", + AcpiGbl_AmDecode [(Resource->I2cSerialBus.TypeSpecificFlags & 1)]); + + /* ResourceSource is a required field */ + + ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) + + Resource->CommonSerialBus.TypeDataLength; + + AcpiUtPrintString ( + ACPI_ADD_PTR (char, Resource, ResourceSourceOffset), + ACPI_UINT8_MAX); + + /* ResourceSourceIndex, ResourceUsage */ + + AcpiOsPrintf (",\n"); + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [(Resource->I2cSerialBus.Flags & 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + AcpiOsPrintf (",\n"); + + /* Dump the vendor data */ + + AcpiDmIndent (Level + 1); + AcpiDmDumpSerialBusVendorData (Resource, Level); + AcpiOsPrintf (")\n"); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmSpiSerialBusDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a SPI serial bus descriptor + * + ******************************************************************************/ + +static void +AcpiDmSpiSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT32 ResourceSourceOffset; + + + /* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */ + + AcpiDmIndent (Level); + AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n", + Resource->SpiSerialBus.DeviceSelection, + AcpiGbl_DpDecode [(Resource->SpiSerialBus.TypeSpecificFlags >> 1) & 1], + AcpiGbl_WmDecode [(Resource->SpiSerialBus.TypeSpecificFlags & 1)], + Resource->SpiSerialBus.DataBitLength); + + /* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */ + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("%s, 0x%8.8X, %s,\n", + AcpiGbl_SmDecode [(Resource->SpiSerialBus.Flags & 1)], + Resource->SpiSerialBus.ConnectionSpeed, + AcpiGbl_CpoDecode [(Resource->SpiSerialBus.ClockPolarity & 1)]); + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("%s, ", + AcpiGbl_CphDecode [(Resource->SpiSerialBus.ClockPhase & 1)]); + + /* ResourceSource is a required field */ + + ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) + + Resource->CommonSerialBus.TypeDataLength; + + AcpiUtPrintString ( + ACPI_ADD_PTR (char, Resource, ResourceSourceOffset), + ACPI_UINT8_MAX); + + /* ResourceSourceIndex, ResourceUsage */ + + AcpiOsPrintf (",\n"); + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [(Resource->SpiSerialBus.Flags & 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + AcpiOsPrintf (",\n"); + + /* Dump the vendor data */ + + AcpiDmIndent (Level + 1); + AcpiDmDumpSerialBusVendorData (Resource, Level); + AcpiOsPrintf (")\n"); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmUartSerialBusDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a UART serial bus descriptor + * + ******************************************************************************/ + +static void +AcpiDmUartSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + UINT32 ResourceSourceOffset; + + + /* ConnectionSpeed, BitsPerByte, StopBits */ + + AcpiDmIndent (Level); + AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n", + Resource->UartSerialBus.DefaultBaudRate, + AcpiGbl_BpbDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 4) & 3], + AcpiGbl_SbDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 2) & 3]); + + /* LinesInUse, IsBigEndian, Parity, FlowControl */ + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n", + Resource->UartSerialBus.LinesEnabled, + AcpiGbl_EdDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 7) & 1], + AcpiGbl_PtDecode [Resource->UartSerialBus.Parity & 7], + AcpiGbl_FcDecode [Resource->UartSerialBus.TypeSpecificFlags & 3]); + + /* ReceiveBufferSize, TransmitBufferSize */ + + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ", + Resource->UartSerialBus.RxFifoSize, + Resource->UartSerialBus.TxFifoSize); + + /* ResourceSource is a required field */ + + ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) + + Resource->CommonSerialBus.TypeDataLength; + + AcpiUtPrintString ( + ACPI_ADD_PTR (char, Resource, ResourceSourceOffset), + ACPI_UINT8_MAX); + + /* ResourceSourceIndex, ResourceUsage */ + + AcpiOsPrintf (",\n"); + AcpiDmIndent (Level + 1); + AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ConsumeDecode [(Resource->UartSerialBus.Flags & 1)]); + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + AcpiOsPrintf (",\n"); + + /* Dump the vendor data */ + + AcpiDmIndent (Level + 1); + AcpiDmDumpSerialBusVendorData (Resource, Level); + AcpiOsPrintf (")\n"); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmSerialBusDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a I2C/SPI/UART serial bus descriptor + * + ******************************************************************************/ + +void +AcpiDmSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + + SerialBusResourceDispatch [Resource->CommonSerialBus.Type] ( + Resource, Length, Level); +} + +#endif + --- sys/contrib/dev/acpica/disassembler/dmresrcs.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmresrcs.c 2011-11-23 13:29:39.000000000 -0500 @@ -121,9 +121,9 @@ AcpiDmIndent (Level); AcpiOsPrintf ("DMA (%s, %s, %s, ", - AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3], - AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1], - AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]); + AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3], + AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1], + AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]); /* Insert a descriptor name */ @@ -137,6 +137,49 @@ /******************************************************************************* * + * FUNCTION: AcpiDmFixedDmaDescriptor + * + * PARAMETERS: Resource - Pointer to the resource descriptor + * Length - Length of the descriptor in bytes + * Level - Current source code indentation level + * + * RETURN: None + * + * DESCRIPTION: Decode a FixedDMA descriptor + * + ******************************************************************************/ + +void +AcpiDmFixedDmaDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + + AcpiDmIndent (Level); + AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ", + Resource->FixedDma.RequestLines, + Resource->FixedDma.Channels); + + if (Resource->FixedDma.Width <= 5) + { + AcpiOsPrintf ("%s, ", + AcpiGbl_DtsDecode [Resource->FixedDma.Width]); + } + else + { + AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ", Resource->FixedDma.Width); + } + + /* Insert a descriptor name */ + + AcpiDmDescriptorName (); + AcpiOsPrintf (")\n"); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmIoDescriptor * * PARAMETERS: Resource - Pointer to the resource descriptor --- sys/contrib/dev/acpica/disassembler/dmutils.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmutils.c 2011-11-23 13:29:39.000000000 -0500 @@ -135,7 +135,8 @@ * * RETURN: None * - * DESCRIPTION: Decode the AccessAs attribute byte. (Mostly SMBus stuff) + * DESCRIPTION: Decode the AccessAs attribute byte. (Mostly SMBus and + * GenericSerialBus stuff.) * ******************************************************************************/ @@ -146,44 +147,61 @@ switch (Attribute) { - case AML_FIELD_ATTRIB_SMB_QUICK: + case AML_FIELD_ATTRIB_QUICK: - AcpiOsPrintf ("SMBQuick"); + AcpiOsPrintf ("AttribQuick"); break; - case AML_FIELD_ATTRIB_SMB_SEND_RCV: + case AML_FIELD_ATTRIB_SEND_RCV: - AcpiOsPrintf ("SMBSendReceive"); + AcpiOsPrintf ("AttribSendReceive"); break; - case AML_FIELD_ATTRIB_SMB_BYTE: + case AML_FIELD_ATTRIB_BYTE: - AcpiOsPrintf ("SMBByte"); + AcpiOsPrintf ("AttribByte"); break; - case AML_FIELD_ATTRIB_SMB_WORD: + case AML_FIELD_ATTRIB_WORD: - AcpiOsPrintf ("SMBWord"); + AcpiOsPrintf ("AttribWord"); break; - case AML_FIELD_ATTRIB_SMB_WORD_CALL: + case AML_FIELD_ATTRIB_BLOCK: - AcpiOsPrintf ("SMBProcessCall"); + AcpiOsPrintf ("AttribBlock"); break; - case AML_FIELD_ATTRIB_SMB_BLOCK: + case AML_FIELD_ATTRIB_MULTIBYTE: - AcpiOsPrintf ("SMBBlock"); + AcpiOsPrintf ("AttribBytes"); break; - case AML_FIELD_ATTRIB_SMB_BLOCK_CALL: + case AML_FIELD_ATTRIB_WORD_CALL: - AcpiOsPrintf ("SMBBlockProcessCall"); + AcpiOsPrintf ("AttribProcessCall"); + break; + + case AML_FIELD_ATTRIB_BLOCK_CALL: + + AcpiOsPrintf ("AttribBlockProcessCall"); + break; + + case AML_FIELD_ATTRIB_RAW_BYTES: + + AcpiOsPrintf ("AttribRawBytes"); + break; + + case AML_FIELD_ATTRIB_RAW_PROCESS: + + AcpiOsPrintf ("AttribRawProcessBytes"); break; default: - AcpiOsPrintf ("0x%.2X", Attribute); + /* A ByteConst is allowed by the grammar */ + + AcpiOsPrintf ("0x%2.2X", Attribute); break; } } --- sys/contrib/dev/acpica/disassembler/dmwalk.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/disassembler/dmwalk.c 2011-11-23 13:29:39.000000000 -0500 @@ -464,7 +464,8 @@ AcpiDmDisassembleOneOp (NULL, Info, Op); - if (Op->Common.DisasmOpcode == ACPI_DASM_LNOT_PREFIX) + if ((Op->Common.DisasmOpcode == ACPI_DASM_LNOT_PREFIX) || + (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP)) { return (AE_OK); } --- sys/contrib/dev/acpica/dispatcher/dsargs.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/dispatcher/dsargs.c 2011-11-23 13:29:28.000000000 -0500 @@ -424,7 +424,7 @@ /* Execute the argument AML */ - Status = AcpiDsExecuteArguments (Node, Node->Parent, + Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode, ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart); return_ACPI_STATUS (Status); } --- sys/contrib/dev/acpica/dispatcher/dsfield.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/dispatcher/dsfield.c 2011-11-23 13:29:28.000000000 -0500 @@ -243,6 +243,7 @@ { ACPI_STATUS Status; UINT64 Position; + ACPI_PARSE_OBJECT *Child; ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -257,10 +258,11 @@ while (Arg) { /* - * Three types of field elements are handled: - * 1) Offset - specifies a bit offset - * 2) AccessAs - changes the access mode - * 3) Name - Enters a new named field into the namespace + * Four types of field elements are handled: + * 1) Name - Enters a new named field into the namespace + * 2) Offset - specifies a bit offset + * 3) AccessAs - changes the access mode/attributes + * 4) Connection - Associate a resource template with the field */ switch (Arg->Common.AmlOpcode) { @@ -279,24 +281,67 @@ Info->FieldBitPosition = (UINT32) Position; break; - case AML_INT_ACCESSFIELD_OP: - + case AML_INT_EXTACCESSFIELD_OP: /* - * Get a new AccessType and AccessAttribute -- to be used for all - * field units that follow, until field end or another AccessAs - * keyword. + * Get new AccessType, AccessAttribute, and AccessLength fields + * -- to be used for all field units that follow, until the + * end-of-field or another AccessAs keyword is encountered. + * NOTE. These three bytes are encoded in the integer value + * of the parseop for convenience. * * In FieldFlags, preserve the flag bits other than the - * ACCESS_TYPE bits + * ACCESS_TYPE bits. */ + + /* AccessType (ByteAcc, WordAcc, etc.) */ + Info->FieldFlags = (UINT8) ((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | - ((UINT8) ((UINT32) Arg->Common.Value.Integer >> 8))); + ((UINT8) ((UINT32) (Arg->Common.Value.Integer & 0x07)))); + + /* AccessAttribute (AttribQuick, AttribByte, etc.) */ + + Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF); + + /* AccessLength (for serial/buffer protocols) */ - Info->Attribute = (UINT8) (Arg->Common.Value.Integer); + Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF); break; + case AML_INT_CONNECTION_OP: + /* + * Clear any previous connection. New connection is used for all + * fields that follow, similar to AccessAs + */ + Info->ResourceBuffer = NULL; + Info->ConnectionNode = NULL; + + /* + * A Connection() is either an actual resource descriptor (buffer) + * or a named reference to a resource template + */ + Child = Arg->Common.Value.Arg; + if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP) + { + Info->ResourceBuffer = Child->Named.Data; + Info->ResourceLength = (UINT16) Child->Named.Value.Integer; + } + else + { + /* Lookup the Connection() namepath, it should already exist */ + + Status = AcpiNsLookup (WalkState->ScopeInfo, + Child->Common.Value.Name, ACPI_TYPE_ANY, + ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, + WalkState, &Info->ConnectionNode); + if (ACPI_FAILURE (Status)) + { + ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status); + return_ACPI_STATUS (Status); + } + } + break; case AML_INT_NAMEDFIELD_OP: @@ -348,7 +393,6 @@ Info->FieldBitPosition += Info->FieldBitLength; break; - default: ACPI_ERROR ((AE_INFO, @@ -406,6 +450,8 @@ } } + ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO)); + /* Second arg is the field flags */ Arg = Arg->Common.Next; @@ -418,7 +464,6 @@ Info.RegionNode = RegionNode; Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); - return_ACPI_STATUS (Status); } @@ -514,8 +559,8 @@ while (Arg) { /* - * Ignore OFFSET and ACCESSAS terms here; we are only interested in the - * field names in order to enter them into the namespace. + * Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested + * in the field names in order to enter them into the namespace. */ if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) { @@ -697,7 +742,6 @@ Info.RegionNode = RegionNode; Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); - return_ACPI_STATUS (Status); } --- sys/contrib/dev/acpica/events/evevent.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/events/evevent.c 2011-11-23 13:29:32.000000000 -0500 @@ -81,6 +81,13 @@ ACPI_FUNCTION_TRACE (EvInitializeEvents); + /* If Hardware Reduced flag is set, there are no fixed events */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* * Initialize the Fixed and General Purpose Events. This is done prior to * enabling SCIs to prevent interrupts from occurring before the handlers @@ -128,6 +135,13 @@ ACPI_FUNCTION_TRACE (EvInstallXruptHandlers); + /* If Hardware Reduced flag is set, there is no ACPI h/w */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Install the SCI handler */ Status = AcpiEvInstallSciHandler (); --- sys/contrib/dev/acpica/events/evglock.c 2011-04-15 14:34:27.000000000 -0400 +++ sys/contrib/dev/acpica/events/evglock.c 2011-11-23 13:29:32.000000000 -0500 @@ -79,6 +79,13 @@ ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler); + /* If Hardware Reduced flag is set, there is no global lock */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Attempt installation of the global lock handler */ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, --- sys/contrib/dev/acpica/events/evregion.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/events/evregion.c 2011-11-23 13:29:32.000000000 -0500 @@ -372,6 +372,7 @@ * FUNCTION: AcpiEvAddressSpaceDispatch * * PARAMETERS: RegionObj - Internal region object + * FieldObj - Corresponding field. Can be NULL. * Function - Read or Write operation * RegionOffset - Where in the region to read or write * BitWidth - Field width in bits (8, 16, 32, or 64) @@ -388,6 +389,7 @@ ACPI_STATUS AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, + ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, @@ -399,6 +401,7 @@ ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *RegionObj2; void *RegionContext = NULL; + ACPI_CONNECTION_INFO *Context; ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch); @@ -423,6 +426,8 @@ return_ACPI_STATUS (AE_NOT_EXIST); } + Context = HandlerDesc->AddressSpace.Context; + /* * It may be the case that the region has never been initialized. * Some types of regions require special init code @@ -450,7 +455,7 @@ AcpiExExitInterpreter (); Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE, - HandlerDesc->AddressSpace.Context, &RegionContext); + Context, &RegionContext); /* Re-enter the interpreter */ @@ -499,6 +504,27 @@ ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); + + /* + * Special handling for GenericSerialBus and GeneralPurposeIo: + * There are three extra parameters that must be passed to the + * handler via the context: + * 1) Connection buffer, a resource template from Connection() op. + * 2) Length of the above buffer. + * 3) Actual access length from the AccessAs() op. + */ + if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) || + (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) && + Context && + FieldObj) + { + /* Get the Connection (ResourceTemplate) buffer */ + + Context->Connection = FieldObj->Field.ResourceBuffer; + Context->Length = FieldObj->Field.ResourceLength; + Context->AccessLength = FieldObj->Field.AccessLength; + } + if (!(HandlerDesc->AddressSpace.HandlerFlags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { @@ -514,7 +540,7 @@ Status = Handler (Function, (RegionObj->Region.Address + RegionOffset), BitWidth, Value, - HandlerDesc->AddressSpace.Context, RegionObj2->Extra.RegionContext); + Context, RegionObj2->Extra.RegionContext); if (ACPI_FAILURE (Status)) { --- sys/contrib/dev/acpica/executer/exconfig.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/executer/exconfig.c 2011-11-23 13:29:27.000000000 -0500 @@ -334,7 +334,7 @@ for (i = 0; i < Length; i++) { - Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, + Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ, RegionOffset, 8, &Value); if (ACPI_FAILURE (Status)) { --- sys/contrib/dev/acpica/executer/excreate.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/executer/excreate.c 2011-11-23 13:29:26.000000000 -0500 @@ -284,7 +284,7 @@ * * PARAMETERS: AmlStart - Pointer to the region declaration AML * AmlLength - Max length of the declaration AML - * RegionSpace - SpaceID for the region + * SpaceId - Address space ID for the region * WalkState - Current state * * RETURN: Status @@ -297,7 +297,7 @@ AcpiExCreateRegion ( UINT8 *AmlStart, UINT32 AmlLength, - UINT8 RegionSpace, + UINT8 SpaceId, ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; @@ -326,16 +326,18 @@ * Space ID must be one of the predefined IDs, or in the user-defined * range */ - if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) && - (RegionSpace < ACPI_USER_REGION_BEGIN) && - (RegionSpace != ACPI_ADR_SPACE_DATA_TABLE)) + if (!AcpiIsValidSpaceId (SpaceId)) { - ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace)); - return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); + /* + * Print an error message, but continue. We don't want to abort + * a table load for this exception. Instead, if the region is + * actually used at runtime, abort the executing method. + */ + ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); } ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", - AcpiUtGetRegionName (RegionSpace), RegionSpace)); + AcpiUtGetRegionName (SpaceId), SpaceId)); /* Create the region descriptor */ @@ -353,10 +355,18 @@ RegionObj2 = ObjDesc->Common.NextObject; RegionObj2->Extra.AmlStart = AmlStart; RegionObj2->Extra.AmlLength = AmlLength; + if (WalkState->ScopeInfo) + { + RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node; + } + else + { + RegionObj2->Extra.ScopeNode = Node; + } /* Init the region from the operands */ - ObjDesc->Region.SpaceId = RegionSpace; + ObjDesc->Region.SpaceId = SpaceId; ObjDesc->Region.Address = 0; ObjDesc->Region.Length = 0; ObjDesc->Region.Node = Node; --- sys/contrib/dev/acpica/executer/exdump.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/executer/exdump.c 2011-11-23 13:29:27.000000000 -0500 @@ -209,11 +209,13 @@ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"} }; -static ACPI_EXDUMP_INFO AcpiExDumpRegionField[3] = +static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL}, {ACPI_EXD_FIELD, 0, NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"} + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"} }; static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] = --- sys/contrib/dev/acpica/executer/exfield.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/executer/exfield.c 2011-11-23 13:29:27.000000000 -0500 @@ -113,19 +113,25 @@ } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus or IPMI read. We must create a buffer to hold + * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold * the data and then directly access the region handler. * - * Note: Smbus protocol value is passed in upper 16-bits of Function + * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function */ if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) { Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); } + else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) + { + Length = ACPI_GSBUS_BUFFER_SIZE; + Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); + } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; @@ -274,23 +280,24 @@ } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus or IPMI write. We will bypass the entire field + * This is an SMBus, GSBus or IPMI write. We will bypass the entire field * mechanism and handoff the buffer directly to the handler. For * these address spaces, the buffer is bi-directional; on a write, * return data is returned in the same buffer. * * Source must be a buffer of sufficient size: - * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. + * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. * - * Note: SMBus protocol type is passed in upper 16-bits of Function + * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer, found type %s", + "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -301,6 +308,11 @@ Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); } + else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) + { + Length = ACPI_GSBUS_BUFFER_SIZE; + Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); + } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; @@ -310,7 +322,7 @@ if (SourceDesc->Buffer.Length < Length) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer of length %u, found length %u", + "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", Length, SourceDesc->Buffer.Length)); return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); --- sys/contrib/dev/acpica/executer/exfldio.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/executer/exfldio.c 2011-11-23 13:29:27.000000000 -0500 @@ -98,6 +98,7 @@ { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *RgnDesc; + UINT8 SpaceId; ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset); @@ -116,6 +117,16 @@ return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } + SpaceId = RgnDesc->Region.SpaceId; + + /* Validate the Space ID */ + + if (!AcpiIsValidSpaceId (SpaceId)) + { + ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); + return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); + } + /* * If the Region Address and Length have not been previously evaluated, * evaluate them now and save the results. @@ -130,11 +141,12 @@ } /* - * Exit now for SMBus or IPMI address space, it has a non-linear + * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear * address space and the request cannot be directly validated */ - if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || - RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI) + if (SpaceId == ACPI_ADR_SPACE_SMBUS || + SpaceId == ACPI_ADR_SPACE_GSBUS || + SpaceId == ACPI_ADR_SPACE_IPMI) { /* SMBus or IPMI has a non-linear address space */ @@ -290,7 +302,8 @@ /* Invoke the appropriate AddressSpace/OpRegion handler */ - Status = AcpiEvAddressSpaceDispatch (RgnDesc, Function, RegionOffset, + Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc, + Function, RegionOffset, ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value); if (ACPI_FAILURE (Status)) @@ -337,6 +350,8 @@ ACPI_OPERAND_OBJECT *ObjDesc, UINT64 Value) { + ACPI_FUNCTION_NAME (ExRegisterOverflow); + if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE) { @@ -353,6 +368,11 @@ * The Value is larger than the maximum value that can fit into * the register. */ + ACPI_ERROR ((AE_INFO, + "Index value 0x%8.8X%8.8X overflows field width 0x%X", + ACPI_FORMAT_UINT64 (Value), + ObjDesc->CommonField.BitLength)); + return (TRUE); } --- sys/contrib/dev/acpica/executer/exprep.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/executer/exprep.c 2011-11-23 13:47:04.000000000 -0500 @@ -49,6 +49,7 @@ #include #include #include +#include #define _COMPONENT ACPI_EXECUTER @@ -484,6 +485,32 @@ ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); + /* Fields specific to GenericSerialBus fields */ + + ObjDesc->Field.AccessLength = Info->AccessLength; + + if (Info->ConnectionNode) + { + SecondDesc = Info->ConnectionNode->Object; + if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID)) + { + Status = AcpiDsGetBufferArguments (SecondDesc); + if (ACPI_FAILURE (Status)) + { + AcpiUtDeleteObjectDesc (ObjDesc); + return_ACPI_STATUS (Status); + } + } + + ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer; + ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length; + } + else if (Info->ResourceBuffer) + { + ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer; + ObjDesc->Field.ResourceLength = Info->ResourceLength; + } + /* Allow full data read from EC address space */ if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && --- sys/contrib/dev/acpica/executer/exutils.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/executer/exutils.c 2011-11-23 13:29:27.000000000 -0500 @@ -499,4 +499,34 @@ } } + +/******************************************************************************* + * + * FUNCTION: AcpiIsValidSpaceId + * + * PARAMETERS: SpaceId - ID to be validated + * + * RETURN: TRUE if valid/supported ID. + * + * DESCRIPTION: Validate an operation region SpaceID. + * + ******************************************************************************/ + +BOOLEAN +AcpiIsValidSpaceId ( + UINT8 SpaceId) +{ + + if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) && + (SpaceId < ACPI_USER_REGION_BEGIN) && + (SpaceId != ACPI_ADR_SPACE_DATA_TABLE) && + (SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE)) + { + return (FALSE); + } + + return (TRUE); +} + + #endif --- sys/contrib/dev/acpica/hardware/hwvalid.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/hardware/hwvalid.c 2011-11-23 13:29:30.000000000 -0500 @@ -149,6 +149,8 @@ (BitWidth != 16) && (BitWidth != 32)) { + ACPI_ERROR ((AE_INFO, + "Bad BitWidth parameter: %8.8X", BitWidth)); return (AE_BAD_PARAMETER); } --- sys/contrib/dev/acpica/include/acapps.h 2011-01-13 12:32:32.000000000 -0500 +++ sys/contrib/dev/acpica/include/acapps.h 2011-11-23 13:29:24.000000000 -0500 @@ -81,6 +81,15 @@ Prefix, ACPICA_COPYRIGHT, \ Prefix +/* Macros for usage messages */ + +#define ACPI_USAGE_HEADER(Usage) \ + printf ("Usage: %s\nOptions:\n", Usage); + +#define ACPI_OPTION(Name, Description) \ + printf (" %-18s%s\n", Name, Description); + + #define FILE_SUFFIX_DISASSEMBLY "dsl" #define ACPI_TABLE_FILE_SUFFIX ".dat" --- sys/contrib/dev/acpica/include/acconfig.h 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/include/acconfig.h 2011-11-23 13:29:25.000000000 -0500 @@ -123,7 +123,7 @@ /* Maximum sleep allowed via Sleep() operator */ -#define ACPI_MAX_SLEEP 20000 /* Two seconds */ +#define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ /****************************************************************************** @@ -183,9 +183,10 @@ #define ACPI_RSDP_CHECKSUM_LENGTH 20 #define ACPI_RSDP_XCHECKSUM_LENGTH 36 -/* SMBus and IPMI bidirectional buffer size */ +/* SMBus, GSBus and IPMI bidirectional buffer size */ #define ACPI_SMBUS_BUFFER_SIZE 34 +#define ACPI_GSBUS_BUFFER_SIZE 34 #define ACPI_IPMI_BUFFER_SIZE 66 /* _SxD and _SxW control methods */ --- sys/contrib/dev/acpica/include/acdebug.h 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/include/acdebug.h 2011-11-23 13:29:23.000000000 -0500 @@ -107,6 +107,10 @@ char *TableArg); void +AcpiDbDisplayTemplate ( + char *BufferArg); + +void AcpiDbUnloadAcpiTable ( char *TableArg, char *InstanceArg); --- sys/contrib/dev/acpica/include/acdisasm.h 2011-03-17 13:44:51.000000000 -0400 +++ sys/contrib/dev/acpica/include/acdisasm.h 2011-11-23 13:29:25.000000000 -0500 @@ -80,57 +80,82 @@ /* * Values for Opcode above. - * Note: 0-7 must not change, used as a flag shift value + * Note: 0-7 must not change, they are used as a flag shift value. Other + * than those, new values can be added wherever appropriate. */ -#define ACPI_DMT_FLAG0 0 -#define ACPI_DMT_FLAG1 1 -#define ACPI_DMT_FLAG2 2 -#define ACPI_DMT_FLAG3 3 -#define ACPI_DMT_FLAG4 4 -#define ACPI_DMT_FLAG5 5 -#define ACPI_DMT_FLAG6 6 -#define ACPI_DMT_FLAG7 7 -#define ACPI_DMT_FLAGS0 8 -#define ACPI_DMT_FLAGS2 9 -#define ACPI_DMT_UINT8 10 -#define ACPI_DMT_UINT16 11 -#define ACPI_DMT_UINT24 12 -#define ACPI_DMT_UINT32 13 -#define ACPI_DMT_UINT56 14 -#define ACPI_DMT_UINT64 15 -#define ACPI_DMT_STRING 16 -#define ACPI_DMT_NAME4 17 -#define ACPI_DMT_NAME6 18 -#define ACPI_DMT_NAME8 19 -#define ACPI_DMT_CHKSUM 20 -#define ACPI_DMT_SPACEID 21 -#define ACPI_DMT_GAS 22 -#define ACPI_DMT_ASF 23 -#define ACPI_DMT_DMAR 24 -#define ACPI_DMT_HEST 25 -#define ACPI_DMT_HESTNTFY 26 -#define ACPI_DMT_HESTNTYP 27 -#define ACPI_DMT_MADT 28 -#define ACPI_DMT_SRAT 29 -#define ACPI_DMT_EXIT 30 -#define ACPI_DMT_SIG 31 -#define ACPI_DMT_FADTPM 32 -#define ACPI_DMT_BUF16 33 -#define ACPI_DMT_IVRS 34 -#define ACPI_DMT_BUFFER 35 -#define ACPI_DMT_PCI_PATH 36 -#define ACPI_DMT_EINJACT 37 -#define ACPI_DMT_EINJINST 38 -#define ACPI_DMT_ERSTACT 39 -#define ACPI_DMT_ERSTINST 40 -#define ACPI_DMT_ACCWIDTH 41 -#define ACPI_DMT_UNICODE 42 -#define ACPI_DMT_UUID 43 -#define ACPI_DMT_DEVICE_PATH 44 -#define ACPI_DMT_LABEL 45 -#define ACPI_DMT_BUF7 46 -#define ACPI_DMT_BUF128 47 -#define ACPI_DMT_SLIC 48 +typedef enum +{ + /* Simple Data Types */ + + ACPI_DMT_FLAG0 = 0, + ACPI_DMT_FLAG1 = 1, + ACPI_DMT_FLAG2 = 2, + ACPI_DMT_FLAG3 = 3, + ACPI_DMT_FLAG4 = 4, + ACPI_DMT_FLAG5 = 5, + ACPI_DMT_FLAG6 = 6, + ACPI_DMT_FLAG7 = 7, + ACPI_DMT_FLAGS0, + ACPI_DMT_FLAGS1, + ACPI_DMT_FLAGS2, + ACPI_DMT_FLAGS4, + ACPI_DMT_UINT8, + ACPI_DMT_UINT16, + ACPI_DMT_UINT24, + ACPI_DMT_UINT32, + ACPI_DMT_UINT40, + ACPI_DMT_UINT48, + ACPI_DMT_UINT56, + ACPI_DMT_UINT64, + ACPI_DMT_BUF7, + ACPI_DMT_BUF16, + ACPI_DMT_BUF128, + ACPI_DMT_SIG, + ACPI_DMT_STRING, + ACPI_DMT_NAME4, + ACPI_DMT_NAME6, + ACPI_DMT_NAME8, + + /* Types that are decoded to strings and miscellaneous */ + + ACPI_DMT_ACCWIDTH, + ACPI_DMT_CHKSUM, + ACPI_DMT_GAS, + ACPI_DMT_SPACEID, + ACPI_DMT_UNICODE, + ACPI_DMT_UUID, + + /* Types used only for the Data Table Compiler */ + + ACPI_DMT_BUFFER, + ACPI_DMT_DEVICE_PATH, + ACPI_DMT_LABEL, + ACPI_DMT_PCI_PATH, + + /* Types that are specific to particular ACPI tables */ + + ACPI_DMT_ASF, + ACPI_DMT_DMAR, + ACPI_DMT_EINJACT, + ACPI_DMT_EINJINST, + ACPI_DMT_ERSTACT, + ACPI_DMT_ERSTINST, + ACPI_DMT_FADTPM, + ACPI_DMT_HEST, + ACPI_DMT_HESTNTFY, + ACPI_DMT_HESTNTYP, + ACPI_DMT_IVRS, + ACPI_DMT_MADT, + ACPI_DMT_PMTT, + ACPI_DMT_SLIC, + ACPI_DMT_SRAT, + + /* Special opcodes */ + + ACPI_DMT_EXTRA_TEXT, + ACPI_DMT_EXIT + +} ACPI_ENTRY_TYPES; typedef void (*ACPI_DMTABLE_HANDLER) ( @@ -175,6 +200,11 @@ #define ASL_WALK_CALLBACK_DEFINED #endif +typedef +void (*ACPI_RESOURCE_HANDLER) ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); typedef struct acpi_resource_tag { @@ -202,6 +232,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[]; @@ -212,6 +243,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; @@ -221,7 +253,13 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[]; @@ -254,14 +292,34 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[]; @@ -354,6 +412,10 @@ ACPI_TABLE_HEADER *Table); void +AcpiDmDumpFpdt ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table); @@ -362,17 +424,29 @@ ACPI_TABLE_HEADER *Table); void +AcpiDmDumpMadt ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpMcfg ( ACPI_TABLE_HEADER *Table); void -AcpiDmDumpMadt ( +AcpiDmDumpMpst ( ACPI_TABLE_HEADER *Table); void AcpiDmDumpMsct ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpPcct ( + ACPI_TABLE_HEADER *Table); + +void +AcpiDmDumpPmtt ( + ACPI_TABLE_HEADER *Table); + UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table); @@ -381,6 +455,10 @@ AcpiDmDumpRsdt ( ACPI_TABLE_HEADER *Table); +UINT32 +AcpiDmDumpS3pt ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table); @@ -671,6 +749,18 @@ UINT32 Level); void +AcpiDmGpioDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void +AcpiDmSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void AcpiDmVendorCommon ( char *Name, UINT8 *ByteData, @@ -694,6 +784,12 @@ UINT32 Level); void +AcpiDmFixedDmaDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void AcpiDmIoDescriptor ( AML_RESOURCE *Resource, UINT32 Length, --- sys/contrib/dev/acpica/include/acevents.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/include/acevents.h 2011-11-23 13:29:24.000000000 -0500 @@ -228,7 +228,8 @@ ACPI_STATUS AcpiEvAddressSpaceDispatch ( - ACPI_OPERAND_OBJECT *RegionObj, + ACPI_OPERAND_OBJECT *RegionObj, + ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, --- sys/contrib/dev/acpica/include/acglobal.h 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/include/acglobal.h 2011-11-23 13:29:24.000000000 -0500 @@ -128,6 +128,12 @@ */ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE); +/* + * Disable runtime checking and repair of values returned by control methods. + * Use only if the repair is causing a problem on a particular machine. + */ +UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE); + /* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ @@ -137,8 +143,20 @@ ACPI_NAME AcpiGbl_TraceMethodName; BOOLEAN AcpiGbl_SystemAwakeAndRunning; +/* + * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning + * that the ACPI hardware is no longer required. A flag in the FADT indicates + * a reduced HW machine, and that flag is duplicated here for convenience. + */ +BOOLEAN AcpiGbl_ReducedHardware; + + #endif +/* Do not disassemble buffers to resource descriptors */ + +ACPI_EXTERN UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE); + /***************************************************************************** * * ACPI Table globals @@ -177,7 +195,7 @@ /***************************************************************************** * - * Mutual exlusion within ACPICA subsystem + * Mutual exclusion within ACPICA subsystem * ****************************************************************************/ --- sys/contrib/dev/acpica/include/acinterp.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acinterp.h 2011-11-23 13:29:24.000000000 -0500 @@ -642,6 +642,10 @@ char *Dest, UINT64 Value); +BOOLEAN +AcpiIsValidSpaceId ( + UINT8 SpaceId); + /* * exregion - default OpRegion handlers --- sys/contrib/dev/acpica/include/aclocal.h 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/include/aclocal.h 2011-11-23 13:29:23.000000000 -0500 @@ -54,7 +54,7 @@ /* Total number of aml opcodes defined */ -#define AML_NUM_OPCODES 0x7F +#define AML_NUM_OPCODES 0x81 /* Forward declarations */ @@ -213,7 +213,6 @@ #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 */ -#define ANOBJ_IS_BIT_OFFSET 0x40 /* iASL only: Reference is a bit offset */ #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */ @@ -286,12 +285,16 @@ ACPI_NAMESPACE_NODE *FieldNode; ACPI_NAMESPACE_NODE *RegisterNode; ACPI_NAMESPACE_NODE *DataRegisterNode; + ACPI_NAMESPACE_NODE *ConnectionNode; + UINT8 *ResourceBuffer; UINT32 BankValue; UINT32 FieldBitPosition; UINT32 FieldBitLength; + UINT16 ResourceLength; UINT8 FieldFlags; UINT8 Attribute; UINT8 FieldType; + UINT8 AccessLength; } ACPI_CREATE_FIELD_INFO; @@ -359,7 +362,8 @@ /* * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, - * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT + * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, + * ACPI_PTYPE2_FIX_VAR */ typedef struct acpi_package_info { @@ -411,6 +415,7 @@ char *Pathname; const ACPI_PREDEFINED_INFO *Predefined; union acpi_operand_object *ParentPackage; + ACPI_NAMESPACE_NODE *Node; UINT32 Flags; UINT8 NodeFlags; @@ -774,6 +779,17 @@ } ACPI_OPCODE_INFO; +/* Structure for Resource Tag information */ + +typedef struct acpi_tag_info +{ + UINT32 BitOffset; + UINT32 BitLength; + +} ACPI_TAG_INFO; + +/* Value associated with the parse object */ + typedef union acpi_parse_value { UINT64 Integer; /* Integer constant (Up to 64 bits) */ @@ -782,6 +798,7 @@ UINT8 *Buffer; /* buffer or string */ char *Name; /* NULL terminated string */ union acpi_parse_object *Arg; /* arguments and contained ops */ + ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ } ACPI_PARSE_VALUE; @@ -1112,7 +1129,7 @@ #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 #define ACPI_RESOURCE_NAME_IO 0x40 #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 -#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 +#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 @@ -1134,7 +1151,9 @@ #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B -#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B +#define ACPI_RESOURCE_NAME_GPIO 0x8C +#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E +#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E /***************************************************************************** --- sys/contrib/dev/acpica/include/acnames.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acnames.h 2011-11-23 13:29:24.000000000 -0500 @@ -58,6 +58,7 @@ #define METHOD_NAME__PRT "_PRT" #define METHOD_NAME__CRS "_CRS" #define METHOD_NAME__PRS "_PRS" +#define METHOD_NAME__AEI "_AEI" #define METHOD_NAME__PRW "_PRW" #define METHOD_NAME__SRS "_SRS" --- sys/contrib/dev/acpica/include/acobject.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acobject.h 2011-11-23 13:29:25.000000000 -0500 @@ -320,6 +320,7 @@ UINT32 BaseByteOffset; /* Byte offset within containing object */\ UINT32 Value; /* Value to store into the Bank or Index register */\ UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\ + UINT8 AccessLength; /* For serial regions/fields */ typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ @@ -335,7 +336,9 @@ { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO + UINT16 ResourceLength; union acpi_operand_object *RegionObj; /* Containing OpRegion object */ + UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */ } ACPI_OBJECT_REGION_FIELD; @@ -463,6 +466,7 @@ { ACPI_OBJECT_COMMON_HEADER ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */ + ACPI_NAMESPACE_NODE *ScopeNode; void *RegionContext; /* Region-specific data */ UINT8 *AmlStart; UINT32 AmlLength; --- sys/contrib/dev/acpica/include/acopcode.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acopcode.h 2011-11-23 13:29:25.000000000 -0500 @@ -94,6 +94,7 @@ #define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) +#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_CONTINUE_OP ARG_NONE #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) @@ -165,6 +166,7 @@ #define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG) #define ARGP_REVISION_OP ARG_NONE #define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST) +#define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME) @@ -225,6 +227,7 @@ #define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF) #define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF) #define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF) +#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE #define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE #define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET) #define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE) @@ -296,6 +299,7 @@ #define ARGI_RETURN_OP ARGI_INVALID_OPCODE #define ARGI_REVISION_OP ARG_NONE #define ARGI_SCOPE_OP ARGI_INVALID_OPCODE +#define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE #define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT) --- sys/contrib/dev/acpica/include/acpixf.h 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/include/acpixf.h 2011-11-23 13:29:25.000000000 -0500 @@ -48,7 +48,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20110527 +#define ACPI_CA_VERSION 0x20111123 #include #include @@ -59,6 +59,7 @@ extern UINT32 AcpiCurrentGpeCount; extern ACPI_TABLE_FADT AcpiGbl_FADT; extern BOOLEAN AcpiGbl_SystemAwakeAndRunning; +extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */ /* Runtime configuration of debug print levels */ @@ -76,6 +77,7 @@ extern UINT8 AcpiGbl_EnableAmlDebugObject; extern UINT8 AcpiGbl_CopyDsdtLocally; extern UINT8 AcpiGbl_TruncateIoAddresses; +extern UINT8 AcpiGbl_DisableAutoRepair; /* @@ -392,6 +394,21 @@ /* + * Interfaces to AML mutex objects + */ +ACPI_STATUS +AcpiAcquireMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + UINT16 Timeout); + +ACPI_STATUS +AcpiReleaseMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname); + + +/* * Fixed Event interfaces */ ACPI_STATUS @@ -516,6 +533,11 @@ ACPI_BUFFER *RetBuffer); ACPI_STATUS +AcpiGetEventResources ( + ACPI_HANDLE DeviceHandle, + ACPI_BUFFER *RetBuffer); + +ACPI_STATUS AcpiWalkResources ( ACPI_HANDLE Device, char *Name, @@ -537,6 +559,12 @@ ACPI_RESOURCE *Resource, ACPI_RESOURCE_ADDRESS64 *Out); +ACPI_STATUS +AcpiBufferToResource ( + UINT8 *AmlBuffer, + UINT16 AmlBufferLength, + ACPI_RESOURCE **ResourcePtr); + /* * Hardware (ACPI device) interfaces --- sys/contrib/dev/acpica/include/acpredef.h 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/include/acpredef.h 2011-11-23 13:29:25.000000000 -0500 @@ -94,6 +94,14 @@ * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length * (Used for _ART, _FPS) * + * ACPI_PTYPE2_FIX_VAR: Each subpackage consists of some fixed-length elements + * followed by an optional element + * object type + * count + * object type + * count = 0 (optional) + * (Used for _DLM) + * *****************************************************************************/ enum AcpiReturnPackageTypes @@ -106,7 +114,8 @@ ACPI_PTYPE2_PKG_COUNT = 6, ACPI_PTYPE2_FIXED = 7, ACPI_PTYPE2_MIN = 8, - ACPI_PTYPE2_REV_FIXED = 9 + ACPI_PTYPE2_REV_FIXED = 9, + ACPI_PTYPE2_FIX_VAR = 10 }; @@ -159,6 +168,7 @@ {{"_AC8", 0, ACPI_RTYPE_INTEGER}}, {{"_AC9", 0, ACPI_RTYPE_INTEGER}}, {{"_ADR", 0, ACPI_RTYPE_INTEGER}}, + {{"_AEI", 0, ACPI_RTYPE_BUFFER}}, {{"_AL0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, @@ -231,6 +241,12 @@ {{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}}, + {{"_CLS", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0}, 0,0}}, + + {{"_CPC", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Bufs) */ + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,0}, 0,0}}, + {{"_CRS", 0, ACPI_RTYPE_BUFFER}}, {{"_CRT", 0, ACPI_RTYPE_INTEGER}}, {{"_CSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n-1 Int) */ @@ -239,12 +255,20 @@ {{"_CST", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */ {{{ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER}, 3,0}}, + {{"_CWS", 1, ACPI_RTYPE_INTEGER}}, {{"_DCK", 1, ACPI_RTYPE_INTEGER}}, {{"_DCS", 0, ACPI_RTYPE_INTEGER}}, {{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}}, {{"_DDN", 0, ACPI_RTYPE_STRING}}, + {{"_DEP", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_DGS", 0, ACPI_RTYPE_INTEGER}}, {{"_DIS", 0, 0}}, + + {{"_DLM", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (1 Ref, 0/1 Optional Buf/Ref) */ + {{{ACPI_PTYPE2_FIX_VAR, ACPI_RTYPE_REFERENCE, 1, ACPI_RTYPE_REFERENCE | ACPI_RTYPE_BUFFER}, 0,0}}, + {{"_DMA", 0, ACPI_RTYPE_BUFFER}}, {{"_DOD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, @@ -264,6 +288,8 @@ {{"_EJ3", 1, 0}}, {{"_EJ4", 1, 0}}, {{"_EJD", 0, ACPI_RTYPE_STRING}}, + {{"_ERR", 3, ACPI_RTYPE_INTEGER}}, /* Internal use only, used by ACPICA test suites */ + {{"_EVT", 1, 0}}, {{"_FDE", 0, ACPI_RTYPE_BUFFER}}, {{"_FDI", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int) */ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}}, @@ -284,14 +310,17 @@ {{"_GAI", 0, ACPI_RTYPE_INTEGER}}, + {{"_GCP", 0, ACPI_RTYPE_INTEGER}}, {{"_GHL", 0, ACPI_RTYPE_INTEGER}}, {{"_GLK", 0, ACPI_RTYPE_INTEGER}}, {{"_GPD", 0, ACPI_RTYPE_INTEGER}}, {{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */ + {{"_GRT", 0, ACPI_RTYPE_BUFFER}}, {{"_GSB", 0, ACPI_RTYPE_INTEGER}}, {{"_GTF", 0, ACPI_RTYPE_BUFFER}}, {{"_GTM", 0, ACPI_RTYPE_BUFFER}}, {{"_GTS", 1, 0}}, + {{"_GWS", 1, ACPI_RTYPE_INTEGER}}, {{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, {{"_HOT", 0, ACPI_RTYPE_INTEGER}}, {{"_HPP", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ @@ -306,6 +335,7 @@ {{"_HPX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (var Ints) */ {{{ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, + {{"_HRV", 0, ACPI_RTYPE_INTEGER}}, {{"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ {{"_INI", 0, 0}}, {{"_IRC", 0, 0}}, @@ -363,6 +393,9 @@ {{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_PRE", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, @@ -393,6 +426,7 @@ {{"_PSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (5 Int) with count */ {{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0}, 0,0}}, + {{"_PSE", 1, 0}}, {{"_PSL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, @@ -459,6 +493,7 @@ {{"_SLI", 0, ACPI_RTYPE_BUFFER}}, {{"_SPD", 1, ACPI_RTYPE_INTEGER}}, {{"_SRS", 1, 0}}, + {{"_SRT", 1, ACPI_RTYPE_INTEGER}}, {{"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ {{"_SST", 1, 0}}, {{"_STA", 0, ACPI_RTYPE_INTEGER}}, @@ -466,6 +501,7 @@ {{"_STP", 2, ACPI_RTYPE_INTEGER}}, {{"_STR", 0, ACPI_RTYPE_BUFFER}}, {{"_STV", 2, ACPI_RTYPE_INTEGER}}, + {{"_SUB", 0, ACPI_RTYPE_STRING}}, {{"_SUN", 0, ACPI_RTYPE_INTEGER}}, {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, --- sys/contrib/dev/acpica/include/acresrc.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acresrc.h 2011-11-23 13:29:25.000000000 -0500 @@ -75,28 +75,42 @@ /* Resource conversion opcodes */ -#define ACPI_RSC_INITGET 0 -#define ACPI_RSC_INITSET 1 -#define ACPI_RSC_FLAGINIT 2 -#define ACPI_RSC_1BITFLAG 3 -#define ACPI_RSC_2BITFLAG 4 -#define ACPI_RSC_COUNT 5 -#define ACPI_RSC_COUNT16 6 -#define ACPI_RSC_LENGTH 7 -#define ACPI_RSC_MOVE8 8 -#define ACPI_RSC_MOVE16 9 -#define ACPI_RSC_MOVE32 10 -#define ACPI_RSC_MOVE64 11 -#define ACPI_RSC_SET8 12 -#define ACPI_RSC_DATA8 13 -#define ACPI_RSC_ADDRESS 14 -#define ACPI_RSC_SOURCE 15 -#define ACPI_RSC_SOURCEX 16 -#define ACPI_RSC_BITMASK 17 -#define ACPI_RSC_BITMASK16 18 -#define ACPI_RSC_EXIT_NE 19 -#define ACPI_RSC_EXIT_LE 20 -#define ACPI_RSC_EXIT_EQ 21 +typedef enum +{ + ACPI_RSC_INITGET = 0, + ACPI_RSC_INITSET, + ACPI_RSC_FLAGINIT, + ACPI_RSC_1BITFLAG, + ACPI_RSC_2BITFLAG, + ACPI_RSC_3BITFLAG, + ACPI_RSC_ADDRESS, + ACPI_RSC_BITMASK, + ACPI_RSC_BITMASK16, + ACPI_RSC_COUNT, + ACPI_RSC_COUNT16, + ACPI_RSC_COUNT_GPIO_PIN, + ACPI_RSC_COUNT_GPIO_RES, + ACPI_RSC_COUNT_GPIO_VEN, + ACPI_RSC_COUNT_SERIAL_RES, + ACPI_RSC_COUNT_SERIAL_VEN, + ACPI_RSC_DATA8, + ACPI_RSC_EXIT_EQ, + ACPI_RSC_EXIT_LE, + ACPI_RSC_EXIT_NE, + ACPI_RSC_LENGTH, + ACPI_RSC_MOVE_GPIO_PIN, + ACPI_RSC_MOVE_GPIO_RES, + ACPI_RSC_MOVE_SERIAL_RES, + ACPI_RSC_MOVE_SERIAL_VEN, + ACPI_RSC_MOVE8, + ACPI_RSC_MOVE16, + ACPI_RSC_MOVE32, + ACPI_RSC_MOVE64, + ACPI_RSC_SET8, + ACPI_RSC_SOURCE, + ACPI_RSC_SOURCEX + +} ACPI_RSCONVERT_OPCODES; /* Resource Conversion sub-opcodes */ @@ -109,6 +123,9 @@ #define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f) +/* + * Individual entry for the resource dump tables + */ typedef const struct acpi_rsdump_info { UINT8 Opcode; @@ -120,20 +137,27 @@ /* Values for the Opcode field above */ -#define ACPI_RSD_TITLE 0 -#define ACPI_RSD_LITERAL 1 -#define ACPI_RSD_STRING 2 -#define ACPI_RSD_UINT8 3 -#define ACPI_RSD_UINT16 4 -#define ACPI_RSD_UINT32 5 -#define ACPI_RSD_UINT64 6 -#define ACPI_RSD_1BITFLAG 7 -#define ACPI_RSD_2BITFLAG 8 -#define ACPI_RSD_SHORTLIST 9 -#define ACPI_RSD_LONGLIST 10 -#define ACPI_RSD_DWORDLIST 11 -#define ACPI_RSD_ADDRESS 12 -#define ACPI_RSD_SOURCE 13 +typedef enum +{ + ACPI_RSD_TITLE = 0, + ACPI_RSD_1BITFLAG, + ACPI_RSD_2BITFLAG, + ACPI_RSD_3BITFLAG, + ACPI_RSD_ADDRESS, + ACPI_RSD_DWORDLIST, + ACPI_RSD_LITERAL, + ACPI_RSD_LONGLIST, + ACPI_RSD_SHORTLIST, + ACPI_RSD_SHORTLISTX, + ACPI_RSD_SOURCE, + ACPI_RSD_STRING, + ACPI_RSD_UINT8, + ACPI_RSD_UINT16, + ACPI_RSD_UINT32, + ACPI_RSD_UINT64, + ACPI_RSD_WORDLIST + +} ACPI_RSDUMP_OPCODES; /* restore default alignment */ @@ -143,13 +167,16 @@ /* Resource tables indexed by internal resource type */ extern const UINT8 AcpiGbl_AmlResourceSizes[]; +extern const UINT8 AcpiGbl_AmlResourceSerialBusSizes[]; extern ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[]; /* Resource tables indexed by raw AML resource descriptor type */ extern const UINT8 AcpiGbl_ResourceStructSizes[]; +extern const UINT8 AcpiGbl_ResourceStructSerialBusSizes[]; extern ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[]; +extern ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[]; typedef struct acpi_vendor_walk_info { @@ -208,6 +235,10 @@ ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer); +ACPI_STATUS +AcpiRsGetAeiMethodData ( + ACPI_NAMESPACE_NODE *Node, + ACPI_BUFFER *RetBuffer); /* * rscalc @@ -348,6 +379,11 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertGpio[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[]; /* These resources require separate get/set tables */ @@ -366,6 +402,7 @@ * rsinfo */ extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[]; +extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[]; /* * rsdump @@ -387,6 +424,12 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[]; extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[]; extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[]; +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[]; #endif #endif /* __ACRESRC_H__ */ --- sys/contrib/dev/acpica/include/acrestyp.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acrestyp.h 2011-11-23 13:29:24.000000000 -0500 @@ -62,11 +62,14 @@ #define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02 #define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03 +/*! [Begin] no source code translation */ /* * IO Attributes * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. */ +/*! [End] no source code translation !*/ + #define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01 #define ACPI_ISA_ONLY_RANGES (UINT8) 0x02 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) @@ -82,16 +85,26 @@ #define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */ /* - * IRQ Attributes + * Interrupt attributes - used in multiple descriptors */ + +/* Triggering */ + #define ACPI_LEVEL_SENSITIVE (UINT8) 0x00 #define ACPI_EDGE_SENSITIVE (UINT8) 0x01 +/* Polarity */ + #define ACPI_ACTIVE_HIGH (UINT8) 0x00 #define ACPI_ACTIVE_LOW (UINT8) 0x01 +#define ACPI_ACTIVE_BOTH (UINT8) 0x02 + +/* Sharing */ #define ACPI_EXCLUSIVE (UINT8) 0x00 #define ACPI_SHARED (UINT8) 0x01 +#define ACPI_EXCLUSIVE_AND_WAKE (UINT8) 0x02 +#define ACPI_SHARED_AND_WAKE (UINT8) 0x03 /* * DMA Attributes @@ -128,6 +141,8 @@ #define ACPI_POS_DECODE (UINT8) 0x00 #define ACPI_SUB_DECODE (UINT8) 0x01 +/* Producer/Consumer */ + #define ACPI_PRODUCER (UINT8) 0x00 #define ACPI_CONSUMER (UINT8) 0x01 @@ -167,7 +182,7 @@ } ACPI_RESOURCE_IRQ; -typedef struct ACPI_RESOURCE_DMA +typedef struct acpi_resource_dma { UINT8 Type; UINT8 BusMaster; @@ -209,6 +224,24 @@ } ACPI_RESOURCE_FIXED_IO; +typedef struct acpi_resource_fixed_dma +{ + UINT16 RequestLines; + UINT16 Channels; + UINT8 Width; + +} ACPI_RESOURCE_FIXED_DMA; + +/* Values for Width field above */ + +#define ACPI_DMA_WIDTH8 0 +#define ACPI_DMA_WIDTH16 1 +#define ACPI_DMA_WIDTH32 2 +#define ACPI_DMA_WIDTH64 3 +#define ACPI_DMA_WIDTH128 4 +#define ACPI_DMA_WIDTH256 5 + + typedef struct acpi_resource_vendor { UINT16 ByteLength; @@ -385,6 +418,184 @@ } ACPI_RESOURCE_GENERIC_REGISTER; +typedef struct acpi_resource_gpio +{ + UINT8 RevisionId; + UINT8 ConnectionType; + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ + UINT8 PinConfig; + UINT8 Sharable; /* For values, see Interrupt Attributes above */ + UINT8 IoRestriction; + UINT8 Triggering; /* For values, see Interrupt Attributes above */ + UINT8 Polarity; /* For values, see Interrupt Attributes above */ + UINT16 DriveStrength; + UINT16 DebounceTimeout; + UINT16 PinTableLength; + UINT16 VendorLength; + ACPI_RESOURCE_SOURCE ResourceSource; + UINT16 *PinTable; + UINT8 *VendorData; + +} ACPI_RESOURCE_GPIO; + +/* Values for GPIO ConnectionType field above */ + +#define ACPI_RESOURCE_GPIO_TYPE_INT 0 +#define ACPI_RESOURCE_GPIO_TYPE_IO 1 + +/* Values for PinConfig field above */ + +#define ACPI_PIN_CONFIG_DEFAULT 0 +#define ACPI_PIN_CONFIG_PULLUP 1 +#define ACPI_PIN_CONFIG_PULLDOWN 2 +#define ACPI_PIN_CONFIG_NOPULL 3 + +/* Values for IoRestriction field above */ + +#define ACPI_IO_RESTRICT_NONE 0 +#define ACPI_IO_RESTRICT_INPUT 1 +#define ACPI_IO_RESTRICT_OUTPUT 2 +#define ACPI_IO_RESTRICT_NONE_PRESERVE 3 + + +/* Common structure for I2C, SPI, and UART serial descriptors */ + +#define ACPI_RESOURCE_SERIAL_COMMON \ + UINT8 RevisionId; \ + UINT8 Type; \ + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\ + UINT8 SlaveMode; \ + UINT8 TypeRevisionId; \ + UINT16 TypeDataLength; \ + UINT16 VendorLength; \ + ACPI_RESOURCE_SOURCE ResourceSource; \ + UINT8 *VendorData; + +typedef struct acpi_resource_common_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + +} ACPI_RESOURCE_COMMON_SERIALBUS; + +/* Values for the Type field above */ + +#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1 +#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2 +#define ACPI_RESOURCE_SERIAL_TYPE_UART 3 + +/* Values for SlaveMode field above */ + +#define ACPI_CONTROLLER_INITIATED 0 +#define ACPI_DEVICE_INITIATED 1 + + +typedef struct acpi_resource_i2c_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + UINT8 AccessMode; + UINT16 SlaveAddress; + UINT32 ConnectionSpeed; + +} ACPI_RESOURCE_I2C_SERIALBUS; + +/* Values for AccessMode field above */ + +#define ACPI_I2C_7BIT_MODE 0 +#define ACPI_I2C_10BIT_MODE 1 + + +typedef struct acpi_resource_spi_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + UINT8 WireMode; + UINT8 DevicePolarity; + UINT8 DataBitLength; + UINT8 ClockPhase; + UINT8 ClockPolarity; + UINT16 DeviceSelection; + UINT32 ConnectionSpeed; + +} ACPI_RESOURCE_SPI_SERIALBUS; + +/* Values for WireMode field above */ + +#define ACPI_SPI_4WIRE_MODE 0 +#define ACPI_SPI_3WIRE_MODE 1 + +/* Values for DevicePolarity field above */ + +#define ACPI_SPI_ACTIVE_LOW 0 +#define ACPI_SPI_ACTIVE_HIGH 1 + +/* Values for ClockPhase field above */ + +#define ACPI_SPI_FIRST_PHASE 0 +#define ACPI_SPI_SECOND_PHASE 1 + +/* Values for ClockPolarity field above */ + +#define ACPI_SPI_START_LOW 0 +#define ACPI_SPI_START_HIGH 1 + + +typedef struct acpi_resource_uart_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + UINT8 Endian; + UINT8 DataBits; + UINT8 StopBits; + UINT8 FlowControl; + UINT8 Parity; + UINT8 LinesEnabled; + UINT16 RxFifoSize; + UINT16 TxFifoSize; + UINT32 DefaultBaudRate; + +} ACPI_RESOURCE_UART_SERIALBUS; + +/* Values for Endian field above */ + +#define ACPI_UART_LITTLE_ENDIAN 0 +#define ACPI_UART_BIG_ENDIAN 1 + +/* Values for DataBits field above */ + +#define ACPI_UART_5_DATA_BITS 0 +#define ACPI_UART_6_DATA_BITS 1 +#define ACPI_UART_7_DATA_BITS 2 +#define ACPI_UART_8_DATA_BITS 3 +#define ACPI_UART_9_DATA_BITS 4 + +/* Values for StopBits field above */ + +#define ACPI_UART_NO_STOP_BITS 0 +#define ACPI_UART_1_STOP_BIT 1 +#define ACPI_UART_1P5_STOP_BITS 2 +#define ACPI_UART_2_STOP_BITS 3 + +/* Values for FlowControl field above */ + +#define ACPI_UART_FLOW_CONTROL_NONE 0 +#define ACPI_UART_FLOW_CONTROL_HW 1 +#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2 + +/* Values for Parity field above */ + +#define ACPI_UART_PARITY_NONE 0 +#define ACPI_UART_PARITY_EVEN 1 +#define ACPI_UART_PARITY_ODD 2 +#define ACPI_UART_PARITY_MARK 3 +#define ACPI_UART_PARITY_SPACE 4 + +/* Values for LinesEnabled bitfield above */ + +#define ACPI_UART_CARRIER_DETECT (1<<2) +#define ACPI_UART_RING_INDICATOR (1<<3) +#define ACPI_UART_DATA_SET_READY (1<<4) +#define ACPI_UART_DATA_TERMINAL_READY (1<<5) +#define ACPI_UART_CLEAR_TO_SEND (1<<6) +#define ACPI_UART_REQUEST_TO_SEND (1<<7) + /* ACPI_RESOURCE_TYPEs */ @@ -405,7 +616,10 @@ #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 -#define ACPI_RESOURCE_TYPE_MAX 16 +#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 /* Master union for resource descriptors */ @@ -416,6 +630,7 @@ ACPI_RESOURCE_START_DEPENDENT StartDpf; ACPI_RESOURCE_IO Io; ACPI_RESOURCE_FIXED_IO FixedIo; + ACPI_RESOURCE_FIXED_DMA FixedDma; ACPI_RESOURCE_VENDOR Vendor; ACPI_RESOURCE_VENDOR_TYPED VendorTyped; ACPI_RESOURCE_END_TAG EndTag; @@ -428,6 +643,11 @@ ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64; ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq; ACPI_RESOURCE_GENERIC_REGISTER GenericReg; + ACPI_RESOURCE_GPIO Gpio; + ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus; + ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus; + ACPI_RESOURCE_UART_SERIALBUS UartSerialBus; + ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus; /* Common fields */ --- sys/contrib/dev/acpica/include/actbl.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/actbl.h 2011-11-23 14:22:55.000000000 -0500 @@ -298,6 +298,7 @@ ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ + ACPI_GENERIC_ADDRESS SleepRegister; /* 64-bit address of the Sleep register */ } ACPI_TABLE_FADT; @@ -309,6 +310,7 @@ #define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ #define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ #define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ +#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */ /* Masks for FADT flags */ @@ -332,6 +334,9 @@ #define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */ +#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */ +#define ACPI_FADT_PREFER_S0_IDLE (1<<21) /* 21: [V5] Use advanced idle capabilities (ACPI 5.0) */ +#define ACPI_FADT_USE_SLEEP_REG (1<<22) /* 22: [V5] Use the sleep register for sleep (ACPI 5.0) */ /* Values for PreferredProfile (Prefered Power Management Profiles) */ @@ -344,7 +349,9 @@ PM_WORKSTATION = 3, PM_ENTERPRISE_SERVER = 4, PM_SOHO_SERVER = 5, - PM_APPLIANCE_PC = 6 + PM_APPLIANCE_PC = 6, + PM_PERFORMANCE_SERVER = 7, + PM_SLATE = 8 }; @@ -392,6 +399,7 @@ */ #include #include +#include /* Macros used to generate offsets to specific table fields */ @@ -405,12 +413,15 @@ * FADT is the bottom line as to what the version really is. * * For reference, the values below are as follows: - * FADT V1 size: 0x74 - * FADT V2 size: 0x84 - * FADT V3+ size: 0xF4 + * FADT V1 size: 0x074 + * FADT V2 size: 0x084 + * FADT V3 size: 0x0F4 + * FADT V4 size: 0x0F4 + * FADT V5 size: 0x100 */ #define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) #define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3) -#define ACPI_FADT_V3_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) +#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepRegister)) +#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) #endif /* __ACTBL_H__ */ --- sys/contrib/dev/acpica/include/actbl1.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/actbl1.h 2011-11-23 13:29:24.000000000 -0500 @@ -252,16 +252,17 @@ enum AcpiEinjActions { - ACPI_EINJ_BEGIN_OPERATION = 0, - ACPI_EINJ_GET_TRIGGER_TABLE = 1, - ACPI_EINJ_SET_ERROR_TYPE = 2, - ACPI_EINJ_GET_ERROR_TYPE = 3, - ACPI_EINJ_END_OPERATION = 4, - ACPI_EINJ_EXECUTE_OPERATION = 5, - ACPI_EINJ_CHECK_BUSY_STATUS = 6, - ACPI_EINJ_GET_COMMAND_STATUS = 7, - ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */ - ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ + ACPI_EINJ_BEGIN_OPERATION = 0, + ACPI_EINJ_GET_TRIGGER_TABLE = 1, + ACPI_EINJ_SET_ERROR_TYPE = 2, + ACPI_EINJ_GET_ERROR_TYPE = 3, + ACPI_EINJ_END_OPERATION = 4, + ACPI_EINJ_EXECUTE_OPERATION = 5, + ACPI_EINJ_CHECK_BUSY_STATUS = 6, + ACPI_EINJ_GET_COMMAND_STATUS = 7, + ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, + ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */ + ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; /* Values for Instruction field above */ @@ -273,9 +274,33 @@ ACPI_EINJ_WRITE_REGISTER = 2, ACPI_EINJ_WRITE_REGISTER_VALUE = 3, ACPI_EINJ_NOOP = 4, - ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */ + ACPI_EINJ_FLUSH_CACHELINE = 5, + ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */ }; +typedef struct acpi_einj_error_type_with_addr +{ + UINT32 ErrorType; + UINT32 VendorStructOffset; + UINT32 Flags; + UINT32 ApicId; + UINT64 Address; + UINT64 Range; + UINT32 PcieId; + +} ACPI_EINJ_ERROR_TYPE_WITH_ADDR; + +typedef struct acpi_einj_vendor +{ + UINT32 Length; + UINT32 PcieId; + UINT16 VendorId; + UINT16 DeviceId; + UINT8 RevisionId; + UINT8 Reserved[3]; + +} ACPI_EINJ_VENDOR; + /* EINJ Trigger Error Action Table */ @@ -313,6 +338,7 @@ #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) #define ACPI_EINJ_PLATFORM_FATAL (1<<11) +#define ACPI_EINJ_VENDOR_DEFINED (1<<31) /******************************************************************************* @@ -731,7 +757,9 @@ ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, ACPI_MADT_TYPE_LOCAL_X2APIC = 9, ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, - ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */ + ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, + ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, + ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ }; @@ -886,11 +914,42 @@ } ACPI_MADT_LOCAL_X2APIC_NMI; +/* 11: Generic Interrupt (ACPI 5.0) */ + +typedef struct acpi_madt_generic_interrupt +{ + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; /* Reserved - must be zero */ + UINT32 GicId; + UINT32 Uid; + UINT32 Flags; + UINT32 ParkingVersion; + UINT32 PerformanceInterrupt; + UINT64 ParkedAddress; + UINT64 BaseAddress; + +} ACPI_MADT_GENERIC_INTERRUPT; + + +/* 12: Generic Distributor (ACPI 5.0) */ + +typedef struct acpi_madt_generic_distributor +{ + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; /* Reserved - must be zero */ + UINT32 GicId; + UINT64 BaseAddress; + UINT32 GlobalIrqBase; + UINT32 Reserved2; /* Reserved - must be zero */ + +} ACPI_MADT_GENERIC_DISTRIBUTOR; + + /* * Common flags fields for MADT subtables */ -/* MADT Local APIC flags (LapicFlags) */ +/* MADT Local APIC flags (LapicFlags) and GIC flags */ #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ --- sys/contrib/dev/acpica/include/actbl3.h 1969-12-31 19:00:00.000000000 -0500 +++ sys/contrib/dev/acpica/include/actbl3.h 2011-11-23 13:29:25.000000000 -0500 @@ -0,0 +1,650 @@ +/****************************************************************************** + * + * Name: actbl3.h - ACPI Table Definitions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2011, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#ifndef __ACTBL3_H__ +#define __ACTBL3_H__ + + +/******************************************************************************* + * + * Additional ACPI Tables (3) + * + * These tables are not consumed directly by the ACPICA subsystem, but are + * included here to support device drivers and the AML disassembler. + * + * The tables in this file are fully defined within the ACPI specification. + * + ******************************************************************************/ + + +/* + * Values for description table header signatures for tables defined in this + * file. Useful because they make it more difficult to inadvertently type in + * the wrong signature. + */ +#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ +#define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */ +#define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */ +#define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */ +#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ +#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ +#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ +#define ACPI_SIG_RASF "RASF" /* RAS Feature table */ + +#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ +#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ + +/* Reserved table signatures */ + +#define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */ +#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table 2 */ +#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ +#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ +#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ + +/* + * All tables must be byte-packed to match the ACPI specification, since + * the tables are provided by the system BIOS. + */ +#pragma pack(1) + +/* + * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables. + * This is the only type that is even remotely portable. Anything else is not + * portable, so do not use any other bitfield types. + */ + + +/******************************************************************************* + * + * BGRT - Boot Graphics Resource Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_bgrt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT16 Version; + UINT8 Status; + UINT8 ImageType; + UINT64 ImageAddress; + UINT32 ImageOffsetX; + UINT32 ImageOffsetY; + +} ACPI_TABLE_BGRT; + + +/******************************************************************************* + * + * DRTM - Dynamic Root of Trust for Measurement table + * + ******************************************************************************/ + +typedef struct acpi_table_drtm +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT64 EntryBaseAddress; + UINT64 EntryLength; + UINT32 EntryAddress32; + UINT64 EntryAddress64; + UINT64 ExitAddress; + UINT64 LogAreaAddress; + UINT32 LogAreaLength; + UINT64 ArchDependentAddress; + UINT32 Flags; + +} ACPI_TABLE_DRTM; + +/* 1) Validated Tables List */ + +typedef struct acpi_drtm_vtl_list +{ + UINT32 ValidatedTableListCount; + +} ACPI_DRTM_VTL_LIST; + +/* 2) Resources List */ + +typedef struct acpi_drtm_resource_list +{ + UINT32 ResourceListCount; + +} ACPI_DRTM_RESOURCE_LIST; + +/* 3) Platform-specific Identifiers List */ + +typedef struct acpi_drtm_id_list +{ + UINT32 IdListCount; + +} ACPI_DRTM_ID_LIST; + + +/******************************************************************************* + * + * FPDT - Firmware Performance Data Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_fpdt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_FPDT; + + +/* FPDT subtable header */ + +typedef struct acpi_fpdt_header +{ + UINT16 Type; + UINT8 Length; + UINT8 Revision; + +} ACPI_FPDT_HEADER; + +/* Values for Type field above */ + +enum AcpiFpdtType +{ + ACPI_FPDT_TYPE_BOOT = 0, + ACPI_FPDT_TYPE_S3PERF = 1, +}; + + +/* + * FPDT subtables + */ + +/* 0: Firmware Basic Boot Performance Record */ + +typedef struct acpi_fpdt_boot +{ + ACPI_FPDT_HEADER Header; + UINT8 Reserved[4]; + UINT64 ResetEnd; + UINT64 LoadStart; + UINT64 StartupStart; + UINT64 ExitServicesEntry; + UINT64 ExitServicesExit; + +} ACPI_FPDT_BOOT; + + +/* 1: S3 Performance Table Pointer Record */ + +typedef struct acpi_fpdt_s3pt_ptr +{ + ACPI_FPDT_HEADER Header; + UINT8 Reserved[4]; + UINT64 Address; + +} ACPI_FPDT_S3PT_PTR; + + +/* + * S3PT - S3 Performance Table. This table is pointed to by the + * FPDT S3 Pointer Record above. + */ +typedef struct acpi_table_s3pt +{ + UINT8 Signature[4]; /* "S3PT" */ + UINT32 Length; + +} ACPI_TABLE_S3PT; + + +/* + * S3PT Subtables + */ +typedef struct acpi_s3pt_header +{ + UINT16 Type; + UINT8 Length; + UINT8 Revision; + +} ACPI_S3PT_HEADER; + +/* Values for Type field above */ + +enum AcpiS3ptType +{ + ACPI_S3PT_TYPE_RESUME = 0, + ACPI_S3PT_TYPE_SUSPEND = 1, +}; + +typedef struct acpi_s3pt_resume +{ + ACPI_S3PT_HEADER Header; + UINT32 ResumeCount; + UINT64 FullResume; + UINT64 AverageResume; + +} ACPI_S3PT_RESUME; + +typedef struct acpi_s3pt_suspend +{ + ACPI_S3PT_HEADER Header; + UINT64 SuspendStart; + UINT64 SuspendEnd; + +} ACPI_S3PT_SUSPEND; + + +/******************************************************************************* + * + * GTDT - Generic Timer Description Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_gtdt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT64 Address; + UINT32 Flags; + UINT32 SecurePl1Interrupt; + UINT32 SecurePl1Flags; + UINT32 NonSecurePl1Interrupt; + UINT32 NonSecurePl1Flags; + UINT32 VirtualTimerInterrupt; + UINT32 VirtualTimerFlags; + UINT32 NonSecurePl2Interrupt; + UINT32 NonSecurePl2Flags; + +} ACPI_TABLE_GTDT; + +/* Values for Flags field above */ + +#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 + +/* Values for all "TimerFlags" fields above */ + +#define ACPI_GTDT_INTERRUPT_MODE 1 +#define ACPI_GTDT_INTERRUPT_POLARITY 2 + + +/******************************************************************************* + * + * MPST - Memory Power State Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +#define ACPI_MPST_CHANNEL_INFO \ + UINT16 Reserved1; \ + UINT8 ChannelId; \ + UINT8 Reserved2; \ + UINT16 PowerNodeCount; + +/* Main table */ + +typedef struct acpi_table_mpst +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ + +} ACPI_TABLE_MPST; + + +/* Memory Platform Communication Channel Info */ + +typedef struct acpi_mpst_channel +{ + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ + +} ACPI_MPST_CHANNEL; + + +/* Memory Power Node Structure */ + +typedef struct acpi_mpst_power_node +{ + UINT8 Flags; + UINT8 Reserved1; + UINT16 NodeId; + UINT32 Length; + UINT64 RangeAddress; + UINT64 RangeLength; + UINT8 NumPowerStates; + UINT8 NumPhysicalComponents; + UINT16 Reserved2; + +} ACPI_MPST_POWER_NODE; + +/* Values for Flags field above */ + +#define ACPI_MPST_ENABLED 1 +#define ACPI_MPST_POWER_MANAGED 2 +#define ACPI_MPST_HOT_PLUG_CAPABLE 4 + + +/* Memory Power State Structure (follows POWER_NODE above) */ + +typedef struct acpi_mpst_power_state +{ + UINT8 PowerState; + UINT8 InfoIndex; + +} ACPI_MPST_POWER_STATE; + + +/* Physical Component ID Structure (follows POWER_STATE above) */ + +typedef struct acpi_mpst_component +{ + UINT16 ComponentId; + +} ACPI_MPST_COMPONENT; + + +/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */ + +typedef struct acpi_mpst_data_hdr +{ + UINT16 CharacteristicsCount; + +} ACPI_MPST_DATA_HDR; + +typedef struct acpi_mpst_power_data +{ + UINT8 Revision; + UINT8 Flags; + UINT16 Reserved1; + UINT32 AveragePower; + UINT32 PowerSaving; + UINT64 ExitLatency; + UINT64 Reserved2; + +} ACPI_MPST_POWER_DATA; + +/* Values for Flags field above */ + +#define ACPI_MPST_PRESERVE 1 +#define ACPI_MPST_AUTOENTRY 2 +#define ACPI_MPST_AUTOEXIT 4 + + +/* Shared Memory Region (not part of an ACPI table) */ + +typedef struct acpi_mpst_shared +{ + UINT32 Signature; + UINT16 PccCommand; + UINT16 PccStatus; + UINT16 CommandRegister; + UINT16 StatusRegister; + UINT16 PowerStateId; + UINT16 PowerNodeId; + UINT64 EnergyConsumed; + UINT64 AveragePower; + +} ACPI_MPST_SHARED; + + +/******************************************************************************* + * + * PCCT - Platform Communications Channel Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_pcct +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Flags; + UINT32 Latency; + UINT32 Reserved; + +} ACPI_TABLE_PCCT; + +/* Values for Flags field above */ + +#define ACPI_PCCT_DOORBELL 1 + +/* + * PCCT subtables + */ + +/* 0: Generic Communications Subspace */ + +typedef struct acpi_pcct_subspace +{ + ACPI_SUBTABLE_HEADER Header; + UINT8 Reserved[6]; + UINT64 BaseAddress; + UINT64 Length; + ACPI_GENERIC_ADDRESS DoorbellRegister; + UINT64 PreserveMask; + UINT64 WriteMask; + +} ACPI_PCCT_SUBSPACE; + + +/* + * PCC memory structures (not part of the ACPI table) + */ + +/* Shared Memory Region */ + +typedef struct acpi_pcct_shared_memory +{ + UINT32 Signature; + UINT16 Command; + UINT16 Status; + +} ACPI_PCCT_SHARED_MEMORY; + + +/******************************************************************************* + * + * PMTT - Platform Memory Topology Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_pmtt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Reserved; + +} ACPI_TABLE_PMTT; + + +/* Common header for PMTT subtables that follow main table */ + +typedef struct acpi_pmtt_header +{ + UINT8 Type; + UINT8 Reserved1; + UINT16 Length; + UINT16 Flags; + UINT16 Reserved2; + +} ACPI_PMTT_HEADER; + +/* Values for Type field above */ + +#define ACPI_PMTT_TYPE_SOCKET 0 +#define ACPI_PMTT_TYPE_CONTROLLER 1 +#define ACPI_PMTT_TYPE_DIMM 2 +#define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */ + +/* Values for Flags field above */ + +#define ACPI_PMTT_TOP_LEVEL 0x0001 +#define ACPI_PMTT_PHYSICAL 0x0002 +#define ACPI_PMTT_MEMORY_TYPE 0x000C + + +/* + * PMTT subtables, correspond to Type in acpi_pmtt_header + */ + + +/* 0: Socket Structure */ + +typedef struct acpi_pmtt_socket +{ + ACPI_PMTT_HEADER Header; + UINT16 SocketId; + UINT16 Reserved; + +} ACPI_PMTT_SOCKET; + + +/* 1: Memory Controller subtable */ + +typedef struct acpi_pmtt_controller +{ + ACPI_PMTT_HEADER Header; + UINT32 ReadLatency; + UINT32 WriteLatency; + UINT32 ReadBandwidth; + UINT32 WriteBandwidth; + UINT16 AccessWidth; + UINT16 Alignment; + UINT16 Reserved; + UINT16 DomainCount; + +} ACPI_PMTT_CONTROLLER; + +/* 1a: Proximity Domain substructure */ + +typedef struct acpi_pmtt_domain +{ + UINT32 ProximityDomain; + +} ACPI_PMTT_DOMAIN; + + +/* 2: Physical Component Identifier (DIMM) */ + +typedef struct acpi_pmtt_physical_component +{ + ACPI_PMTT_HEADER Header; + UINT16 ComponentId; + UINT16 Reserved; + UINT32 MemorySize; + UINT32 BiosHandle; + +} ACPI_PMTT_PHYSICAL_COMPONENT; + + +/******************************************************************************* + * + * RASF - RAS Feature Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_rasf +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT8 ChannelId[12]; + +} ACPI_TABLE_RASF; + +/* RASF Platform Communication Channel Shared Memory Region */ + +typedef struct acpi_rasf_shared_memory +{ + UINT32 Signature; + UINT16 Command; + UINT16 Status; + UINT64 RequestedAddress; + UINT64 RequestedLength; + UINT64 ActualAddress; + UINT64 ActualLength; + UINT16 Flags; + UINT8 Speed; + +} ACPI_RASF_SHARED_MEMORY; + +/* Masks for Flags and Speed fields above */ + +#define ACPI_RASF_SCRUBBER_RUNNING 1 +#define ACPI_RASF_SPEED (7<<1) + +/* Channel Commands */ + +enum AcpiRasfCommands +{ + ACPI_RASF_GET_RAS_CAPABILITIES = 1, + ACPI_RASF_GET_PATROL_PARAMETERS = 2, + ACPI_RASF_START_PATROL_SCRUBBER = 3, + ACPI_RASF_STOP_PATROL_SCRUBBER = 4 +}; + +/* Channel Command flags */ + +#define ACPI_RASF_GENERATE_SCI (1<<15) + +/* Status values */ + +enum AcpiRasfStatus +{ + ACPI_RASF_SUCCESS = 0, + ACPI_RASF_NOT_VALID = 1, + ACPI_RASF_NOT_SUPPORTED = 2, + ACPI_RASF_BUSY = 3, + ACPI_RASF_FAILED = 4, + ACPI_RASF_ABORTED = 5, + ACPI_RASF_INVALID_DATA = 6 +}; + +/* Status flags */ + +#define ACPI_RASF_COMMAND_COMPLETE (1) +#define ACPI_RASF_SCI_DOORBELL (1<<1) +#define ACPI_RASF_ERROR (1<<2) +#define ACPI_RASF_STATUS (0x1F<<3) + + +/* Reset to default packing */ + +#pragma pack() + +#endif /* __ACTBL3_H__ */ --- sys/contrib/dev/acpica/include/actypes.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/include/actypes.h 2011-11-23 13:29:25.000000000 -0500 @@ -716,8 +716,10 @@ #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 #define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7 +#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8 +#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9 -#define ACPI_NUM_PREDEFINED_REGIONS 8 +#define ACPI_NUM_PREDEFINED_REGIONS 10 /* * Special Address Spaces @@ -1030,6 +1032,17 @@ #define ACPI_DEFAULT_HANDLER NULL +/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */ + +typedef struct acpi_connection_info +{ + UINT8 *Connection; + UINT16 Length; + UINT8 AccessLength; + +} ACPI_CONNECTION_INFO; + + typedef ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) ( ACPI_HANDLE RegionHandle, --- sys/contrib/dev/acpica/include/acutils.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/acutils.h 2011-11-23 13:29:24.000000000 -0500 @@ -46,6 +46,7 @@ extern const UINT8 AcpiGbl_ResourceAmlSizes[]; +extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[]; /* Strings used by the disassembler and debugger resource dump routines */ @@ -69,6 +70,22 @@ extern const char *AcpiGbl_TrsDecode[]; extern const char *AcpiGbl_TtpDecode[]; extern const char *AcpiGbl_TypDecode[]; +extern const char *AcpiGbl_PpcDecode[]; +extern const char *AcpiGbl_IorDecode[]; +extern const char *AcpiGbl_DtsDecode[]; +extern const char *AcpiGbl_CtDecode[]; +extern const char *AcpiGbl_SbtDecode[]; +extern const char *AcpiGbl_AmDecode[]; +extern const char *AcpiGbl_SmDecode[]; +extern const char *AcpiGbl_WmDecode[]; +extern const char *AcpiGbl_CphDecode[]; +extern const char *AcpiGbl_CpoDecode[]; +extern const char *AcpiGbl_DpDecode[]; +extern const char *AcpiGbl_EdDecode[]; +extern const char *AcpiGbl_BpbDecode[]; +extern const char *AcpiGbl_SbDecode[]; +extern const char *AcpiGbl_FcDecode[]; +extern const char *AcpiGbl_PtDecode[]; #endif /* Types for Resource descriptor entries */ --- sys/contrib/dev/acpica/include/amlcode.h 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/include/amlcode.h 2011-11-23 13:29:24.000000000 -0500 @@ -191,6 +191,15 @@ /* + * Opcodes for "Field" operators + */ +#define AML_FIELD_OFFSET_OP (UINT8) 0x00 +#define AML_FIELD_ACCESS_OP (UINT8) 0x01 +#define AML_FIELD_CONNECTION_OP (UINT8) 0x02 /* ACPI 5.0 */ +#define AML_FIELD_EXT_ACCESS_OP (UINT8) 0x03 /* ACPI 5.0 */ + + +/* * Internal opcodes * Use only "Unknown" AML opcodes, don't attempt to use * any valid ACPI ASCII values (A-Z, 0-9, '-') @@ -204,7 +213,8 @@ #define AML_INT_METHODCALL_OP (UINT16) 0x0035 #define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036 #define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037 - +#define AML_INT_CONNECTION_OP (UINT16) 0x0038 +#define AML_INT_EXTACCESSFIELD_OP (UINT16) 0x0039 #define ARG_NONE 0x0 @@ -478,13 +488,16 @@ */ typedef enum { - AML_FIELD_ATTRIB_SMB_QUICK = 0x02, - AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, - AML_FIELD_ATTRIB_SMB_BYTE = 0x06, - AML_FIELD_ATTRIB_SMB_WORD = 0x08, - AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, - AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, - AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D + AML_FIELD_ATTRIB_QUICK = 0x02, + AML_FIELD_ATTRIB_SEND_RCV = 0x04, + AML_FIELD_ATTRIB_BYTE = 0x06, + AML_FIELD_ATTRIB_WORD = 0x08, + AML_FIELD_ATTRIB_BLOCK = 0x0A, + AML_FIELD_ATTRIB_MULTIBYTE = 0x0B, + AML_FIELD_ATTRIB_WORD_CALL = 0x0C, + AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D, + AML_FIELD_ATTRIB_RAW_BYTES = 0x0E, + AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F } AML_ACCESS_ATTRIBUTE; --- sys/contrib/dev/acpica/include/amlresrc.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/amlresrc.h 2011-11-23 13:29:25.000000000 -0500 @@ -59,29 +59,48 @@ #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" #define ACPI_RESTAG_BASEADDRESS "_BAS" #define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ +#define ACPI_RESTAG_DEBOUNCETIME "_DBT" #define ACPI_RESTAG_DECODE "_DEC" +#define ACPI_RESTAG_DEVICEPOLARITY "_DPL" #define ACPI_RESTAG_DMA "_DMA" #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ +#define ACPI_RESTAG_DRIVESTRENGTH "_DRS" +#define ACPI_RESTAG_ENDIANNESS "_END" +#define ACPI_RESTAG_FLOWCONTROL "_FLC" #define ACPI_RESTAG_GRANULARITY "_GRA" #define ACPI_RESTAG_INTERRUPT "_INT" #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */ #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */ #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ +#define ACPI_RESTAG_IORESTRICTION "_IOR" #define ACPI_RESTAG_LENGTH "_LEN" +#define ACPI_RESTAG_LINE "_LIN" #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ #define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ #define ACPI_RESTAG_MAXADDR "_MAX" #define ACPI_RESTAG_MINADDR "_MIN" #define ACPI_RESTAG_MAXTYPE "_MAF" #define ACPI_RESTAG_MINTYPE "_MIF" +#define ACPI_RESTAG_MODE "_MOD" +#define ACPI_RESTAG_PARITY "_PAR" +#define ACPI_RESTAG_PHASE "_PHA" +#define ACPI_RESTAG_PIN "_PIN" +#define ACPI_RESTAG_PINCONFIG "_PPI" +#define ACPI_RESTAG_POLARITY "_POL" #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" #define ACPI_RESTAG_RANGETYPE "_RNG" #define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */ +#define ACPI_RESTAG_LENGTH_RX "_RXL" +#define ACPI_RESTAG_LENGTH_TX "_TXL" +#define ACPI_RESTAG_SLAVEMODE "_SLV" +#define ACPI_RESTAG_SPEED "_SPE" +#define ACPI_RESTAG_STOPBITS "_STB" #define ACPI_RESTAG_TRANSLATION "_TRA" #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ +#define ACPI_RESTAG_VENDORDATA "_VEN" /* Default sizes for "small" resource descriptors */ @@ -92,6 +111,7 @@ #define ASL_RDESC_END_DEPEND_SIZE 0x00 #define ASL_RDESC_IO_SIZE 0x07 #define ASL_RDESC_FIXED_IO_SIZE 0x03 +#define ASL_RDESC_FIXED_DMA_SIZE 0x05 #define ASL_RDESC_END_TAG_SIZE 0x01 @@ -214,6 +234,16 @@ } AML_RESOURCE_END_TAG; +typedef struct aml_resource_fixed_dma +{ + AML_RESOURCE_SMALL_HEADER_COMMON + UINT16 RequestLines; + UINT16 Channels; + UINT8 Width; + +} AML_RESOURCE_FIXED_DMA; + + /* * LARGE descriptors */ @@ -368,6 +398,130 @@ } AML_RESOURCE_GENERIC_REGISTER; + +/* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */ + +typedef struct aml_resource_gpio +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT8 ConnectionType; + UINT16 Flags; + UINT16 IntFlags; + UINT8 PinConfig; + UINT16 DriveStrength; + UINT16 DebounceTimeout; + 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_GPIO; + +#define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */ + +/* Values for ConnectionType above */ + +#define AML_RESOURCE_GPIO_TYPE_INT 0 +#define AML_RESOURCE_GPIO_TYPE_IO 1 +#define AML_RESOURCE_MAX_GPIOTYPE 1 + + +/* Common preamble for all serial descriptors (ACPI 5.0) */ + +#define AML_RESOURCE_SERIAL_COMMON \ + UINT8 RevisionId; \ + UINT8 ResSourceIndex; \ + UINT8 Type; \ + UINT8 Flags; \ + UINT16 TypeSpecificFlags; \ + UINT8 TypeRevisionId; \ + UINT16 TypeDataLength; \ + +/* Values for the type field above */ + +#define AML_RESOURCE_I2C_SERIALBUSTYPE 1 +#define AML_RESOURCE_SPI_SERIALBUSTYPE 2 +#define AML_RESOURCE_UART_SERIALBUSTYPE 3 +#define AML_RESOURCE_MAX_SERIALBUSTYPE 3 +#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */ + +typedef struct aml_resource_common_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + +} AML_RESOURCE_COMMON_SERIALBUS; + +typedef struct aml_resource_i2c_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + UINT32 ConnectionSpeed; + UINT16 SlaveAddress; + /* + * Optional fields follow immediately: + * 1) Vendor Data bytes + * 2) Resource Source String + */ + +} AML_RESOURCE_I2C_SERIALBUS; + +#define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_I2C_MIN_DATA_LEN 6 + +typedef struct aml_resource_spi_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + UINT32 ConnectionSpeed; + UINT8 DataBitLength; + UINT8 ClockPhase; + UINT8 ClockPolarity; + UINT16 DeviceSelection; + /* + * Optional fields follow immediately: + * 1) Vendor Data bytes + * 2) Resource Source String + */ + +} AML_RESOURCE_SPI_SERIALBUS; + +#define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_SPI_MIN_DATA_LEN 9 + + +typedef struct aml_resource_uart_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + UINT32 DefaultBaudRate; + UINT16 RxFifoSize; + UINT16 TxFifoSize; + UINT8 Parity; + UINT8 LinesEnabled; + /* + * Optional fields follow immediately: + * 1) Vendor Data bytes + * 2) Resource Source String + */ + +} AML_RESOURCE_UART_SERIALBUS; + +#define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_UART_MIN_DATA_LEN 10 + + /* restore default alignment */ #pragma pack() @@ -390,6 +544,7 @@ AML_RESOURCE_END_DEPENDENT EndDpf; AML_RESOURCE_IO Io; AML_RESOURCE_FIXED_IO FixedIo; + AML_RESOURCE_FIXED_DMA FixedDma; AML_RESOURCE_VENDOR_SMALL VendorSmall; AML_RESOURCE_END_TAG EndTag; @@ -405,6 +560,11 @@ AML_RESOURCE_ADDRESS64 Address64; AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64; AML_RESOURCE_EXTENDED_IRQ ExtendedIrq; + AML_RESOURCE_GPIO Gpio; + AML_RESOURCE_I2C_SERIALBUS I2cSerialBus; + AML_RESOURCE_SPI_SERIALBUS SpiSerialBus; + AML_RESOURCE_UART_SERIALBUS UartSerialBus; + AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus; /* Utility overlays */ --- sys/contrib/dev/acpica/include/platform/acenv.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/include/platform/acenv.h 2011-11-23 13:29:23.000000000 -0500 @@ -79,7 +79,7 @@ #define ACPI_SINGLE_THREADED #endif -/* AcpiExec and AcpiBin configuration */ +/* AcpiExec configuration. Multithreaded with full AML debugger */ #ifdef ACPI_EXEC_APP #define ACPI_APPLICATION @@ -88,7 +88,27 @@ #define ACPI_DBG_TRACK_ALLOCATIONS #endif -#ifdef ACPI_BIN_APP +/* AcpiNames configuration. Single threaded with debugger output enabled. */ + +#ifdef ACPI_NAMES_APP +#define ACPI_DEBUGGER +#define ACPI_APPLICATION +#define ACPI_SINGLE_THREADED +#endif + +/* + * AcpiBin/AcpiHelp/AcpiSrc configuration. All single threaded, with + * no debug output. + */ +#if (defined ACPI_BIN_APP) || \ + (defined ACPI_SRC_APP) || \ + (defined ACPI_XTRACT_APP) +#define ACPI_APPLICATION +#define ACPI_SINGLE_THREADED +#endif + +#ifdef ACPI_HELP_APP +#define ACPI_DEBUG_OUTPUT #define ACPI_APPLICATION #define ACPI_SINGLE_THREADED #endif --- sys/contrib/dev/acpica/namespace/nspredef.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/namespace/nspredef.c 2011-11-23 13:29:29.000000000 -0500 @@ -216,14 +216,20 @@ } /* - * 1) We have a return value, but if one wasn't expected, just exit, this is - * not a problem. For example, if the "Implicit Return" feature is - * enabled, methods will always return a value. + * Return value validation and possible repair. * - * 2) If the return value can be of any type, then we cannot perform any - * validation, exit. + * 1) Don't perform return value validation/repair if this feature + * has been disabled via a global option. + * + * 2) We have a return value, but if one wasn't expected, just exit, + * this is not a problem. For example, if the "Implicit Return" + * feature is enabled, methods will always return a value. + * + * 3) If the return value can be of any type, then we cannot perform + * any validation, just exit. */ - if ((!Predefined->Info.ExpectedBtypes) || + if (AcpiGbl_DisableAutoRepair || + (!Predefined->Info.ExpectedBtypes) || (Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL)) { goto Cleanup; @@ -237,6 +243,7 @@ goto Cleanup; } Data->Predefined = Predefined; + Data->Node = Node; Data->NodeFlags = Node->Flags; Data->Pathname = Pathname; @@ -658,6 +665,7 @@ case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_COUNT: + case ACPI_PTYPE2_FIX_VAR: /* * These types all return a single Package that consists of a @@ -800,6 +808,29 @@ break; + case ACPI_PTYPE2_FIX_VAR: + /* + * Each subpackage has a fixed number of elements and an + * optional element + */ + ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + Status = AcpiNsCheckPackageElements (Data, SubElements, + Package->RetInfo.ObjectType1, + Package->RetInfo.Count1, + Package->RetInfo.ObjectType2, + SubPackage->Package.Count - Package->RetInfo.Count1, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_PTYPE2_FIXED: /* Each sub-package has a fixed length */ --- sys/contrib/dev/acpica/namespace/nsrepair.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/namespace/nsrepair.c 2011-11-23 13:29:29.000000000 -0500 @@ -696,6 +696,7 @@ case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_REV_FIXED: + case ACPI_PTYPE2_FIX_VAR: break; default: --- sys/contrib/dev/acpica/namespace/nsrepair2.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/namespace/nsrepair2.c 2011-11-23 13:29:29.000000000 -0500 @@ -516,11 +516,12 @@ } /* - * Copy and uppercase the string. From the ACPI specification: + * Copy and uppercase the string. From the ACPI 5.0 specification: * * A valid PNP ID must be of the form "AAA####" where A is an uppercase * letter and # is a hex digit. A valid ACPI ID must be of the form - * "ACPI####" where # is a hex digit. + * "NNNN####" where N is an uppercase letter or decimal digit, and + * # is a hex digit. */ for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) { @@ -555,8 +556,23 @@ { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + /* + * We can only sort the _TSS return package if there is no _PSS in the + * same scope. This is because if _PSS is present, the ACPI specification + * dictates that the _TSS Power Dissipation field is to be ignored, and + * therefore some BIOSs leave garbage values in the _TSS Power field(s). + * In this case, it is best to just return the _TSS package as-is. + * (May, 2011) + */ + Status = AcpiNsGetNode (Data->Node, "^_PSS", ACPI_NS_NO_UPSEARCH, &Node); + if (ACPI_SUCCESS (Status)) + { + return (AE_OK); + } + Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1, ACPI_SORT_DESCENDING, "PowerDissipation"); --- sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c 1969-12-31 19:00:00.000000000 -0500 +++ sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c 2011-11-23 16:32:35.000000000 -0500 @@ -0,0 +1,1214 @@ +/****************************************************************************** + * + * Module Name: osunixxf - UNIX OSL interfaces + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2011, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + + +/* + * These interfaces are required in order to compile the ASL compiler and the + * various ACPICA tools under Linux or other Unix-like system. + * + * Note: Use #define __APPLE__ for OS X generation. + */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define _COMPONENT ACPI_OS_SERVICES + ACPI_MODULE_NAME ("osunixxf") + + +extern FILE *AcpiGbl_DebugFile; +FILE *AcpiGbl_OutputFile; + + +/* Upcalls to AcpiExec */ + +ACPI_PHYSICAL_ADDRESS +AeLocalGetRootPointer ( + void); + +void +AeTableOverride ( + ACPI_TABLE_HEADER *ExistingTable, + ACPI_TABLE_HEADER **NewTable); + +typedef void* (*PTHREAD_CALLBACK) (void *); + +/* Apple-specific */ + +#ifdef __APPLE__ +#define sem_destroy sem_close +#endif + + +/****************************************************************************** + * + * FUNCTION: AcpiOsInitialize, AcpiOsTerminate + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Init and terminate. Nothing to do. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsInitialize ( + void) +{ + + AcpiGbl_OutputFile = stdout; + return (AE_OK); +} + + +ACPI_STATUS +AcpiOsTerminate ( + void) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsGetRootPointer + * + * PARAMETERS: None + * + * RETURN: RSDP physical address + * + * DESCRIPTION: Gets the ACPI root pointer (RSDP) + * + *****************************************************************************/ + +ACPI_PHYSICAL_ADDRESS +AcpiOsGetRootPointer ( + void) +{ + + return (AeLocalGetRootPointer ()); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsPredefinedOverride + * + * PARAMETERS: InitVal - Initial value of the predefined object + * NewVal - The new value for the object + * + * RETURN: Status, pointer to value. Null pointer returned if not + * overriding. + * + * DESCRIPTION: Allow the OS to override predefined names + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsPredefinedOverride ( + const ACPI_PREDEFINED_NAMES *InitVal, + ACPI_STRING *NewVal) +{ + + if (!InitVal || !NewVal) + { + return (AE_BAD_PARAMETER); + } + + *NewVal = NULL; + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsTableOverride + * + * PARAMETERS: ExistingTable - Header of current table (probably + * firmware) + * NewTable - Where an entire new table is returned. + * + * RETURN: Status, pointer to new table. Null pointer returned if no + * table is available to override + * + * DESCRIPTION: Return a different version of a table if one is available + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsTableOverride ( + ACPI_TABLE_HEADER *ExistingTable, + ACPI_TABLE_HEADER **NewTable) +{ + + if (!ExistingTable || !NewTable) + { + return (AE_BAD_PARAMETER); + } + + *NewTable = NULL; + +#ifdef ACPI_EXEC_APP + + AeTableOverride (ExistingTable, NewTable); + return (AE_OK); +#else + + return (AE_NO_ACPI_TABLES); +#endif +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsRedirectOutput + * + * PARAMETERS: Destination - An open file handle/pointer + * + * RETURN: None + * + * DESCRIPTION: Causes redirect of AcpiOsPrintf and AcpiOsVprintf + * + *****************************************************************************/ + +void +AcpiOsRedirectOutput ( + void *Destination) +{ + + AcpiGbl_OutputFile = Destination; +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsPrintf + * + * PARAMETERS: fmt, ... - Standard printf format + * + * RETURN: None + * + * DESCRIPTION: Formatted output + * + *****************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiOsPrintf ( + const char *Fmt, + ...) +{ + va_list Args; + + + va_start (Args, Fmt); + AcpiOsVprintf (Fmt, Args); + va_end (Args); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsVprintf + * + * PARAMETERS: fmt - Standard printf format + * args - Argument list + * + * RETURN: None + * + * DESCRIPTION: Formatted output with argument list pointer + * + *****************************************************************************/ + +void +AcpiOsVprintf ( + const char *Fmt, + va_list Args) +{ + UINT8 Flags; + + + Flags = AcpiGbl_DbOutputFlags; + if (Flags & ACPI_DB_REDIRECTABLE_OUTPUT) + { + /* Output is directable to either a file (if open) or the console */ + + if (AcpiGbl_DebugFile) + { + /* Output file is open, send the output there */ + + vfprintf (AcpiGbl_DebugFile, Fmt, Args); + } + else + { + /* No redirection, send output to console (once only!) */ + + Flags |= ACPI_DB_CONSOLE_OUTPUT; + } + } + + if (Flags & ACPI_DB_CONSOLE_OUTPUT) + { + vfprintf (AcpiGbl_OutputFile, Fmt, Args); + } +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsGetLine + * + * PARAMETERS: Buffer - Where to return the command line + * BufferLength - Maximum length of Buffer + * BytesRead - Where the actual byte count is returned + * + * RETURN: Status and actual bytes read + * + * DESCRIPTION: Formatted input with argument list pointer + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsGetLine ( + char *Buffer, + UINT32 BufferLength, + UINT32 *BytesRead) +{ + UINT8 Temp; + UINT32 i; + + + for (i = 0; ; i++) + { + if (i >= BufferLength) + { + return (AE_BUFFER_OVERFLOW); + } + + scanf ("%1c", &Temp); + if (!Temp || Temp == '\n') + { + break; + } + + Buffer [i] = Temp; + } + + /* Null terminate the buffer */ + + Buffer [i] = 0; + + /* Return the number of bytes in the string */ + + if (BytesRead) + { + *BytesRead = i; + } + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsMapMemory + * + * PARAMETERS: where - Physical address of memory to be mapped + * length - How much memory to map + * + * RETURN: Pointer to mapped memory. Null on error. + * + * DESCRIPTION: Map physical memory into caller's address space + * + *****************************************************************************/ + +void * +AcpiOsMapMemory ( + ACPI_PHYSICAL_ADDRESS where, + ACPI_SIZE length) +{ + + return (ACPI_TO_POINTER ((ACPI_SIZE) where)); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsUnmapMemory + * + * PARAMETERS: where - Logical address of memory to be unmapped + * length - How much memory to unmap + * + * RETURN: None. + * + * DESCRIPTION: Delete a previously created mapping. Where and Length must + * correspond to a previous mapping exactly. + * + *****************************************************************************/ + +void +AcpiOsUnmapMemory ( + void *where, + ACPI_SIZE length) +{ + + return; +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsAllocate + * + * PARAMETERS: Size - Amount to allocate, in bytes + * + * RETURN: Pointer to the new allocation. Null on error. + * + * DESCRIPTION: Allocate memory. Algorithm is dependent on the OS. + * + *****************************************************************************/ + +void * +AcpiOsAllocate ( + ACPI_SIZE size) +{ + void *Mem; + + + Mem = (void *) malloc ((size_t) size); + return (Mem); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsFree + * + * PARAMETERS: mem - Pointer to previously allocated memory + * + * RETURN: None. + * + * DESCRIPTION: Free memory allocated via AcpiOsAllocate + * + *****************************************************************************/ + +void +AcpiOsFree ( + void *mem) +{ + + free (mem); +} + + +#ifdef ACPI_SINGLE_THREADED +/****************************************************************************** + * + * FUNCTION: Semaphore stub functions + * + * DESCRIPTION: Stub functions used for single-thread applications that do + * not require semaphore synchronization. Full implementations + * of these functions appear after the stubs. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsCreateSemaphore ( + UINT32 MaxUnits, + UINT32 InitialUnits, + ACPI_HANDLE *OutHandle) +{ + *OutHandle = (ACPI_HANDLE) 1; + return (AE_OK); +} + +ACPI_STATUS +AcpiOsDeleteSemaphore ( + ACPI_HANDLE Handle) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiOsWaitSemaphore ( + ACPI_HANDLE Handle, + UINT32 Units, + UINT16 Timeout) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiOsSignalSemaphore ( + ACPI_HANDLE Handle, + UINT32 Units) +{ + return (AE_OK); +} + +#else +/****************************************************************************** + * + * FUNCTION: AcpiOsCreateSemaphore + * + * PARAMETERS: InitialUnits - Units to be assigned to the new semaphore + * OutHandle - Where a handle will be returned + * + * RETURN: Status + * + * DESCRIPTION: Create an OS semaphore + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsCreateSemaphore ( + UINT32 MaxUnits, + UINT32 InitialUnits, + ACPI_HANDLE *OutHandle) +{ + sem_t *Sem; + + + if (!OutHandle) + { + return (AE_BAD_PARAMETER); + } + +#ifdef __APPLE__ + { + char *SemaphoreName = tmpnam (NULL); + + Sem = sem_open (SemaphoreName, O_EXCL|O_CREAT, 0755, InitialUnits); + if (!Sem) + { + return (AE_NO_MEMORY); + } + sem_unlink (SemaphoreName); /* This just deletes the name */ + } + +#else + Sem = AcpiOsAllocate (sizeof (sem_t)); + if (!Sem) + { + return (AE_NO_MEMORY); + } + + if (sem_init (Sem, 0, InitialUnits) == -1) + { + AcpiOsFree (Sem); + return (AE_BAD_PARAMETER); + } +#endif + + *OutHandle = (ACPI_HANDLE) Sem; + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsDeleteSemaphore + * + * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore + * + * RETURN: Status + * + * DESCRIPTION: Delete an OS semaphore + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsDeleteSemaphore ( + ACPI_HANDLE Handle) +{ + sem_t *Sem = (sem_t *) Handle; + + + if (!Sem) + { + return (AE_BAD_PARAMETER); + } + + if (sem_destroy (Sem) == -1) + { + return (AE_BAD_PARAMETER); + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsWaitSemaphore + * + * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore + * Units - How many units to wait for + * Timeout - How long to wait + * + * RETURN: Status + * + * DESCRIPTION: Wait for units + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsWaitSemaphore ( + ACPI_HANDLE Handle, + UINT32 Units, + UINT16 Timeout) +{ + ACPI_STATUS Status = AE_OK; + sem_t *Sem = (sem_t *) Handle; + struct timespec T; + + + if (!Sem) + { + return (AE_BAD_PARAMETER); + } + + switch (Timeout) + { + /* + * No Wait: + * -------- + * A zero timeout value indicates that we shouldn't wait - just + * acquire the semaphore if available otherwise return AE_TIME + * (a.k.a. 'would block'). + */ + case 0: + + if (sem_trywait(Sem) == -1) + { + Status = (AE_TIME); + } + break; + + /* Wait Indefinitely */ + + case ACPI_WAIT_FOREVER: + + if (sem_wait (Sem)) + { + Status = (AE_TIME); + } + break; + + /* Wait with Timeout */ + + default: + + T.tv_sec = Timeout / 1000; + T.tv_nsec = (Timeout - (T.tv_sec * 1000)) * 1000000; + +#ifdef ACPI_USE_ALTERNATE_TIMEOUT + /* + * Alternate timeout mechanism for environments where + * sem_timedwait is not available or does not work properly. + */ + while (Timeout) + { + if (sem_trywait (Sem) == 0) + { + /* Got the semaphore */ + return (AE_OK); + } + usleep (1000); /* one millisecond */ + Timeout--; + } + Status = (AE_TIME); +#else + + if (sem_timedwait (Sem, &T)) + { + Status = (AE_TIME); + } +#endif + + break; + } + + return (Status); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsSignalSemaphore + * + * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore + * Units - Number of units to send + * + * RETURN: Status + * + * DESCRIPTION: Send units + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsSignalSemaphore ( + ACPI_HANDLE Handle, + UINT32 Units) +{ + sem_t *Sem = (sem_t *)Handle; + + + if (!Sem) + { + return (AE_BAD_PARAMETER); + } + + if (sem_post (Sem) == -1) + { + return (AE_LIMIT); + } + + return (AE_OK); +} + +#endif /* ACPI_SINGLE_THREADED */ + + +/****************************************************************************** + * + * FUNCTION: Spinlock interfaces + * + * DESCRIPTION: Map these interfaces to semaphore interfaces + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsCreateLock ( + ACPI_SPINLOCK *OutHandle) +{ + + return (AcpiOsCreateSemaphore (1, 1, OutHandle)); +} + + +void +AcpiOsDeleteLock ( + ACPI_SPINLOCK Handle) +{ + AcpiOsDeleteSemaphore (Handle); +} + + +ACPI_CPU_FLAGS +AcpiOsAcquireLock ( + ACPI_HANDLE Handle) +{ + AcpiOsWaitSemaphore (Handle, 1, 0xFFFF); + return (0); +} + + +void +AcpiOsReleaseLock ( + ACPI_SPINLOCK Handle, + ACPI_CPU_FLAGS Flags) +{ + AcpiOsSignalSemaphore (Handle, 1); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsInstallInterruptHandler + * + * PARAMETERS: InterruptNumber - Level handler should respond to. + * Isr - Address of the ACPI interrupt handler + * ExceptPtr - Where status is returned + * + * RETURN: Handle to the newly installed handler. + * + * DESCRIPTION: Install an interrupt handler. Used to install the ACPI + * OS-independent handler. + * + *****************************************************************************/ + +UINT32 +AcpiOsInstallInterruptHandler ( + UINT32 InterruptNumber, + ACPI_OSD_HANDLER ServiceRoutine, + void *Context) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsRemoveInterruptHandler + * + * PARAMETERS: Handle - Returned when handler was installed + * + * RETURN: Status + * + * DESCRIPTION: Uninstalls an interrupt handler. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsRemoveInterruptHandler ( + UINT32 InterruptNumber, + ACPI_OSD_HANDLER ServiceRoutine) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsStall + * + * PARAMETERS: microseconds - Time to sleep + * + * RETURN: Blocks until sleep is completed. + * + * DESCRIPTION: Sleep at microsecond granularity + * + *****************************************************************************/ + +void +AcpiOsStall ( + UINT32 microseconds) +{ + + if (microseconds) + { + usleep (microseconds); + } +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsSleep + * + * PARAMETERS: milliseconds - Time to sleep + * + * RETURN: Blocks until sleep is completed. + * + * DESCRIPTION: Sleep at millisecond granularity + * + *****************************************************************************/ + +void +AcpiOsSleep ( + UINT64 milliseconds) +{ + + sleep (milliseconds / 1000); /* Sleep for whole seconds */ + + /* + * Arg to usleep() must be less than 1,000,000 (1 second) + */ + usleep ((milliseconds % 1000) * 1000); /* Sleep for remaining usecs */ +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsGetTimer + * + * PARAMETERS: None + * + * RETURN: Current time in 100 nanosecond units + * + * DESCRIPTION: Get the current system time + * + *****************************************************************************/ + +UINT64 +AcpiOsGetTimer ( + void) +{ + struct timeval time; + + + gettimeofday (&time, NULL); + + /* Seconds * 10^7 = 100ns(10^-7), Microseconds(10^-6) * 10^1 = 100ns */ + + return (((UINT64) time.tv_sec * 10000000) + ((UINT64) time.tv_usec * 10)); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsReadPciConfiguration + * + * PARAMETERS: PciId - Seg/Bus/Dev + * Register - Device Register + * Value - Buffer where value is placed + * Width - Number of bits + * + * RETURN: Status + * + * DESCRIPTION: Read data from PCI configuration space + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsReadPciConfiguration ( + ACPI_PCI_ID *PciId, + UINT32 Register, + UINT64 *Value, + UINT32 Width) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsWritePciConfiguration + * + * PARAMETERS: PciId - Seg/Bus/Dev + * Register - Device Register + * Value - Value to be written + * Width - Number of bits + * + * RETURN: Status. + * + * DESCRIPTION: Write data to PCI configuration space + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsWritePciConfiguration ( + ACPI_PCI_ID *PciId, + UINT32 Register, + UINT64 Value, + UINT32 Width) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsReadPort + * + * PARAMETERS: Address - Address of I/O port/register to read + * Value - Where value is placed + * Width - Number of bits + * + * RETURN: Value read from port + * + * DESCRIPTION: Read data from an I/O port or register + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsReadPort ( + ACPI_IO_ADDRESS Address, + UINT32 *Value, + UINT32 Width) +{ + + switch (Width) + { + case 8: + *Value = 0xFF; + break; + + case 16: + *Value = 0xFFFF; + break; + + case 32: + *Value = 0xFFFFFFFF; + break; + + default: + return (AE_BAD_PARAMETER); + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsWritePort + * + * PARAMETERS: Address - Address of I/O port/register to write + * Value - Value to write + * Width - Number of bits + * + * RETURN: None + * + * DESCRIPTION: Write data to an I/O port or register + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsWritePort ( + ACPI_IO_ADDRESS Address, + UINT32 Value, + UINT32 Width) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsReadMemory + * + * PARAMETERS: Address - Physical Memory Address to read + * Value - Where value is placed + * Width - Number of bits + * + * RETURN: Value read from physical memory address + * + * DESCRIPTION: Read data from a physical memory address + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsReadMemory ( + ACPI_PHYSICAL_ADDRESS Address, + UINT32 *Value, + UINT32 Width) +{ + + switch (Width) + { + case 8: + case 16: + case 32: + *Value = 0; + break; + + default: + return (AE_BAD_PARAMETER); + } + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsWriteMemory + * + * PARAMETERS: Address - Physical Memory Address to write + * Value - Value to write + * Width - Number of bits + * + * RETURN: None + * + * DESCRIPTION: Write data to a physical memory address + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsWriteMemory ( + ACPI_PHYSICAL_ADDRESS Address, + UINT32 Value, + UINT32 Width) +{ + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsReadable + * + * PARAMETERS: Pointer - Area to be verified + * Length - Size of area + * + * RETURN: TRUE if readable for entire length + * + * DESCRIPTION: Verify that a pointer is valid for reading + * + *****************************************************************************/ + +BOOLEAN +AcpiOsReadable ( + void *Pointer, + ACPI_SIZE Length) +{ + + return (TRUE); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsWritable + * + * PARAMETERS: Pointer - Area to be verified + * Length - Size of area + * + * RETURN: TRUE if writable for entire length + * + * DESCRIPTION: Verify that a pointer is valid for writing + * + *****************************************************************************/ + +BOOLEAN +AcpiOsWritable ( + void *Pointer, + ACPI_SIZE Length) +{ + + return (TRUE); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsSignal + * + * PARAMETERS: Function - ACPI CA signal function code + * Info - Pointer to function-dependent structure + * + * RETURN: Status + * + * DESCRIPTION: Miscellaneous functions. Example implementation only. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsSignal ( + UINT32 Function, + void *Info) +{ + + switch (Function) + { + case ACPI_SIGNAL_FATAL: + break; + + case ACPI_SIGNAL_BREAKPOINT: + break; + + default: + break; + } + + return (AE_OK); +} + +/* Optional multi-thread support */ + +#ifndef ACPI_SINGLE_THREADED +/****************************************************************************** + * + * FUNCTION: AcpiOsGetThreadId + * + * PARAMETERS: None + * + * RETURN: Id of the running thread + * + * DESCRIPTION: Get the ID of the current (running) thread + * + *****************************************************************************/ + +ACPI_THREAD_ID +AcpiOsGetThreadId ( + void) +{ + pthread_t thread; + + + thread = pthread_self(); + return (ACPI_CAST_PTHREAD_T (thread)); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiOsExecute + * + * PARAMETERS: Type - Type of execution + * Function - Address of the function to execute + * Context - Passed as a parameter to the function + * + * RETURN: Status. + * + * DESCRIPTION: Execute a new thread + * + *****************************************************************************/ + +ACPI_STATUS +AcpiOsExecute ( + ACPI_EXECUTE_TYPE Type, + ACPI_OSD_EXEC_CALLBACK Function, + void *Context) +{ + pthread_t thread; + int ret; + + + ret = pthread_create (&thread, NULL, (PTHREAD_CALLBACK) Function, Context); + if (ret) + { + AcpiOsPrintf("Create thread failed"); + } + return (0); +} + +#endif /* ACPI_SINGLE_THREADED */ --- sys/contrib/dev/acpica/osunixxf.c 2011-06-01 17:16:56.000000000 -0400 +++ sys/contrib/dev/acpica/osunixxf.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,1208 +0,0 @@ -/****************************************************************************** - * - * Module Name: osunixxf - UNIX OSL interfaces - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2011, Intel Corp. - * All rights reserved. - * - * 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. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * 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 MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. - */ - - -/* - * These interfaces are required in order to compile the ASL compiler and the - * various ACPICA tools under Linux or other Unix-like system. - * - * Note: Use #define __APPLE__ for OS X generation. - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define _COMPONENT ACPI_OS_SERVICES - ACPI_MODULE_NAME ("osunixxf") - - -extern FILE *AcpiGbl_DebugFile; -FILE *AcpiGbl_OutputFile; - - -/* Upcalls to AcpiExec */ - -ACPI_PHYSICAL_ADDRESS -AeLocalGetRootPointer ( - void); - -void -AeTableOverride ( - ACPI_TABLE_HEADER *ExistingTable, - ACPI_TABLE_HEADER **NewTable); - -typedef void* (*PTHREAD_CALLBACK) (void *); - -/* Apple-specific */ - -#ifdef __APPLE__ -#define sem_destroy sem_close -#endif - - -/****************************************************************************** - * - * FUNCTION: AcpiOsInitialize, AcpiOsTerminate - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Init and terminate. Nothing to do. - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsInitialize ( - void) -{ - - AcpiGbl_OutputFile = stdout; - return (AE_OK); -} - - -ACPI_STATUS -AcpiOsTerminate ( - void) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsGetRootPointer - * - * PARAMETERS: None - * - * RETURN: RSDP physical address - * - * DESCRIPTION: Gets the ACPI root pointer (RSDP) - * - *****************************************************************************/ - -ACPI_PHYSICAL_ADDRESS -AcpiOsGetRootPointer ( - void) -{ - - return (AeLocalGetRootPointer ()); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsPredefinedOverride - * - * PARAMETERS: InitVal - Initial value of the predefined object - * NewVal - The new value for the object - * - * RETURN: Status, pointer to value. Null pointer returned if not - * overriding. - * - * DESCRIPTION: Allow the OS to override predefined names - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsPredefinedOverride ( - const ACPI_PREDEFINED_NAMES *InitVal, - ACPI_STRING *NewVal) -{ - - if (!InitVal || !NewVal) - { - return (AE_BAD_PARAMETER); - } - - *NewVal = NULL; - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsTableOverride - * - * PARAMETERS: ExistingTable - Header of current table (probably - * firmware) - * NewTable - Where an entire new table is returned. - * - * RETURN: Status, pointer to new table. Null pointer returned if no - * table is available to override - * - * DESCRIPTION: Return a different version of a table if one is available - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsTableOverride ( - ACPI_TABLE_HEADER *ExistingTable, - ACPI_TABLE_HEADER **NewTable) -{ - - if (!ExistingTable || !NewTable) - { - return (AE_BAD_PARAMETER); - } - - *NewTable = NULL; - -#ifdef ACPI_EXEC_APP - - AeTableOverride (ExistingTable, NewTable); - return (AE_OK); -#else - - return (AE_NO_ACPI_TABLES); -#endif -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsRedirectOutput - * - * PARAMETERS: Destination - An open file handle/pointer - * - * RETURN: None - * - * DESCRIPTION: Causes redirect of AcpiOsPrintf and AcpiOsVprintf - * - *****************************************************************************/ - -void -AcpiOsRedirectOutput ( - void *Destination) -{ - - AcpiGbl_OutputFile = Destination; -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsPrintf - * - * PARAMETERS: fmt, ... - Standard printf format - * - * RETURN: None - * - * DESCRIPTION: Formatted output - * - *****************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiOsPrintf ( - const char *Fmt, - ...) -{ - va_list Args; - - - va_start (Args, Fmt); - AcpiOsVprintf (Fmt, Args); - va_end (Args); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsVprintf - * - * PARAMETERS: fmt - Standard printf format - * args - Argument list - * - * RETURN: None - * - * DESCRIPTION: Formatted output with argument list pointer - * - *****************************************************************************/ - -void -AcpiOsVprintf ( - const char *Fmt, - va_list Args) -{ - INT32 Count = 0; - UINT8 Flags; - - - Flags = AcpiGbl_DbOutputFlags; - if (Flags & ACPI_DB_REDIRECTABLE_OUTPUT) - { - /* Output is directable to either a file (if open) or the console */ - - if (AcpiGbl_DebugFile) - { - /* Output file is open, send the output there */ - - Count = vfprintf (AcpiGbl_DebugFile, Fmt, Args); - } - else - { - /* No redirection, send output to console (once only!) */ - - Flags |= ACPI_DB_CONSOLE_OUTPUT; - } - } - - if (Flags & ACPI_DB_CONSOLE_OUTPUT) - { - Count = vfprintf (AcpiGbl_OutputFile, Fmt, Args); - } -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsGetLine - * - * PARAMETERS: Buffer - Where to return the command line - * BufferLength - Maximum length of Buffer - * BytesRead - Where the actual byte count is returned - * - * RETURN: Status and actual bytes read - * - * DESCRIPTION: Formatted input with argument list pointer - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsGetLine ( - char *Buffer, - UINT32 BufferLength, - UINT32 *BytesRead) -{ - UINT8 Temp; - UINT32 i; - - - for (i = 0; ; i++) - { - if (i >= BufferLength) - { - return (AE_BUFFER_OVERFLOW); - } - - scanf ("%1c", &Temp); - if (!Temp || Temp == '\n') - { - break; - } - - Buffer [i] = Temp; - } - - /* Null terminate the buffer */ - - Buffer [i] = 0; - - /* Return the number of bytes in the string */ - - if (BytesRead) - { - *BytesRead = i; - } - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsMapMemory - * - * PARAMETERS: where - Physical address of memory to be mapped - * length - How much memory to map - * - * RETURN: Pointer to mapped memory. Null on error. - * - * DESCRIPTION: Map physical memory into caller's address space - * - *****************************************************************************/ - -void * -AcpiOsMapMemory ( - ACPI_PHYSICAL_ADDRESS where, - ACPI_SIZE length) -{ - - return (ACPI_TO_POINTER ((ACPI_SIZE) where)); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsUnmapMemory - * - * PARAMETERS: where - Logical address of memory to be unmapped - * length - How much memory to unmap - * - * RETURN: None. - * - * DESCRIPTION: Delete a previously created mapping. Where and Length must - * correspond to a previous mapping exactly. - * - *****************************************************************************/ - -void -AcpiOsUnmapMemory ( - void *where, - ACPI_SIZE length) -{ - - return; -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsAllocate - * - * PARAMETERS: Size - Amount to allocate, in bytes - * - * RETURN: Pointer to the new allocation. Null on error. - * - * DESCRIPTION: Allocate memory. Algorithm is dependent on the OS. - * - *****************************************************************************/ - -void * -AcpiOsAllocate ( - ACPI_SIZE size) -{ - void *Mem; - - - Mem = (void *) malloc ((size_t) size); - return (Mem); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsFree - * - * PARAMETERS: mem - Pointer to previously allocated memory - * - * RETURN: None. - * - * DESCRIPTION: Free memory allocated via AcpiOsAllocate - * - *****************************************************************************/ - -void -AcpiOsFree ( - void *mem) -{ - - free (mem); -} - - -#ifdef ACPI_SINGLE_THREADED -/****************************************************************************** - * - * FUNCTION: Semaphore stub functions - * - * DESCRIPTION: Stub functions used for single-thread applications that do - * not require semaphore synchronization. Full implementations - * of these functions appear after the stubs. - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsCreateSemaphore ( - UINT32 MaxUnits, - UINT32 InitialUnits, - ACPI_HANDLE *OutHandle) -{ - *OutHandle = (ACPI_HANDLE) 1; - return (AE_OK); -} - -ACPI_STATUS -AcpiOsDeleteSemaphore ( - ACPI_HANDLE Handle) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiOsWaitSemaphore ( - ACPI_HANDLE Handle, - UINT32 Units, - UINT16 Timeout) -{ - return (AE_OK); -} - -ACPI_STATUS -AcpiOsSignalSemaphore ( - ACPI_HANDLE Handle, - UINT32 Units) -{ - return (AE_OK); -} - -#else -/****************************************************************************** - * - * FUNCTION: AcpiOsCreateSemaphore - * - * PARAMETERS: InitialUnits - Units to be assigned to the new semaphore - * OutHandle - Where a handle will be returned - * - * RETURN: Status - * - * DESCRIPTION: Create an OS semaphore - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsCreateSemaphore ( - UINT32 MaxUnits, - UINT32 InitialUnits, - ACPI_HANDLE *OutHandle) -{ - sem_t *Sem; - - - if (!OutHandle) - { - return (AE_BAD_PARAMETER); - } - -#ifdef __APPLE__ - { - char *SemaphoreName = tmpnam (NULL); - - Sem = sem_open (SemaphoreName, O_EXCL|O_CREAT, 0755, InitialUnits); - if (!Sem) - { - return (AE_NO_MEMORY); - } - sem_unlink (SemaphoreName); /* This just deletes the name */ - } - -#else - Sem = AcpiOsAllocate (sizeof (sem_t)); - if (!Sem) - { - return (AE_NO_MEMORY); - } - - if (sem_init (Sem, 0, InitialUnits) == -1) - { - AcpiOsFree (Sem); - return (AE_BAD_PARAMETER); - } -#endif - - *OutHandle = (ACPI_HANDLE) Sem; - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsDeleteSemaphore - * - * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore - * - * RETURN: Status - * - * DESCRIPTION: Delete an OS semaphore - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsDeleteSemaphore ( - ACPI_HANDLE Handle) -{ - sem_t *Sem = (sem_t *) Handle; - - - if (!Sem) - { - return (AE_BAD_PARAMETER); - } - - if (sem_destroy (Sem) == -1) - { - return (AE_BAD_PARAMETER); - } - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsWaitSemaphore - * - * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore - * Units - How many units to wait for - * Timeout - How long to wait - * - * RETURN: Status - * - * DESCRIPTION: Wait for units - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsWaitSemaphore ( - ACPI_HANDLE Handle, - UINT32 Units, - UINT16 Timeout) -{ - ACPI_STATUS Status = AE_OK; - sem_t *Sem = (sem_t *) Handle; - struct timespec T; - - - if (!Sem) - { - return (AE_BAD_PARAMETER); - } - - switch (Timeout) - { - /* - * No Wait: - * -------- - * A zero timeout value indicates that we shouldn't wait - just - * acquire the semaphore if available otherwise return AE_TIME - * (a.k.a. 'would block'). - */ - case 0: - - if (sem_trywait(Sem) == -1) - { - Status = (AE_TIME); - } - break; - - /* Wait Indefinitely */ - - case ACPI_WAIT_FOREVER: - - if (sem_wait (Sem)) - { - Status = (AE_TIME); - } - break; - - /* Wait with Timeout */ - - default: - - T.tv_sec = Timeout / 1000; - T.tv_nsec = (Timeout - (T.tv_sec * 1000)) * 1000000; - -#ifdef ACPI_USE_ALTERNATE_TIMEOUT - /* - * Alternate timeout mechanism for environments where - * sem_timedwait is not available or does not work properly. - */ - while (Timeout) - { - if (sem_trywait (Sem) == 0) - { - /* Got the semaphore */ - return (AE_OK); - } - usleep (1000); /* one millisecond */ - Timeout--; - } - Status = (AE_TIME); -#else - - if (sem_timedwait (Sem, &T)) - { - Status = (AE_TIME); - } -#endif - - break; - } - - return (Status); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsSignalSemaphore - * - * PARAMETERS: Handle - Handle returned by AcpiOsCreateSemaphore - * Units - Number of units to send - * - * RETURN: Status - * - * DESCRIPTION: Send units - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsSignalSemaphore ( - ACPI_HANDLE Handle, - UINT32 Units) -{ - sem_t *Sem = (sem_t *)Handle; - - - if (!Sem) - { - return (AE_BAD_PARAMETER); - } - - if (sem_post (Sem) == -1) - { - return (AE_LIMIT); - } - - return (AE_OK); -} - -#endif /* ACPI_SINGLE_THREADED */ - - -/****************************************************************************** - * - * FUNCTION: Spinlock interfaces - * - * DESCRIPTION: Map these interfaces to semaphore interfaces - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsCreateLock ( - ACPI_SPINLOCK *OutHandle) -{ - - return (AcpiOsCreateSemaphore (1, 1, OutHandle)); -} - - -void -AcpiOsDeleteLock ( - ACPI_SPINLOCK Handle) -{ - AcpiOsDeleteSemaphore (Handle); -} - - -ACPI_CPU_FLAGS -AcpiOsAcquireLock ( - ACPI_HANDLE Handle) -{ - AcpiOsWaitSemaphore (Handle, 1, 0xFFFF); - return (0); -} - - -void -AcpiOsReleaseLock ( - ACPI_SPINLOCK Handle, - ACPI_CPU_FLAGS Flags) -{ - AcpiOsSignalSemaphore (Handle, 1); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsInstallInterruptHandler - * - * PARAMETERS: InterruptNumber - Level handler should respond to. - * Isr - Address of the ACPI interrupt handler - * ExceptPtr - Where status is returned - * - * RETURN: Handle to the newly installed handler. - * - * DESCRIPTION: Install an interrupt handler. Used to install the ACPI - * OS-independent handler. - * - *****************************************************************************/ - -UINT32 -AcpiOsInstallInterruptHandler ( - UINT32 InterruptNumber, - ACPI_OSD_HANDLER ServiceRoutine, - void *Context) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsRemoveInterruptHandler - * - * PARAMETERS: Handle - Returned when handler was installed - * - * RETURN: Status - * - * DESCRIPTION: Uninstalls an interrupt handler. - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsRemoveInterruptHandler ( - UINT32 InterruptNumber, - ACPI_OSD_HANDLER ServiceRoutine) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsExecute - * - * PARAMETERS: Type - Type of execution - * Function - Address of the function to execute - * Context - Passed as a parameter to the function - * - * RETURN: Status. - * - * DESCRIPTION: Execute a new thread - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsExecute ( - ACPI_EXECUTE_TYPE Type, - ACPI_OSD_EXEC_CALLBACK Function, - void *Context) -{ - pthread_t thread; - int ret; - - - ret = pthread_create (&thread, NULL, (PTHREAD_CALLBACK) Function, Context); - if (ret) - { - AcpiOsPrintf("Create thread failed"); - } - return (0); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsStall - * - * PARAMETERS: microseconds - Time to sleep - * - * RETURN: Blocks until sleep is completed. - * - * DESCRIPTION: Sleep at microsecond granularity - * - *****************************************************************************/ - -void -AcpiOsStall ( - UINT32 microseconds) -{ - - if (microseconds) - { - usleep (microseconds); - } -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsSleep - * - * PARAMETERS: milliseconds - Time to sleep - * - * RETURN: Blocks until sleep is completed. - * - * DESCRIPTION: Sleep at millisecond granularity - * - *****************************************************************************/ - -void -AcpiOsSleep ( - UINT64 milliseconds) -{ - - sleep (milliseconds / 1000); /* Sleep for whole seconds */ - - /* - * Arg to usleep() must be less than 1,000,000 (1 second) - */ - usleep ((milliseconds % 1000) * 1000); /* Sleep for remaining usecs */ -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsGetTimer - * - * PARAMETERS: None - * - * RETURN: Current time in 100 nanosecond units - * - * DESCRIPTION: Get the current system time - * - *****************************************************************************/ - -UINT64 -AcpiOsGetTimer ( - void) -{ - struct timeval time; - - - gettimeofday (&time, NULL); - - /* Seconds * 10^7 = 100ns(10^-7), Microseconds(10^-6) * 10^1 = 100ns */ - - return (((UINT64) time.tv_sec * 10000000) + ((UINT64) time.tv_usec * 10)); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsReadPciConfiguration - * - * PARAMETERS: PciId - Seg/Bus/Dev - * Register - Device Register - * Value - Buffer where value is placed - * Width - Number of bits - * - * RETURN: Status - * - * DESCRIPTION: Read data from PCI configuration space - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsReadPciConfiguration ( - ACPI_PCI_ID *PciId, - UINT32 Register, - UINT64 *Value, - UINT32 Width) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsWritePciConfiguration - * - * PARAMETERS: PciId - Seg/Bus/Dev - * Register - Device Register - * Value - Value to be written - * Width - Number of bits - * - * RETURN: Status. - * - * DESCRIPTION: Write data to PCI configuration space - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsWritePciConfiguration ( - ACPI_PCI_ID *PciId, - UINT32 Register, - UINT64 Value, - UINT32 Width) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsReadPort - * - * PARAMETERS: Address - Address of I/O port/register to read - * Value - Where value is placed - * Width - Number of bits - * - * RETURN: Value read from port - * - * DESCRIPTION: Read data from an I/O port or register - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsReadPort ( - ACPI_IO_ADDRESS Address, - UINT32 *Value, - UINT32 Width) -{ - - switch (Width) - { - case 8: - *Value = 0xFF; - break; - - case 16: - *Value = 0xFFFF; - break; - - case 32: - *Value = 0xFFFFFFFF; - break; - - default: - return (AE_BAD_PARAMETER); - } - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsWritePort - * - * PARAMETERS: Address - Address of I/O port/register to write - * Value - Value to write - * Width - Number of bits - * - * RETURN: None - * - * DESCRIPTION: Write data to an I/O port or register - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsWritePort ( - ACPI_IO_ADDRESS Address, - UINT32 Value, - UINT32 Width) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsReadMemory - * - * PARAMETERS: Address - Physical Memory Address to read - * Value - Where value is placed - * Width - Number of bits - * - * RETURN: Value read from physical memory address - * - * DESCRIPTION: Read data from a physical memory address - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsReadMemory ( - ACPI_PHYSICAL_ADDRESS Address, - UINT32 *Value, - UINT32 Width) -{ - - switch (Width) - { - case 8: - case 16: - case 32: - *Value = 0; - break; - - default: - return (AE_BAD_PARAMETER); - } - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsWriteMemory - * - * PARAMETERS: Address - Physical Memory Address to write - * Value - Value to write - * Width - Number of bits - * - * RETURN: None - * - * DESCRIPTION: Write data to a physical memory address - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsWriteMemory ( - ACPI_PHYSICAL_ADDRESS Address, - UINT32 Value, - UINT32 Width) -{ - - return (AE_OK); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsReadable - * - * PARAMETERS: Pointer - Area to be verified - * Length - Size of area - * - * RETURN: TRUE if readable for entire length - * - * DESCRIPTION: Verify that a pointer is valid for reading - * - *****************************************************************************/ - -BOOLEAN -AcpiOsReadable ( - void *Pointer, - ACPI_SIZE Length) -{ - - return (TRUE); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsWritable - * - * PARAMETERS: Pointer - Area to be verified - * Length - Size of area - * - * RETURN: TRUE if writable for entire length - * - * DESCRIPTION: Verify that a pointer is valid for writing - * - *****************************************************************************/ - -BOOLEAN -AcpiOsWritable ( - void *Pointer, - ACPI_SIZE Length) -{ - - return (TRUE); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsGetThreadId - * - * PARAMETERS: None - * - * RETURN: Id of the running thread - * - * DESCRIPTION: Get the ID of the current (running) thread - * - *****************************************************************************/ - -ACPI_THREAD_ID -AcpiOsGetThreadId ( - void) -{ - - return (ACPI_CAST_PTHREAD_T (pthread_self())); -} - - -/****************************************************************************** - * - * FUNCTION: AcpiOsSignal - * - * PARAMETERS: Function - ACPI CA signal function code - * Info - Pointer to function-dependent structure - * - * RETURN: Status - * - * DESCRIPTION: Miscellaneous functions. Example implementation only. - * - *****************************************************************************/ - -ACPI_STATUS -AcpiOsSignal ( - UINT32 Function, - void *Info) -{ - - switch (Function) - { - case ACPI_SIGNAL_FATAL: - break; - - case ACPI_SIGNAL_BREAKPOINT: - break; - - default: - break; - } - - return (AE_OK); -} --- sys/contrib/dev/acpica/parser/psargs.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/parser/psargs.c 2011-11-23 13:29:30.000000000 -0500 @@ -531,37 +531,57 @@ AcpiPsGetNextField ( ACPI_PARSE_STATE *ParserState) { - UINT32 AmlOffset = (UINT32) - ACPI_PTR_DIFF (ParserState->Aml, - ParserState->AmlStart); + UINT32 AmlOffset; ACPI_PARSE_OBJECT *Field; + ACPI_PARSE_OBJECT *Arg = NULL; UINT16 Opcode; UINT32 Name; + UINT8 AccessType; + UINT8 AccessAttribute; + UINT8 AccessLength; + UINT32 PkgLength; + UINT8 *PkgEnd; + UINT32 BufferLength; ACPI_FUNCTION_TRACE (PsGetNextField); + AmlOffset = (UINT32) ACPI_PTR_DIFF ( + ParserState->Aml, ParserState->AmlStart); + /* Determine field type */ switch (ACPI_GET8 (ParserState->Aml)) { - default: + case AML_FIELD_OFFSET_OP: - Opcode = AML_INT_NAMEDFIELD_OP; + Opcode = AML_INT_RESERVEDFIELD_OP; + ParserState->Aml++; break; - case 0x00: + case AML_FIELD_ACCESS_OP: - Opcode = AML_INT_RESERVEDFIELD_OP; + Opcode = AML_INT_ACCESSFIELD_OP; ParserState->Aml++; break; - case 0x01: + case AML_FIELD_CONNECTION_OP: - Opcode = AML_INT_ACCESSFIELD_OP; + Opcode = AML_INT_CONNECTION_OP; + ParserState->Aml++; + break; + + case AML_FIELD_EXT_ACCESS_OP: + + Opcode = AML_INT_EXTACCESSFIELD_OP; ParserState->Aml++; break; + + default: + + Opcode = AML_INT_NAMEDFIELD_OP; + break; } /* Allocate a new field op */ @@ -601,17 +621,116 @@ case AML_INT_ACCESSFIELD_OP: + case AML_INT_EXTACCESSFIELD_OP: /* * Get AccessType and AccessAttrib and merge into the field Op - * AccessType is first operand, AccessAttribute is second + * AccessType is first operand, AccessAttribute is second. stuff + * these bytes into the node integer value for convenience. */ - Field->Common.Value.Integer = (((UINT32) ACPI_GET8 (ParserState->Aml) << 8)); + + /* Get the two bytes (Type/Attribute) */ + + AccessType = ACPI_GET8 (ParserState->Aml); ParserState->Aml++; - Field->Common.Value.Integer |= ACPI_GET8 (ParserState->Aml); + AccessAttribute = ACPI_GET8 (ParserState->Aml); ParserState->Aml++; + + Field->Common.Value.Integer = (UINT8) AccessType; + Field->Common.Value.Integer |= (UINT16) (AccessAttribute << 8); + + /* This opcode has a third byte, AccessLength */ + + if (Opcode == AML_INT_EXTACCESSFIELD_OP) + { + AccessLength = ACPI_GET8 (ParserState->Aml); + ParserState->Aml++; + + Field->Common.Value.Integer |= (UINT32) (AccessLength << 16); + } break; + + case AML_INT_CONNECTION_OP: + + /* + * Argument for Connection operator can be either a Buffer + * (resource descriptor), or a NameString. + */ + if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP) + { + ParserState->Aml++; + + PkgEnd = ParserState->Aml; + PkgLength = AcpiPsGetNextPackageLength (ParserState); + PkgEnd += PkgLength; + + if (ParserState->Aml < PkgEnd) + { + /* Non-empty list */ + + Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP); + if (!Arg) + { + return_PTR (NULL); + } + + /* Get the actual buffer length argument */ + + Opcode = ACPI_GET8 (ParserState->Aml); + ParserState->Aml++; + + switch (Opcode) + { + case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ + BufferLength = ACPI_GET8 (ParserState->Aml); + ParserState->Aml += 1; + break; + + case AML_WORD_OP: /* AML_WORDDATA_ARG */ + BufferLength = ACPI_GET16 (ParserState->Aml); + ParserState->Aml += 2; + break; + + case AML_DWORD_OP: /* AML_DWORDATA_ARG */ + BufferLength = ACPI_GET32 (ParserState->Aml); + ParserState->Aml += 4; + break; + + default: + BufferLength = 0; + break; + } + + /* Fill in bytelist data */ + + Arg->Named.Value.Size = BufferLength; + Arg->Named.Data = ParserState->Aml; + } + + /* Skip to End of byte data */ + + ParserState->Aml = PkgEnd; + } + else + { + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP); + if (!Arg) + { + return_PTR (NULL); + } + + /* Get the Namestring argument */ + + Arg->Common.Value.Name = AcpiPsGetNextNamestring (ParserState); + } + + /* Link the buffer/namestring to parent (CONNECTION_OP) */ + + AcpiPsAppendArg (Field, Arg); + break; + + default: /* Opcode was set in previous switch */ --- sys/contrib/dev/acpica/parser/psopcode.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/parser/psopcode.c 2011-11-23 13:29:30.000000000 -0500 @@ -328,12 +328,17 @@ /* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT), /* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), /* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), -/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), +/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), /* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE), /* ACPI 3.0 opcodes */ -/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R) +/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R), + +/* ACPI 5.0 opcodes */ + +/* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0) /*! [End] no source code translation !*/ }; @@ -353,7 +358,7 @@ /* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, /* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D, -/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, /* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, /* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, --- sys/contrib/dev/acpica/parser/pstree.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/parser/pstree.c 2011-11-23 13:29:30.000000000 -0500 @@ -85,7 +85,12 @@ ACPI_FUNCTION_ENTRY (); - +/* + if (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP) + { + return (Op->Common.Value.Arg); + } +*/ /* Get the info structure for this opcode */ OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); --- sys/contrib/dev/acpica/resources/rscalc.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rscalc.c 2011-11-23 13:29:33.000000000 -0500 @@ -345,6 +345,26 @@ break; + case ACPI_RESOURCE_TYPE_GPIO: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + (Resource->Data.Gpio.PinTableLength * 2) + + Resource->Data.Gpio.ResourceSource.StringLength + + Resource->Data.Gpio.VendorLength); + + break; + + + case ACPI_RESOURCE_TYPE_SERIAL_BUS: + + TotalSize = AcpiGbl_AmlResourceSerialBusSizes [Resource->Data.CommonSerialBus.Type]; + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + Resource->Data.I2cSerialBus.ResourceSource.StringLength + + Resource->Data.I2cSerialBus.VendorLength); + + break; + + default: break; } @@ -395,12 +415,13 @@ UINT32 ExtraStructBytes; UINT8 ResourceIndex; UINT8 MinimumAmlResourceLength; + AML_RESOURCE *AmlResource; ACPI_FUNCTION_TRACE (RsGetListLength); - *SizeNeeded = 0; + *SizeNeeded = ACPI_RS_SIZE_MIN; /* Minimum size is one EndTag */ EndAml = AmlBuffer + AmlBufferLength; /* Walk the list of AML resource descriptors */ @@ -412,9 +433,15 @@ Status = AcpiUtValidateResource (AmlBuffer, &ResourceIndex); if (ACPI_FAILURE (Status)) { + /* + * Exit on failure. Cannot continue because the descriptor length + * may be bogus also. + */ return_ACPI_STATUS (Status); } + AmlResource = (void *) AmlBuffer; + /* Get the resource length and base (minimum) AML size */ ResourceLength = AcpiUtGetResourceLength (AmlBuffer); @@ -460,10 +487,8 @@ case ACPI_RESOURCE_NAME_END_TAG: /* - * End Tag: - * This is the normal exit, add size of EndTag + * End Tag: This is the normal exit */ - *SizeNeeded += ACPI_RS_SIZE_MIN; return_ACPI_STATUS (AE_OK); @@ -494,6 +519,30 @@ ResourceLength - ExtraStructBytes, MinimumAmlResourceLength); break; + case ACPI_RESOURCE_NAME_GPIO: + + /* Vendor data is optional */ + + if (AmlResource->Gpio.VendorLength) + { + ExtraStructBytes += AmlResource->Gpio.VendorOffset - + AmlResource->Gpio.PinTableOffset + AmlResource->Gpio.VendorLength; + } + else + { + ExtraStructBytes += AmlResource->LargeHeader.ResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER) - + AmlResource->Gpio.PinTableOffset; + } + break; + + case ACPI_RESOURCE_NAME_SERIAL_BUS: + + MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[ + AmlResource->CommonSerialBus.Type]; + ExtraStructBytes += AmlResource->CommonSerialBus.ResourceLength - + MinimumAmlResourceLength; + break; default: break; @@ -505,8 +554,16 @@ * Important: Round the size up for the appropriate alignment. This * is a requirement on IA64. */ - BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] + + if (AcpiUtGetResourceType (AmlBuffer) == ACPI_RESOURCE_NAME_SERIAL_BUS) + { + BufferSize = AcpiGbl_ResourceStructSerialBusSizes[ + AmlResource->CommonSerialBus.Type] + ExtraStructBytes; + } + else + { + BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] + ExtraStructBytes; + } BufferSize = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (BufferSize); *SizeNeeded += BufferSize; --- sys/contrib/dev/acpica/resources/rscreate.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rscreate.c 2011-11-23 13:29:33.000000000 -0500 @@ -54,6 +54,79 @@ /******************************************************************************* * + * FUNCTION: AcpiBufferToResource + * + * PARAMETERS: AmlBuffer - Pointer to the resource byte stream + * AmlBufferLength - Length of the AmlBuffer + * ResourcePtr - Where the converted resource is returned + * + * RETURN: Status + * + * DESCRIPTION: Convert a raw AML buffer to a resource list + * + ******************************************************************************/ + +ACPI_STATUS +AcpiBufferToResource ( + UINT8 *AmlBuffer, + UINT16 AmlBufferLength, + ACPI_RESOURCE **ResourcePtr) +{ + ACPI_STATUS Status; + ACPI_SIZE ListSizeNeeded; + void *Resource; + void *CurrentResourcePtr; + + /* + * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag + * is not required here. + */ + + /* Get the required length for the converted resource */ + + Status = AcpiRsGetListLength (AmlBuffer, AmlBufferLength, + &ListSizeNeeded); + if (Status == AE_AML_NO_RESOURCE_END_TAG) + { + Status = AE_OK; + } + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Allocate a buffer for the converted resource */ + + Resource = ACPI_ALLOCATE_ZEROED (ListSizeNeeded); + CurrentResourcePtr = Resource; + if (!Resource) + { + return (AE_NO_MEMORY); + } + + /* Perform the AML-to-Resource conversion */ + + Status = AcpiUtWalkAmlResources (AmlBuffer, AmlBufferLength, + AcpiRsConvertAmlToResources, &CurrentResourcePtr); + if (Status == AE_AML_NO_RESOURCE_END_TAG) + { + Status = AE_OK; + } + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (Resource); + } + else + { + *ResourcePtr = Resource; + } + + return (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiRsCreateResourceList * * PARAMETERS: AmlBuffer - Pointer to the resource byte stream --- sys/contrib/dev/acpica/resources/rsdump.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsdump.c 2011-11-23 13:29:33.000000000 -0500 @@ -91,6 +91,11 @@ UINT8 *Data); static void +AcpiRsDumpWordList ( + UINT16 Length, + UINT16 *Data); + +static void AcpiRsDumpDwordList ( UINT8 Length, UINT32 *Data); @@ -289,6 +294,87 @@ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (GenericReg.Address), "Address", NULL} }; +ACPI_RSDUMP_INFO AcpiRsDumpGpio[16] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGpio), "GPIO", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.ConnectionType), "ConnectionType", AcpiGbl_CtDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Gpio.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.PinConfig), "PinConfig", AcpiGbl_PpcDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.Sharable), "Sharable", AcpiGbl_ShrDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.IoRestriction), "IoRestriction", AcpiGbl_IorDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Gpio.Triggering), "Triggering", AcpiGbl_HeDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.Polarity), "Polarity", AcpiGbl_LlDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.DriveStrength), "DriveStrength", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.DebounceTimeout), "DebounceTimeout", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Gpio.ResourceSource), "ResourceSource", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.PinTableLength), "PinTableLength", NULL}, + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (Gpio.PinTable), "PinTable", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (Gpio.VendorData), "VendorData", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[4] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedDma), "FixedDma", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedDma.RequestLines), "RequestLines", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedDma.Channels), "Channels", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedDma.Width), "TransferWidth", AcpiGbl_DtsDecode}, +}; + +#define ACPI_RS_DUMP_COMMON_SERIAL_BUS \ + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.RevisionId), "RevisionId", NULL}, \ + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.Type), "Type", AcpiGbl_SbtDecode}, \ + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, \ + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.SlaveMode), "SlaveMode", AcpiGbl_SmDecode}, \ + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.TypeRevisionId), "TypeRevisionId", NULL}, \ + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.TypeDataLength), "TypeDataLength", NULL}, \ + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (CommonSerialBus.ResourceSource), "ResourceSource", NULL}, \ + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.VendorLength), "VendorLength", NULL}, \ + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (CommonSerialBus.VendorData), "VendorData", NULL}, + +ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[10] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpCommonSerialBus), "Common Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS +}; + +ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[13] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpI2cSerialBus), "I2C Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (I2cSerialBus.AccessMode), "AccessMode", AcpiGbl_AmDecode}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (I2cSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (I2cSerialBus.SlaveAddress), "SlaveAddress", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[17] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpSpiSerialBus), "Spi Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (SpiSerialBus.WireMode), "WireMode", AcpiGbl_WmDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (SpiSerialBus.DevicePolarity), "DevicePolarity", AcpiGbl_DpDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.DataBitLength), "DataBitLength", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.ClockPhase), "ClockPhase", AcpiGbl_CphDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.ClockPolarity), "ClockPolarity", AcpiGbl_CpoDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (SpiSerialBus.DeviceSelection), "DeviceSelection", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (SpiSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[19] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpUartSerialBus), "Uart Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.FlowControl), "FlowControl", AcpiGbl_FcDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.StopBits), "StopBits", AcpiGbl_SbDecode}, + {ACPI_RSD_3BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.DataBits), "DataBits", AcpiGbl_BpbDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.Endian), "Endian", AcpiGbl_EdDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (UartSerialBus.Parity), "Parity", AcpiGbl_PtDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (UartSerialBus.LinesEnabled), "LinesEnabled", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (UartSerialBus.RxFifoSize), "RxFifoSize", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (UartSerialBus.TxFifoSize), "TxFifoSize", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (UartSerialBus.DefaultBaudRate), "ConnectionSpeed", NULL}, +}; /* * Tables used for common address descriptor flag fields @@ -391,7 +477,15 @@ /* Data items, 8/16/32/64 bit */ case ACPI_RSD_UINT8: - AcpiRsOutInteger8 (Name, ACPI_GET8 (Target)); + if (Table->Pointer) + { + AcpiRsOutString (Name, ACPI_CAST_PTR (char, + Table->Pointer [*Target])); + } + else + { + AcpiRsOutInteger8 (Name, ACPI_GET8 (Target)); + } break; case ACPI_RSD_UINT16: @@ -418,6 +512,11 @@ Table->Pointer [*Target & 0x03])); break; + case ACPI_RSD_3BITFLAG: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, + Table->Pointer [*Target & 0x07])); + break; + case ACPI_RSD_SHORTLIST: /* * Short byte list (single line output) for DMA and IRQ resources @@ -430,6 +529,19 @@ } break; + case ACPI_RSD_SHORTLISTX: + /* + * Short byte list (single line output) for GPIO vendor data + * Note: The list length is obtained from the previous table entry + */ + if (PreviousTarget) + { + AcpiRsOutTitle (Name); + AcpiRsDumpShortByteList (*PreviousTarget, + *(ACPI_CAST_INDIRECT_PTR (UINT8, Target))); + } + break; + case ACPI_RSD_LONGLIST: /* * Long byte list for Vendor resource data @@ -453,6 +565,18 @@ } break; + case ACPI_RSD_WORDLIST: + /* + * Word list for GPIO Pin Table + * Note: The list length is obtained from the previous table entry + */ + if (PreviousTarget) + { + AcpiRsDumpWordList (*PreviousTarget, + *(ACPI_CAST_INDIRECT_PTR (UINT16, Target))); + } + break; + case ACPI_RSD_ADDRESS: /* * Common flags for all Address resources @@ -613,13 +737,20 @@ /* Dump the resource descriptor */ - AcpiRsDumpDescriptor (&ResourceList->Data, - AcpiGbl_DumpResourceDispatch[Type]); + if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS) + { + AcpiRsDumpDescriptor (&ResourceList->Data, + AcpiGbl_DumpSerialBusDispatch[ResourceList->Data.CommonSerialBus.Type]); + } + else + { + AcpiRsDumpDescriptor (&ResourceList->Data, + AcpiGbl_DumpResourceDispatch[Type]); + } /* Point to the next resource structure */ - ResourceList = ACPI_ADD_PTR (ACPI_RESOURCE, ResourceList, - ResourceList->Length); + ResourceList = ACPI_NEXT_RESOURCE (ResourceList); /* Exit when END_TAG descriptor is reached */ @@ -796,5 +927,20 @@ } } +static void +AcpiRsDumpWordList ( + UINT16 Length, + UINT16 *Data) +{ + UINT16 i; + + + for (i = 0; i < Length; i++) + { + AcpiOsPrintf ("%25s%2.2X : %4.4X\n", + "Word", i, Data[i]); + } +} + #endif --- sys/contrib/dev/acpica/resources/rsinfo.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsinfo.c 2011-11-23 13:29:32.000000000 -0500 @@ -82,7 +82,10 @@ AcpiRsConvertAddress64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */ AcpiRsConvertExtAddress64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ AcpiRsConvertExtIrq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ - AcpiRsConvertGenericReg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + AcpiRsConvertGenericReg, /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + AcpiRsConvertGpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */ + AcpiRsConvertFixedDma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */ + NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */ }; /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ @@ -101,7 +104,7 @@ AcpiRsConvertEndDpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ AcpiRsConvertIo, /* 0x08, ACPI_RESOURCE_NAME_IO */ AcpiRsConvertFixedIo, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */ - NULL, /* 0x0A, Reserved */ + AcpiRsConvertFixedDma, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */ NULL, /* 0x0B, Reserved */ NULL, /* 0x0C, Reserved */ NULL, /* 0x0D, Reserved */ @@ -121,7 +124,20 @@ AcpiRsConvertAddress16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */ AcpiRsConvertExtIrq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */ AcpiRsConvertAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ - AcpiRsConvertExtAddress64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ + AcpiRsConvertExtAddress64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ + AcpiRsConvertGpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ + NULL, /* 0x0D, Reserved */ + NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */ +}; + +/* Subtype table for SerialBus -- I2C, SPI, and UART */ + +ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[] = +{ + NULL, + AcpiRsConvertI2cSerialBus, + AcpiRsConvertSpiSerialBus, + AcpiRsConvertUartSerialBus, }; @@ -148,6 +164,17 @@ AcpiRsDumpExtAddress64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ AcpiRsDumpExtIrq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ AcpiRsDumpGenericReg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + AcpiRsDumpGpio, /* ACPI_RESOURCE_TYPE_GPIO */ + AcpiRsDumpFixedDma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */ + NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ +}; + +ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] = +{ + NULL, + AcpiRsDumpI2cSerialBus, /* AML_RESOURCE_I2C_BUS_TYPE */ + AcpiRsDumpSpiSerialBus, /* AML_RESOURCE_SPI_BUS_TYPE */ + AcpiRsDumpUartSerialBus, /* AML_RESOURCE_UART_BUS_TYPE */ }; #endif @@ -175,7 +202,10 @@ sizeof (AML_RESOURCE_ADDRESS64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */ sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),/*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ sizeof (AML_RESOURCE_EXTENDED_IRQ), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ - sizeof (AML_RESOURCE_GENERIC_REGISTER) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + sizeof (AML_RESOURCE_GENERIC_REGISTER), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + 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 */ }; @@ -193,7 +223,7 @@ ACPI_RS_SIZE_MIN, ACPI_RS_SIZE (ACPI_RESOURCE_IO), ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_IO), - 0, + ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA), 0, 0, 0, @@ -213,6 +243,23 @@ ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS16), ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ), ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64), - ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64) + ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64), + ACPI_RS_SIZE (ACPI_RESOURCE_GPIO), + ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS) +}; + +const UINT8 AcpiGbl_AmlResourceSerialBusSizes[] = +{ + 0, + sizeof (AML_RESOURCE_I2C_SERIALBUS), + sizeof (AML_RESOURCE_SPI_SERIALBUS), + sizeof (AML_RESOURCE_UART_SERIALBUS), }; +const UINT8 AcpiGbl_ResourceStructSerialBusSizes[] = +{ + 0, + ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS), + ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS), + ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS), +}; --- sys/contrib/dev/acpica/resources/rsirq.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsirq.c 2011-11-23 13:29:33.000000000 -0500 @@ -274,3 +274,35 @@ ACPI_RS_OFFSET (Data.Dma.ChannelCount)} }; + +/******************************************************************************* + * + * AcpiRsConvertFixedDma + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[4] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA, + ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedDma)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA, + sizeof (AML_RESOURCE_FIXED_DMA), + 0}, + + /* + * These fields are contiguous in both the source and destination: + * RequestLines + * Channels + */ + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.FixedDma.RequestLines), + AML_OFFSET (FixedDma.RequestLines), + 2}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.FixedDma.Width), + AML_OFFSET (FixedDma.Width), + 1}, + +}; --- sys/contrib/dev/acpica/resources/rslist.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rslist.c 2011-11-23 13:29:33.000000000 -0500 @@ -77,6 +77,8 @@ ACPI_RESOURCE **ResourcePtr = ACPI_CAST_INDIRECT_PTR ( ACPI_RESOURCE, Context); ACPI_RESOURCE *Resource; + AML_RESOURCE *AmlResource; + ACPI_RSCONVERT_INFO *ConversionTable; ACPI_STATUS Status; @@ -94,11 +96,42 @@ "Misaligned resource pointer %p", Resource)); } - /* Convert the AML byte stream resource to a local resource struct */ + /* Get the appropriate conversion info table */ + + AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml); + if (AcpiUtGetResourceType (Aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) + { + if (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE) + { + ConversionTable = NULL; + } + else + { + /* This is an I2C, SPI, or UART SerialBus descriptor */ + + ConversionTable = + AcpiGbl_ConvertResourceSerialBusDispatch[ + AmlResource->CommonSerialBus.Type]; + } + } + else + { + ConversionTable = + AcpiGbl_GetResourceDispatch[ResourceIndex]; + } + + if (!ConversionTable) + { + ACPI_ERROR ((AE_INFO, + "Invalid/unsupported resource descriptor: Type 0x%2.2X", + ResourceIndex)); + return (AE_AML_INVALID_RESOURCE_TYPE); + } + + /* Convert the AML byte stream resource to a local resource struct */ Status = AcpiRsConvertAmlToResource ( - Resource, ACPI_CAST_PTR (AML_RESOURCE, Aml), - AcpiGbl_GetResourceDispatch[ResourceIndex]); + Resource, AmlResource, ConversionTable); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, @@ -113,7 +146,7 @@ /* Point to the next structure in the output buffer */ - *ResourcePtr = ACPI_ADD_PTR (void, Resource, Resource->Length); + *ResourcePtr = ACPI_NEXT_RESOURCE (Resource); return_ACPI_STATUS (AE_OK); } @@ -145,6 +178,7 @@ { UINT8 *Aml = OutputBuffer; UINT8 *EndAml = OutputBuffer + AmlSizeNeeded; + ACPI_RSCONVERT_INFO *ConversionTable; ACPI_STATUS Status; @@ -167,9 +201,36 @@ /* Perform the conversion */ + if (Resource->Type == ACPI_RESOURCE_TYPE_SERIAL_BUS) + { + if (Resource->Data.CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE) + { + ConversionTable = NULL; + } + else + { + /* This is an I2C, SPI, or UART SerialBus descriptor */ + + ConversionTable = AcpiGbl_ConvertResourceSerialBusDispatch[ + Resource->Data.CommonSerialBus.Type]; + } + } + else + { + ConversionTable = AcpiGbl_SetResourceDispatch[Resource->Type]; + } + + if (!ConversionTable) + { + ACPI_ERROR ((AE_INFO, + "Invalid/unsupported resource descriptor: Type 0x%2.2X", + Resource->Type)); + return (AE_AML_INVALID_RESOURCE_TYPE); + } + Status = AcpiRsConvertResourceToAml (Resource, - ACPI_CAST_PTR (AML_RESOURCE, Aml), - AcpiGbl_SetResourceDispatch[Resource->Type]); + ACPI_CAST_PTR (AML_RESOURCE, Aml), + ConversionTable); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, @@ -204,7 +265,7 @@ /* Point to the next input resource descriptor */ - Resource = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, Resource->Length); + Resource = ACPI_NEXT_RESOURCE (Resource); } /* Completed buffer, but did not find an EndTag resource descriptor */ --- sys/contrib/dev/acpica/resources/rsmisc.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsmisc.c 2011-11-23 13:29:33.000000000 -0500 @@ -94,6 +94,11 @@ ACPI_FUNCTION_TRACE (RsConvertAmlToResource); + if (!Info) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + if (((ACPI_SIZE) Resource) & 0x3) { /* Each internal resource struct is expected to be 32-bit aligned */ @@ -112,7 +117,6 @@ * table length (# of table entries) */ Count = INIT_TABLE_LENGTH (Info); - while (Count) { /* @@ -162,6 +166,15 @@ break; + case ACPI_RSC_3BITFLAG: + /* + * Mask and shift the flag bits + */ + ACPI_SET8 (Destination) = (UINT8) + ((ACPI_GET8 (Source) >> Info->Value) & 0x07); + break; + + case ACPI_RSC_COUNT: ItemCount = ACPI_GET8 (Source); @@ -182,6 +195,75 @@ break; + case ACPI_RSC_COUNT_GPIO_PIN: + + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source); + + Resource->Length = Resource->Length + ItemCount; + ItemCount = ItemCount / 2; + ACPI_SET16 (Destination) = ItemCount; + break; + + + case ACPI_RSC_COUNT_GPIO_VEN: + + ItemCount = ACPI_GET8 (Source); + ACPI_SET8 (Destination) = (UINT8) ItemCount; + + Resource->Length = Resource->Length + + (Info->Value * ItemCount); + break; + + + case ACPI_RSC_COUNT_GPIO_RES: + + /* + * Vendor data is optional (length/offset may both be zero) + * Examine vendor data length field first + */ + Target = ACPI_ADD_PTR (void, Aml, (Info->Value + 2)); + if (ACPI_GET16 (Target)) + { + /* Use vendor offset to get resource source length */ + + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source); + } + else + { + /* No vendor data to worry about */ + + ItemCount = Aml->LargeHeader.ResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER) - + ACPI_GET16 (Source); + } + + Resource->Length = Resource->Length + ItemCount; + ACPI_SET16 (Destination) = ItemCount; + break; + + + case ACPI_RSC_COUNT_SERIAL_VEN: + + ItemCount = ACPI_GET16 (Source) - Info->Value; + + Resource->Length = Resource->Length + ItemCount; + ACPI_SET16 (Destination) = ItemCount; + break; + + + case ACPI_RSC_COUNT_SERIAL_RES: + + ItemCount = (AmlResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER)) - + ACPI_GET16 (Source) - Info->Value; + + Resource->Length = Resource->Length + ItemCount; + ACPI_SET16 (Destination) = ItemCount; + break; + + case ACPI_RSC_LENGTH: Resource->Length = Resource->Length + Info->Value; @@ -204,6 +286,66 @@ break; + case ACPI_RSC_MOVE_GPIO_PIN: + + /* Generate and set the PIN data pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount * 2)); + *(UINT16 **) Destination = ACPI_CAST_PTR (UINT16, Target); + + /* Copy the PIN data */ + + Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source)); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + + case ACPI_RSC_MOVE_GPIO_RES: + + /* Generate and set the ResourceSource string pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount)); + *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); + + /* Copy the ResourceSource string */ + + Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source)); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + + case ACPI_RSC_MOVE_SERIAL_VEN: + + /* Generate and set the Vendor Data pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount)); + *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); + + /* Copy the Vendor Data */ + + Source = ACPI_ADD_PTR (void, Aml, Info->Value); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + + case ACPI_RSC_MOVE_SERIAL_RES: + + /* Generate and set the ResourceSource string pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount)); + *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); + + /* Copy the ResourceSource string */ + + Source = ACPI_ADD_PTR (void, Aml, (ACPI_GET16 (Source) + Info->Value)); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_SET8: ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value); @@ -243,11 +385,12 @@ * Optional ResourceSource (Index and String). This is the more * complicated case used by the Interrupt() macro */ - Target = ACPI_ADD_PTR (char, Resource, Info->AmlOffset + (ItemCount * 4)); + Target = ACPI_ADD_PTR (char, Resource, + Info->AmlOffset + (ItemCount * 4)); Resource->Length += - AcpiRsGetResourceSource (AmlResourceLength, - (ACPI_RS_LENGTH) (((ItemCount - 1) * sizeof (UINT32)) + Info->Value), + AcpiRsGetResourceSource (AmlResourceLength, (ACPI_RS_LENGTH) + (((ItemCount - 1) * sizeof (UINT32)) + Info->Value), Destination, Aml, Target); break; @@ -356,6 +499,7 @@ { void *Source = NULL; void *Destination; + char *Target; ACPI_RSDESC_SIZE AmlLength = 0; UINT8 Count; UINT16 Temp16 = 0; @@ -365,6 +509,11 @@ ACPI_FUNCTION_TRACE (RsConvertResourceToAml); + if (!Info) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + /* * First table entry must be ACPI_RSC_INITxxx and must contain the * table length (# of table entries) @@ -420,6 +569,15 @@ break; + case ACPI_RSC_3BITFLAG: + /* + * Mask and shift the flag bits + */ + ACPI_SET8 (Destination) |= (UINT8) + ((ACPI_GET8 (Source) & 0x07) << Info->Value); + break; + + case ACPI_RSC_COUNT: ItemCount = ACPI_GET8 (Source); @@ -437,6 +595,68 @@ break; + case ACPI_RSC_COUNT_GPIO_PIN: + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination) = (UINT16) AmlLength; + + AmlLength = (UINT16) (AmlLength + ItemCount * 2); + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + ACPI_SET16 (Target) = (UINT16) AmlLength; + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + + case ACPI_RSC_COUNT_GPIO_VEN: + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination) = (UINT16) ItemCount; + + AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount)); + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + + case ACPI_RSC_COUNT_GPIO_RES: + + /* Set resource source string length */ + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination) = (UINT16) AmlLength; + + /* Compute offset for the Vendor Data */ + + AmlLength = (UINT16) (AmlLength + ItemCount); + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + + /* Set vendor offset only if there is vendor data */ + + if (Resource->Data.Gpio.VendorLength) + { + ACPI_SET16 (Target) = (UINT16) AmlLength; + } + + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + + case ACPI_RSC_COUNT_SERIAL_VEN: + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination) = ItemCount + Info->Value; + AmlLength = (UINT16) (AmlLength + ItemCount); + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + + case ACPI_RSC_COUNT_SERIAL_RES: + + ItemCount = ACPI_GET16 (Source); + AmlLength = (UINT16) (AmlLength + ItemCount); + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + case ACPI_RSC_LENGTH: AcpiRsSetResourceLength (Info->Value, Aml); @@ -456,6 +676,44 @@ break; + case ACPI_RSC_MOVE_GPIO_PIN: + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + ACPI_GET16 (Destination)); + Source = * (UINT16 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + + case ACPI_RSC_MOVE_GPIO_RES: + + /* Used for both ResourceSource string and VendorData */ + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + ACPI_GET16 (Destination)); + Source = * (UINT8 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + + case ACPI_RSC_MOVE_SERIAL_VEN: + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + (AmlLength - ItemCount)); + Source = * (UINT8 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + + case ACPI_RSC_MOVE_SERIAL_RES: + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + (AmlLength - ItemCount)); + Source = * (UINT8 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_ADDRESS: /* Set the Resource Type, General Flags, and Type-Specific Flags */ --- sys/contrib/dev/acpica/resources/rsserial.c 1969-12-31 19:00:00.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsserial.c 2011-11-23 13:47:04.000000000 -0500 @@ -0,0 +1,425 @@ +/******************************************************************************* + * + * Module Name: rsserial - GPIO/SerialBus resource descriptors + * + ******************************************************************************/ + +/* + * Copyright (C) 2000 - 2011, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#define __RSIRQ_C__ + +#include +#include +#include + +#define _COMPONENT ACPI_RESOURCES + ACPI_MODULE_NAME ("rsserial") + + +/******************************************************************************* + * + * AcpiRsConvertGpio + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertGpio[17] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO, + ACPI_RS_SIZE (ACPI_RESOURCE_GPIO), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO, + sizeof (AML_RESOURCE_GPIO), + 0}, + + /* + * These fields are contiguous in both the source and destination: + * RevisionId + * ConnectionType + */ + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.RevisionId), + AML_OFFSET (Gpio.RevisionId), + 2}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer), + AML_OFFSET (Gpio.Flags), + 0}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Sharable), + AML_OFFSET (Gpio.IntFlags), + 3}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction), + AML_OFFSET (Gpio.IntFlags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering), + AML_OFFSET (Gpio.IntFlags), + 0}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity), + AML_OFFSET (Gpio.IntFlags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.PinConfig), + AML_OFFSET (Gpio.PinConfig), + 1}, + + /* + * These fields are contiguous in both the source and destination: + * DriveStrength + * DebounceTimeout + */ + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Gpio.DriveStrength), + AML_OFFSET (Gpio.DriveStrength), + 2}, + + /* Pin Table */ + + {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength), + AML_OFFSET (Gpio.PinTableOffset), + AML_OFFSET (Gpio.ResSourceOffset)}, + + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable), + AML_OFFSET (Gpio.PinTableOffset), + 0}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index), + AML_OFFSET (Gpio.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength), + AML_OFFSET (Gpio.ResSourceOffset), + AML_OFFSET (Gpio.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr), + AML_OFFSET (Gpio.ResSourceOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.Gpio.VendorLength), + AML_OFFSET (Gpio.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.VendorData), + AML_OFFSET (Gpio.VendorOffset), + 0}, +}; + + +/******************************************************************************* + * + * AcpiRsConvertI2cSerialBus + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[16] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, + ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, + sizeof (AML_RESOURCE_I2C_SERIALBUS), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId), + AML_OFFSET (CommonSerialBus.RevisionId), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type), + AML_OFFSET (CommonSerialBus.Type), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode), + AML_OFFSET (CommonSerialBus.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer), + AML_OFFSET (CommonSerialBus.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), + AML_OFFSET (CommonSerialBus.TypeRevisionId), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + 1}, + + /* Vendor data */ + + {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + AML_RESOURCE_I2C_MIN_DATA_LEN}, + + {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData), + 0, + sizeof (AML_RESOURCE_I2C_SERIALBUS)}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index), + AML_OFFSET (CommonSerialBus.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + /* I2C bus type specific */ + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode), + AML_OFFSET (I2cSerialBus.TypeSpecificFlags), + 0}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed), + AML_OFFSET (I2cSerialBus.ConnectionSpeed), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress), + AML_OFFSET (I2cSerialBus.SlaveAddress), + 1}, +}; + + +/******************************************************************************* + * + * AcpiRsConvertSpiSerialBus + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[20] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, + ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, + sizeof (AML_RESOURCE_SPI_SERIALBUS), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId), + AML_OFFSET (CommonSerialBus.RevisionId), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type), + AML_OFFSET (CommonSerialBus.Type), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode), + AML_OFFSET (CommonSerialBus.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer), + AML_OFFSET (CommonSerialBus.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), + AML_OFFSET (CommonSerialBus.TypeRevisionId), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + 1}, + + /* Vendor data */ + + {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + AML_RESOURCE_SPI_MIN_DATA_LEN}, + + {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData), + 0, + sizeof (AML_RESOURCE_SPI_SERIALBUS)}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index), + AML_OFFSET (CommonSerialBus.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + /* Spi bus type specific */ + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode), + AML_OFFSET (SpiSerialBus.TypeSpecificFlags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity), + AML_OFFSET (SpiSerialBus.TypeSpecificFlags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength), + AML_OFFSET (SpiSerialBus.DataBitLength), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase), + AML_OFFSET (SpiSerialBus.ClockPhase), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity), + AML_OFFSET (SpiSerialBus.ClockPolarity), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection), + AML_OFFSET (SpiSerialBus.DeviceSelection), + 1}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed), + AML_OFFSET (SpiSerialBus.ConnectionSpeed), + 1}, +}; + + +/******************************************************************************* + * + * AcpiRsConvertUartSerialBus + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[22] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, + ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, + sizeof (AML_RESOURCE_UART_SERIALBUS), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId), + AML_OFFSET (CommonSerialBus.RevisionId), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type), + AML_OFFSET (CommonSerialBus.Type), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode), + AML_OFFSET (CommonSerialBus.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer), + AML_OFFSET (CommonSerialBus.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), + AML_OFFSET (CommonSerialBus.TypeRevisionId), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + 1}, + + /* Vendor data */ + + {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + AML_RESOURCE_UART_MIN_DATA_LEN}, + + {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData), + 0, + sizeof (AML_RESOURCE_UART_SERIALBUS)}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index), + AML_OFFSET (CommonSerialBus.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + /* Uart bus type specific */ + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 0}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 2}, + + {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 4}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 7}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.Parity), + AML_OFFSET (UartSerialBus.Parity), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled), + AML_OFFSET (UartSerialBus.LinesEnabled), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize), + AML_OFFSET (UartSerialBus.RxFifoSize), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize), + AML_OFFSET (UartSerialBus.TxFifoSize), + 1}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate), + AML_OFFSET (UartSerialBus.DefaultBaudRate), + 1}, +}; --- sys/contrib/dev/acpica/resources/rsutils.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsutils.c 2011-11-23 13:29:33.000000000 -0500 @@ -173,6 +173,9 @@ * since there are no alignment or endian issues */ case ACPI_RSC_MOVE8: + case ACPI_RSC_MOVE_GPIO_RES: + case ACPI_RSC_MOVE_SERIAL_VEN: + case ACPI_RSC_MOVE_SERIAL_RES: ACPI_MEMCPY (Destination, Source, ItemCount); return; @@ -182,6 +185,7 @@ * misaligned memory transfers */ case ACPI_RSC_MOVE16: + case ACPI_RSC_MOVE_GPIO_PIN: ACPI_MOVE_16_TO_16 (&ACPI_CAST_PTR (UINT16, Destination)[i], &ACPI_CAST_PTR (UINT16, Source)[i]); break; @@ -653,6 +657,61 @@ /******************************************************************************* * + * FUNCTION: AcpiRsGetAeiMethodData + * + * PARAMETERS: Node - Device node + * RetBuffer - Pointer to a buffer structure for the + * results + * + * RETURN: Status + * + * DESCRIPTION: This function is called to get the _AEI value of an object + * contained in an object specified by the handle passed in + * + * If the function fails an appropriate status will be returned + * and the contents of the callers buffer is undefined. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiRsGetAeiMethodData ( + ACPI_NAMESPACE_NODE *Node, + ACPI_BUFFER *RetBuffer) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (RsGetAeiMethodData); + + + /* Parameters guaranteed valid by caller */ + + /* Execute the method, no parameters */ + + Status = AcpiUtEvaluateObject (Node, METHOD_NAME__AEI, + ACPI_BTYPE_BUFFER, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* + * Make the call to create a resource linked list from the + * byte stream buffer that comes back from the _CRS method + * execution. + */ + Status = AcpiRsCreateResourceList (ObjDesc, RetBuffer); + + /* On exit, we must delete the object returned by evaluateObject */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiRsGetMethodData * * PARAMETERS: Handle - Handle to the containing object --- sys/contrib/dev/acpica/resources/rsxface.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/resources/rsxface.c 2011-11-23 13:29:33.000000000 -0500 @@ -351,6 +351,52 @@ ACPI_EXPORT_SYMBOL (AcpiSetCurrentResources) +/******************************************************************************* + * + * FUNCTION: AcpiGetEventResources + * + * PARAMETERS: DeviceHandle - Handle to the device object for the + * device we are getting resources + * InBuffer - Pointer to a buffer containing the + * resources to be set for the device + * + * RETURN: Status + * + * DESCRIPTION: This function is called to get the event resources for a + * specific device. The caller must first acquire a handle for + * the desired device. The resource data is passed to the routine + * the buffer pointed to by the InBuffer variable. Uses the + * _AEI method. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiGetEventResources ( + ACPI_HANDLE DeviceHandle, + ACPI_BUFFER *RetBuffer) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + + ACPI_FUNCTION_TRACE (AcpiGetEventResources); + + + /* Validate parameters then dispatch to internal routine */ + + Status = AcpiRsValidateParameters (DeviceHandle, RetBuffer, &Node); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + Status = AcpiRsGetAeiMethodData (Node, RetBuffer); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiGetEventResources) + + /****************************************************************************** * * FUNCTION: AcpiResourceToAddress64 @@ -544,8 +590,9 @@ * * PARAMETERS: DeviceHandle - Handle to the device object for the * device we are querying - * Name - Method name of the resources we want - * (METHOD_NAME__CRS or METHOD_NAME__PRS) + * Name - Method name of the resources we want. + * (METHOD_NAME__CRS, METHOD_NAME__PRS, or + * METHOD_NAME__AEI) * UserFunction - Called for each resource * Context - Passed to UserFunction * @@ -577,12 +624,13 @@ if (!DeviceHandle || !UserFunction || !Name || (!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) && - !ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS))) + !ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS) && + !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI))) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Get the _CRS or _PRS resource list */ + /* Get the _CRS/_PRS/_AEI resource list */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer); --- sys/contrib/dev/acpica/tables/tbfadt.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/tables/tbfadt.c 2011-11-23 13:29:38.000000000 -0500 @@ -280,8 +280,13 @@ AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT); - AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, - ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + /* If Hardware Reduced flag is set, there is no FACS */ + + if (!AcpiGbl_ReducedHardware) + { + AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, + ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + } } @@ -309,13 +314,13 @@ /* * Check if the FADT is larger than the largest table that we expect - * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue + * (the ACPI 5.0 version). If so, truncate the table, and issue * a warning. */ if (Length > sizeof (ACPI_TABLE_FADT)) { ACPI_WARNING ((AE_INFO, - "FADT (revision %u) is longer than ACPI 2.0 version, " + "FADT (revision %u) is longer than ACPI 5.0 version, " "truncating length %u to %u", Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); } @@ -329,6 +334,14 @@ ACPI_MEMCPY (&AcpiGbl_FADT, Table, ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT))); + /* Take a copy of the Hardware Reduced flag */ + + AcpiGbl_ReducedHardware = FALSE; + if (AcpiGbl_FADT.Flags & ACPI_FADT_HW_REDUCED) + { + AcpiGbl_ReducedHardware = TRUE; + } + /* Convert the local copy of the FADT to the common internal format */ AcpiTbConvertFadt (); @@ -530,6 +543,13 @@ AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt; } + /* If Hardware Reduced flag is set, we are all done */ + + if (AcpiGbl_ReducedHardware) + { + return; + } + /* Examine all of the 64-bit extended address fields (X fields) */ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) --- sys/contrib/dev/acpica/tables/tbutils.c 2011-01-13 12:32:32.000000000 -0500 +++ sys/contrib/dev/acpica/tables/tbutils.c 2011-11-23 13:29:38.000000000 -0500 @@ -88,6 +88,14 @@ ACPI_STATUS Status; + /* If Hardware Reduced flag is set, there is no FACS */ + + if (AcpiGbl_ReducedHardware) + { + AcpiGbl_FACS = NULL; + return (AE_OK); + } + Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS)); return (Status); --- sys/contrib/dev/acpica/tools/acpiexec/aecommon.h 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/tools/acpiexec/aecommon.h 1969-12-31 19:00:00.000000000 -0500 @@ -1,197 +0,0 @@ -/****************************************************************************** - * - * Module Name: aecommon - common include for the AcpiExec utility - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2011, Intel Corp. - * All rights reserved. - * - * 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. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * 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 MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. - */ - -#ifndef _AECOMMON -#define _AECOMMON - -#ifdef _MSC_VER /* disable some level-4 warnings */ -#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -extern FILE *AcpiGbl_DebugFile; -extern BOOLEAN AcpiGbl_IgnoreErrors; -extern UINT8 AcpiGbl_RegionFillValue; - -/* Check for unexpected exceptions */ - -#define AE_CHECK_STATUS(Name, Status, Expected) \ - if (Status != Expected) \ - { \ - AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \ - AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \ - } - -/* Check for unexpected non-AE_OK errors */ - -#define AE_CHECK_OK(Name, Status) AE_CHECK_STATUS (Name, Status, AE_OK); - -typedef struct ae_table_desc -{ - ACPI_TABLE_HEADER *Table; - struct ae_table_desc *Next; - -} AE_TABLE_DESC; - -/* - * Debug Regions - */ -typedef struct ae_region -{ - ACPI_PHYSICAL_ADDRESS Address; - UINT32 Length; - void *Buffer; - void *NextRegion; - UINT8 SpaceId; - -} AE_REGION; - -typedef struct ae_debug_regions -{ - UINT32 NumberOfRegions; - AE_REGION *RegionList; - -} AE_DEBUG_REGIONS; - - -#define TEST_OUTPUT_LEVEL(lvl) if ((lvl) & OutputLevel) - -#define OSD_PRINT(lvl,fp) TEST_OUTPUT_LEVEL(lvl) {\ - AcpiOsPrintf PARAM_LIST(fp);} - -void ACPI_SYSTEM_XFACE -AeCtrlCHandler ( - int Sig); - -ACPI_STATUS -AeBuildLocalTables ( - UINT32 TableCount, - AE_TABLE_DESC *TableList); - -ACPI_STATUS -AeInstallTables ( - void); - -void -AeDumpNamespace ( - void); - -void -AeDumpObject ( - char *MethodName, - ACPI_BUFFER *ReturnObj); - -void -AeDumpBuffer ( - UINT32 Address); - -void -AeExecute ( - char *Name); - -void -AeSetScope ( - char *Name); - -void -AeCloseDebugFile ( - void); - -void -AeOpenDebugFile ( - char *Name); - -ACPI_STATUS -AeDisplayAllMethods ( - UINT32 DisplayCount); - -ACPI_STATUS -AeInstallEarlyHandlers ( - void); - -ACPI_STATUS -AeInstallLateHandlers ( - void); - -void -AeMiscellaneousTests ( - void); - -ACPI_STATUS -AeRegionHandler ( - UINT32 Function, - ACPI_PHYSICAL_ADDRESS Address, - UINT32 BitWidth, - UINT64 *Value, - void *HandlerContext, - void *RegionContext); - -UINT32 -AeGpeHandler ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber, - void *Context); - -void -AeGlobalEventHandler ( - UINT32 Type, - ACPI_HANDLE GpeDevice, - UINT32 EventNumber, - void *Context); - -#endif /* _AECOMMON */ - --- sys/contrib/dev/acpica/utilities/utdecode.c 2011-04-18 12:32:28.000000000 -0400 +++ sys/contrib/dev/acpica/utilities/utdecode.c 2011-11-23 13:29:39.000000000 -0500 @@ -187,7 +187,9 @@ "SMBus", "SystemCMOS", "PCIBARTarget", - "IPMI" + "IPMI", + "GeneralPurposeIo", + "GenericSerialBus" }; --- sys/contrib/dev/acpica/utilities/utmutex.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/utilities/utmutex.c 2011-11-23 13:29:38.000000000 -0500 @@ -335,15 +335,10 @@ AcpiUtReleaseMutex ( ACPI_MUTEX_HANDLE MutexId) { - ACPI_THREAD_ID ThisThreadId; - - ACPI_FUNCTION_NAME (UtReleaseMutex); - - ThisThreadId = AcpiOsGetThreadId (); ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", - (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); + (UINT32) AcpiOsGetThreadId (), AcpiUtGetMutexName (MutexId))); if (MutexId > ACPI_MAX_MUTEX) { @@ -374,7 +369,7 @@ */ for (i = MutexId; i < ACPI_NUM_MUTEX; i++) { - if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId) + if (AcpiGbl_MutexInfo[i].ThreadId == AcpiOsGetThreadId ()) { if (i == MutexId) { --- sys/contrib/dev/acpica/utilities/utresrc.c 2011-02-11 19:14:20.000000000 -0500 +++ sys/contrib/dev/acpica/utilities/utresrc.c 2011-11-23 13:39:34.000000000 -0500 @@ -46,7 +46,7 @@ #include #include -#include +#include #define _COMPONENT ACPI_UTILITIES @@ -179,6 +179,154 @@ "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[] = +{ + "StopBitsNone", + "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 @@ -200,7 +348,7 @@ ACPI_AML_SIZE_SMALL (AML_RESOURCE_END_DEPENDENT), ACPI_AML_SIZE_SMALL (AML_RESOURCE_IO), ACPI_AML_SIZE_SMALL (AML_RESOURCE_FIXED_IO), - 0, + ACPI_AML_SIZE_SMALL (AML_RESOURCE_FIXED_DMA), 0, 0, 0, @@ -220,7 +368,18 @@ ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS16), ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_IRQ), ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS64), - ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64) + ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO), + 0, + ACPI_AML_SIZE_LARGE (AML_RESOURCE_COMMON_SERIALBUS), +}; + +const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[] = +{ + 0, + ACPI_AML_SIZE_LARGE (AML_RESOURCE_I2C_SERIALBUS), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_SPI_SERIALBUS), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_UART_SERIALBUS), }; @@ -238,35 +397,49 @@ 0, 0, 0, - ACPI_SMALL_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_SMALL_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, - 0, + ACPI_SMALL_VARIABLE_LENGTH, /* 04 IRQ */ + ACPI_FIXED_LENGTH, /* 05 DMA */ + ACPI_SMALL_VARIABLE_LENGTH, /* 06 StartDependentFunctions */ + ACPI_FIXED_LENGTH, /* 07 EndDependentFunctions */ + ACPI_FIXED_LENGTH, /* 08 IO */ + ACPI_FIXED_LENGTH, /* 09 FixedIO */ + ACPI_FIXED_LENGTH, /* 0A FixedDMA */ 0, 0, 0, - ACPI_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, + ACPI_VARIABLE_LENGTH, /* 0E VendorShort */ + ACPI_FIXED_LENGTH, /* 0F EndTag */ /* Large descriptors */ 0, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, + ACPI_FIXED_LENGTH, /* 01 Memory24 */ + ACPI_FIXED_LENGTH, /* 02 GenericRegister */ 0, - ACPI_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH + ACPI_VARIABLE_LENGTH, /* 04 VendorLong */ + ACPI_FIXED_LENGTH, /* 05 Memory32 */ + ACPI_FIXED_LENGTH, /* 06 Memory32Fixed */ + ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ + ACPI_VARIABLE_LENGTH, /* 08 Word* address */ + ACPI_VARIABLE_LENGTH, /* 09 ExtendedIRQ */ + ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ + ACPI_FIXED_LENGTH, /* 0B Extended* address */ + ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ + 0, + ACPI_VARIABLE_LENGTH /* 0E *SerialBus */ }; +/* + * For the iASL compiler/disassembler, we don't want any error messages + * because the disassembler uses the resource validation code to determine + * if Buffer objects are actually Resource Templates. + */ +#ifdef ACPI_ASL_COMPILER +#define ACPI_RESOURCE_ERROR(plist) +#else +#define ACPI_RESOURCE_ERROR(plist) ACPI_ERROR(plist) +#endif + /******************************************************************************* * @@ -297,6 +470,7 @@ UINT8 ResourceIndex; UINT32 Length; UINT32 Offset = 0; + UINT8 EndTag[2] = {0x79, 0x00}; ACPI_FUNCTION_TRACE (UtWalkAmlResources); @@ -322,6 +496,10 @@ Status = AcpiUtValidateResource (Aml, &ResourceIndex); if (ACPI_FAILURE (Status)) { + /* + * Exit on failure. Cannot continue because the descriptor length + * may be bogus also. + */ return_ACPI_STATUS (Status); } @@ -336,7 +514,7 @@ Status = UserFunction (Aml, Length, Offset, ResourceIndex, Context); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } @@ -371,7 +549,19 @@ /* Did not find an EndTag descriptor */ - return (AE_AML_NO_RESOURCE_END_TAG); + if (UserFunction) + { + /* Insert an EndTag anyway. AcpiRsGetListLength always leaves room */ + + (void) AcpiUtValidateResource (EndTag, &ResourceIndex); + Status = UserFunction (EndTag, 2, Offset, ResourceIndex, Context); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } @@ -396,6 +586,7 @@ void *Aml, UINT8 *ReturnIndex) { + AML_RESOURCE *AmlResource; UINT8 ResourceType; UINT8 ResourceIndex; ACPI_RS_LENGTH ResourceLength; @@ -420,7 +611,7 @@ if (ResourceType > ACPI_RESOURCE_NAME_LARGE_MAX) { - return (AE_AML_INVALID_RESOURCE_TYPE); + goto InvalidResource; } /* @@ -439,17 +630,18 @@ ((ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3); } - /* Check validity of the resource type, zero indicates name is invalid */ - + /* + * Check validity of the resource type, via AcpiGbl_ResourceTypes. Zero + * indicates an invalid resource. + */ if (!AcpiGbl_ResourceTypes[ResourceIndex]) { - return (AE_AML_INVALID_RESOURCE_TYPE); + goto InvalidResource; } - /* - * 2) Validate the ResourceLength field. This ensures that the length - * is at least reasonable, and guarantees that it is non-zero. + * Validate the ResourceLength field. This ensures that the length + * is at least reasonable, and guarantees that it is non-zero. */ ResourceLength = AcpiUtGetResourceLength (Aml); MinimumResourceLength = AcpiGbl_ResourceAmlSizes[ResourceIndex]; @@ -464,7 +656,7 @@ if (ResourceLength != MinimumResourceLength) { - return (AE_AML_BAD_RESOURCE_LENGTH); + goto BadResourceLength; } break; @@ -474,7 +666,7 @@ if (ResourceLength < MinimumResourceLength) { - return (AE_AML_BAD_RESOURCE_LENGTH); + goto BadResourceLength; } break; @@ -485,7 +677,7 @@ if ((ResourceLength > MinimumResourceLength) || (ResourceLength < (MinimumResourceLength - 1))) { - return (AE_AML_BAD_RESOURCE_LENGTH); + goto BadResourceLength; } break; @@ -493,7 +685,22 @@ /* Shouldn't happen (because of validation earlier), but be sure */ - return (AE_AML_INVALID_RESOURCE_TYPE); + goto InvalidResource; + } + + AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml); + if (ResourceType == ACPI_RESOURCE_NAME_SERIAL_BUS) + { + /* Validate the BusType field */ + + if ((AmlResource->CommonSerialBus.Type == 0) || + (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)) + { + ACPI_RESOURCE_ERROR ((AE_INFO, + "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X", + AmlResource->CommonSerialBus.Type)); + return (AE_AML_INVALID_RESOURCE_TYPE); + } } /* Optionally return the resource table index */ @@ -504,6 +711,22 @@ } return (AE_OK); + + +InvalidResource: + + ACPI_RESOURCE_ERROR ((AE_INFO, + "Invalid/unsupported resource descriptor: Type 0x%2.2X", + ResourceType)); + return (AE_AML_INVALID_RESOURCE_TYPE); + +BadResourceLength: + + ACPI_RESOURCE_ERROR ((AE_INFO, + "Invalid resource descriptor length: Type " + "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X", + ResourceType, ResourceLength, MinimumResourceLength)); + return (AE_AML_BAD_RESOURCE_LENGTH); } --- sys/contrib/dev/acpica/utilities/utxfmutex.c 1969-12-31 19:00:00.000000000 -0500 +++ sys/contrib/dev/acpica/utilities/utxfmutex.c 2011-11-23 18:35:24.000000000 -0500 @@ -0,0 +1,213 @@ +/******************************************************************************* + * + * Module Name: utxfmutex - external AML mutex access functions + * + ******************************************************************************/ + +/* + * Copyright (C) 2000 - 2011, Intel Corp. + * All rights reserved. + * + * 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. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#define __UTXFMUTEX_C__ + +#include +#include +#include + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utxfmutex") + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiUtGetMutexObject ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + ACPI_OPERAND_OBJECT **RetObj); + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetMutexObject + * + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * RetObj - Where the mutex object is returned + * + * RETURN: Status + * + * DESCRIPTION: Get an AML mutex object. The mutex node is pointed to by + * Handle:Pathname. Either Handle or Pathname can be NULL, but + * not both. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiUtGetMutexObject ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + ACPI_OPERAND_OBJECT **RetObj) +{ + ACPI_NAMESPACE_NODE *MutexNode; + ACPI_OPERAND_OBJECT *MutexObj; + ACPI_STATUS Status; + + + /* Parameter validation */ + + if (!RetObj || (!Handle && !Pathname)) + { + return (AE_BAD_PARAMETER); + } + + /* Get a the namespace node for the mutex */ + + MutexNode = Handle; + if (Pathname != NULL) + { + Status = AcpiGetHandle (Handle, Pathname, + ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode)); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + + /* Ensure that we actually have a Mutex object */ + + if (!MutexNode || + (MutexNode->Type != ACPI_TYPE_MUTEX)) + { + return (AE_TYPE); + } + + /* Get the low-level mutex object */ + + MutexObj = AcpiNsGetAttachedObject (MutexNode); + if (!MutexObj) + { + return (AE_NULL_OBJECT); + } + + *RetObj = MutexObj; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiAcquireMutex + * + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * Timeout - Max time to wait for the lock (millisec) + * + * RETURN: Status + * + * DESCRIPTION: Acquire an AML mutex. This is a device driver interface to + * AML mutex objects, and allows for transaction locking between + * drivers and AML code. The mutex node is pointed to by + * Handle:Pathname. Either Handle or Pathname can be NULL, but + * not both. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiAcquireMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + UINT16 Timeout) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *MutexObj; + + + /* Get the low-level mutex associated with Handle:Pathname */ + + Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Acquire the OS mutex */ + + Status = AcpiOsAcquireMutex (MutexObj->Mutex.OsMutex, Timeout); + return (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiReleaseMutex + * + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * + * RETURN: Status + * + * DESCRIPTION: Release an AML mutex. This is a device driver interface to + * AML mutex objects, and allows for transaction locking between + * drivers and AML code. The mutex node is pointed to by + * Handle:Pathname. Either Handle or Pathname can be NULL, but + * not both. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiReleaseMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *MutexObj; + + + /* Get the low-level mutex associated with Handle:Pathname */ + + Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Release the OS mutex */ + + AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex); + return (AE_OK); +} --- sys/modules/acpi/acpi/Makefile 2011-04-18 12:32:32.000000000 -0400 +++ sys/modules/acpi/acpi/Makefile 2011-11-23 18:33:51.000000000 -0500 @@ -35,7 +35,7 @@ SRCS+= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbmethod.c SRCS+= dbnames.c dbstats.c dbutils.c dbxface.c SRCS+= dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c -SRCS+= dmresrcs.c dmutils.c dmwalk.c +SRCS+= dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c SRCS+= dsargs.c dscontrol.c dsfield.c dsinit.c dsmethod.c dsmthdat.c SRCS+= dsobject.c dsopcode.c dsutils.c dswexec.c dswload.c dswload2.c SRCS+= dswscope.c dswstate.c @@ -53,11 +53,12 @@ SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c pstree.c psutils.c SRCS+= pswalk.c psxface.c SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c rsio.c rsirq.c rslist.c -SRCS+= rsmemory.c rsmisc.c rsutils.c rsxface.c +SRCS+= rsmemory.c rsmisc.c rsserial.c rsutils.c rsxface.c SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c tbxfroot.c SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdecode.c utdelete.c uteval.c SRCS+= utglobal.c utids.c utinit.c utlock.c utmath.c utmisc.c utmutex.c SRCS+= utobject.c utosi.c utresrc.c utstate.c utxface.c utxferror.c +SRCS+= utxfmutex.c # OSPM layer and core hardware drivers SRCS+= acpi.c acpi_button.c acpi_isab.c acpi_package.c acpi_pci.c acpi_pcib.c --- usr.sbin/acpi/Makefile.inc 2009-06-05 14:50:45.000000000 -0400 +++ usr.sbin/acpi/Makefile.inc 2011-11-23 16:38:05.000000000 -0500 @@ -8,17 +8,18 @@ .include "${.CURDIR}/../../Makefile.inc" .endif -.PATH: ${ACPICA_DIR} \ - ${ACPICA_DIR}/common \ - ${ACPICA_DIR}/compiler \ - ${ACPICA_DIR}/debugger \ - ${ACPICA_DIR}/disassembler \ - ${ACPICA_DIR}/dispatcher \ - ${ACPICA_DIR}/events \ - ${ACPICA_DIR}/executer \ - ${ACPICA_DIR}/hardware \ - ${ACPICA_DIR}/namespace \ - ${ACPICA_DIR}/parser \ - ${ACPICA_DIR}/resources \ - ${ACPICA_DIR}/tables \ +.PATH: ${ACPICA_DIR} \ + ${ACPICA_DIR}/common \ + ${ACPICA_DIR}/compiler \ + ${ACPICA_DIR}/debugger \ + ${ACPICA_DIR}/disassembler \ + ${ACPICA_DIR}/dispatcher \ + ${ACPICA_DIR}/events \ + ${ACPICA_DIR}/executer \ + ${ACPICA_DIR}/hardware \ + ${ACPICA_DIR}/namespace \ + ${ACPICA_DIR}/os_specific/service_layers \ + ${ACPICA_DIR}/parser \ + ${ACPICA_DIR}/resources \ + ${ACPICA_DIR}/tables \ ${ACPICA_DIR}/utilities --- usr.sbin/acpi/acpidb/Makefile 2011-04-18 12:32:37.000000000 -0400 +++ usr.sbin/acpi/acpidb/Makefile 2011-11-23 16:39:01.000000000 -0500 @@ -2,7 +2,6 @@ PROG= acpidb SRCS= acpidb.c -SRCS+= osunixxf.c # debugger SRCS+= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c \ @@ -11,7 +10,7 @@ # disassembler SRCS+= dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c \ - dmresrcl.c dmresrcs.c dmutils.c dmwalk.c + dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c # events SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c \ @@ -44,10 +43,13 @@ nsrepair.c nsrepair2.c nssearch.c nsutils.c nswalk.c \ nsxfeval.c nsxfname.c nsxfobj.c +# os_specific/service_layers +SRCS+= osunixxf.c + # resources SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c \ rsio.c rsirq.c rslist.c rsmemory.c rsmisc.c \ - rsutils.c rsxface.c + rsserial.c rsutils.c rsxface.c # tables SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c \ --- usr.sbin/acpi/acpidb/acpidb.c 2011-11-23 15:27:08.000000000 -0500 +++ usr.sbin/acpi/acpidb/acpidb.c 2011-11-23 15:09:06.000000000 -0500 @@ -43,7 +43,8 @@ #include #include -#include +#include +#include /* * Dummy DSDT Table Header --- usr.sbin/acpi/iasl/Makefile 2011-04-18 12:32:37.000000000 -0400 +++ usr.sbin/acpi/iasl/Makefile 2011-11-23 16:38:36.000000000 -0500 @@ -2,7 +2,6 @@ PROG= iasl SRCS= adfile.c adisasm.c adwalk.c -SRCS+= osunixxf.c # common SRCS+= dmextern.c dmrestag.c dmtable.c dmtbdump.c dmtbinfo.c \ @@ -16,18 +15,19 @@ aslopcodes.c asloperands.c aslopt.c aslpredef.c \ aslresource.c aslrestype1.c aslrestype1i.c \ aslrestype2.c aslrestype2d.c aslrestype2e.c \ - aslrestype2q.c aslrestype2w.c aslstartup.c aslstubs.c \ - asltransform.c asltree.c aslutils.c asluuid.c \ - aslwalks.c dtcompile.c dtexpress.c dtfield.c dtio.c \ - dtparser.y.h dtparserlex.c dtparserparse.c dtsubtable.c \ - dttable.c dttemplate.c dtutils.c + aslrestype2q.c aslrestype2s.c aslrestype2w.c \ + aslstartup.c aslstubs.c asltransform.c asltree.c \ + aslutils.c asluuid.c aslwalks.c dtcompile.c dtexpress.c \ + dtfield.c dtio.c dtparser.y.h dtparserlex.c \ + dtparserparse.c dtsubtable.c dttable.c dttemplate.c \ + dtutils.c # debugger SRCS+= dbfileio.c # disassembler SRCS+= dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c \ - dmresrcl.c dmresrcs.c dmutils.c dmwalk.c + dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c # interpreter/dispatcher SRCS+= dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c \ @@ -48,6 +48,9 @@ SRCS+= nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c \ nsparse.c nssearch.c nsutils.c nswalk.c nsxfobj.c +# os_specific/service_layers +SRCS+= osunixxf.c + # tables SRCS+= tbfadt.c tbinstal.c tbutils.c tbxface.c @@ -64,8 +67,6 @@ CFLAGS+= -DACPI_ASL_COMPILER -I. LFLAGS= -i -s YFLAGS= -d -DPADD= ${LIBPTHREAD} -LDADD= -lpthread CLEANFILES= aslcompiler.y.h aslcompilerlex.c aslcompilerparse.c \ aslcompilerparse.h dtparser.y.h dtparserlex.c \