summaryrefslogtreecommitdiff
path: root/source/compiler/asloperands.c
Commit message (Collapse)AuthorAgeFilesLines
* Updated all copyrights to 2021. This affects all ACPICA source codeRobert Moore2021-01-051-1/+1
| | | | modules.
* All acpica: Update copyrights to 2020Robert Moore2020-01-091-1/+1
| | | | Including tool signons.
* iASL: add buffer overflow analysis for BufferField declarationsErik Schmauss2019-05-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create___Field declares a BufferField over an existing buffer. This change adds an additional check to analyze constant values in the declarations of these buffer fields. This attempt to detect that the new buffer does not overrun the original source buffer. There have been 2 more compiler remarks added. One that states that the starting index of the new buffer field is beyond the end of the buffer and another message indicating that the this new buffer extends beyond the end of the source buffer. We initially thought that this would actually be an error. However, consider the following case: Name (BUF0, buffer(0){}) // Create an empty buffer Name (BUF1, buffer(0x5){0x0,0x1,0x2,0x3,0x4}) BUF0 = BUF1 CreateByteField (BUF0, 0x0, BYTE) // this is valid! This code runs without issues because BUF0 gets assigned to BUF1. Due to the lack of usage analysis in iASL, the source buffer can change throughout table load or a control method execution. In order to make this analysis check result as an error, we need to add additional steps to analyze the usage of BUF0 between its declaration and it's use in CreateByteField. Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
* iASL: perform analysis and code generation after parsing all tablesErik Schmauss2019-04-021-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performing parse tree analysis on all definition blocks simultaneously results in more effective namespace cross-reference. This enables iASL static analysis to determine unresolved external declarations and namespace collisions during compilation. In order to take advantage of this, compile definition blocks with the following command: iasl dsdt.asl ssdt1.asl ssdt2.asl ... *** Changes related to multiple files: Keep track of all files in a global list that is persistent throughout compilation of both files. This is done in order to compile multiple ASL files in the same namespace and parse tree. This also resulted in moving the file handle assignment for the -vi option during file initialization rather than commandline processing. As each definition block is parsed, it is connected as a sibling node to the previous definiton block. *** Changes related to iASL error reporting: Also, more error messages were added by replacing the fprintf to stderr with AslError. By doing so, an error can be logged properly and AML output files will be cleaned if there is a compiler error. Adds the ability to print the correct source line by logging the .src filename in each error node. This is necessary for errors that point to an include file. New iASL error: emitting an error when compiling duplicate files. Ignore max error count when compiling with -f because compilation needs to continue. Fix parser error path to correctly abort compilation rather than trying to proceed with more compilation. *** Changes related to codegen behavior: Seek to the end of the AML output file after codegen in case multiple definition blocks need to be encoded in the same AML file. This makes other parts of the codebase a little more convinent since it doesn't have to seek to the correct place in the AML. *** Misc changes: Remove a call to ACPI_FREE. We should never be calling ACPI_FREE in memory allocated in caches. Display compilation summaries for multiple input files. Files that have parser errors are reported as having parser errors. The summary is based on the global file list. Encapsulate global variables in global file nodes used for summary reporting. Final cleanup functions for iASL has been consolidated to the main() function for simplicity. Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
* Rename nameseg length macro/define for clarityRobert Moore2019-02-221-2/+2
| | | | | | | ACPI_NAME_SIZE changed to ACPI_NAMESEG_SIZE This clarifies that this is the length of an individual nameseg, not the length of a generic namestring/namepath. Improves understanding of the code.
* iASL: Emit error for creation of a zero-length op regionRobert Moore2019-01-161-1/+9
| | | | Such a region is unusable.
* All acpica: Update copyrights to 2019Robert Moore2019-01-081-1/+1
| | | | including tool signons.
* iASL: Standardize names for all global variablesRobert Moore2018-09-201-14/+14
| | | | For consistency, all iASL global names forced to AslGbl*
* iASL: Additional update for Offset() processingRobert Moore2018-08-141-1/+9
| | | | Handle the "no optimization" (-oa) case properly for Offset().
* iASL: Add remark for unnecessary Offset() operatorsRobert Moore2018-08-141-5/+18
| | | | | | | If the Offset() value is the same as the current offset within the field, the operator is redundant and unnecessary. The iASL optimizer will eliminate the operator, but a remark will inform the user that something is wrong or at best, a waste.
* Add error messages for ACPI tables with bad OEM and OEM Table IDsRobert Moore2018-04-131-1/+14
| | | | | | OEM ID has a max length of 6 chars OEM TABLE ID has a max length 0f 8 chars. (As per the ACPI spec)
* All acpica: Update copyrights to 2018Robert Moore2018-01-041-1/+1
| | | | including tool signons.
* iASL: Move all allocation functions to new modulesRobert Moore2017-09-011-2/+2
| | | | | Memory allocation functions are in aslallocate.c Cache functions are in aslcache.c
* Update legal header in all source modulesRobert Moore2017-03-021-0/+36
| | | | | | Adds the dual GNU/BSD dual license to the existing Intel license. Provides all licensing information in each source module. Affects all ACPICA source modules.
* iASL: add ASL conversion toolRobert Moore2017-02-241-2/+3
| | | | | | | The key feature of this utility is that the original comments within the input ASL files are preserved during the conversion process, and included within the converted ASL+ file -- thus creating a transparent conversion of existing ASL files to ASL+ (ASL 2.0)
* Cleanup AML opcode definitions, no functional changeRobert Moore2017-02-231-1/+1
| | | | | | | This change is a cleanup and further standardization of the AML opcode defines in amlcode.h Improves the readability and maintainability of the source code.
* Source tree: Update copyright notices to 2017Robert Moore2017-01-061-1/+1
| | | | Affects all files.
* iASL: Optimization for FieldUnit listsRobert Moore2016-09-231-0/+14
| | | | | Ignore a field unit that is both unnamed and has a length of zero. Previously, two zero bytes were emitted for no good reason.
* ACPI 6.0/iASL: Add support for the External AML opcodeRobert Moore2016-01-291-8/+2
| | | | | | | Support for both the compiler and disassembler. Also, the interpreter will ignore this opcode if it is ever encountered (should not happen). David Box.
* Source tree: Update copyright notices to 2016Robert Moore2016-01-061-1/+1
| | | | Affects all files.
* iASL: Add support for multiple ACPI tables in a single ASL file.Robert Moore2015-10-231-1/+1
| | | | | Initial support to simply compile the file to a single AML file. Probably mostly useful for testing/debugging purposes.
* iASL: Update for code formatting, no functional changesRobert Moore2015-10-141-20/+23
| | | | | Mostly indentation inconsistencies across the code. Split some long lines, etc.
* Update source file permissions (2)Robert Moore2015-09-231-0/+0
| | | | Reset user execute bit, set other permissions read-only.
* Update source file permissions (1)Robert Moore2015-09-231-0/+0
| | | | Set user execute bit to force git to commit the files.
* Replace some instances of "4" with ACPI_NAME_SIZE.Robert Moore2015-07-241-3/+3
| | | | For clarity and consistency.
* De-macroize calls to standard C library functions.Robert Moore2015-06-091-3/+3
| | | | | | Across all of ACPICA. Replace C library macros such as ACPI_STRLEN with the standard names such as strlen. The original purpose for these macros is long since obsolete.
* Update Copyright headers to 2015.David E. Box2015-01-271-1/+1
|
* Revert "source and test: update copyright notices to 2015"David E. Box2015-01-271-1271/+1271
| | | | | | This reverts commit 28a95326289ca5ee7cd95f8e8e809dc5564d9509. Commit mistakenly changes file format to CRLF from default LF.
* source and test: update copyright notices to 2015David E. Box2015-01-231-1271/+1271
|
* Standardize one blank line after copyright header, no functional change.Robert Moore2014-08-141-1/+0
| | | | | From acpisrc execution -- the utility now ensures that there is exactly one blank line after the header.
* iASL: Improve cacheing, reduce memory leaks.Robert Moore2014-08-131-3/+3
| | | | | | | | Ensure that the parse tree is deleted for each compile. Fix other miscellaneous memory leaks per-compile. Consistently deploy the use of the string cache. Add tracking for multiple buffers within caches. Ensure the cache buffers are always deleted.
* Update ACPICA copyrights to 2014.Robert Moore2014-01-061-1/+1
| | | | | Update ACPICA copyrights to 2014. Includes all source headers and signons for the various tools.
* iASL: Improve behavior of the -p (path prefix) option.Robert Moore2013-12-111-0/+1
| | | | | | | | This change allows for zero or multiple periods (dots) within the prefix pathname. Also converts backslashes to forward slashes. ACPICA BZ 1060.
* iASL: Ensure valid C identifiers in output files.Robert Moore2013-07-191-3/+6
| | | | | | | For the options that create tables in C, ensure that the C names that are emitted consist of valid C characters. The OemTableID is used to generate unique C identifiers. Convert any non-alphanumeric characters to underscores.
* Standardize all switch() blocks.Robert Moore2013-04-231-6/+17
| | | | | | After many years, different formatting for switch() has crept in. This change makes every switch block identical. Chao Guan. ACPICA bugzilla 997.
* Update ACPICA copyrights to 2013.Robert Moore2013-01-081-1/+1
| | | | Includes all source headers and signons for the various tools.
* Small fix for standard Intel legal header.Robert Moore2012-09-271-1/+1
| | | | Remove an extraneous space after a comma, for consistency.
* Remove extra spaces after periods in the Intel license.Robert Moore2012-09-261-11/+11
| | | | For consistency with the rest of the source code.
* Remove extra spaces after periods within comments.Robert Moore2012-09-261-9/+9
| | | | This makes all comments consistent.
* iASL/Tools: Cleanup empty lines at file start and end.Robert Moore2012-09-211-1/+0
| | | | Maintenance for source code consistency.
* iASL/Tools: return statement audit.Robert Moore2012-09-211-2/+0
| | | | | Ensure that all normal return statements surround the return expression (value) with parens, for consistency.
* iASL: Fix problem with constant folding in method declarations.Robert Moore2012-08-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | This change fixes an issue with method declarations where the SyncLevel term is a ByteConstExpr, but if a Type3 opcode was used, it would not be evaluated properly. This is an interim fix for this single case, specifically to allow the ASLTS test to run properly. However, it does not address the general case where parse tree transforms are applied before the constant folding is performed. In this case, the SyncLevel is merged with the NumArgs and SerializedFlag to generate a raw data byte before the constant folding is performed. After this parse tree transform, no constant folding can be performed on the Method() parameters. Two solutions: 1) The general case could possibly be solved by performing parse tree transforms only after the constant folding has been completed 2) Continue to special-case each of these issues in the various ASL operators that have similar issues.
* Update ACPICA copyrights to 2012.Robert Moore2012-01-031-1/+1
| | | | Standard ACPICA source modules only.
* iASL: Fix some VarPackage issues.Robert Moore2011-09-161-2/+6
| | | | | | | 1) properly handle constants like One,Ones,Zero. Do not make a var_package when these are used as a package length. 2) Allow VAR_PACKAGE (in addition to PACKAGE) opcode when validating object types for predifined names.
* Update all ACPICA copyrights and signons to 2011.Robert Moore2011-01-031-1/+1
| | | | Standard ACPICA source modules only.
* Remove obsolete ACPI_INTEGER (acpi_integer) type.Robert Moore2010-01-191-1/+1
| | | | | | | | This type was introduced as the code was migrated from ACPI 1.0 (with 32-bit AML integers) to ACPI 2.0 (with 64-bit integers). It is now obsolete and this change removes it from the ACPICA code base, replaced by UINT64. The original typedef has been retained for now for compatibility with existing device driver code.
* Update all ACPICA copyrights and signons to 2010.Robert Moore2010-01-081-1/+1
| | | | | | Add 2010 copyright to all module headers and signons, including the Linux header. This affects virtually every file in the ACPICA core subsystem, iASL compiler, and all utilities.
* Update for new gcc-4 warning options.Robert Moore2010-01-081-1/+1
| | | | | | | Added several new options for the gcc-4 generation, and updated the source accordingly. This includes some code restructuring to eliminate unreachable code, elimination of some gotos, elimination of unused return values, and some additional casting.
* iASL: Add msg if initializer list is shorter than package length.Robert Moore2009-10-291-7/+17
| | | | | | | Adds a new remark for a Package() declaration if an initializer list exists, but is shorter than the declared length of the package. Although technically legal, this is probably a coding error and it is seen in the field. ACPICA BZ 815. Lin Ming, Bob Moore.
* Update all copyrights and signons to 2009.Robert Moore2009-01-081-1/+1
| | | | | | Add 2009 copyright to all module headers and signons, including the Linux header. This affects virtually every file in the ACPICA core subsystem, iASL compiler, and all utilities.