diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2002-10-04 20:07:58 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2002-10-04 20:07:58 +0000 |
commit | 6a8b238332cd2e994e0dde2c3b654cd726b5c640 (patch) | |
tree | 9bf86c8dafc22cbe90582f70fe04af90018e690b | |
parent | 789741b5dc7e5eda79d843a46b11d7ff5c0b7fd9 (diff) | |
parent | 3b2a4f1cbea5e9139e6d4710e31efedef37247ac (diff) | |
download | FreeBSD-src-6a8b238332cd2e994e0dde2c3b654cd726b5c640.zip FreeBSD-src-6a8b238332cd2e994e0dde2c3b654cd726b5c640.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r104470,
which included commits to RCS files with non-trunk default branches.
48 files changed, 1995 insertions, 1408 deletions
diff --git a/sys/contrib/dev/acpica/CHANGES.txt b/sys/contrib/dev/acpica/CHANGES.txt index 66313c2..f87c968 100644 --- a/sys/contrib/dev/acpica/CHANGES.txt +++ b/sys/contrib/dev/acpica/CHANGES.txt @@ -1,14 +1,215 @@ ---------------------------------------- + +02 October 2002. Summary of changes for this release. + + +1) ACPI CA Core Subsystem version 20021002: + +Fixed a problem where a store/copy of a string to an existing +string did not always set the string length properly in the +String object. + +Fixed a reported problem with the ToString operator where the +behavior was identical to the ToHexString operator instead of +just simply converting a raw buffer to a string data type. + +Fixed a problem where CopyObject and the other "explicit" +conversion operators were not updating the internal namespace +node type as part of the store operation. + +Fixed a memory leak during implicit source operand conversion +where the original object was not deleted if it was converted +to a new object of a different type. + +Enhanced error messages for all problems associated with +namespace lookups. Common procedure generates and prints the +lookup name as well as the formatted status. + +Completed implementation of a new design for the Alias support +within the namespace. The existing design did not handle the +case where a new object was assigned to one of the two names +due to the use of an explicit conversion operator, resulting +in the two names pointing to two different objects. The new +design simply points the Alias name to the original name node +- not to the object. This results in a level of indirection +that must be handled in the name resolution mechanism. + +Code and Data Size: Current core subsystem library sizes are +shown below. These are the code and data sizes for the +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. + + Previous Release + Non-Debug Version: 69.6K Code, 8.3K Data, 77.9K Total + Debug Version: 150.0K Code, 61.7K Data, 211.7K Total + Current Release: + Non-Debug Version: 70.7K Code, 8.6K Data, 79.3K Total + Debug Version: 151.7K Code, 62.4K Data, 214.1K Total + + +2) Linux + +Initialize thermal driver's timer before it is used. (Knut +Neumann) + +Allow handling negative celsius values. (Kochi Takayoshi) + +Fix thermal management and make trip points. R/W (Pavel +Machek) + +Fix /proc/acpi/sleep. (P. Christeas) + +IA64 fixes. (David Mosberger) + +Fix reversed logic in blacklist code. (Sergio Monteiro Basto) + +Replace ACPI_DEBUG define with ACPI_DEBUG_OUTPUT. (Dominik +Brodowski) + + +3) iASL Compiler/Disassembler + +Clarified some warning/error messages. + + +---------------------------------------- +18 September 2002. Summary of changes for this release. + + +1) ACPI CA Core Subsystem version 20020918: + +Fixed a reported problem with reference chaining (via the +Index() and RefOf() operators) in the ObjectType() and +SizeOf() operators. The definition of these operators +includes the dereferencing of all chained references to return +information on the base object. + +Fixed a problem with stores to indexed package elements - the +existing code would not complete the store if an "implicit +conversion" was not performed. In other words, if the +existing object (package element) was to be replaced +completely, the code didn't handle this case. + +Relaxed typechecking on the ASL "Scope" operator to allow the +target name to refer to an object of type Integer, String, or +Buffer, in addition to the scoping object types (Device, +predefined Scopes, Processor, PowerResource, and ThermalZone.) +This allows existing AML code that has workarounds for a bug +in Windows to function properly. A warning is issued, +however. This affects both the AML interpreter and the iASL +compiler. Below is an example of this type of ASL code: + + Name(DEB,0x00) + Scope(DEB) + { + +Fixed some reported problems with 64-bit integer support in +the local implementation of C library functions (clib.c) + + +2) Linux + +Use ACPI fix map region instead of IOAPIC region, since it is +undefined in non-SMP. + +Ensure that the SCI has the proper polarity and trigger, even +on systems that do not have an interrupt override entry in the +MADT. + +2.5 big driver reorganization (Pat Mochel) + +Use early table mapping code from acpitable.c (Andi Kleen) + +New blacklist entries (Andi Kleen) + +Blacklist improvements. Split blacklist code out into a +separate file. Move checking the blacklist to very early. +Previously, we would use ACPI tables, and then halfway through +init, check the blacklist -- too late. Now, it's early enough +to completely fall-back to non-ACPI. + + +3) iASL Compiler/Disassembler version 20020918: + +Fixed a problem where the typechecking code didn't know that +an alias could point to a method. In other words, aliases +were not being dereferenced during typechecking. + + +---------------------------------------- +29 August 2002. Summary of changes for this release. + +1) ACPI CA Core Subsystem Version 20020829: + +If the target of a Scope() operator already exists, it must be +an object type that actually opens a scope -- such as a +Device, Method, Scope, etc. This is a fatal runtime error. +Similar error check has been added to the iASL compiler also. + +Tightened up the namespace load to disallow multiple names in +the same scope. This previously was allowed if both objects +were of the same type. (i.e., a lookup was the same as +entering a new name). + + +2) Linux + +Ensure that the ACPI interrupt has the proper trigger and +polarity. + +local_irq_disable is extraneous. (Matthew Wilcox) + +Make "acpi=off" actually do what it says, and not use the ACPI +interpreter *or* the tables. + +Added arch-neutral support for parsing SLIT and SRAT tables +(Kochi Takayoshi) + + +3) iASL Compiler/Disassembler Version 20020829: + +Implemented namepath optimization for name declarations. For +example, a declaration like "Method (\_SB_.ABCD)" would get +optimized to "Method (ABCD)" if the declaration is within the +\_SB_ scope. This optimization is in addition to the named +reference path optimization first released in the previous +version. This would seem to complete all possible +optimizations for namepaths within the ASL/AML. + +If the target of a Scope() operator already exists, it must be +an object type that actually opens a scope -- such as a +Device, Method, Scope, etc. + +Implemented a check and warning for unreachable code in the +same block below a Return() statement. + +Fixed a problem where the listing file was not generated if +the compiler aborted if the maximum error count was exceeded +(200). + +Fixed a problem where the typechecking of method return values +was broken. This includes the check for a return value when +the method is invoked as a TermArg (a return value is +expected.) + +Fixed a reported problem where EOF conditions during a quoted +string or comment caused a fault. + + +---------------------------------------- 15 August 2002. Summary of changes for this release. 1) ACPI CA Core Subsystem Version 20020815: Fixed a reported problem where a Store to a method argument that contains a reference did not perform the indirect store -correctly. This problem was created during the conversion -to the new reference object model – the indirect store to a -method argument code was not updated to reflect the new -model. +correctly. This problem was created during the conversion to +the new reference object model - the indirect store to a +method argument code was not updated to reflect the new model. Reworked the ACPI mode change code to better conform to ACPI 2.0, handle corner cases, and improve code legibility (Kochi @@ -16,43 +217,37 @@ Takayoshi) Fixed a problem with the pathname parsing for the carat (^) prefix. The heavy use of the carat operator by the new -namepath optimization in the iASL compiler uncovered a -problem with the AML interpreter handling of this prefix. -In the case where one or more carats precede a single -nameseg, the nameseg was treated as standalone and the -search rule (to root) was inadvertently applied. This could -cause both the iASL compiler and the interpreter to find the -wrong object or to miss the error that should occur if the -object does not exist at that exact pathname. +namepath optimization in the iASL compiler uncovered a problem +with the AML interpreter handling of this prefix. In the case +where one or more carats precede a single nameseg, the nameseg +was treated as standalone and the search rule (to root) was +inadvertently applied. This could cause both the iASL +compiler and the interpreter to find the wrong object or to +miss the error that should occur if the object does not exist +at that exact pathname. Found and fixed the problem where the HP Pavilion DSDT would not load. This was a relatively minor tweak to the table loading code (a problem caused by the unexpected encounter -with a method invocation not within a control method), but -it does not solve the overall issue of the execution of AML -code at the table level. This investigation is still -ongoing. +with a method invocation not within a control method), but it +does not solve the overall issue of the execution of AML code +at the table level. This investigation is still ongoing. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 69.1K Code, 8.2K Data, 77.3K -Total - Debug Version: 149.4K Code, 61.6K Data, 211.0K -Total + Non-Debug Version: 69.1K Code, 8.2K Data, 77.3K Total + Debug Version: 149.4K Code, 61.6K Data, 211.0K Total Current Release: - Non-Debug Version: 69.6K Code, 8.3K Data, 77.9K -Total - Debug Version: 150.0K Code, 61.7K Data, 211.7K -Total + Non-Debug Version: 69.6K Code, 8.3K Data, 77.9K Total + Debug Version: 150.0K Code, 61.7K Data, 211.7K Total 2) Linux @@ -63,8 +258,8 @@ Fix several bugs in thermal.c (Herbert Nachtnebel) Make CONFIG_ACPI_BOOT work properly (Pavel Machek) -Change acpi_system_suspend to use updated irq functions -(Pavel Machek) +Change acpi_system_suspend to use updated irq functions (Pavel +Machek) Export acpi_get_firmware_table (Matthew Wilcox) @@ -75,22 +270,22 @@ Fix early-boot table parsing (Bjorn Helgaas) 3) iASL Compiler/Disassembler -Reworked the compiler options to make them more consistent -and to use two-letter options where appropriate. We were -running out of sensible letters. This may break some -makefiles, so check the current options list by invoking the -compiler with no parameters. +Reworked the compiler options to make them more consistent and +to use two-letter options where appropriate. We were running +out of sensible letters. This may break some makefiles, so +check the current options list by invoking the compiler with +no parameters. Completed the design and implementation of the ASL namepath optimization option for the compiler. This option optimizes -all references to named objects to the shortest possible -path. The first attempt tries to utilize a single nameseg -(4 characters) and the “search-to-root” algorithm used by -the interpreter. If that cannot be used (because either the -name is not in the search path or there is a conflict with -another object with the same name), the pathname is -optimized using the carat prefix (usually a shorter string -than specifying the entire path from the root.) +all references to named objects to the shortest possible path. +The first attempt tries to utilize a single nameseg (4 +characters) and the "search-to-root" algorithm used by the +interpreter. If that cannot be used (because either the name +is not in the search path or there is a conflict with another +object with the same name), the pathname is optimized using +the carat prefix (usually a shorter string than specifying the +entire path from the root.) Implemented support to obtain the DSDT from the Windows registry (when the disassembly option is specified with no @@ -107,12 +302,12 @@ compile it in one step. Added a warning message for invalid escapes (a backslash followed by any character other than the allowable escapes). -This catches the quoted string error “\_SB_” (which should -be “\\_SB_” ). Also, there are numerous instances in the -ACPI specification where this error occurs. +This catches the quoted string error "\_SB_" (which should be +"\\_SB_" ). Also, there are numerous instances in the ACPI +specification where this error occurs. -Added a compiler option to disable all optimizations. This -is basically the “compatibility mode” because by using this +Added a compiler option to disable all optimizations. This is +basically the "compatibility mode" because by using this option, the AML code will come out exactly the same as other ASL compilers. @@ -124,14 +319,13 @@ StartDependentFn macro. These are common errors that should be caught at compile time. Implemented _OSI support for the disassembler and compiler. -_OSI must be included in the namespace for proper -disassembly (because the disassembler must know the number -of arguments.) +_OSI must be included in the namespace for proper disassembly +(because the disassembler must know the number of arguments.) -Added an “optimization” message type that is optional (off -by default). This message is used for all optimizations – -including constant folding, integer optimization, and -namepath optimization. +Added an "optimization" message type that is optional (off by +default). This message is used for all optimizations - +including constant folding, integer optimization, and namepath +optimization. ---------------------------------------- 25 July 2002. Summary of changes for this release. @@ -159,24 +353,19 @@ AcpiOsVprintf interfaces. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 68.7K Code, 7.4K Data, 76.1K -Total - Debug Version: 142.9K Code, 58.7K Data, 201.6K -Total + Non-Debug Version: 68.7K Code, 7.4K Data, 76.1K Total + Debug Version: 142.9K Code, 58.7K Data, 201.6K Total Current Release: - Non-Debug Version: 69.1K Code, 8.2K Data, 77.3K -Total - Debug Version: 149.4K Code, 61.6K Data, 211.0K -Total + Non-Debug Version: 69.1K Code, 8.2K Data, 77.3K Total + Debug Version: 149.4K Code, 61.6K Data, 211.0K Total 2) Linux @@ -190,12 +379,12 @@ scan (Richard Schaal) 3) iASL compiler The AML disassembler is integrated into the compiler. The "- -d" option invokes the disassembler to completely -disassemble an input AML file, producing as output a text -ASL file with the extension ".dsl" (to avoid name collisions -with existing .asl source files.) A future enhancement will -allow the disassembler to obtain the BIOS DSDT from the -registry under Windows. +d" option invokes the disassembler to completely disassemble +an input AML file, producing as output a text ASL file with +the extension ".dsl" (to avoid name collisions with existing +.asl source files.) A future enhancement will allow the +disassembler to obtain the BIOS DSDT from the registry under +Windows. Fixed a problem with the VendorShort and VendorLong resource descriptors where an invalid AML sequence was created. @@ -204,10 +393,10 @@ Implemented a fix for BufferData term in the ASL parser. It was inadvertently defined twice, allowing invalid syntax to pass and causing reduction conflicts. -Fixed a problem where the Ones opcode could get converted to -a value of zero if "Ones" was used where a byte, word or -dword value was expected. The 64-bit value is now truncated -to the correct size with the correct value. +Fixed a problem where the Ones opcode could get converted to a +value of zero if "Ones" was used where a byte, word or dword +value was expected. The 64-bit value is now truncated to the +correct size with the correct value. ---------------------------------------- @@ -222,37 +411,36 @@ subsystem (other than the FADT, DSDT, FACS, PSDTs, etc.) are no longer validated in any way and are returned from AcpiGetFirmwareTable if requested. The AcpiOsTableOverride interface is now called for each table that is loaded by the -subsystem in order to allow the host to override any table -it chooses. Previously, only the DSDT could be overridden. +subsystem in order to allow the host to override any table it +chooses. Previously, only the DSDT could be overridden. Added one new files, tbrsdt.c and tbgetall.c. Fixed a problem with the conversion of internal package -objects to external objects (when a package is returned from -a control method.) The return buffer length was set to zero +objects to external objects (when a package is returned from a +control method.) The return buffer length was set to zero instead of the proper length of the package object. -Fixed a reported problem with the use of the RefOf and -DeRefOf operators when passing reference arguments to -control methods. A new type of Reference object is used -internally for references produced by the RefOf operator. +Fixed a reported problem with the use of the RefOf and DeRefOf +operators when passing reference arguments to control methods. +A new type of Reference object is used internally for +references produced by the RefOf operator. Added additional error messages in the Resource Manager to explain AE_BAD_DATA errors when they occur during resource parsing. -Split the AcpiEnableSubsystem into two primitives to enable -a finer granularity initialization sequence. These two -calls should be called in this order: AcpiEnableSubsystem -(flags), AcpiInitializeObjects (flags). The flags parameter -remains the same. +Split the AcpiEnableSubsystem into two primitives to enable a +finer granularity initialization sequence. These two calls +should be called in this order: AcpiEnableSubsystem (flags), +AcpiInitializeObjects (flags). The flags parameter remains +the same. 2) Linux -Updated the ACPI utilities module to understand the new -style of fully resolved package objects that are now -returned from the core subsystem. This eliminates errors of -the form: +Updated the ACPI utilities module to understand the new style +of fully resolved package objects that are now returned from +the core subsystem. This eliminates errors of the form: ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PPB_._PRT] acpi_utils-0430 [145] acpi_evaluate_reference: @@ -263,18 +451,18 @@ scheme instead of calling AcpiEvaluate Object twice. Added support for ECDT. This allows the use of the Embedded Controller before the namespace has been fully initialized, -which is necessary for ACPI 2.0 support, and for some -laptops to initialize properly. (Laptops using ECDT are -still rare, so only limited testing was performed of the -added functionality.) +which is necessary for ACPI 2.0 support, and for some laptops +to initialize properly. (Laptops using ECDT are still rare, so +only limited testing was performed of the added +functionality.) Fixed memory leaks in the EC driver. Eliminated a brittle code structure in acpi_bus_init(). -Eliminated the acpi_evaluate() helper function in utils.c. -It is no longer needed since acpi_evaluate_object can -optionally allocate memory for the return object. +Eliminated the acpi_evaluate() helper function in utils.c. It +is no longer needed since acpi_evaluate_object can optionally +allocate memory for the return object. Implemented fix for keyboard hang when getting battery readings on some systems (Stephen White) @@ -290,76 +478,69 @@ IOAPIC support 1) ACPI CA Core Subsystem Version 20020611: -Fixed a reported problem where constants such as Zero and -One appearing within _PRT packages were not handled -correctly within the resource manager code. Originally -reported against the ASL compiler because the code generator -now optimizes integers to their minimal AML representation -(i.e. AML constants if possible.) The _PRT code now handles -all AML constant opcodes correctly (Zero, One, Ones, -Revision). +Fixed a reported problem where constants such as Zero and One +appearing within _PRT packages were not handled correctly +within the resource manager code. Originally reported against +the ASL compiler because the code generator now optimizes +integers to their minimal AML representation (i.e. AML +constants if possible.) The _PRT code now handles all AML +constant opcodes correctly (Zero, One, Ones, Revision). Fixed a problem with the Concatenate operator in the AML interpreter where a buffer result object was incorrectly marked as not fully evaluated, causing a run-time error of AE_AML_INTERNAL. -All package sub-objects are now fully resolved before they -are returned from the external ACPI interfaces. This means -that name strings are resolved to object handles, and -constant operators (Zero, One, Ones, Revision) are resolved -to Integers. +All package sub-objects are now fully resolved before they are +returned from the external ACPI interfaces. This means that +name strings are resolved to object handles, and constant +operators (Zero, One, Ones, Revision) are resolved to +Integers. Implemented immediate resolution of the AML Constant opcodes -(Zero, One, Ones, Revision) to Integer objects upon -detection within the AML stream. This has simplified and -reduced the generated code size of the subsystem by -eliminating about 10 switch statements for these constants -(which previously were contained in Reference objects.) The -complicating issues are that the Zero opcode is used as a -"placeholder" for unspecified optional target operands and -stores to constants are defined to be no-ops. +(Zero, One, Ones, Revision) to Integer objects upon detection +within the AML stream. This has simplified and reduced the +generated code size of the subsystem by eliminating about 10 +switch statements for these constants (which previously were +contained in Reference objects.) The complicating issues are +that the Zero opcode is used as a "placeholder" for +unspecified optional target operands and stores to constants +are defined to be no-ops. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 69.3K Code, 7.4K Data, 76.7K -Total - Debug Version: 143.8K Code, 58.8K Data, 202.6K -Total + Non-Debug Version: 69.3K Code, 7.4K Data, 76.7K Total + Debug Version: 143.8K Code, 58.8K Data, 202.6K Total Current Release: - Non-Debug Version: 68.7K Code, 7.4K Data, 76.1K -Total - Debug Version: 142.9K Code, 58.7K Data, 201.6K -Total + Non-Debug Version: 68.7K Code, 7.4K Data, 76.1K Total + Debug Version: 142.9K Code, 58.7K Data, 201.6K Total 2) Linux -Added preliminary support for obtaining _TRA data for PCI -root bridges (Bjorn Helgaas). +Added preliminary support for obtaining _TRA data for PCI root +bridges (Bjorn Helgaas). 3) iASL Compiler Version X2046: -Fixed a problem where the "_DDN" reserved name was defined -to be a control method with one argument. There are no +Fixed a problem where the "_DDN" reserved name was defined to +be a control method with one argument. There are no arguments, and _DDN does not have to be a control method. Fixed a problem with the Linux version of the compiler where the source lines printed with error messages were the wrong -lines. This turned out to be the "LF versus CR/LF" -difference between Windows and Unix. This appears to be the -longstanding issue concerning listing output and error -messages. +lines. This turned out to be the "LF versus CR/LF" difference +between Windows and Unix. This appears to be the longstanding +issue concerning listing output and error messages. Fixed a problem with the Linux version of compiler where opcode names within error messages were wrong. This was @@ -367,8 +548,8 @@ caused by a slight difference in the output of the Flex tool on Linux versus Windows. Fixed a problem with the Linux compiler where the hex output -files contained some garbage data caused by an internal -buffer overrun. +files contained some garbage data caused by an internal buffer +overrun. ---------------------------------------- @@ -378,15 +559,14 @@ buffer overrun. 1) ACPI CA Core Subsystem Version 20020517: Implemented a workaround to an BIOS bug discovered on the HP -OmniBook where the FADT revision number and the table size -are inconsistent (ACPI 2.0 revision vs. ACPI 1.0 table -size). The new behavior is to fallback to using only the -ACPI 1.0 fields of the FADT if the table is too small to be -a ACPI 2.0 table as claimed by the revision number. -Although this is a BIOS bug, this is a case where the -workaround is simple enough and with no side effects, so it -seemed prudent to add it. A warning message is issued, -however. +OmniBook where the FADT revision number and the table size are +inconsistent (ACPI 2.0 revision vs. ACPI 1.0 table size). The +new behavior is to fallback to using only the ACPI 1.0 fields +of the FADT if the table is too small to be a ACPI 2.0 table +as claimed by the revision number. Although this is a BIOS +bug, this is a case where the workaround is simple enough and +with no side effects, so it seemed prudent to add it. A +warning message is issued, however. Implemented minimum size checks for the fixed-length ACPI tables -- the FADT and FACS, as well as consistency checks @@ -396,33 +576,28 @@ Fixed a reported problem in the table override support where the new table pointer was incorrectly treated as a physical address instead of a logical address. -Eliminated the use of the AE_AML_ERROR exception and -replaced it with more descriptive codes. +Eliminated the use of the AE_AML_ERROR exception and replaced +it with more descriptive codes. -Fixed a problem where an exception would occur if an ASL -Field was defined with no named Field Units underneath it -(used by some index fields). +Fixed a problem where an exception would occur if an ASL Field +was defined with no named Field Units underneath it (used by +some index fields). Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 68.8K Code, 7.1K Data, 75.9K -Total - Debug Version: 142.9K Code, 58.4K Data, 201.3K -Total + Non-Debug Version: 68.8K Code, 7.1K Data, 75.9K Total + Debug Version: 142.9K Code, 58.4K Data, 201.3K Total Current Release: - Non-Debug Version: 69.3K Code, 7.4K Data, 76.7K -Total - Debug Version: 143.8K Code, 58.8K Data, 202.6K -Total + Non-Debug Version: 69.3K Code, 7.4K Data, 76.7K Total + Debug Version: 143.8K Code, 58.8K Data, 202.6K Total @@ -456,15 +631,15 @@ alphanumeric characters (e.g., "*PNP0011" is not allowed because of the asterisk.) Implemented checking for invalid use of ACPI reserved names -for most of the name creation operators (Name, Device, -Event, Mutex, OperationRegion, PowerResource, Processor, and +for most of the name creation operators (Name, Device, Event, +Mutex, OperationRegion, PowerResource, Processor, and ThermalZone.) Previously, this check was only performed for control methods. Implemented an additional check on the Name operator to emit -an error if a reserved name that must be implemented in ASL -as a control method is used. We know that a reserved name -must be a method if it is defined with input arguments. +an error if a reserved name that must be implemented in ASL as +a control method is used. We know that a reserved name must +be a method if it is defined with input arguments. The warning emitted when a namespace object reference is not found during the cross reference phase has been changed into @@ -478,8 +653,8 @@ The 16-bit tools (adump16 and aexec16) have been regenerated and tested. Fixed a problem with the output of both acpidump and adump16 -where the indentation of closing parentheses and brackets -was not aligned properly with the parent block. +where the indentation of closing parentheses and brackets was +not aligned properly with the parent block. ---------------------------------------- @@ -490,18 +665,17 @@ was not aligned properly with the parent block. Added support a new OSL interface that allows the host operating system software to override the DSDT found in the -firmware - AcpiOsTableOverride. With this interface, the -OSL can examine the version of the firmware DSDT and replace -it with a different one if desired. +firmware - AcpiOsTableOverride. With this interface, the OSL +can examine the version of the firmware DSDT and replace it +with a different one if desired. Added new external interfaces for accessing ACPI registers from device drivers and other system software - AcpiGetRegister and AcpiSetRegister. This was simply an -externalization of the existing AcpiHwBitRegister -interfaces. +externalization of the existing AcpiHwBitRegister interfaces. -Fixed a regression introduced in the previous build where -the ASL/AML CreateField operator always returned an error, +Fixed a regression introduced in the previous build where the +ASL/AML CreateField operator always returned an error, "destination must be a NS Node". Extended the maximum time (before failure) to successfully @@ -509,34 +683,29 @@ enable ACPI mode to 3 seconds. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 68.5K Code, 7.0K Data, 75.5K -Total - Debug Version: 142.4K Code, 58.3K Data, 200.7K -Total + Non-Debug Version: 68.5K Code, 7.0K Data, 75.5K Total + Debug Version: 142.4K Code, 58.3K Data, 200.7K Total Current Release: - Non-Debug Version: 68.8K Code, 7.1K Data, 75.9K -Total - Debug Version: 142.9K Code, 58.4K Data, 201.3K -Total + Non-Debug Version: 68.8K Code, 7.1K Data, 75.9K Total + Debug Version: 142.9K Code, 58.4K Data, 201.3K Total 2) Linux -Enhanced ACPI init code for SMP. We are now fully MPS and -$PIR-free. While 3 out of 4 of our in-house systems work -fine, the last one still hangs when testing the LAPIC timer. +Enhanced ACPI init code for SMP. We are now fully MPS and $PIR- +free. While 3 out of 4 of our in-house systems work fine, the +last one still hangs when testing the LAPIC timer. -Renamed many files in 2.5 kernel release to omit "acpi_" -from the name. +Renamed many files in 2.5 kernel release to omit "acpi_" from +the name. Added warning on boot for Presario 711FR. @@ -549,42 +718,41 @@ IA64: Fixed memory map functions (JI Lee) 3) iASL Compiler Version X2043: -Added support to allow the compiler to be integrated into -the MS VC++ development environment for one-button -compilation of single files or entire projects -- with error- -to-source-line mapping. - -Implemented support for compile-time constant folding for -the Type3, Type4, and Type5 opcodes first defined in the -ACPI 2.0 specification. This allows the ASL writer to use -expressions instead of Integer/Buffer/String constants in -terms that must evaluate to constants at compile time and -will also simplify the emitted AML in any such sub- -expressions that can be folded (evaluated at compile-time.) -This increases the size of the compiler significantly -because a portion of the ACPI CA AML interpreter is included -within the compiler in order to pre-evaluate constant -expressions. +Added support to allow the compiler to be integrated into the +MS VC++ development environment for one-button compilation of +single files or entire projects -- with error-to-source-line +mapping. + +Implemented support for compile-time constant folding for the +Type3, Type4, and Type5 opcodes first defined in the ACPI 2.0 +specification. This allows the ASL writer to use expressions +instead of Integer/Buffer/String constants in terms that must +evaluate to constants at compile time and will also simplify +the emitted AML in any such sub-expressions that can be folded +(evaluated at compile-time.) This increases the size of the +compiler significantly because a portion of the ACPI CA AML +interpreter is included within the compiler in order to pre- +evaluate constant expressions. Fixed a problem with the "Unicode" ASL macro that caused the compiler to fault. (This macro is used in conjunction with the _STR reserved name.) Implemented an AML opcode optimization to use the Zero, One, -and Ones opcodes where possible to further reduce the size -of integer constants and thus reduce the overall size of the +and Ones opcodes where possible to further reduce the size of +integer constants and thus reduce the overall size of the generated AML code. Implemented error checking for new reserved terms for ACPI version 2.0A. -Implemented the -qr option to display the current list of -ACPI reserved names known to the compiler. +Implemented the -qr option to display the current list of ACPI +reserved names known to the compiler. -Implemented the -qc option to display the current list of -ASL operators that are allowed within constant expressions -and can therefore be folded at compile time if the operands -are constants. +Implemented the -qc option to display the current list of ASL +operators that are allowed within constant expressions and can +therefore be folded at compile time if the operands are +constants. 4) Documentation @@ -601,18 +769,18 @@ and add information about new features and options. 1) ACPI CA Core Subsystem Version 20020419: The source code base for the Core Subsystem has been -completely cleaned with PC-lint (FlexLint) for both 32-bit -and 64-bit versions. The Lint option files used are -included in the /acpi/generate/lint directory. +completely cleaned with PC-lint (FlexLint) for both 32-bit and +64-bit versions. The Lint option files used are included in +the /acpi/generate/lint directory. Implemented enhanced status/error checking across the entire Hardware manager subsystem. Any hardware errors (reported from the OSL) are now bubbled up and will abort a running control method. -Fixed a problem where the per-ACPI-table integer width (32 -or 64) was stored only with control method nodes, causing a -fault when non-control method code was executed during table +Fixed a problem where the per-ACPI-table integer width (32 or +64) was stored only with control method nodes, causing a fault +when non-control method code was executed during table loading. The solution implemented uses a global variable to indicate table width across the entire ACPI subsystem. Therefore, ACPI CA does not support mixed integer widths @@ -620,21 +788,20 @@ across different ACPI tables (DSDT, SSDT). Fixed a problem where NULL extended fields (X fields) in an ACPI 2.0 ACPI FADT caused the table load to fail. Although -the existing ACPI specification is a bit fuzzy on this -topic, the new behavior is to fall back on a ACPI 1.0 field -if the corresponding ACPI 2.0 X field is zero (even though -the table revision indicates a full ACPI 2.0 table.) The -ACPI specification will be updated to clarify this issue. - -Fixed a problem with the SystemMemory operation region -handler where memory was always accessed byte-wise even if -the AML-specified access width was larger than a byte. This -caused problems on systems with memory-mapped I/O. Memory -is now accessed with the width specified. On systems that -do not support non-aligned transfers, a check is made to -guarantee proper address alignment before proceeding in -order to avoid an AML-caused alignment fault within the -kernel. +the existing ACPI specification is a bit fuzzy on this topic, +the new behavior is to fall back on a ACPI 1.0 field if the +corresponding ACPI 2.0 X field is zero (even though the table +revision indicates a full ACPI 2.0 table.) The ACPI +specification will be updated to clarify this issue. + +Fixed a problem with the SystemMemory operation region handler +where memory was always accessed byte-wise even if the AML- +specified access width was larger than a byte. This caused +problems on systems with memory-mapped I/O. Memory is now +accessed with the width specified. On systems that do not +support non-aligned transfers, a check is made to guarantee +proper address alignment before proceeding in order to avoid +an AML-caused alignment fault within the kernel. Fixed a problem with the ExtendedIrq resource where only one byte of the 4-byte Irq field was extracted. @@ -644,24 +811,19 @@ This function was out of date and required a rewrite. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 66.6K Code, 6.5K Data, 73.1K -Total - Debug Version: 139.8K Code, 57.4K Data, 197.2K -Total + Non-Debug Version: 66.6K Code, 6.5K Data, 73.1K Total + Debug Version: 139.8K Code, 57.4K Data, 197.2K Total Current Release: - Non-Debug Version: 68.5K Code, 7.0K Data, 75.5K -Total - Debug Version: 142.4K Code, 58.3K Data, 200.7K -Total + Non-Debug Version: 68.5K Code, 7.0K Data, 75.5K Total + Debug Version: 142.4K Code, 58.3K Data, 200.7K Total 2) Linux @@ -671,14 +833,14 @@ PCI IRQ routing fixes (Dominik Brodowski) 3) iASL Compiler Version X2042: -Implemented an additional compile-time error check for a -field unit whose size + minimum access width would cause a -run-time access beyond the end-of-region. Previously, only -the field size itself was checked. +Implemented an additional compile-time error check for a field +unit whose size + minimum access width would cause a run-time +access beyond the end-of-region. Previously, only the field +size itself was checked. -The Core subsystem and iASL compiler now share a common -parse object in preparation for compile-time evaluation of -the type 3/4/5 ASL operators. +The Core subsystem and iASL compiler now share a common parse +object in preparation for compile-time evaluation of the type +3/4/5 ASL operators. ---------------------------------------- @@ -686,31 +848,29 @@ Summary of changes for this release: 03_29_02 1) ACPI CA Core Subsystem Version 20020329: -Implemented support for late evaluation of TermArg operands -to Buffer and Package objects. This allows complex -expressions to be used in the declarations of these object -types. - -Fixed an ACPI 1.0 compatibility issue when reading Fields. -In ACPI 1.0, if the field was larger than 32 bits, it was -returned as a buffer – otherwise it was returned as an -integer. In ACPI 2.0, the field is returned as a buffer -only if the field is larger than 64 bits. The TableRevision -is now considered when making this conversion to avoid +Implemented support for late evaluation of TermArg operands to +Buffer and Package objects. This allows complex expressions +to be used in the declarations of these object types. + +Fixed an ACPI 1.0 compatibility issue when reading Fields. In +ACPI 1.0, if the field was larger than 32 bits, it was +returned as a buffer - otherwise it was returned as an +integer. In ACPI 2.0, the field is returned as a buffer only +if the field is larger than 64 bits. The TableRevision is now +considered when making this conversion to avoid incompatibility with existing ASL code. -Implemented logical addressing for AcpiOsGetRootPointer. -This allows an RSDP with either a logical or physical -address. With this support, the host OS can now override -all ACPI tables with one logical RSDP. Includes -implementation of “typed” pointer support to allow a common -data type for both physical and logical pointers internally. -This required a change to the AcpiOsGetRootPointer -interface. +Implemented logical addressing for AcpiOsGetRootPointer. This +allows an RSDP with either a logical or physical address. +With this support, the host OS can now override all ACPI +tables with one logical RSDP. Includes implementation of +"typed" pointer support to allow a common data type for both +physical and logical pointers internally. This required a +change to the AcpiOsGetRootPointer interface. -Implemented the use of ACPI 2.0 Generic Address Structures -for all GPE, Fixed Event, and PM Timer I/O. This allows the -use of memory mapped I/O for these ACPI features. +Implemented the use of ACPI 2.0 Generic Address Structures for +all GPE, Fixed Event, and PM Timer I/O. This allows the use +of memory mapped I/O for these ACPI features. Initialization now ignores not only non-required tables (All tables other than the FADT, FACS, DSDT, and SSDTs), but also @@ -722,29 +882,24 @@ objects are now supported -- Devices, Processor, Power, and Thermal. Removed most verbosity from the ACPI_DB_INFO debug level. -Only critical information is returned when this debug level -is enabled. +Only critical information is returned when this debug level is +enabled. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release - Non-Debug Version: 65.4K Code, 6.2K Data, 71.6K -Total - Debug Version: 138.0K Code, 56.6K Data, 194.6K -Total + Non-Debug Version: 65.4K Code, 6.2K Data, 71.6K Total + Debug Version: 138.0K Code, 56.6K Data, 194.6K Total Current Release: - Non-Debug Version: 66.6K Code, 6.5K Data, 73.1K -Total - Debug Version: 139.8K Code, 57.4K Data, 197.2K -Total + Non-Debug Version: 66.6K Code, 6.5K Data, 73.1K Total + Debug Version: 139.8K Code, 57.4K Data, 197.2K Total 2) Linux: @@ -766,12 +921,11 @@ bound (associated) with their PCI counterparts (e.g. PCI1- >01:00.0). This allows, among other things, ACPI to resolve bus numbers for subordinate PCI bridges. -Enhanced PCI IRQ routing to get the proper bus number for -_PRT entries defined underneath PCI bridges. +Enhanced PCI IRQ routing to get the proper bus number for _PRT +entries defined underneath PCI bridges. -Added IBM 600E to bad bios list due to invalid _ADR value -for PIIX4 PCI-ISA bridge, resulting in improper PCI IRQ -routing. +Added IBM 600E to bad bios list due to invalid _ADR value for +PIIX4 PCI-ISA bridge, resulting in improper PCI IRQ routing. In the process of adding full MADT support (e.g. IOAPIC) for IA32 (acpi.c, mpparse.c) -- stay tuned. @@ -788,8 +942,8 @@ Can now shut down the system using "magic sysrq" key. 3) iASL Compiler version 2041: -Fixed a problem where conversion errors for -hex/octal/decimal constants were not reported. +Fixed a problem where conversion errors for hex/octal/decimal +constants were not reported. Implemented a fix for the General Register template Address field. This field was 8 bits when it should be 64. @@ -797,8 +951,8 @@ field. This field was 8 bits when it should be 64. Fixed a problem where errors/warnings were no longer being emitted within the listing output file. -Implemented the ACPI 2.0A restriction on ACPI Table -Signatures to exactly 4 characters, alphanumeric only. +Implemented the ACPI 2.0A restriction on ACPI Table Signatures +to exactly 4 characters, alphanumeric only. @@ -815,8 +969,8 @@ attempting to read or write beyond the end of the parent Operation Region. Fixed a problem in the SystemMemory Operation Region handler -where an attempt was made to map memory beyond the end of -the region. This was the root cause of the "AE_ERROR" and +where an attempt was made to map memory beyond the end of the +region. This was the root cause of the "AE_ERROR" and "AE_NO_MEMORY" errors on some Linux systems. Fixed a problem where the interpreter/namespace "search to @@ -828,12 +982,12 @@ internal types. 2) Linux: -We now use safe_halt() macro versus individual calls to sti -| hlt. +We now use safe_halt() macro versus individual calls to sti | +hlt. Writing to the processor limit interface should now work. -"echo 1" will increase the limit, 2 will decrease, and 0 -will reset to the default. +"echo 1" will increase the limit, 2 will decrease, and 0 will +reset to the default. 3) ASL compiler: @@ -850,11 +1004,11 @@ Summary of changes for this release: 02_25_02 Fixed a problem where the GPE bit masks were not initialized properly, causing erratic GPE behavior. -Implemented limited support for multiple calling -conventions. The code can be generated with either the VPL -(variable parameter list, or "C") convention, or the FPL -(fixed parameter list, or "Pascal") convention. The core -subsystem is about 3.4% smaller when generated with FPL. +Implemented limited support for multiple calling conventions. +The code can be generated with either the VPL (variable +parameter list, or "C") convention, or the FPL (fixed +parameter list, or "Pascal") convention. The core subsystem +is about 3.4% smaller when generated with FPL. 2) Linux @@ -874,8 +1028,8 @@ codes. Changed ACPI PRT option from "pci=noacpi-routing" to "pci=noacpi" -Fixed limit interface & usage to fix bugs with passive -cooling hysterisis. +Fixed limit interface & usage to fix bugs with passive cooling +hysterisis. Restructured PRT support. @@ -886,13 +1040,13 @@ Summary of changes for this label: 02_14_02 1) ACPI CA Core Subsystem: -Implemented support in AcpiLoadTable to allow loading of -FACS and FADT tables. +Implemented support in AcpiLoadTable to allow loading of FACS +and FADT tables. Suport for the now-obsolete interim 0.71 64-bit ACPI tables -has been removed. All 64-bit platforms should be migrated -to the ACPI 2.0 tables. The actbl71.h header has been -removed from the source tree. +has been removed. All 64-bit platforms should be migrated to +the ACPI 2.0 tables. The actbl71.h header has been removed +from the source tree. All C macros defined within the subsystem have been prefixed with "ACPI_" to avoid collision with other system include @@ -902,15 +1056,15 @@ Removed the return value for the two AcpiOsPrint interfaces, since it is never used and causes lint warnings for ignoring the return value. -Added error checking to all internal mutex acquire and -release calls. Although a failure from one of these -interfaces is probably a fatal system error, these checks -will cause the immediate abort of the currently executing -method or interface. +Added error checking to all internal mutex acquire and release +calls. Although a failure from one of these interfaces is +probably a fatal system error, these checks will cause the +immediate abort of the currently executing method or +interface. Fixed a problem where the AcpiSetCurrentResources interface -could fault. This was a side effect of the deployment of -the new memory allocation model. +could fault. This was a side effect of the deployment of the +new memory allocation model. Fixed a couple of problems with the Global Lock support introduced in the last major build. The "common" (1.0/2.0) @@ -924,24 +1078,19 @@ global. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release (02_07_01) - Non-Debug Version: 65.2K Code, 6.2K Data, 71.4K -Total - Debug Version: 136.9K Code, 56.4K Data, 193.3K -Total + Non-Debug Version: 65.2K Code, 6.2K Data, 71.4K Total + Debug Version: 136.9K Code, 56.4K Data, 193.3K Total Current Release: - Non-Debug Version: 65.4K Code, 6.2K Data, 71.6K -Total - Debug Version: 138.0K Code, 56.6K Data, 194.6K -Total + Non-Debug Version: 65.4K Code, 6.2K Data, 71.6K Total + Debug Version: 138.0K Code, 56.6K Data, 194.6K Total 2) Linux @@ -949,16 +1098,15 @@ Total Updated Linux-specific code for core macro and OSL interface changes described above. -Improved /proc/acpi/event. It now can be opened only once -and has proper poll functionality. +Improved /proc/acpi/event. It now can be opened only once and +has proper poll functionality. Fixed and restructured power management (acpi_bus). Only create /proc "view by type" when devices of that class exist. -Fixed "charging/discharging" bug (and others) in -acpi_battery. +Fixed "charging/discharging" bug (and others) in acpi_battery. Improved thermal zone code. @@ -966,14 +1114,14 @@ Improved thermal zone code. 3) ASL Compiler, version X2039: Implemented the new compiler restriction on ASL String -hex/octal escapes to non-null, ASCII values. An error -results if an invalid value is used. (This will require an -ACPI 2.0 specification change.) +hex/octal escapes to non-null, ASCII values. An error results +if an invalid value is used. (This will require an ACPI 2.0 +specification change.) AML object labels that are output to the optional C and ASM -source are now prefixed with both the ACPI table signature -and table ID to help guarantee uniqueness within a large -BIOS project. +source are now prefixed with both the ACPI table signature and +table ID to help guarantee uniqueness within a large BIOS +project. ---------------------------------------- @@ -981,57 +1129,54 @@ Summary of changes for this label: 02_01_02 1) ACPI CA Core Subsystem: -ACPI 2.0 support is complete in the entire Core Subsystem -and the ASL compiler. All new ACPI 2.0 operators are -implemented and all other changes for ACPI 2.0 support are -complete. With simultaneous code and data optimizations -throughout the subsystem, ACPI 2.0 support has been -implemented with almost no additional cost in terms of code -and data size. - -Implemented a new mechanism for allocation of return -buffers. If the buffer length is set to -ACPI_ALLOCATE_BUFFER, the buffer will be allocated on behalf -of the caller. Consolidated all return buffer validation -and allocation to a common procedure. Return buffers will -be allocated via the primary OSL allocation interface since -it appears that a separate pool is not needed by most users. -If a separate pool is required for these buffers, the caller -can still use the original mechanism and pre-allocate the -buffer(s). +ACPI 2.0 support is complete in the entire Core Subsystem and +the ASL compiler. All new ACPI 2.0 operators are implemented +and all other changes for ACPI 2.0 support are complete. With +simultaneous code and data optimizations throughout the +subsystem, ACPI 2.0 support has been implemented with almost +no additional cost in terms of code and data size. + +Implemented a new mechanism for allocation of return buffers. +If the buffer length is set to ACPI_ALLOCATE_BUFFER, the +buffer will be allocated on behalf of the caller. +Consolidated all return buffer validation and allocation to a +common procedure. Return buffers will be allocated via the +primary OSL allocation interface since it appears that a +separate pool is not needed by most users. If a separate pool +is required for these buffers, the caller can still use the +original mechanism and pre-allocate the buffer(s). Implemented support for string operands within the DerefOf operator. Restructured the Hardware and Event managers to be table -driven, simplifying the source code and reducing the amount -of generated code. +driven, simplifying the source code and reducing the amount of +generated code. Split the common read/write low-level ACPI register bitfield -procedure into a separate read and write, simplifying the -code considerably. +procedure into a separate read and write, simplifying the code +considerably. Obsoleted the AcpiOsCallocate OSL interface. This interface was used only a handful of times and didn't have enough critical mass for a separate interface. Replaced with a common calloc procedure in the core. -Fixed a reported problem with the GPE number mapping -mechanism that allows GPE1 numbers to be non-contiguous with -GPE0. Reorganized the GPE information and shrunk a large -array that was originally large enough to hold info for all -possible GPEs (256) to simply large enough to hold all GPEs -up to the largest GPE number on the machine. +Fixed a reported problem with the GPE number mapping mechanism +that allows GPE1 numbers to be non-contiguous with GPE0. +Reorganized the GPE information and shrunk a large array that +was originally large enough to hold info for all possible GPEs +(256) to simply large enough to hold all GPEs up to the +largest GPE number on the machine. -Fixed a reported problem with resource structure alignment -on 64-bit platforms. +Fixed a reported problem with resource structure alignment on +64-bit platforms. Changed the AcpiEnableEvent and AcpiDisableEvent external interfaces to not require any flags for the common case of enabling/disabling a GPE. -Implemented support to allow a "Notify" on a Processor -object. +Implemented support to allow a "Notify" on a Processor object. Most TBDs in comments within the source code have been resolved and eliminated. @@ -1043,11 +1188,11 @@ debugger. Removed obsolete and unnecessary GPE save/restore code. Implemented Field support in the ASL Load operator. This -allows a table to be loaded from a named field, in addition -to loading a table directly from an Operation Region. +allows a table to be loaded from a named field, in addition to +loading a table directly from an Operation Region. -Implemented timeout and handle support in the external -Global Lock interfaces. +Implemented timeout and handle support in the external Global +Lock interfaces. Fixed a problem in the AcpiDump utility where pathnames were no longer being generated correctly during the dump of named @@ -1060,13 +1205,12 @@ method was confusing during single stepping. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release (12_18_01) Non-Debug Version: 66.1K Code, 5.5K Data, 71.6K @@ -1081,8 +1225,8 @@ Total 2) Linux - Implemented fix for PIIX reverse throttling errata -(Processor driver) + Implemented fix for PIIX reverse throttling errata (Processor +driver) Added new Limit interface (Processor and Thermal drivers) @@ -1092,37 +1236,34 @@ Many updates to /proc Battery "low" event support (Battery driver) -Supports ACPI PCI IRQ routing (PCI Link and PCI root -drivers) +Supports ACPI PCI IRQ routing (PCI Link and PCI root drivers) -IA32 - IA64 initialization unification, no longer -experimental +IA32 - IA64 initialization unification, no longer experimental Menuconfig options redesigned 3) ASL Compiler, version X2037: Implemented several new output features to simplify -integration of AML code into firmware: 1) Output the AML in -C source code with labels for each named ASL object. The +integration of AML code into firmware: 1) Output the AML in C +source code with labels for each named ASL object. The original ASL source code is interleaved as C comments. 2) -Output the AML in ASM source code with labels and -interleaved ASL source. 3) Output the AML in raw hex -table form, in either C or ASM. +Output the AML in ASM source code with labels and interleaved +ASL source. 3) Output the AML in raw hex table form, in +either C or ASM. Implemented support for optional string parameters to the LoadTable operator. -Completed support for embedded escape sequences within -string literals. The compiler now supports all single -character escapes as well as the Octal and Hex escapes. -Note: the insertion of a null byte into a string literal -(via the hex/octal escape) causes the string to be -immediately terminated. A warning is issued. +Completed support for embedded escape sequences within string +literals. The compiler now supports all single character +escapes as well as the Octal and Hex escapes. Note: the +insertion of a null byte into a string literal (via the +hex/octal escape) causes the string to be immediately +terminated. A warning is issued. -Fixed a problem where incorrect AML was generated for the -case where an ASL namepath consists of a single parent -prefix ( +Fixed a problem where incorrect AML was generated for the case +where an ASL namepath consists of a single parent prefix ( ) with no trailing name segments. @@ -1149,25 +1290,23 @@ Cleaned up busmgr /proc error handling (Andreas Dilger) 2) ACPI CA Core Subsystem: -Implemented ACPI 2.0 semantics for the "Break" operator -(Exit from while loop) +Implemented ACPI 2.0 semantics for the "Break" operator (Exit +from while loop) Completed implementation of the ACPI 2.0 "Continue", "ConcatenateResTemplate", "DataTableRegion", and "LoadTable" -operators. All new ACPI 2.0 operators are now implemented -in both the ASL compiler and the AML interpreter. The only -remaining ACPI 2.0 task is support for the String data type -in the DerefOf operator. Fixed a problem with AcquireMutex -where the status code was lost if the caller had to actually -wait for the mutex. +operators. All new ACPI 2.0 operators are now implemented in +both the ASL compiler and the AML interpreter. The only +remaining ACPI 2.0 task is support for the String data type in +the DerefOf operator. Fixed a problem with AcquireMutex where +the status code was lost if the caller had to actually wait +for the mutex. -Increased the maximum ASL Field size from 64K bits to 4G -bits. +Increased the maximum ASL Field size from 64K bits to 4G bits. Completed implementation of the external Global Lock -interfaces -- AcpiAcquireGlobalLock and -AcpiReleaseGlobalLock. The Timeout and Handler parameters -were added. +interfaces -- AcpiAcquireGlobalLock and AcpiReleaseGlobalLock. +The Timeout and Handler parameters were added. Completed another pass at removing warnings and issues when compiling with 64-bit compilers. The code now compiles @@ -1175,23 +1314,22 @@ cleanly with the Intel 64-bit C/C++ compiler. Most notably, the pointer add and subtract (diff) macros have changed considerably. -Created and deployed a new ACPI_SIZE type that is 64-bits -wide on 64-bit platforms, 32-bits on all others. This type -is used wherever memory allocation and/or the C sizeof() -operator is used, and affects the OSL memory allocation -interfaces AcpiOsAllocate and AcpiOsCallocate. +Created and deployed a new ACPI_SIZE type that is 64-bits wide +on 64-bit platforms, 32-bits on all others. This type is used +wherever memory allocation and/or the C sizeof() operator is +used, and affects the OSL memory allocation interfaces +AcpiOsAllocate and AcpiOsCallocate. Implemented sticky user breakpoints in the AML debugger. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that these +values will vary depending on the efficiency of the compiler +and the compiler options used during generation. Previous Release (12_05_01) Non-Debug Version: 64.7K Code, 5.3K Data, 70.0K @@ -1206,8 +1344,8 @@ Total 3) ASL Compiler, version X2034: -Now checks for (and generates an error if detected) the use -of a Break or Continue statement without an enclosing While +Now checks for (and generates an error if detected) the use of +a Break or Continue statement without an enclosing While statement. Successfully generated the compiler with the Intel 64-bit C @@ -1219,36 +1357,33 @@ Summary of changes for this label: 12_05_01 1) ACPI CA Core Subsystem: The ACPI 2.0 CopyObject operator is fully implemented. This -operator creates a new copy of an object (and is also used -to bypass the "implicit conversion" mechanism of the Store +operator creates a new copy of an object (and is also used to +bypass the "implicit conversion" mechanism of the Store operator.) The ACPI 2.0 semantics for the SizeOf operator are fully implemented. The change is that performing a SizeOf on a -reference object causes an automatic dereference of the -object to tha actual value before the size is evaluated. -This behavior was undefined in ACPI 1.0. +reference object causes an automatic dereference of the object +to tha actual value before the size is evaluated. This +behavior was undefined in ACPI 1.0. The ACPI 2.0 semantics for the Extended IRQ resource -descriptor have been implemented. The interrupt polarity -and mode are now independently set. +descriptor have been implemented. The interrupt polarity and +mode are now independently set. Fixed a problem where ASL Constants (Zero, One, Ones, Revision) appearing in Package objects were not properly -converted to integers when the internal Package was -converted to an external object (via the AcpiEvaluateObject -interface.) +converted to integers when the internal Package was converted +to an external object (via the AcpiEvaluateObject interface.) Fixed a problem with the namespace object deletion mechanism -for objects created by control methods. There were two -parts to this problem: 1) Objects created during the -initialization phase method parse were not being deleted, -and 2) The object owner ID mechanism to track objects was -broken. +for objects created by control methods. There were two parts +to this problem: 1) Objects created during the initialization +phase method parse were not being deleted, and 2) The object +owner ID mechanism to track objects was broken. -Fixed a problem where the use of the ASL Scope operator -within a control method would result in an invalid opcode -exception. +Fixed a problem where the use of the ASL Scope operator within +a control method would result in an invalid opcode exception. Fixed a problem introduced in the previous label where the buffer length required for the _PRT structure was not being @@ -1256,13 +1391,12 @@ returned correctly. Code and Data Size: Current core subsystem library sizes are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +acpica.lib produced by the Microsoft Visual C++ 6.0 compiler, +and these values do not include any ACPI driver or OSPM code. +The debug version of the code includes the debug output trace +mechanism and has a larger code and data size. Note that +these values will vary depending on the efficiency of the +compiler and the compiler options used during generation. Previous Release (11_20_01) Non-Debug Version: 64.1K Code, 5.3K Data, 69.4K @@ -1280,13 +1414,12 @@ Total Updated all files to apply cleanly against 2.4.16. -Added basic PCI Interrupt Routing Table (PRT) support for -IA32 (acpi_pci.c), and unified the PRT code for IA32 and -IA64. This version supports both static and dyanmic PRT -entries, but dynamic entries are treated as if they were -static (not yet reconfigurable). Architecture- specific -code to use this data is absent on IA32 but should be -available shortly. +Added basic PCI Interrupt Routing Table (PRT) support for IA32 +(acpi_pci.c), and unified the PRT code for IA32 and IA64. +This version supports both static and dyanmic PRT entries, but +dynamic entries are treated as if they were static (not yet +reconfigurable). Architecture- specific code to use this data +is absent on IA32 but should be available shortly. Changed the initialization sequence to start the ACPI interpreter (acpi_init) prior to initialization of the PCI @@ -1295,9 +1428,9 @@ to support PRT and facilitate other (future) enhancement. A side effect is that the ACPI bus driver and certain device drivers can no longer be loaded as modules. -Modified the 'make menuconfig' options to allow PCI -Interrupt Routing support to be included without the ACPI -Bus and other device drivers. +Modified the 'make menuconfig' options to allow PCI Interrupt +Routing support to be included without the ACPI Bus and other +device drivers. 3) ASL Compiler, version X2033: @@ -1311,38 +1444,36 @@ Summary of changes for this label: 11_20_01 1) ACPI CA Core Subsystem: -Updated Index support to match ACPI 2.0 semantics. Storing -a Integer, String, or Buffer to an Index of a Buffer will -store only the least-significant byte of the source to the -Indexed buffer byte. Multiple writes are not performed. +Updated Index support to match ACPI 2.0 semantics. Storing a +Integer, String, or Buffer to an Index of a Buffer will store +only the least-significant byte of the source to the Indexed +buffer byte. Multiple writes are not performed. -Fixed a problem where the access type used in an AccessAs -ASL operator was not recorded correctly into the field -object. +Fixed a problem where the access type used in an AccessAs ASL +operator was not recorded correctly into the field object. Fixed a problem where ASL Event objects were created in a signalled state. Events are now created in an unsignalled state. The internal object cache is now purged after table loading -and initialization to reduce the use of dynamic kernel -memory -- on the assumption that object use is greatest -during the parse phase of the entire table (versus the run- -time use of individual control methods.) +and initialization to reduce the use of dynamic kernel memory +-- on the assumption that object use is greatest during the +parse phase of the entire table (versus the run-time use of +individual control methods.) ACPI 2.0 variable-length packages are now fully operational. -Code and Data Size: Code and Data optimizations have -permitted new feature development with an actual reduction -in the library size. Current core subsystem library sizes -are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +Code and Data Size: Code and Data optimizations have permitted +new feature development with an actual reduction in the +library size. Current core subsystem library sizes are shown +below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these +values do not include any ACPI driver or OSPM code. The debug +version of the code includes the debug output trace mechanism +and has a larger code and data size. Note that these values +will vary depending on the efficiency of the compiler and the +compiler options used during generation. Previous Release (11_09_01): Non-Debug Version: 63.7K Code, 5.2K Data, 68.9K @@ -1360,33 +1491,32 @@ Total Enhanced the ACPI boot-time initialization code to allow the use of Local APIC tables for processor enumeration on IA-32, -and to pave the way for a fully MPS-free boot (on SMP -systems) in the near future. This functionality replaces +and to pave the way for a fully MPS-free boot (on SMP systems) +in the near future. This functionality replaces arch/i386/kernel/acpitables.c, which was introduced in an -earlier 2.4.15-preX release. To enable this feature you -must add "acpi_boot=on" to the kernel command line -- see -the help entry for CONFIG_ACPI_BOOT for more information. -An IA-64 release is in the works... +earlier 2.4.15-preX release. To enable this feature you must +add "acpi_boot=on" to the kernel command line -- see the help +entry for CONFIG_ACPI_BOOT for more information. An IA-64 +release is in the works... Restructured the configuration options to allow boot-time table parsing support without inclusion of the ACPI Interpreter (and other) code. NOTE: This release does not include fixes for the reported -events, power-down, and thermal passive cooling issues -(coming soon). +events, power-down, and thermal passive cooling issues (coming +soon). 3) ASL Compiler: Added additional typechecking for Fields within restricted access Operation Regions. All fields within EC and CMOS regions must be declared with ByteAcc. All fields withing -SMBus regions must be declared with the BufferAcc access -type. +SMBus regions must be declared with the BufferAcc access type. Fixed a problem where the listing file output of control -methods no longer interleaved the actual AML code with the -ASL source code. +methods no longer interleaved the actual AML code with the ASL +source code. @@ -1395,17 +1525,16 @@ Summary of changes for this label: 11_09_01 1) ACPI CA Core Subsystem: -Implemented ACPI 2.0-defined support for writes to fields -with a Buffer, String, or Integer source operand that is -smaller than the target field. In these cases, the source -operand is zero-extended to fill the target field. +Implemented ACPI 2.0-defined support for writes to fields with +a Buffer, String, or Integer source operand that is smaller +than the target field. In these cases, the source operand is +zero-extended to fill the target field. -Fixed a problem where a Field starting bit offset (within -the parent operation region) was calculated incorrectly if -the alignment of the field differed from the access width. -This affected CreateWordField, CreateDwordField, -CreateQwordField, and possibly other fields that use the -"AccessAny" keyword. +Fixed a problem where a Field starting bit offset (within the +parent operation region) was calculated incorrectly if the +alignment of the field differed from the access width. This +affected CreateWordField, CreateDwordField, CreateQwordField, +and possibly other fields that use the "AccessAny" keyword. Fixed a problem introduced in the 11_02_01 release where indirect stores through method arguments did not operate @@ -1420,14 +1549,14 @@ rather than legacy BIOS interfaces (e.g. MPS) for the configuration of system processors, memory, and interrupts during setup_arch(). Note that this patch does not include the required architecture-specific changes required to apply -this information -- subsequent patches will be posted for -both IA32 and IA64 to achieve this. +this information -- subsequent patches will be posted for both +IA32 and IA64 to achieve this. -Added low-level sleep support for IA32 platforms, courtesy -of Pat Mochel. This allows IA32 systems to transition -to/from various sleeping states (e.g. S1, S3), although the -lack of a centralized driver model and power-manageable -drivers will prevent its (successful) use on most systems. +Added low-level sleep support for IA32 platforms, courtesy of +Pat Mochel. This allows IA32 systems to transition to/from +various sleeping states (e.g. S1, S3), although the lack of a +centralized driver model and power-manageable drivers will +prevent its (successful) use on most systems. Revamped the ACPI 'menuconfig' layout: created new "ACPI Support" submenu, unified IA32 and IA64 options, added new @@ -1449,60 +1578,59 @@ implemented. OSL Interfaces: Several of the OSL (AcpiOs*) interfaces required changes to support ACPI 2.0 Qword field access. Read/Write PciConfiguration(), Read/Write Memory(), and -Read/Write Port() now accept an ACPI_INTEGER (64 bits) as -the value parameter. Also, the value parameter for the -address space handler interface is now an ACPI_INTEGER. OSL +Read/Write Port() now accept an ACPI_INTEGER (64 bits) as the +value parameter. Also, the value parameter for the address +space handler interface is now an ACPI_INTEGER. OSL implementations of these interfaces must now handle the case where the Width parameter is 64. -Index Fields: Fixed a problem where unaligned bit assembly -and disassembly for IndexFields was not supported correctly. +Index Fields: Fixed a problem where unaligned bit assembly and +disassembly for IndexFields was not supported correctly. Index and Bank Fields: Nested Index and Bank Fields are now -supported. During field access, a check is performed to -ensure that the value written to an Index or Bank register -is not out of the range of the register. The Index (or -Bank) register is written before each access to the field -data. Future support will include allowing individual -IndexFields to be wider than the DataRegister width. +supported. During field access, a check is performed to ensure +that the value written to an Index or Bank register is not out +of the range of the register. The Index (or Bank) register is +written before each access to the field data. Future support +will include allowing individual IndexFields to be wider than +the DataRegister width. Fields: Fixed a problem where the AML interpreter was incorrectly attempting to write beyond the end of a -Field/OpRegion. This was a boundary case that occurred when -a DWORD field was written to a BYTE access OpRegion, forcing -multiple writes and causing the interpreter to write one -datum too many. +Field/OpRegion. This was a boundary case that occurred when a +DWORD field was written to a BYTE access OpRegion, forcing +multiple writes and causing the interpreter to write one datum +too many. Fields: Fixed a problem with Field/OpRegion access where the -starting bit address of a field was incorrectly calculated -if the current access type was wider than a byte (WordAcc, +starting bit address of a field was incorrectly calculated if +the current access type was wider than a byte (WordAcc, DwordAcc, or QwordAcc). -Fields: Fixed a problem where forward references to -individual FieldUnits (individual Field names within a Field -definition) were not resolved during the AML table load. - -Fields: Fixed a problem where forward references from a -Field definition to the parent Operation Region definition +Fields: Fixed a problem where forward references to individual +FieldUnits (individual Field names within a Field definition) were not resolved during the AML table load. +Fields: Fixed a problem where forward references from a Field +definition to the parent Operation Region definition were not +resolved during the AML table load. + Fields: Duplicate FieldUnit names within a scope are now detected during AML table load. Acpi Interfaces: Fixed a problem where the AcpiGetName() interface returned an incorrect name for the root node. -Code and Data Size: Code and Data optimizations have -permitted new feature development with an actual reduction -in the library size. Current core subsystem library sizes -are shown below. These are the code and data sizes for the -acpica.lib produced by the Microsoft Visual C++ 6.0 -compiler, and these values do not include any ACPI driver or -OSPM code. The debug version of the code includes the debug -output trace mechanism and has a larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +Code and Data Size: Code and Data optimizations have permitted +new feature development with an actual reduction in the +library size. Current core subsystem library sizes are shown +below. These are the code and data sizes for the acpica.lib +produced by the Microsoft Visual C++ 6.0 compiler, and these +values do not include any ACPI driver or OSPM code. The debug +version of the code includes the debug output trace mechanism +and has a larger code and data size. Note that these values +will vary depending on the efficiency of the compiler and the +compiler options used during generation. Previous Release (10_18_01): Non-Debug Version: 63.9K Code, 5.1K Data, 69.0K @@ -1523,13 +1651,13 @@ MODULE_LICENSE("GPL") to all modules. 3) ASL Compiler version X2030: -Duplicate FieldUnit names within a scope are now detected -and flagged as errors. +Duplicate FieldUnit names within a scope are now detected and +flagged as errors. 4) Documentation: -Programmer Reference updated to reflect OSL and address -space handler interface changes described above. +Programmer Reference updated to reflect OSL and address space +handler interface changes described above. ---------------------------------------- Summary of changes for this label: 10_18_01 @@ -1537,18 +1665,18 @@ Summary of changes for this label: 10_18_01 ACPI CA Core Subsystem: Fixed a problem with the internal object reference count -mechanism that occasionally caused premature object -deletion. This resolves all of the outstanding problem -reports where an object is deleted in the middle of an -interpreter evaluation. Although this problem only showed -up in rather obscure cases, the solution to the problem -involved an adjustment of all reference counts involving -objects attached to namespace nodes. +mechanism that occasionally caused premature object deletion. +This resolves all of the outstanding problem reports where an +object is deleted in the middle of an interpreter evaluation. +Although this problem only showed up in rather obscure cases, +the solution to the problem involved an adjustment of all +reference counts involving objects attached to namespace +nodes. Fixed a problem with Field support in the interpreter where -writing to an aligned field whose length is an exact -multiple (2 or greater) of the field access granularity -would cause an attempt to write beyond the end of the field. +writing to an aligned field whose length is an exact multiple +(2 or greater) of the field access granularity would cause an +attempt to write beyond the end of the field. The top level AML opcode execution functions within the interpreter have been renamed with a more meaningful and @@ -1563,36 +1691,34 @@ Fixed a problem where the AML debugger was causing some internal objects to not be deleted during subsystem termination. -Fixed a problem with the external AcpiEvaluateObject -interface where the subsystem would fault if the named -object to be evaluated refered to a constant such as Zero, -Ones, etc. +Fixed a problem with the external AcpiEvaluateObject interface +where the subsystem would fault if the named object to be +evaluated refered to a constant such as Zero, Ones, etc. Fixed a problem with IndexFields and BankFields where the subsystem would fault if the index, data, or bank registers were not defined in the same scope as the field itself. -Added printf format string checking for compilers that -support this feature. Corrected more than 50 instances of -issues with format specifiers within invocations of -ACPI_DEBUG_PRINT throughout the core subsystem code. +Added printf format string checking for compilers that support +this feature. Corrected more than 50 instances of issues with +format specifiers within invocations of ACPI_DEBUG_PRINT +throughout the core subsystem code. -The ASL "Revision" operator now returns the ACPI support -level implemented in the core - the value "2" since the ACPI -2.0 support is more than 50% implemented. +The ASL "Revision" operator now returns the ACPI support level +implemented in the core - the value "2" since the ACPI 2.0 +support is more than 50% implemented. Enhanced the output of the AML debugger "dump namespace" command to output in a more human-readable form. Current core subsystem library code sizes are shown below. -These are the code and data sizes for the acpica.lib -produced by the Microsoft Visual C++ 6.0 compiler, and these -values do not include any ACPI driver or OSPM code. The -debug version of the code includes the full debug trace -mechanism -- leading to a much larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +These are the code and data sizes for the acpica.lib produced +by the Microsoft Visual C++ 6.0 compiler, and these values do +not include any ACPI driver or OSPM code. The debug version +of the code includes the full debug trace mechanism -- leading +to a much larger code and data size. Note that these values +will vary depending on the efficiency of the compiler and the +compiler options used during generation. Previous Label (09_20_01): Non-Debug Version: 65K Code, 5K Data, 70K @@ -1608,87 +1734,84 @@ Total Linux: -Implemented a "Bad BIOS Blacklist" to track machines that -have known ASL/AML problems. +Implemented a "Bad BIOS Blacklist" to track machines that have +known ASL/AML problems. Enhanced the /proc interface for the thermal zone driver and -added support for _HOT (the critical suspend trip point). -The 'info' file now includes threshold/policy information, -and allows setting of _SCP (cooling preference) and _TZP -(polling frequency) values to the 'info' file. Examples: -"echo tzp=5 > info" sets the polling frequency to 5 seconds, -and "echo scp=1 > info" sets the cooling preference to the -passive/quiet mode (if supported by the ASL). +added support for _HOT (the critical suspend trip point). The +'info' file now includes threshold/policy information, and +allows setting of _SCP (cooling preference) and _TZP (polling +frequency) values to the 'info' file. Examples: "echo tzp=5 > +info" sets the polling frequency to 5 seconds, and "echo scp=1 +> info" sets the cooling preference to the passive/quiet mode +(if supported by the ASL). -Implemented a workaround for a gcc bug that resuted in an -OOPs when loading the control method battery driver. +Implemented a workaround for a gcc bug that resuted in an OOPs +when loading the control method battery driver. ---------------------------------------- Summary of changes for this label: 09_20_01 ACPI CA Core Subsystem: -The AcpiEnableEvent and AcpiDisableEvent interfaces have -been modified to allow individual GPE levels to be flagged -as wake-enabled (i.e., these GPEs are to remain enabled when -the platform sleeps.) +The AcpiEnableEvent and AcpiDisableEvent interfaces have been +modified to allow individual GPE levels to be flagged as wake- +enabled (i.e., these GPEs are to remain enabled when the +platform sleeps.) -The AcpiEnterSleepState and AcpiLeaveSleepState interfaces -now support wake-enabled GPEs. This means that upon -entering the sleep state, all GPEs that are not wake-enabled -are disabled. When leaving the sleep state, these GPEs are -reenabled. +The AcpiEnterSleepState and AcpiLeaveSleepState interfaces now +support wake-enabled GPEs. This means that upon entering the +sleep state, all GPEs that are not wake-enabled are disabled. +When leaving the sleep state, these GPEs are reenabled. A local double-precision divide/modulo module has been added to enhance portability to OS kernels where a 64-bit math library is not available. The new module is "utmath.c". -Several optimizations have been made to reduce the use of -CPU stack. Originally over 2K, the maximum stack usage is -now below 2K at 1860 bytes (1.82k) +Several optimizations have been made to reduce the use of CPU +stack. Originally over 2K, the maximum stack usage is now +below 2K at 1860 bytes (1.82k) -Fixed a problem with the AcpiGetFirmwareTable interface -where the root table pointer was not mapped into a logical -address properly. +Fixed a problem with the AcpiGetFirmwareTable interface where +the root table pointer was not mapped into a logical address +properly. -Fixed a problem where a NULL pointer was being dereferenced -in the interpreter code for the ASL Notify operator. +Fixed a problem where a NULL pointer was being dereferenced in +the interpreter code for the ASL Notify operator. Fixed a problem where the use of the ASL Revision operator returned an error. This operator now returns the current version of the ACPI CA core subsystem. Fixed a problem where objects passed as control method -parameters to AcpiEvaluateObject were always deleted at -method termination. However, these objects may end up being -stored into the namespace by the called method. The object -reference count mechanism was applied to these objects -instead of a force delete. - -Fixed a problem where static strings or buffers (contained -in the AML code) that are declared as package elements -within the ASL code could cause a fault because the -interpreter would attempt to delete them. These objects are -now marked with the "static object" flag to prevent any -attempt to delete them. +parameters to AcpiEvaluateObject were always deleted at method +termination. However, these objects may end up being stored +into the namespace by the called method. The object reference +count mechanism was applied to these objects instead of a +force delete. + +Fixed a problem where static strings or buffers (contained in +the AML code) that are declared as package elements within the +ASL code could cause a fault because the interpreter would +attempt to delete them. These objects are now marked with the +"static object" flag to prevent any attempt to delete them. Implemented an interpreter optimization to use operands directly from the state object instead of extracting the -operands to local variables. This reduces stack use and -code size, and improves performance. +operands to local variables. This reduces stack use and code +size, and improves performance. The module exxface.c was eliminated as it was an unnecessary extra layer of code. Current core subsystem library code sizes are shown below. -These are the code and data sizes for the acpica.lib -produced by the Microsoft Visual C++ 6.0 compiler, and these -values do not include any ACPI driver or OSPM code. The -debug version of the code includes the full debug trace -mechanism -- leading to a much larger code and data size. -Note that these values will vary depending on the efficiency -of the compiler and the compiler options used during -generation. +These are the code and data sizes for the acpica.lib produced +by the Microsoft Visual C++ 6.0 compiler, and these values do +not include any ACPI driver or OSPM code. The debug version +of the code includes the full debug trace mechanism -- leading +to a much larger code and data size. Note that these values +will vary depending on the efficiency of the compiler and the +compiler options used during generation. Non-Debug Version: 65K Code, 5K Data, 70K Total (Previously 69K) Debug Version: 138K Code, 58K Data, @@ -1718,11 +1841,10 @@ remainder instead of the quotient. This was a longstanding bug and it fixes several known outstanding issues on various platforms. -The ACPI_DEBUG_PRINT and function trace entry/exit macros -have been further optimized for size. There are 700 -invocations of the DEBUG_PRINT macro alone, so each -optimization reduces the size of the debug version of the -subsystem significantly. +The ACPI_DEBUG_PRINT and function trace entry/exit macros have +been further optimized for size. There are 700 invocations of +the DEBUG_PRINT macro alone, so each optimization reduces the +size of the debug version of the subsystem significantly. A stack trace mechanism has been implemented. The maximum stack usage is about 2K on 32-bit platforms. The debugger @@ -1734,51 +1856,49 @@ are now prefixed with the string "Acpi". This keeps all of the symbols grouped together in a kernel map, and avoids conflicts with other kernel subsystems. -Most of the internal fixed lookup tables have been moved -into the code segment via the const operator. +Most of the internal fixed lookup tables have been moved into +the code segment via the const operator. -Several enhancements have been made to the interpreter to -both reduce the code size and improve performance. +Several enhancements have been made to the interpreter to both +reduce the code size and improve performance. Current core subsystem library code sizes are shown below. -These are the code and data sizes for the acpica.lib -produced by the Microsoft Visual C++ 6.0 compiler, and these -values do not include any ACPI driver or OSPM code. The -debug version of the code includes the full debug trace -mechanism which contains over 700 invocations of the -DEBUG_PRINT macro, 500 function entry macro invocations, and -over 900 function exit macro invocations -- leading to a -much larger code and data size. Note that these values will -vary depending on the efficiency of the compiler and the -compiler options used during generation. +These are the code and data sizes for the acpica.lib produced +by the Microsoft Visual C++ 6.0 compiler, and these values do +not include any ACPI driver or OSPM code. The debug version +of the code includes the full debug trace mechanism which +contains over 700 invocations of the DEBUG_PRINT macro, 500 +function entry macro invocations, and over 900 function exit +macro invocations -- leading to a much larger code and data +size. Note that these values will vary depending on the +efficiency of the compiler and the compiler options used +during generation. Non-Debug Version: 64K Code, 5K Data, 69K Total Debug Version: 137K Code, 58K Data, 195K Total Linux: -Implemented wbinvd() macro, pending a kernel-wide -definition. +Implemented wbinvd() macro, pending a kernel-wide definition. Fixed /proc/acpi/event to handle poll() and short reads. ASL Compiler, version X2026: -Fixed a problem introduced in the previous label where the -AML code emitted for package objects produced packages with -zero length. +Fixed a problem introduced in the previous label where the AML +code emitted for package objects produced packages with zero +length. ---------------------------------------- Summary of changes for this label: 08_16_01 ACPI CA Core Subsystem: -The following ACPI 2.0 ASL operators have been implemented -in the AML interpreter (These are already supported by the -Intel ASL compiler): ToDecimalString, ToHexString, -ToString, ToInteger, and ToBuffer. Support for 64-bit AML -constants is implemented in the AML parser, debugger, and -disassembler. +The following ACPI 2.0 ASL operators have been implemented in +the AML interpreter (These are already supported by the Intel +ASL compiler): ToDecimalString, ToHexString, ToString, +ToInteger, and ToBuffer. Support for 64-bit AML constants is +implemented in the AML parser, debugger, and disassembler. The internal memory tracking mechanism (leak detection code) has been upgraded to reduce the memory overhead (a separate @@ -1827,28 +1947,27 @@ Summary of changes for this label: 07_17_01 ACPI CA Core Subsystem: -Added a new interface named AcpiGetFirmwareTable to obtain -any ACPI table via the ACPI signature. The interface can be +Added a new interface named AcpiGetFirmwareTable to obtain any +ACPI table via the ACPI signature. The interface can be called at any time during kernel initialization, even before -the kernel virtual memory manager is initialized and paging -is enabled. This allows kernel subsystems to obtain ACPI -tables very early, even before the ACPI CA subsystem is -initialized. +the kernel virtual memory manager is initialized and paging is +enabled. This allows kernel subsystems to obtain ACPI tables +very early, even before the ACPI CA subsystem is initialized. -Fixed a problem where Fields defined with the AnyAcc -attribute could be resolved to the incorrect address under -the following conditions: 1) the field width is larger than -8 bits and 2) the parent operation region is not defined on -a DWORD boundary. +Fixed a problem where Fields defined with the AnyAcc attribute +could be resolved to the incorrect address under the following +conditions: 1) the field width is larger than 8 bits and 2) +the parent operation region is not defined on a DWORD +boundary. Fixed a problem where the interpreter is not being locked -during namespace initialization (during execution of the -_INI control methods), causing an error when an attempt is -made to release it later. +during namespace initialization (during execution of the _INI +control methods), causing an error when an attempt is made to +release it later. -ACPI 2.0 support in the AML Interpreter has begun and will -be ongoing throughout the rest of this year. In this label, -The Mod operator is implemented. +ACPI 2.0 support in the AML Interpreter has begun and will be +ongoing throughout the rest of this year. In this label, The +Mod operator is implemented. Added a new data type to contain full PCI addresses named ACPI_PCI_ID. This structure contains the PCI Segment, Bus, @@ -1866,24 +1985,24 @@ standard. OSL Interfaces: The interfaces to the PCI configuration space have been -changed to add the PCI Segment number and to split the -single 32-bit combined DeviceFunction field into two 16-bit -fields. This was accomplished by moving the four values -that define an address in PCI configuration space (segment, -bus, device, and function) to the new ACPI_PCI_ID structure. - -The changes to the PCI configuration space interfaces led to -a reexamination of the complete set of address space access -interfaces for PCI, I/O, and Memory. The previously -existing 18 interfaces have proven difficult to maintain -(any small change must be propagated across at least 6 -interfaces) and do not easily allow for future expansion to -64 bits if necessary. Also, on some systems, it would not -be appropriate to demultiplex the access width (8, 16, 32,or -64) before calling the OSL if the corresponding native OS -interfaces contain a similar access width parameter. For -these reasons, the 18 address space interfaces have been -replaced by these 6 new ones: +changed to add the PCI Segment number and to split the single +32-bit combined DeviceFunction field into two 16-bit fields. +This was accomplished by moving the four values that define an +address in PCI configuration space (segment, bus, device, and +function) to the new ACPI_PCI_ID structure. + +The changes to the PCI configuration space interfaces led to a +reexamination of the complete set of address space access +interfaces for PCI, I/O, and Memory. The previously existing +18 interfaces have proven difficult to maintain (any small +change must be propagated across at least 6 interfaces) and do +not easily allow for future expansion to 64 bits if necessary. +Also, on some systems, it would not be appropriate to +demultiplex the access width (8, 16, 32,or 64) before calling +the OSL if the corresponding native OS interfaces contain a +similar access width parameter. For these reasons, the 18 +address space interfaces have been replaced by these 6 new +ones: AcpiOsReadPciConfiguration AcpiOsWritePciConfiguration @@ -1892,47 +2011,45 @@ AcpiOsWriteMemory AcpiOsReadPort AcpiOsWritePort -Added a new interface named AcpiOsGetRootPointer to allow -the OSL to perform the platform and/or OS-specific actions +Added a new interface named AcpiOsGetRootPointer to allow the +OSL to perform the platform and/or OS-specific actions necessary to obtain the ACPI RSDP table pointer. On IA-32 -platforms, this interface will simply call down to the CA -core to perform the low-memory search for the table. On IA- -64, the RSDP is obtained from EFI. Migrating this interface -to the OSL allows the CA core to remain OS and platform -independent. - -Added a new interface named AcpiOsSignal to provide a -generic "function code and pointer" interface for various +platforms, this interface will simply call down to the CA core +to perform the low-memory search for the table. On IA-64, the +RSDP is obtained from EFI. Migrating this interface to the +OSL allows the CA core to remain OS and platform independent. + +Added a new interface named AcpiOsSignal to provide a generic +"function code and pointer" interface for various miscellaneous signals and notifications that must be made to -the host OS. The first such signals are intended to -support the ASL Fatal and Breakpoint operators. In the -latter case, the AcpiOsBreakpoint interface has been -obsoleted. +the host OS. The first such signals are intended to support +the ASL Fatal and Breakpoint operators. In the latter case, +the AcpiOsBreakpoint interface has been obsoleted. The definition of the AcpiFormatException interface has been -changed to simplify its use. The caller no longer must -supply a buffer to the call; A pointer to a const string is -now returned directly. This allows the call to be easily -used in printf statements, etc. since the caller does not -have to manage a local buffer. +changed to simplify its use. The caller no longer must supply +a buffer to the call; A pointer to a const string is now +returned directly. This allows the call to be easily used in +printf statements, etc. since the caller does not have to +manage a local buffer. ASL Compiler, Version X2025: The ACPI 2.0 Switch/Case/Default operators have been -implemented and are fully functional. They will work with -all ACPI 1.0 interpreters, since the operators are simply +implemented and are fully functional. They will work with all +ACPI 1.0 interpreters, since the operators are simply translated to If/Else pairs. -The ACPI 2.0 ElseIf operator is implemented and will also -work with 1.0 interpreters, for the same reason. +The ACPI 2.0 ElseIf operator is implemented and will also work +with 1.0 interpreters, for the same reason. Implemented support for ACPI 2.0 variable-length packages. These packages have a separate opcode, and their size is determined by the interpreter at run-time. Documentation The ACPI CA Programmer Reference has been -updated to reflect the new interfaces and changes to -existing interfaces. +updated to reflect the new interfaces and changes to existing +interfaces. ------------------------------------------ Summary of changes for this label: 06_15_01 @@ -1945,9 +2062,9 @@ to the nearest DWORD. Buffers are always Byte-accessible. ASL Compiler, version X2024: -Fixed a problem where the Switch() operator would either -fault or hang the compiler. Note however, that the AML code -for this ACPI 2.0 operator is not yet implemented. +Fixed a problem where the Switch() operator would either fault +or hang the compiler. Note however, that the AML code for +this ACPI 2.0 operator is not yet implemented. Compiler uses the new AcpiOsGetTimer interface to obtain compile timings. @@ -1957,14 +2074,13 @@ converts a reference to a named field within a resource descriptor from a byte offset to a bit offset if required. Added some missing named fields from the resource descriptor -support. These are the names that are automatically created -by the compiler to reference fields within a descriptor. -They are only valid at compile time and are not passed -through to the AML interpreter. +support. These are the names that are automatically created by +the compiler to reference fields within a descriptor. They +are only valid at compile time and are not passed through to +the AML interpreter. -Resource descriptor named fields are now typed as Integers -and subject to compile-time typechecking when used in -expressions. +Resource descriptor named fields are now typed as Integers and +subject to compile-time typechecking when used in expressions. ------------------------------------------ Summary of changes for this label: 05_18_01 @@ -1978,14 +2094,14 @@ improve performance, readability and maintainability. New DEBUG_PRINTP macro automatically inserts the procedure name into the output, saving hundreds of copies of procedure -name strings within the source, shrinking the memory -footprint of the debug version of the core subsystem. +name strings within the source, shrinking the memory footprint +of the debug version of the core subsystem. Source Code Structure: -The source code directory tree was restructured to reflect -the current organization of the component architecture. -Some files and directories have been moved and/or renamed. +The source code directory tree was restructured to reflect the +current organization of the component architecture. Some +files and directories have been moved and/or renamed. Linux: @@ -2004,8 +2120,8 @@ compiler buffer. The temporary .SRC file is deleted unless the "-s" option is specified -The "-d" debug output option now sends all output to the -.DBG file instead of the console. +The "-d" debug output option now sends all output to the .DBG +file instead of the console. "External" second parameter is now optional @@ -2027,8 +2143,7 @@ EISAID now returns an object of type INTEGER "Interrupt (ResourceType," parse error fixed. -"Register" with a user-defined region space parse error -fixed +"Register" with a user-defined region space parse error fixed Escaped backslash at the end of a string ("\\") scan/parse error fixed @@ -2049,9 +2164,8 @@ Removed /proc/sys/acpi. You can still dump your DSDT from ACPI CA Core Subsystem: -Fixed a problem introduced in the previous label where some -of the "small" resource descriptor types were not -recognized. +Fixed a problem introduced in the previous label where some of +the "small" resource descriptor types were not recognized. Improved error messages for the case where an ASL Field is outside the range of the parent operation region. @@ -2072,20 +2186,19 @@ Summary of changes for this label: 04_27_01 ACPI CA Core Subsystem: -Fixed a problem where the namespace mutex could be released -at the wrong time during execution of +Fixed a problem where the namespace mutex could be released at +the wrong time during execution of AcpiRemoveAddressSpaceHandler. -Added optional thread ID output for debug traces, to -simplify debugging of multiple threads. Added context -switch notification when the debug code realizes that a -different thread is now executing ACPI code. +Added optional thread ID output for debug traces, to simplify +debugging of multiple threads. Added context switch +notification when the debug code realizes that a different +thread is now executing ACPI code. Some additional external data types have been prefixed with -the string "ACPI_" for consistency. This may effect -existing code. The data types affected are the external -callback typedefs - e.g., WALK_CALLBACK becomes -ACPI_WALK_CALLBACK. +the string "ACPI_" for consistency. This may effect existing +code. The data types affected are the external callback +typedefs - e.g., WALK_CALLBACK becomes ACPI_WALK_CALLBACK. Linux: @@ -2116,15 +2229,15 @@ Summary of changes for this label: 04_13_01 ACPI CA Core Subsystem: Restructured support for BufferFields and RegionFields. -BankFields support is now fully operational. All known 32- -bit limitations on field sizes have been removed. Both -BufferFields and (Operation) RegionFields are now supported -by the same field management code. +BankFields support is now fully operational. All known 32-bit +limitations on field sizes have been removed. Both +BufferFields and (Operation) RegionFields are now supported by +the same field management code. -Resource support now supports QWORD address and IO -resources. The 16/32/64 bit address structures and the -Extended IRQ structure have been changed to properly handle -Source Resource strings. +Resource support now supports QWORD address and IO resources. +The 16/32/64 bit address structures and the Extended IRQ +structure have been changed to properly handle Source Resource +strings. A ThreadId of -1 is now used to indicate a "mutex not acquired" condition internally and must never be returned by @@ -2142,30 +2255,29 @@ Fixed the EC driver to honor _GLK. ASL Compiler, version X2016: Fixed support for the "FixedHw" keyword. Previously, the -FixedHw address space was set to 0, not 0x7f as it should -be. +FixedHw address space was set to 0, not 0x7f as it should be. ------------------------------------------ Summary of changes for this label: 03_13_01 ACPI CA Core Subsystem: -During ACPI initialization, the _SB_._INI method is now run -if present. +During ACPI initialization, the _SB_._INI method is now run if +present. Notify handler fix - notifies are deferred until the parent method completes execution. This fixes the "mutex already acquired" issue seen occasionally. -Part of the "implicit conversion" rules in ACPI 2.0 have -been found to cause compatibility problems with existing -ASL/AML. The convert "result-to-target-type" implementation -has been removed for stores to method Args and Locals. -Source operand conversion is still fully implemented. -Possible changes to ACPI 2.0 specification pending. +Part of the "implicit conversion" rules in ACPI 2.0 have been +found to cause compatibility problems with existing ASL/AML. +The convert "result-to-target-type" implementation has been +removed for stores to method Args and Locals. Source operand +conversion is still fully implemented. Possible changes to +ACPI 2.0 specification pending. -Fix to AcpiRsCalculatePciRoutingTableLength to return -correct length. +Fix to AcpiRsCalculatePciRoutingTableLength to return correct +length. Fix for compiler warnings for 64-bit compiles. @@ -2175,8 +2287,7 @@ Fix for compiler warnings for 64-bit compiles. Release-version compile problem fixed. -New kernel configuration options documented in -Configure.help. +New kernel configuration options documented in Configure.help. IBM 600E - Fixed Sleep button may generate "Invalid <NULL> context" message. @@ -2222,45 +2333,43 @@ Modules will not load if CONFIG_MODVERSION is set. IBM 600E - entering S5 may reboot instead of shutting down. -IBM 600E - Sleep button may generate "Invalid <NULL> -context" message. +IBM 600E - Sleep button may generate "Invalid <NULL> context" +message. -Some systems may fail with "execution mutex already -acquired" message. +Some systems may fail with "execution mutex already acquired" +message. ACPI CA Core Subsystem: Added a new OSL Interface, AcpiOsGetThreadId. This was -required for the deadlock detection code. Defined to return -a non-zero, 32-bit thread ID for the currently executing -thread. May be a non-zero constant integer on single-thread -systems. +required for the deadlock detection code. Defined to return a +non-zero, 32-bit thread ID for the currently executing thread. +May be a non-zero constant integer on single-thread systems. -Implemented deadlock detection for internal subsystem -mutexes. We may add conditional compilation for this code -(debug only) later. +Implemented deadlock detection for internal subsystem mutexes. +We may add conditional compilation for this code (debug only) +later. -ASL/AML Mutex object semantics are now fully supported. -This includes multiple acquires/releases by owner and -support for the Mutex SyncLevel parameter. +ASL/AML Mutex object semantics are now fully supported. This +includes multiple acquires/releases by owner and support for +the Mutex SyncLevel parameter. A new "Force Release" mechanism automatically frees all ASL -Mutexes that have been acquired but not released when a -thread exits the interpreter. This forces conformance to -the ACPI spec ("All mutexes must be released when an -invocation exits") and prevents deadlocked ASL threads. -This mechanism can be expanded (later) to monitor other -resource acquisitions if OEM ASL code continues to misbehave -(which it will). - -Several new ACPI exception codes have been added for the -Mutex support. - -Recursive method calls are now allowed and supported (the -ACPI spec does in fact allow recursive method calls.) The -number of recursive calls is subject to the restrictions -imposed by the SERIALIZED method keyword and SyncLevel (ACPI -2.0) method parameter. +Mutexes that have been acquired but not released when a thread +exits the interpreter. This forces conformance to the ACPI +spec ("All mutexes must be released when an invocation exits") +and prevents deadlocked ASL threads. This mechanism can be +expanded (later) to monitor other resource acquisitions if OEM +ASL code continues to misbehave (which it will). + +Several new ACPI exception codes have been added for the Mutex +support. + +Recursive method calls are now allowed and supported (the ACPI +spec does in fact allow recursive method calls.) The number +of recursive calls is subject to the restrictions imposed by +the SERIALIZED method keyword and SyncLevel (ACPI 2.0) method +parameter. Implemented support for the SyncLevel parameter for control methods (ACPI 2.0 feature) @@ -2279,10 +2388,10 @@ returned from AcpiEvaluateObject. Added external interfaces (Acpi*) to the ACPI debug memory manager. This manager keeps a list of all outstanding allocations, and can therefore detect memory leaks and -attempts to free memory blocks more than once. Useful for -code such as the power manager, etc. May not be appropriate -for device drivers. Performance with the debug code enabled -is slow. +attempts to free memory blocks more than once. Useful for code +such as the power manager, etc. May not be appropriate for +device drivers. Performance with the debug code enabled is +slow. The ACPI Global Lock is now an optional hardware element. @@ -2312,35 +2421,34 @@ AcpiFree Summary of changes for this label: 02_08_01 Core ACPI CA Subsystem: Fixed a problem where an error was -incorrectly returned if the return resource buffer was -larger than the actual data (in the resource interfaces). +incorrectly returned if the return resource buffer was larger +than the actual data (in the resource interfaces). References to named objects within packages are resolved to -the full pathname string before packages are returned -directly (via the AcpiEvaluateObject interface) or -indirectly via the resource interfaces. +the full pathname string before packages are returned directly +(via the AcpiEvaluateObject interface) or indirectly via the +resource interfaces. Linux OS Services Layer (OSL): Improved /proc battery interface. -Added C-state debugging output and other miscellaneous -fixes. +Added C-state debugging output and other miscellaneous fixes. ASL Compiler Version X2014: All defined method arguments can now be used as local -variables, including the ones that are not actually passed -in as parameters. The compiler tracks initialization of the +variables, including the ones that are not actually passed in +as parameters. The compiler tracks initialization of the arguments and issues an exception if they are used without prior assignment (just like locals). -The -o option now specifies a filename prefix that is used -for all output files, including the AML output file. -Otherwise, the default behavior is as follows: 1) the AML -goes to the file specified in the DSDT. 2) all other output -files use the input source filename as the base. +The -o option now specifies a filename prefix that is used for +all output files, including the AML output file. Otherwise, +the default behavior is as follows: 1) the AML goes to the +file specified in the DSDT. 2) all other output files use the +input source filename as the base. ------------------------------------------ Summary of changes for this label: 01_25_01 @@ -2352,8 +2460,8 @@ that include a target operand. Partially implemented support for Implicit Result-to-Target conversion. This is when a result object is converted on the -fly to the type of an existing target object. Completion -of this support is pending further analysis of the ACPI +fly to the type of an existing target object. Completion of +this support is pending further analysis of the ACPI specification concerning this matter. CPU-specific code has been removed from the subsystem @@ -2368,14 +2476,14 @@ accordingly. Fixed C2 and C3 latency calculations. -We no longer use the compilation date for the version -message on initialization, but retrieve the version from +We no longer use the compilation date for the version message +on initialization, but retrieve the version from AcpiGetSystemInfo(). Incorporated for fix Sony VAIO machines. -Documentation: The Programmer Reference has been updated -and reformatted. +Documentation: The Programmer Reference has been updated and +reformatted. ASL Compiler: Version X2013: Fixed a problem where the line @@ -2388,17 +2496,16 @@ Summary of changes for this label: 01_15_01 Core ACPI CA Subsystem: Implemented support for type conversions in the execution of -the ASL Concatenate operator (The second operand is -converted to match the type of the first operand before -concatenation.) +the ASL Concatenate operator (The second operand is converted +to match the type of the first operand before concatenation.) Support for implicit source operand conversion is partially implemented. The ASL source operand types Integer, Buffer, -and String are freely interchangeable for most ASL -operators and are converted by the interpreter on the fly -as required. Implicit Target operand conversion (where the -result is converted to the target type before storing) is -not yet implemented. +and String are freely interchangeable for most ASL operators +and are converted by the interpreter on the fly as required. +Implicit Target operand conversion (where the result is +converted to the target type before storing) is not yet +implemented. Support for 32-bit and 64-bit BCD integers is implemented. @@ -2428,8 +2535,8 @@ integers and strings. Version X2012: 1. Relaxed typechecking to allow interchangeability between -strings, integers, and buffers. These types are now -converted by the interpreter at runtime. +strings, integers, and buffers. These types are now converted +by the interpreter at runtime. 2. Compiler reports time taken by each internal subsystem in the debug output file. @@ -2439,9 +2546,9 @@ Summary of changes for this label: 12_14_00 ASL Compiler: -This is the first official release of the compiler. Since -the compiler requires elements of the Core Subsystem, this -label synchronizes everything. +This is the first official release of the compiler. Since the +compiler requires elements of the Core Subsystem, this label +synchronizes everything. ------------------------------------------ Summary of changes for this label: 12_08_00 @@ -2450,8 +2557,8 @@ Fixed a problem where named references within the ASL definition of both OperationRegions and CreateXXXFields did not work properly. The symptom was an AE_AML_OPERAND_TYPE during initialization of the region/field. This is similar -(but not related internally) to the problem that was fixed -in the last label. +(but not related internally) to the problem that was fixed in +the last label. Implemented both 32-bit and 64-bit support for the BCD ASL functions ToBCD and FromBCD. @@ -2472,15 +2579,15 @@ arguments [DEBG] ammonad-0284: Exec_monadic2_r/Not: bad operand(s) (0x3005) Fixed a problem where operators with more than one nested -subexpression would fail. The symptoms were varied, by -mostly AE_AML_OPERAND_TYPE errors. This was actually a -rather serious problem that has gone unnoticed until now. +subexpression would fail. The symptoms were varied, by mostly +AE_AML_OPERAND_TYPE errors. This was actually a rather +serious problem that has gone unnoticed until now. Subtract (Add (1,2), Multiply (3,4)) -Fixed a problem where AcpiGetHandle didn't quite get fixed -in the previous build (The prefix part of a relative path -was handled incorrectly). +Fixed a problem where AcpiGetHandle didn't quite get fixed in +the previous build (The prefix part of a relative path was +handled incorrectly). Fixed a problem where Operation Region initialization failed if the operation region name was a "namepath" instead of a @@ -2493,16 +2600,16 @@ assignment. Subsequent assignments were ignored. ------------------------------------------ Summary of changes for this label: 11_15_00 -ACPI 2.0 table support with backwards support for ACPI 1.0 -and the 0.71 extensions. Note: although we can read ACPI -2.0 BIOS tables, the AML interpreter does NOT have support -for the new 2.0 ASL grammar terms at this time. +ACPI 2.0 table support with backwards support for ACPI 1.0 and +the 0.71 extensions. Note: although we can read ACPI 2.0 BIOS +tables, the AML interpreter does NOT have support for the new +2.0 ASL grammar terms at this time. -All ACPI hardware access is via the GAS structures in the -ACPI 2.0 FADT. +All ACPI hardware access is via the GAS structures in the ACPI +2.0 FADT. -All physical memory addresses across all platforms are now -64 bits wide. Logical address width remains dependent on the +All physical memory addresses across all platforms are now 64 +bits wide. Logical address width remains dependent on the platform (i.e., "void *"). AcpiOsMapMemory interface changed to a 64-bit physical @@ -2511,11 +2618,11 @@ address. The AML interpreter integer size is now 64 bits, as per the ACPI 2.0 specification. -For backwards compatibility with ACPI 1.0, ACPI tables with -a revision number less than 2 use 32-bit integers only. +For backwards compatibility with ACPI 1.0, ACPI tables with a +revision number less than 2 use 32-bit integers only. -Fixed a problem where the evaluation of OpRegion operands -did not always resolve them to numbers properly. +Fixed a problem where the evaluation of OpRegion operands did +not always resolve them to numbers properly. ------------------------------------------ Summary of changes for this label: 10_20_00 @@ -2523,14 +2630,14 @@ Summary of changes for this label: 10_20_00 Fix for CBN_._STA issue. This fix will allow correct access to CBN_ OpRegions when the _STA returns 0x8. -Support to convert ACPI constants (Ones, Zeros, One) to -actual values before a package object is returned +Support to convert ACPI constants (Ones, Zeros, One) to actual +values before a package object is returned -Fix for method call as predicate to if/while construct -causing incorrect if/while behavior +Fix for method call as predicate to if/while construct causing +incorrect if/while behavior -Fix for Else block package lengths sometimes calculated -wrong (if block > 63 bytes) +Fix for Else block package lengths sometimes calculated wrong +(if block > 63 bytes) Fix for Processor object length field, was always zero @@ -2551,11 +2658,11 @@ Summary of changes for this label: 9_29_00 New table initialization interfaces: AcpiInitializeSubsystem no longer has any parameters AcpiFindRootPointer - Find the RSDP (if necessary) AcpiLoadTables (RSDP) - load all tables -found at RSDP->RSDT Obsolete Interfaces -AcpiLoadFirmwareTables - replaced by AcpiLoadTables +found at RSDP->RSDT Obsolete Interfaces AcpiLoadFirmwareTables +- replaced by AcpiLoadTables -Note: These interface changes require changes to all -existing OSDs +Note: These interface changes require changes to all existing +OSDs The PCI_Config default address space handler is always installed at the root namespace object. @@ -2569,10 +2676,9 @@ AcpiInitialize) AcpiEnableSubsystem Obsolete Interfaces: AcpiLoadNamespace (Namespace is automatically loaded when a table is loaded) -The ACPI_OPERAND_OBJECT has been optimized to shrink its -size from 52 bytes to 32 bytes. There is usually one of -these for every namespace object, so the memory savings is -significant. +The ACPI_OPERAND_OBJECT has been optimized to shrink its size +from 52 bytes to 32 bytes. There is usually one of these for +every namespace object, so the memory savings is significant. Implemented just-in-time evaluation of the CreateField operators. @@ -2581,32 +2687,31 @@ Bug fixes for IA-64 support have been integrated. Additional code review comments have been implemented -The so-called "third pass parse" has been replaced by a -final walk through the namespace to initialize all operation -regions (address spaces) and fields that have not yet been -initialized during the execution of the various _INI and REG -methods. +The so-called "third pass parse" has been replaced by a final +walk through the namespace to initialize all operation regions +(address spaces) and fields that have not yet been initialized +during the execution of the various _INI and REG methods. New file - namespace/nsinit.c ------------------------------------------- Summary of changes for this label: 09_01_00 -Namespace manager data structures have been reworked to -change the primary object from a table to a single object. -This has resulted in dynamic memory savings of 3X within -the namespace and 2X overall in the ACPI CA subsystem. +Namespace manager data structures have been reworked to change +the primary object from a table to a single object. This has +resulted in dynamic memory savings of 3X within the namespace +and 2X overall in the ACPI CA subsystem. Fixed problem where the call to AcpiEvFindPciRootBuses was inadvertently left commented out. -Reduced the warning count when generating the source with -the GCC compiler. +Reduced the warning count when generating the source with the +GCC compiler. Revision numbers added to each module header showing the -SourceSafe version of the file. Please refer to this -version number when giving us feedback or comments on -individual modules. +SourceSafe version of the file. Please refer to this version +number when giving us feedback or comments on individual +modules. The main object types within the subsystem have been renamed to clarify their purpose: @@ -2627,35 +2732,35 @@ multiple times per method Fixed debugger problem where single stepping caused a semaphore to be oversignalled -Improved performance through additional parse object caching -- added ACPI_EXTENDED_OP type +Improved performance through additional parse object caching - +added ACPI_EXTENDED_OP type ------------------------------------------- Summary of changes for this label: 08_10_00 Parser/Interpreter integration: Eliminated the creation of complete parse trees for ACPI tables and control methods. -Instead, parse subtrees are created and then deleted as -soon as they are processed (Either entered into the -namespace or executed by the interpreter). This reduces -the use of dynamic kernel memory significantly. (about 10X) +Instead, parse subtrees are created and then deleted as soon +as they are processed (Either entered into the namespace or +executed by the interpreter). This reduces the use of dynamic +kernel memory significantly. (about 10X) Exception codes broken into classes and renumbered. Be sure -to recompile all code that includes acexcep.h. Hopefully -we won't have to renumber the codes again now that they are +to recompile all code that includes acexcep.h. Hopefully we +won't have to renumber the codes again now that they are split into classes (environment, programmer, AML code, ACPI table, and internal). -Fixed some additional alignment issues in the Resource -Manager subcomponent +Fixed some additional alignment issues in the Resource Manager +subcomponent Implemented semaphore tracking in the AcpiExec utility, and fixed several places where mutexes/semaphores were being unlocked without a corresponding lock operation. There are no known semaphore or mutex "leaks" at this time. -Fixed the case where an ASL Return operator is used to -return an unnamed package. +Fixed the case where an ASL Return operator is used to return +an unnamed package. ------------------------------------------- Summary of changes for this label: 07_28_00 @@ -2667,25 +2772,24 @@ WordAccess or DwordAccess, but the field unit defined within the Field was less than a Word or Dword. Fixed a problem in AmlDumpOperands() module's loop to pull -operands off of the operand stack to display information. -The problem manifested itself as a TLB error on 64-bit -systems when accessing an operand stack with two or more -operands. +operands off of the operand stack to display information. The +problem manifested itself as a TLB error on 64-bit systems +when accessing an operand stack with two or more operands. Fixed a problem with the PCI configuration space handlers where context was getting confused between accesses. This required a change to the generic address space handler and address space setup definitions. Handlers now get both a -global handler context (this is the one passed in by the -user when executing AcpiInstallAddressSpaceHandler() and a +global handler context (this is the one passed in by the user +when executing AcpiInstallAddressSpaceHandler() and a specific region context that is unique to each region (For example, the _ADR, _SEG and _BBN values associated with a specific region). The generic function definitions have changed to the following: typedef ACPI_STATUS (*ADDRESS_SPACE_HANDLER) ( UINT32 -Function, UINT32 Address, UINT32 BitWidth, UINT32 *Value, -void *HandlerContext, // This used to be void *Context void +Function, UINT32 Address, UINT32 BitWidth, UINT32 *Value, void +*HandlerContext, // This used to be void *Context void *RegionContext); // This is an additional parameter typedef ACPI_STATUS (*ADDRESS_SPACE_SETUP) ( ACPI_HANDLE @@ -2706,9 +2810,8 @@ The parser/interpreter integration continues in Phase 5 with the implementation of a complete 2-pass parse (the AML is parsed twice) for each table; This avoids the construction of a huge parse tree and therefore reduces the amount of -dynamic memory required by the subsystem. Greater use of -the parse object cache means that performance is -unaffected. +dynamic memory required by the subsystem. Greater use of the +parse object cache means that performance is unaffected. Many comments from the two code reviews have been rolled in. @@ -2719,13 +2822,13 @@ Summary of changes for this label: 06_30_00 With a nod and a tip of the hat to the technology of yesteryear, we've added support in the source code for 80 -column output devices. The code is now mostly constrained -to 80 columns or less to support environments and editors -that 1) cannot display or print more than 80 characters on -a single line, and 2) cannot disable line wrapping. +column output devices. The code is now mostly constrained to +80 columns or less to support environments and editors that 1) +cannot display or print more than 80 characters on a single +line, and 2) cannot disable line wrapping. -A major restructuring of the namespace data structure has -been completed. The result is 1) cleaner and more +A major restructuring of the namespace data structure has been +completed. The result is 1) cleaner and more understandable/maintainable code, and 2) a significant reduction in the dynamic memory requirement for each named ACPI object (almost half). @@ -2733,14 +2836,14 @@ ACPI object (almost half). ------------------------------------------- Summary of changes for this label: 06_23_00 -Linux support has been added. In order to obtain approval -to get the ACPI CA subsystem into the Linux kernel, we've -had to make quite a few changes to the base subsystem that -will affect all users (all the changes are generic and OS- +Linux support has been added. In order to obtain approval to +get the ACPI CA subsystem into the Linux kernel, we've had to +make quite a few changes to the base subsystem that will +affect all users (all the changes are generic and OS- independent). The effects of these global changes have been -somewhat far reaching. Files have been merged and/or -renamed and interfaces have been renamed. The major -changes are described below. +somewhat far reaching. Files have been merged and/or renamed +and interfaces have been renamed. The major changes are +described below. Osd* interfaces renamed to AcpiOs* to eliminate namespace pollution/confusion within our target kernels. All OSD @@ -2749,18 +2852,18 @@ convention. Files merged across the subsystem. A number of the smaller source and header files have been merged to reduce the file -count and increase the density of the existing files. -There are too many to list here. In general, makefiles that -call out individual files will require rebuilding. +count and increase the density of the existing files. There +are too many to list here. In general, makefiles that call +out individual files will require rebuilding. -Interpreter files renamed. All interpreter files now have -the prefix am* instead of ie* and is*. +Interpreter files renamed. All interpreter files now have the +prefix am* instead of ie* and is*. -Header files renamed: The acapi.h file is now acpixf.h. -The acpiosd.h file is now acpiosxf.h. We are removing -references to the acronym "API" since it is somewhat -windowsy. The new name is "external interface" or xface or -xf in the filenames.j +Header files renamed: The acapi.h file is now acpixf.h. The +acpiosd.h file is now acpiosxf.h. We are removing references +to the acronym "API" since it is somewhat windowsy. The new +name is "external interface" or xface or xf in the +filenames.j All manifest constants have been forced to upper case (some @@ -2774,8 +2877,8 @@ The globals "DebugLevel" and "DebugLayer" have been renamed All other globals within the subsystem are now prefixed with "AcpiGbl_" Internal procedures within the subsystem are now prefixed with "Acpi" (with only a few exceptions). The -original two-letter abbreviation for the subcomponent -remains after "Acpi" - for example, CmCallocate became +original two-letter abbreviation for the subcomponent remains +after "Acpi" - for example, CmCallocate became AcpiCmCallocate. Added a source code translation/conversion utility. Used to @@ -2788,19 +2891,19 @@ OsdUnMapMemory was renamed to OsdUnmapMemory and then AcpiOsUnmapMemory. (UnMap became Unmap). A "MaxUnits" parameter has been added to -AcpiOsCreateSemaphore. When set to one, this indicates -that the caller wants to use the semaphore as a mutex, not a +AcpiOsCreateSemaphore. When set to one, this indicates that +the caller wants to use the semaphore as a mutex, not a counting semaphore. ACPI CA uses both types. However, implementers of this call may want to use different OS -primitives depending on the type of semaphore requested. -For example, some operating systems provide separate "mutex" -and "semaphore" interfaces - where the mutex interface is -much faster because it doesn't have all the overhead of a -full semaphore implementation. +primitives depending on the type of semaphore requested. For +example, some operating systems provide separate "mutex" and +"semaphore" interfaces - where the mutex interface is much +faster because it doesn't have all the overhead of a full +semaphore implementation. -Fixed a deadlock problem where a method that accesses the -PCI address space can block forever if it is the first -access to the space. +Fixed a deadlock problem where a method that accesses the PCI +address space can block forever if it is the first access to +the space. ------------------------------------------- Summary of changes for this label: 06_02_00 @@ -2811,10 +2914,9 @@ alignment handler technology namely SAL/EFI and the IA-64 Linux kernel) has been added (via configurable macros) in these three areas: - Transfer of data from the raw AML byte stream is done via byte moves instead of word/dword/qword -moves. - External objects are aligned within the user -buffer, including package elements (sub-objects). - -Conversion of name strings to UINT32 Acpi Names is now done -byte-wise. +moves. - External objects are aligned within the user buffer, +including package elements (sub-objects). - Conversion of +name strings to UINT32 Acpi Names is now done byte-wise. The Store operator was modified to mimic Microsoft's implementation when storing to a Buffer Field. diff --git a/sys/contrib/dev/acpica/acdebug.h b/sys/contrib/dev/acpica/acdebug.h index 68fd1f0..9127022 100644 --- a/sys/contrib/dev/acpica/acdebug.h +++ b/sys/contrib/dev/acpica/acdebug.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdebug.h - ACPI/AML debugger - * $Revision: 63 $ + * $Revision: 64 $ * *****************************************************************************/ @@ -289,6 +289,10 @@ AcpiDbDecodeAndDisplayObject ( NATIVE_CHAR *OutputType); void +AcpiDbDecodeNode ( + ACPI_NAMESPACE_NODE *Node); + +void AcpiDbDisplayResultObject ( ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState); diff --git a/sys/contrib/dev/acpica/acexcep.h b/sys/contrib/dev/acpica/acexcep.h index a2ccb42..ffc2075 100644 --- a/sys/contrib/dev/acpica/acexcep.h +++ b/sys/contrib/dev/acpica/acexcep.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acexcep.h - Exception codes returned by the ACPI subsystem - * $Revision: 63 $ + * $Revision: 64 $ * *****************************************************************************/ @@ -233,8 +233,9 @@ #define AE_AML_ALIGNMENT (ACPI_STATUS) (0x001D | AE_CODE_AML) #define AE_AML_NO_RESOURCE_END_TAG (ACPI_STATUS) (0x001E | AE_CODE_AML) #define AE_AML_BAD_RESOURCE_VALUE (ACPI_STATUS) (0x001F | AE_CODE_AML) +#define AE_AML_CIRCULAR_REFERENCE (ACPI_STATUS) (0x0020 | AE_CODE_AML) -#define AE_CODE_AML_MAX 0x001F +#define AE_CODE_AML_MAX 0x0020 /* * Internal exceptions used for control @@ -249,8 +250,9 @@ #define AE_CTRL_TRANSFER (ACPI_STATUS) (0x0008 | AE_CODE_CONTROL) #define AE_CTRL_BREAK (ACPI_STATUS) (0x0009 | AE_CODE_CONTROL) #define AE_CTRL_CONTINUE (ACPI_STATUS) (0x000A | AE_CODE_CONTROL) +#define AE_CTRL_SKIP (ACPI_STATUS) (0x000B | AE_CODE_CONTROL) -#define AE_CODE_CTRL_MAX 0x000A +#define AE_CODE_CTRL_MAX 0x000B #ifdef DEFINE_ACPI_GLOBALS @@ -346,7 +348,8 @@ NATIVE_CHAR const *AcpiGbl_ExceptionNames_Aml[] = "AE_AML_NO_WHILE", "AE_AML_ALIGNMENT", "AE_AML_NO_RESOURCE_END_TAG", - "AE_AML_BAD_RESOURCE_VALUE" + "AE_AML_BAD_RESOURCE_VALUE", + "AE_AML_CIRCULAR_REFERENCE" }; NATIVE_CHAR const *AcpiGbl_ExceptionNames_Ctrl[] = @@ -360,7 +363,8 @@ NATIVE_CHAR const *AcpiGbl_ExceptionNames_Ctrl[] = "AE_CTRL_END", "AE_CTRL_TRANSFER", "AE_CTRL_BREAK", - "AE_CTRL_CONTINUE" + "AE_CTRL_CONTINUE", + "AE_CTRL_SKIP" }; #endif /* ACPI GLOBALS */ diff --git a/sys/contrib/dev/acpica/acglobal.h b/sys/contrib/dev/acpica/acglobal.h index 37d5c34..7615f89 100644 --- a/sys/contrib/dev/acpica/acglobal.h +++ b/sys/contrib/dev/acpica/acglobal.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables - * $Revision: 130 $ + * $Revision: 131 $ * *****************************************************************************/ @@ -227,6 +227,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired; ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent; +ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized; extern BOOLEAN AcpiGbl_Shutdown; extern UINT32 AcpiGbl_StartupFlags; diff --git a/sys/contrib/dev/acpica/acinterp.h b/sys/contrib/dev/acpica/acinterp.h index 9593aef..1f9f9d3 100644 --- a/sys/contrib/dev/acpica/acinterp.h +++ b/sys/contrib/dev/acpica/acinterp.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acinterp.h - Interpreter subcomponent prototypes and defines - * $Revision: 138 $ + * $Revision: 139 $ * *****************************************************************************/ @@ -286,6 +286,13 @@ AcpiExGetObjectReference ( ACPI_WALK_STATE *WalkState); ACPI_STATUS +AcpiExResolveMultiple ( + ACPI_WALK_STATE *WalkState, + ACPI_OPERAND_OBJECT *Operand, + ACPI_OBJECT_TYPE *ReturnType, + ACPI_OPERAND_OBJECT **ReturnDesc); + +ACPI_STATUS AcpiExConcatTemplate ( ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc2, diff --git a/sys/contrib/dev/acpica/aclocal.h b/sys/contrib/dev/acpica/aclocal.h index ad86dc4..dd714d8 100644 --- a/sys/contrib/dev/acpica/aclocal.h +++ b/sys/contrib/dev/acpica/aclocal.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 175 $ + * $Revision: 176 $ * *****************************************************************************/ @@ -758,8 +758,8 @@ typedef struct acpi_parseobj_asl UINT32 AmlSubtreeLength; UINT32 FinalAmlLength; UINT32 FinalAmlOffset; + UINT32 CompileFlags; UINT16 ParseOpcode; - UINT16 CompileFlags; UINT8 AmlOpcodeLength; UINT8 AmlPkgLenBytes; UINT8 Extra; diff --git a/sys/contrib/dev/acpica/acmacros.h b/sys/contrib/dev/acpica/acmacros.h index 8cfa916..cf3a30e 100644 --- a/sys/contrib/dev/acpica/acmacros.h +++ b/sys/contrib/dev/acpica/acmacros.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acmacros.h - C macros for the entire subsystem. - * $Revision: 128 $ + * $Revision: 130 $ * *****************************************************************************/ @@ -456,6 +456,7 @@ AcpiOsPrintf ACPI_PARAM_LIST(fp);} #define ACPI_REPORT_WARNING(fp) {AcpiUtReportWarning(_THIS_MODULE,__LINE__,_COMPONENT); \ AcpiOsPrintf ACPI_PARAM_LIST(fp);} +#define ACPI_REPORT_NSERROR(s,e) AcpiNsReportError(_THIS_MODULE,__LINE__,_COMPONENT, s, e); #else @@ -465,6 +466,7 @@ AcpiOsPrintf ACPI_PARAM_LIST(fp);} #define ACPI_REPORT_WARNING(fp) {AcpiUtReportWarning("ACPI",__LINE__,_COMPONENT); \ AcpiOsPrintf ACPI_PARAM_LIST(fp);} +#define ACPI_REPORT_NSERROR(s,e) AcpiNsReportError("ACPI",__LINE__,_COMPONENT, s, e); #endif diff --git a/sys/contrib/dev/acpica/acnamesp.h b/sys/contrib/dev/acpica/acnamesp.h index ea935f9..e14ef80 100644 --- a/sys/contrib/dev/acpica/acnamesp.h +++ b/sys/contrib/dev/acpica/acnamesp.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * $Revision: 126 $ + * $Revision: 127 $ * *****************************************************************************/ @@ -513,6 +513,14 @@ UINT32 AcpiNsLocal ( ACPI_OBJECT_TYPE Type); +void +AcpiNsReportError ( + NATIVE_CHAR *ModuleName, + UINT32 LineNumber, + UINT32 ComponentId, + char *InternalName, + ACPI_STATUS LookupStatus); + ACPI_STATUS AcpiNsBuildInternalName ( ACPI_NAMESTRING_INFO *Info); diff --git a/sys/contrib/dev/acpica/acparser.h b/sys/contrib/dev/acpica/acparser.h index e51d9cb..5df55df 100644 --- a/sys/contrib/dev/acpica/acparser.h +++ b/sys/contrib/dev/acpica/acparser.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: acparser.h - AML Parser subcomponent prototypes and defines - * $Revision: 61 $ + * $Revision: 62 $ * *****************************************************************************/ @@ -135,6 +135,7 @@ #define ACPI_PARSE_EXECUTE 0x0030 #define ACPI_PARSE_MODE_MASK 0x0030 +#define ACPI_PARSE_DEFERRED_OP 0x0100 /* Parser external interfaces */ diff --git a/sys/contrib/dev/acpica/actbl2.h b/sys/contrib/dev/acpica/actbl2.h index e0f9c68..0f81b3a 100644 --- a/sys/contrib/dev/acpica/actbl2.h +++ b/sys/contrib/dev/acpica/actbl2.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actbl2.h - ACPI Specification Revision 2.0 Tables - * $Revision: 27 $ + * $Revision: 28 $ * *****************************************************************************/ @@ -230,8 +230,8 @@ typedef struct UINT16 Plvl3Lat; /* Worst case HW latency to enter/exit C3 state */ UINT16 FlushSize; /* Number of flush strides that need to be read */ UINT16 FlushStride; /* Processor's memory cache line width, in bytes */ - UINT8 DutyOffset; /* Processor’s duty cycle index in processor's P_CNT reg*/ - UINT8 DutyWidth; /* Processor’s duty cycle value bit width in P_CNT register.*/ + UINT8 DutyOffset; /* Processor's duty cycle index in processor's P_CNT reg*/ + UINT8 DutyWidth; /* Processor's duty cycle value bit width in P_CNT register.*/ UINT8 DayAlrm; /* Index to day-of-month alarm in RTC CMOS RAM */ UINT8 MonAlrm; /* Index to month-of-year alarm in RTC CMOS RAM */ UINT8 Century; /* Index to century in RTC CMOS RAM */ diff --git a/sys/contrib/dev/acpica/actypes.h b/sys/contrib/dev/acpica/actypes.h index 903b581..9523371 100644 --- a/sys/contrib/dev/acpica/actypes.h +++ b/sys/contrib/dev/acpica/actypes.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 238 $ + * $Revision: 239 $ * *****************************************************************************/ @@ -1306,7 +1306,7 @@ typedef struct AcpiResource #define ACPI_SIZEOF_RESOURCE(Type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (Type)) -#define ACPI_NEXT_RESOURCE(Res) (ACPI_RESOURCE *)((UINT8 *) Res + Res->length) +#define ACPI_NEXT_RESOURCE(Res) (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length) #ifdef _HW_ALIGNMENT_SUPPORT #define ACPI_ALIGN_RESOURCE_SIZE(Length) (Length) diff --git a/sys/contrib/dev/acpica/dbdisply.c b/sys/contrib/dev/acpica/dbdisply.c index 89daabc..9c0ad34 100644 --- a/sys/contrib/dev/acpica/dbdisply.c +++ b/sys/contrib/dev/acpica/dbdisply.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 78 $ + * $Revision: 79 $ * ******************************************************************************/ @@ -358,7 +358,7 @@ DumpNte: else { - AcpiOsPrintf ("Object (%p) Pathname: %s\n", Node, RetBuf.Pointer); + AcpiOsPrintf ("Object (%p) Pathname: %s\n", Node, (char *) RetBuf.Pointer); } if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) @@ -407,7 +407,7 @@ AcpiDbDecodeInternalObject ( if (!ObjDesc) { - AcpiOsPrintf (" Uninitialized\n"); + AcpiOsPrintf (" Uninitialized"); return; } @@ -546,7 +546,7 @@ AcpiDbDisplayInternalObject ( Type = ACPI_GET_OBJECT_TYPE (ObjDesc); if (Type > INTERNAL_TYPE_MAX) { - AcpiOsPrintf (" Type %hX [Invalid Type]", Type); + AcpiOsPrintf (" Type %X [Invalid Type]", (UINT32) Type); return; } @@ -591,13 +591,20 @@ AcpiDbDisplayInternalObject ( case AML_INDEX_OP: AcpiOsPrintf ("[Index] "); - AcpiDbDecodeInternalObject (ObjDesc->Reference.Object); + if (!ObjDesc->Reference.Where) + { + AcpiOsPrintf ("Uninitialized WHERE ptr"); + } + else + { + AcpiDbDecodeInternalObject (*(ObjDesc->Reference.Where)); + } break; case AML_REF_OF_OP: - AcpiOsPrintf ("[Reference] "); + AcpiOsPrintf ("[RefOf] "); /* Reference can be to a Node or an Operand object */ diff --git a/sys/contrib/dev/acpica/dbexec.c b/sys/contrib/dev/acpica/dbexec.c index f17b26d..5bb5edf 100644 --- a/sys/contrib/dev/acpica/dbexec.c +++ b/sys/contrib/dev/acpica/dbexec.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbexec - debugger control method execution - * $Revision: 44 $ + * $Revision: 45 $ * ******************************************************************************/ @@ -363,7 +363,8 @@ AcpiDbExecute ( if (ReturnObj.Length) { AcpiOsPrintf ("Execution of %s returned object %p Buflen %X\n", - AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, ReturnObj.Length); + AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, + (UINT32) ReturnObj.Length); AcpiDbDumpObject (ReturnObj.Pointer, 1); } else @@ -408,7 +409,7 @@ AcpiDbMethodThread ( if (ReturnObj.Length) { AcpiOsPrintf ("Execution of %s returned object %p Buflen %X\n", - Info->Pathname, ReturnObj.Pointer, ReturnObj.Length); + Info->Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length); AcpiDbDumpObject (ReturnObj.Pointer, 1); } } diff --git a/sys/contrib/dev/acpica/dbinput.c b/sys/contrib/dev/acpica/dbinput.c index 208be5d..8edcbda 100644 --- a/sys/contrib/dev/acpica/dbinput.c +++ b/sys/contrib/dev/acpica/dbinput.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbinput - user front-end to the AML debugger - * $Revision: 87 $ + * $Revision: 88 $ * ******************************************************************************/ @@ -341,7 +341,7 @@ AcpiDbDisplayHelp ( return; default: - AcpiOsPrintf ("Unrecognized Command Class: %X\n", HelpType); + AcpiOsPrintf ("Unrecognized Command Class: %s\n", HelpType); return; } } diff --git a/sys/contrib/dev/acpica/dbstats.c b/sys/contrib/dev/acpica/dbstats.c index ec20e5a..fc95cc4 100644 --- a/sys/contrib/dev/acpica/dbstats.c +++ b/sys/contrib/dev/acpica/dbstats.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbstats - Generation and display of ACPI table statistics - * $Revision: 61 $ + * $Revision: 63 $ * ******************************************************************************/ @@ -115,9 +115,9 @@ *****************************************************************************/ -#include <acpi.h> -#include <acdebug.h> -#include <acnamesp.h> +#include "acpi.h" +#include "acdebug.h" +#include "acnamesp.h" #ifdef ACPI_DEBUGGER @@ -412,7 +412,7 @@ AcpiDbDisplayStatistics ( AcpiOsPrintf ("\nObjects defined in the current namespace:\n\n"); - AcpiOsPrintf ("%16.16s % 10.10s % 10.10s\n", "ACPI_TYPE", "NODES", "OBJECTS"); + AcpiOsPrintf ("%16.16s %10.10s %10.10s\n", "ACPI_TYPE", "NODES", "OBJECTS"); for (i = 0; i < INTERNAL_TYPE_NODE_MAX; i++) { diff --git a/sys/contrib/dev/acpica/dmnames.c b/sys/contrib/dev/acpica/dmnames.c index 18e3614..799bfe1 100644 --- a/sys/contrib/dev/acpica/dmnames.c +++ b/sys/contrib/dev/acpica/dmnames.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dmnames - AML disassembler, names, namestrings, pathnames - * $Revision: 3 $ + * $Revision: 4 $ * ******************************************************************************/ @@ -145,7 +145,19 @@ AcpiDmValidateName ( char *Name, ACPI_PARSE_OBJECT *Op) { + #if 0 + if ((!Name) || + (!Op->Common.Parent)) + { + return; + } + + if (!Op->Common.Node) + { + AcpiOsPrintf (" /**** Name not found or not accessible from this scope ****/ "); + } + ACPI_PARSE_OBJECT *TargetOp; diff --git a/sys/contrib/dev/acpica/dsfield.c b/sys/contrib/dev/acpica/dsfield.c index cb054aa..22359ef 100644 --- a/sys/contrib/dev/acpica/dsfield.c +++ b/sys/contrib/dev/acpica/dsfield.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsfield - Dispatcher field routines - * $Revision: 66 $ + * $Revision: 68 $ * *****************************************************************************/ @@ -204,6 +204,7 @@ AcpiDsCreateBufferField ( Flags, WalkState, &(Node)); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -350,13 +351,13 @@ AcpiDsGetFieldNames ( WalkState, &Info->FieldNode); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR ((char *) &Arg->Named.Name, Status); if (Status != AE_ALREADY_EXISTS) { return_ACPI_STATUS (Status); } - ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", - &Arg->Named.Name)); + /* Already exists, ignore error */ } else { @@ -380,7 +381,7 @@ AcpiDsGetFieldNames ( if (Position > ACPI_UINT32_MAX) { ACPI_REPORT_ERROR (("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", - &Info->FieldNode->Name)); + (char *) &Info->FieldNode->Name)); return_ACPI_STATUS (AE_SUPPORT); } @@ -440,6 +441,7 @@ AcpiDsCreateField ( ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -527,14 +529,12 @@ AcpiDsInitFieldObjects ( WalkState, &Node); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR ((char *) &Arg->Named.Name, Status); if (Status != AE_ALREADY_EXISTS) { return_ACPI_STATUS (Status); } - ACPI_REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", - &Arg->Named.Name)); - /* Name already exists, just ignore this error */ Status = AE_OK; @@ -590,6 +590,7 @@ AcpiDsCreateBankField ( ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -602,6 +603,7 @@ AcpiDsCreateBankField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -662,6 +664,7 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -673,6 +676,7 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -681,7 +685,6 @@ AcpiDsCreateIndexField ( Arg = Arg->Common.Next; Info.FieldFlags = Arg->Common.Value.Integer8; - /* Each remaining arg is a Named Field */ Info.FieldType = INTERNAL_TYPE_INDEX_FIELD; diff --git a/sys/contrib/dev/acpica/dsobject.c b/sys/contrib/dev/acpica/dsobject.c index 7f54e84..569023c 100644 --- a/sys/contrib/dev/acpica/dsobject.c +++ b/sys/contrib/dev/acpica/dsobject.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsobject - Dispatcher object management routines - * $Revision: 106 $ + * $Revision: 108 $ * *****************************************************************************/ @@ -339,12 +339,12 @@ AcpiDsBuildInternalObject ( { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; - char *Name; ACPI_FUNCTION_TRACE ("DsBuildInternalObject"); + *ObjDescPtr = NULL; if (Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) { /* @@ -361,28 +361,8 @@ AcpiDsBuildInternalObject ( if (ACPI_FAILURE (Status)) { - if (Status == AE_NOT_FOUND) - { - Name = NULL; - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String, NULL, &Name); - if (ACPI_SUCCESS (Status)) - { - ACPI_REPORT_WARNING (("Reference %s at AML %X not found\n", - Name, Op->Common.AmlOffset)); - ACPI_MEM_FREE (Name); - } - else - { - ACPI_REPORT_WARNING (("Reference %s at AML %X not found\n", - Op->Common.Value.String, Op->Common.AmlOffset)); - } - - *ObjDescPtr = NULL; - } - else - { - return_ACPI_STATUS (Status); - } + ACPI_REPORT_NSERROR (Op->Common.Value.String, Status); + return_ACPI_STATUS (Status); } } } @@ -881,9 +861,10 @@ AcpiDsInitObjectFromOp ( ObjDesc->Reference.Opcode = AML_LOCAL_OP; ObjDesc->Reference.Offset = Opcode - AML_LOCAL_OP; + #ifndef ACPI_NO_METHOD_EXECUTION - AcpiDsMethodDataGetNode (AML_LOCAL_OP, ObjDesc->Reference.Offset, - WalkState, (ACPI_NAMESPACE_NODE **) &ObjDesc->Reference.Object); + Status = AcpiDsMethodDataGetNode (AML_LOCAL_OP, ObjDesc->Reference.Offset, + WalkState, (ACPI_NAMESPACE_NODE **) &ObjDesc->Reference.Object); #endif break; diff --git a/sys/contrib/dev/acpica/dsopcode.c b/sys/contrib/dev/acpica/dsopcode.c index 93a2d52..8be92c8 100644 --- a/sys/contrib/dev/acpica/dsopcode.c +++ b/sys/contrib/dev/acpica/dsopcode.c @@ -2,7 +2,7 @@ * * Module Name: dsopcode - Dispatcher Op Region support and handling of * "control" opcodes - * $Revision: 81 $ + * $Revision: 82 $ * *****************************************************************************/ @@ -188,7 +188,7 @@ AcpiDsExecuteArguments ( return_ACPI_STATUS (Status); } - WalkState->ParseFlags = 0; + WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP; /* Pass1: Parse the entire declaration */ diff --git a/sys/contrib/dev/acpica/dsutils.c b/sys/contrib/dev/acpica/dsutils.c index 89e9b56..17cd17a 100644 --- a/sys/contrib/dev/acpica/dsutils.c +++ b/sys/contrib/dev/acpica/dsutils.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsutils - Dispatcher utilities - * $Revision: 94 $ + * $Revision: 95 $ * ******************************************************************************/ @@ -405,7 +405,6 @@ AcpiDsCreateOperand ( UINT32 ArgIndex) { ACPI_STATUS Status = AE_OK; - ACPI_STATUS Status2; NATIVE_CHAR *NameString; UINT32 NameLength; ACPI_OPERAND_OBJECT *ObjDesc; @@ -413,7 +412,6 @@ AcpiDsCreateOperand ( UINT16 Opcode; ACPI_INTERPRETER_MODE InterpreterMode; const ACPI_OPCODE_INFO *OpInfo; - char *Name; ACPI_FUNCTION_TRACE_PTR ("DsCreateOperand", Arg); @@ -496,18 +494,14 @@ AcpiDsCreateOperand ( * very serious error at this point */ Status = AE_AML_NAME_NOT_FOUND; - - Name = NULL; - Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX, NameString, NULL, &Name); - if (ACPI_SUCCESS (Status2)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Object name [%s] was not found in namespace\n", Name)); - ACPI_MEM_FREE (Name); - } } } + if (ACPI_FAILURE (Status)) + { + ACPI_REPORT_NSERROR (NameString, Status); + } + /* Free the namestring created above */ ACPI_MEM_FREE (NameString); diff --git a/sys/contrib/dev/acpica/dswload.c b/sys/contrib/dev/acpica/dswload.c index 161c570..852d40a 100644 --- a/sys/contrib/dev/acpica/dswload.c +++ b/sys/contrib/dev/acpica/dswload.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswload - Dispatcher namespace load callbacks - * $Revision: 70 $ + * $Revision: 75 $ * *****************************************************************************/ @@ -202,25 +202,30 @@ AcpiDsLoad1BeginOp ( ACPI_STATUS Status; ACPI_OBJECT_TYPE ObjectType; NATIVE_CHAR *Path; + UINT32 Flags; ACPI_FUNCTION_NAME ("DsLoad1BeginOp"); + Op = WalkState->Op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); - - if (Op && (Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); - } - /* We are only interested in opcodes that have an associated name */ if (Op) { if (!(WalkState->OpInfo->Flags & AML_NAMED)) { +#if 0 + if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) || + (WalkState->OpInfo->Class == AML_CLASS_CONTROL)) + { + AcpiOsPrintf ("\n\n***EXECUTABLE OPCODE %s***\n\n", WalkState->OpInfo->Name); + *OutOp = Op; + return (AE_CTRL_SKIP); + } +#endif *OutOp = Op; return (AE_OK); } @@ -241,7 +246,33 @@ AcpiDsLoad1BeginOp ( ObjectType = WalkState->OpInfo->ObjectType; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType)); + "State=%p Op=%p [%s] ", WalkState, Op, AcpiUtGetTypeName (ObjectType))); + + /* + * Setup the search flags. + * + * Since we are entering a name into the namespace, we do not want to + * enable the search-to-root upsearch. + * + * There are only two conditions where it is acceptable that the name + * already exists: + * 1) the Scope() operator can reopen a scoping object that was + * previously defined (Scope, Method, Device, etc.) + * 2) Whenever we are parsing a deferred opcode (OpRegion, Buffer, + * BufferField, or Package), the name of the object is already + * in the namespace. + */ + Flags = ACPI_NS_NO_UPSEARCH; + if ((WalkState->Opcode != AML_SCOPE_OP) && + (!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP))) + { + Flags |= ACPI_NS_ERROR_IF_FOUND; + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n")); + } + else + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n")); + } /* * Enter the named type into the internal namespace. We enter the name @@ -249,13 +280,62 @@ AcpiDsLoad1BeginOp ( * arguments to the opcode must be created as we go back up the parse tree later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, WalkState, &(Node)); - + ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &(Node)); if (ACPI_FAILURE (Status)) { + ACPI_REPORT_NSERROR (Path, Status); return (Status); } + /* + * For the scope op, we must check to make sure that the target is + * one of the opcodes that actually opens a scope + */ + if (WalkState->Opcode == AML_SCOPE_OP) + { + switch (Node->Type) + { + case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */ + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_POWER: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_THERMAL: + + /* These are acceptable types */ + break; + + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + + /* + * These types we will allow, but we will change the type. This + * enables some existing code of the form: + * + * Name (DEB, 0) + * Scope (DEB) { ... } + * + * Note: silently change the type here. On the second pass, we will report a warning + */ + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", + Path, AcpiUtGetTypeName (Node->Type))); + + Node->Type = ACPI_TYPE_ANY; + WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; + break; + + default: + + /* All other types are an error */ + + ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)\n", + AcpiUtGetTypeName (Node->Type), Path)); + + return (AE_AML_OPERAND_TYPE); + } + } + if (!Op) { /* Create a new op */ @@ -314,10 +394,10 @@ AcpiDsLoad1EndOp ( ACPI_FUNCTION_NAME ("DsLoad1EndOp"); + Op = WalkState->Op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); - /* We are only interested in opcodes that have an associated name */ if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD))) @@ -504,37 +584,87 @@ AcpiDsLoad2BeginOp ( ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, WalkState, &(Node)); } - if (ACPI_SUCCESS (Status)) + if (ACPI_FAILURE (Status)) { - if (!Op) + ACPI_REPORT_NSERROR (BufferPtr, Status); + return_ACPI_STATUS (Status); + } + + /* + * For the scope op, we must check to make sure that the target is + * one of the opcodes that actually opens a scope + */ + if (WalkState->Opcode == AML_SCOPE_OP) + { + switch (Node->Type) { - /* Create a new op */ + case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */ + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_POWER: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_THERMAL: - Op = AcpiPsAllocOp (WalkState->Opcode); - if (!Op) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } + /* These are acceptable types */ + break; - /* Initialize the new op */ + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: - if (Node) - { - Op->Named.Name = Node->Name.Integer; - } - if (OutOp) - { - *OutOp = Op; - } + /* + * These types we will allow, but we will change the type. This + * enables some existing code of the form: + * + * Name (DEB, 0) + * Scope (DEB) { ... } + */ + + ACPI_REPORT_WARNING (("Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", + BufferPtr, AcpiUtGetTypeName (Node->Type))); + + Node->Type = ACPI_TYPE_ANY; + WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; + break; + + default: + + /* All other types are an error */ + + ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s]\n", + AcpiUtGetTypeName (Node->Type), BufferPtr)); + + return (AE_AML_OPERAND_TYPE); } + } - /* - * Put the Node in the "op" object that the parser uses, so we - * can get it again quickly when this scope is closed - */ - Op->Common.Node = Node; + if (!Op) + { + /* Create a new op */ + + Op = AcpiPsAllocOp (WalkState->Opcode); + if (!Op) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Initialize the new op */ + + if (Node) + { + Op->Named.Name = Node->Name.Integer; + } + if (OutOp) + { + *OutOp = Op; + } } + /* + * Put the Node in the "op" object that the parser uses, so we + * can get it again quickly when this scope is closed + */ + Op->Common.Node = Node; + return_ACPI_STATUS (Status); } @@ -856,7 +986,10 @@ AcpiDsLoad2EndOp ( */ Op->Common.Node = NewNode; } - + else + { + ACPI_REPORT_NSERROR (Arg->Common.Value.String, Status); + } break; diff --git a/sys/contrib/dev/acpica/dswscope.c b/sys/contrib/dev/acpica/dswscope.c index d34808e..92736f5 100644 --- a/sys/contrib/dev/acpica/dswscope.c +++ b/sys/contrib/dev/acpica/dswscope.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswscope - Scope stack manipulation - * $Revision: 52 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -156,7 +156,7 @@ AcpiDsScopeStackClear ( WalkState->ScopeInfo = ScopeInfo->Scope.Next; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Popped object type %X\n", ScopeInfo->Common.Value)); + "Popped object type (%s)\n", AcpiUtGetTypeName (ScopeInfo->Common.Value))); AcpiUtDeleteGenericState (ScopeInfo); } } @@ -261,7 +261,7 @@ AcpiDsScopeStackPop ( } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Popped object type %X\n", ScopeInfo->Common.Value)); + "Popped object type (%s)\n", AcpiUtGetTypeName (ScopeInfo->Common.Value))); AcpiUtDeleteGenericState (ScopeInfo); diff --git a/sys/contrib/dev/acpica/evevent.c b/sys/contrib/dev/acpica/evevent.c index 46617c3..32af556 100644 --- a/sys/contrib/dev/acpica/evevent.c +++ b/sys/contrib/dev/acpica/evevent.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evevent - Fixed and General Purpose Even handling and dispatch - * $Revision: 90 $ + * $Revision: 92 $ * *****************************************************************************/ @@ -234,6 +234,7 @@ AcpiEvHandlerInitialize ( return_ACPI_STATUS (Status); } + AcpiGbl_EventsInitialized = TRUE; return_ACPI_STATUS (Status); } @@ -301,8 +302,8 @@ AcpiEvFixedEventDetect ( void) { UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; - UINT32 GpeStatus; - UINT32 GpeEnable; + UINT32 FixedStatus; + UINT32 FixedEnable; NATIVE_UINT_MAX32 i; @@ -313,12 +314,12 @@ AcpiEvFixedEventDetect ( * Read the fixed feature status and enable registers, as all the cases * depend on their values. Ignore errors here. */ - (void) AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, &GpeStatus); - (void) AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_ENABLE, &GpeEnable); + (void) AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, &FixedStatus); + (void) AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_ENABLE, &FixedEnable); ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed AcpiEvent Block: Enable %08X Status %08X\n", - GpeEnable, GpeStatus)); + FixedEnable, FixedStatus)); /* * Check for all possible Fixed Events and dispatch those that are active @@ -327,8 +328,8 @@ AcpiEvFixedEventDetect ( { /* Both the status and enable bits must be on for this event */ - if ((GpeStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) && - (GpeEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask)) + if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) && + (FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask)) { /* Found an active (signalled) event */ diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c index ad4c637..5062112 100644 --- a/sys/contrib/dev/acpica/evmisc.c +++ b/sys/contrib/dev/acpica/evmisc.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evmisc - Miscellaneous event manager support functions - * $Revision: 56 $ + * $Revision: 57 $ * *****************************************************************************/ @@ -667,7 +667,7 @@ AcpiEvReleaseGlobalLock (void) * * RETURN: none * - * DESCRIPTION: free memory allocated for table storage. + * DESCRIPTION: Disable events and free memory allocated for table storage. * ******************************************************************************/ @@ -680,45 +680,49 @@ AcpiEvTerminate (void) ACPI_FUNCTION_TRACE ("EvTerminate"); - /* - * Disable all event-related functionality. - * In all cases, on error, print a message but obviously we don't abort. - */ - /* - * Disable all fixed events - */ - for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) + if (AcpiGbl_EventsInitialized) { - Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); - if (ACPI_FAILURE (Status)) + /* + * Disable all event-related functionality. + * In all cases, on error, print a message but obviously we don't abort. + */ + + /* + * Disable all fixed events + */ + for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable fixed event %d.\n", i)); + Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", i)); + } } - } - /* - * Disable all GPEs - */ - for (i = 0; i < AcpiGbl_GpeNumberMax; i++) - { - if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) + /* + * Disable all GPEs + */ + for (i = 0; i < AcpiGbl_GpeNumberMax; i++) { - Status = AcpiHwDisableGpe(i); - if (ACPI_FAILURE (Status)) + if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable GPE %d.\n", i)); + Status = AcpiHwDisableGpe(i); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable GPE %d\n", i)); + } } } - } - /* - * Remove SCI handler - */ - Status = AcpiEvRemoveSciHandler(); - if (ACPI_FAILURE(Status)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to remove SCI handler.\n")); + /* + * Remove SCI handler + */ + Status = AcpiEvRemoveSciHandler(); + if (ACPI_FAILURE(Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not remove SCI handler\n")); + } } /* @@ -729,7 +733,7 @@ AcpiEvTerminate (void) Status = AcpiDisable (); if (ACPI_FAILURE (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed.\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed\n")); } } diff --git a/sys/contrib/dev/acpica/exconvrt.c b/sys/contrib/dev/acpica/exconvrt.c index c3c8f98..6729a27 100644 --- a/sys/contrib/dev/acpica/exconvrt.c +++ b/sys/contrib/dev/acpica/exconvrt.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exconvrt - Object conversion routines - * $Revision: 37 $ + * $Revision: 39 $ * *****************************************************************************/ @@ -273,7 +273,7 @@ AcpiExConvertToInteger ( * * RETURN: Status * - * DESCRIPTION: Convert an ACPI Object to an Buffer + * DESCRIPTION: Convert an ACPI Object to a Buffer * ******************************************************************************/ @@ -335,7 +335,34 @@ AcpiExConvertToBuffer ( case ACPI_TYPE_STRING: - *ResultDesc = ObjDesc; + /* + * Create a new Buffer object + */ + RetDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER); + if (!RetDesc) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Need enough space for one integer */ + + NewBuf = ACPI_MEM_CALLOCATE (ObjDesc->String.Length); + if (!NewBuf) + { + ACPI_REPORT_ERROR + (("ExConvertToBuffer: Buffer allocation failure\n")); + AcpiUtRemoveReference (RetDesc); + return_ACPI_STATUS (AE_NO_MEMORY); + } + + ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer, ObjDesc->String.Length); + RetDesc->Buffer.Flags |= AOPOBJ_DATA_VALID; + RetDesc->Buffer.Pointer = NewBuf; + RetDesc->Buffer.Length = ObjDesc->String.Length; + + /* Return the new buffer descriptor */ + + *ResultDesc = RetDesc; break; @@ -359,11 +386,13 @@ AcpiExConvertToBuffer ( * * FUNCTION: AcpiExConvertAscii * - * PARAMETERS: Integer + * PARAMETERS: Integer - Value to be converted + * Base - 10 or 16 + * String - Where the string is returned * * RETURN: Actual string length * - * DESCRIPTION: Convert an ACPI Integer to a hex string + * DESCRIPTION: Convert an ACPI Integer to a hex or decimal string * ******************************************************************************/ @@ -706,8 +735,8 @@ AcpiExConvertToTargetType ( if (DestinationType != ACPI_GET_OBJECT_TYPE (SourceDesc)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Target does not allow conversion of type %s to %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Explicit operator, will store (%s) over existing type (%s)\n", AcpiUtGetObjectTypeName (SourceDesc), AcpiUtGetTypeName (DestinationType))); Status = AE_TYPE; diff --git a/sys/contrib/dev/acpica/excreate.c b/sys/contrib/dev/acpica/excreate.c index ce2f25e..332f3b5 100644 --- a/sys/contrib/dev/acpica/excreate.c +++ b/sys/contrib/dev/acpica/excreate.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: excreate - Named object creation - * $Revision: 93 $ + * $Revision: 94 $ * *****************************************************************************/ @@ -146,7 +146,8 @@ ACPI_STATUS AcpiExCreateAlias ( ACPI_WALK_STATE *WalkState) { - ACPI_NAMESPACE_NODE *SourceNode; + ACPI_NAMESPACE_NODE *TargetNode; + ACPI_NAMESPACE_NODE *AliasNode; ACPI_STATUS Status; @@ -155,25 +156,63 @@ AcpiExCreateAlias ( /* Get the source/alias operands (both namespace nodes) */ - SourceNode = (ACPI_NAMESPACE_NODE *) WalkState->Operands[1]; + AliasNode = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0]; + TargetNode = (ACPI_NAMESPACE_NODE *) WalkState->Operands[1]; - - /* Attach the original source object to the new Alias Node */ - - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0], - AcpiNsGetAttachedObject (SourceNode), - SourceNode->Type); + if (TargetNode->Type == INTERNAL_TYPE_ALIAS) + { + /* + * Dereference an existing alias so that we don't create a chain + * of aliases. With this code, we guarantee that an alias is + * always exactly one level of indirection away from the + * actual aliased name. + */ + TargetNode = (ACPI_NAMESPACE_NODE *) TargetNode->Object; + } /* - * The new alias assumes the type of the source, but it points - * to the same object. The reference count of the object has an - * additional reference to prevent deletion out from under either the - * source or the alias Node + * For objects that can never change (i.e., the NS node will + * permanently point to the same object), we can simply attach + * the object to the new NS node. For other objects (such as + * Integers, buffers, etc.), we have to point the Alias node + * to the original Node. */ + switch (TargetNode->Type) + { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + case ACPI_TYPE_PACKAGE: + case ACPI_TYPE_BUFFER_FIELD: + + /* + * The new alias has the type ALIAS and points to the original + * NS node, not the object itself. This is because for these + * types, the object can change dynamically via a Store. + */ + AliasNode->Type = INTERNAL_TYPE_ALIAS; + AliasNode->Object = (ACPI_OPERAND_OBJECT *) TargetNode; + break; + + default: + + /* Attach the original source object to the new Alias Node */ + + /* + * The new alias assumes the type of the target, and it points + * to the same object. The reference count of the object has an + * additional reference to prevent deletion out from under either the + * target node or the alias Node + */ + Status = AcpiNsAttachObject (AliasNode, + AcpiNsGetAttachedObject (TargetNode), + TargetNode->Type); + break; + } /* Since both operands are Nodes, we don't need to delete them */ - return_ACPI_STATUS (Status); + return_ACPI_STATUS (AE_OK); } diff --git a/sys/contrib/dev/acpica/exdump.c b/sys/contrib/dev/acpica/exdump.c index 9f374d0..1a20823 100644 --- a/sys/contrib/dev/acpica/exdump.c +++ b/sys/contrib/dev/acpica/exdump.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exdump - Interpreter debug output routines - * $Revision: 159 $ + * $Revision: 160 $ * *****************************************************************************/ @@ -687,6 +687,14 @@ AcpiExDumpObjectDescriptor ( } } + if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED) + { + AcpiExDumpNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags); + AcpiOsPrintf ("\nAttached Object (%p):\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object); + AcpiExDumpObjectDescriptor (((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags); + return; + } + if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) { AcpiOsPrintf ("ExDumpObjectDescriptor: %p is not a valid ACPI object\n", ObjDesc); diff --git a/sys/contrib/dev/acpica/exmisc.c b/sys/contrib/dev/acpica/exmisc.c index 2b23b38..537217b 100644 --- a/sys/contrib/dev/acpica/exmisc.c +++ b/sys/contrib/dev/acpica/exmisc.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 108 $ + * $Revision: 109 $ * *****************************************************************************/ @@ -121,7 +121,6 @@ #include "acpi.h" #include "acinterp.h" #include "amlcode.h" -#include "acdispat.h" #define _COMPONENT ACPI_EXECUTER diff --git a/sys/contrib/dev/acpica/exoparg1.c b/sys/contrib/dev/acpica/exoparg1.c index 08f2348..60d65b7 100644 --- a/sys/contrib/dev/acpica/exoparg1.c +++ b/sys/contrib/dev/acpica/exoparg1.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg1 - AML execution - opcodes with 1 argument - * $Revision: 142 $ + * $Revision: 143 $ * *****************************************************************************/ @@ -151,7 +151,6 @@ * fully resolved operands. !*/ - /******************************************************************************* * * FUNCTION: AcpiExOpcode_1A_0T_0R @@ -678,78 +677,12 @@ AcpiExOpcode_1A_0T_1R ( case AML_TYPE_OP: /* ObjectType (SourceObject) */ - if (ACPI_GET_OBJECT_TYPE (Operand[0]) == INTERNAL_TYPE_REFERENCE) - { - /* - * Not a Name -- an indirect name pointer would have - * been converted to a direct name pointer in ResolveOperands - */ - switch (Operand[0]->Reference.Opcode) - { - case AML_DEBUG_OP: - - /* The Debug Object is of type "DebugObject" */ - - Type = ACPI_TYPE_DEBUG_OBJECT; - break; - - - case AML_INDEX_OP: + /* Get the type of the base object */ - /* Get the type of this reference (index into another object) */ - - Type = Operand[0]->Reference.TargetType; - if (Type == ACPI_TYPE_PACKAGE) - { - /* - * The main object is a package, we want to get the type - * of the individual package element that is referenced by - * the index. - */ - Type = ACPI_GET_OBJECT_TYPE (*(Operand[0]->Reference.Where)); - } - break; - - - case AML_LOCAL_OP: - case AML_ARG_OP: - - Type = AcpiDsMethodDataGetType (Operand[0]->Reference.Opcode, - Operand[0]->Reference.Offset, WalkState); - break; - - - default: - - ACPI_REPORT_ERROR (("AcpiExOpcode_1A_0T_1R/TypeOp: Unknown Reference subtype %X\n", - Operand[0]->Reference.Opcode)); - Status = AE_AML_INTERNAL; - goto Cleanup; - } - } - else + Status = AcpiExResolveMultiple (WalkState, Operand[0], &Type, NULL); + if (ACPI_FAILURE (Status)) { - /* - * It's not a Reference, so it must be a direct name pointer. - */ - Type = AcpiNsGetType ((ACPI_NAMESPACE_NODE *) Operand[0]); - - /* Convert internal types to external types */ - - switch (Type) - { - case INTERNAL_TYPE_REGION_FIELD: - case INTERNAL_TYPE_BANK_FIELD: - case INTERNAL_TYPE_INDEX_FIELD: - - Type = ACPI_TYPE_FIELD_UNIT; - break; - - default: - /* No change to Type required */ - break; - } - + goto Cleanup; } /* Allocate a descriptor to hold the type. */ @@ -767,43 +700,38 @@ AcpiExOpcode_1A_0T_1R ( case AML_SIZE_OF_OP: /* SizeOf (SourceObject) */ - TempDesc = Operand[0]; - if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED) - { - TempDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) Operand[0]); - } + /* Get the base object */ - if (!TempDesc) + Status = AcpiExResolveMultiple (WalkState, Operand[0], &Type, &TempDesc); + if (ACPI_FAILURE (Status)) { - Value = 0; + goto Cleanup; } - else + + /* + * Type is guaranteed to be a buffer, string, or package at this + * point (even if the original operand was an object reference, it + * will be resolved and typechecked during operand resolution.) + */ + switch (Type) { - /* - * Type is guaranteed to be a buffer, string, or package at this - * point (even if the original operand was an object reference, it - * will be resolved and typechecked during operand resolution.) - */ - switch (ACPI_GET_OBJECT_TYPE (TempDesc)) - { - case ACPI_TYPE_BUFFER: - Value = TempDesc->Buffer.Length; - break; + case ACPI_TYPE_BUFFER: + Value = TempDesc->Buffer.Length; + break; - case ACPI_TYPE_STRING: - Value = TempDesc->String.Length; - break; + case ACPI_TYPE_STRING: + Value = TempDesc->String.Length; + break; - case ACPI_TYPE_PACKAGE: - Value = TempDesc->Package.Count; - break; + case ACPI_TYPE_PACKAGE: + Value = TempDesc->Package.Count; + break; - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "SizeOf, Not Buf/Str/Pkg - found type %s\n", - AcpiUtGetObjectTypeName (TempDesc))); - Status = AE_AML_OPERAND_TYPE; - goto Cleanup; - } + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "SizeOf, Not Buf/Str/Pkg - found type %s\n", + AcpiUtGetTypeName (Type))); + Status = AE_AML_OPERAND_TYPE; + goto Cleanup; } /* diff --git a/sys/contrib/dev/acpica/exoparg2.c b/sys/contrib/dev/acpica/exoparg2.c index bd70810..465809f 100644 --- a/sys/contrib/dev/acpica/exoparg2.c +++ b/sys/contrib/dev/acpica/exoparg2.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exoparg2 - AML execution - opcodes with 2 arguments - * $Revision: 110 $ + * $Revision: 111 $ * *****************************************************************************/ @@ -346,9 +346,10 @@ AcpiExOpcode_2A_1T_1R ( { ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; - ACPI_OPERAND_OBJECT *TempDesc; + ACPI_OPERAND_OBJECT *TempDesc = NULL; UINT32 Index; ACPI_STATUS Status = AE_OK; + ACPI_SIZE Length; ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode)); @@ -390,7 +391,6 @@ AcpiExOpcode_2A_1T_1R ( Status = AcpiUtDivide (&Operand[0]->Integer.Value, &Operand[1]->Integer.Value, NULL, &ReturnDesc->Integer.Value); - break; @@ -406,15 +406,15 @@ AcpiExOpcode_2A_1T_1R ( switch (ACPI_GET_OBJECT_TYPE (Operand[0])) { case ACPI_TYPE_INTEGER: - Status = AcpiExConvertToInteger (Operand[1], &Operand[1], WalkState); + Status = AcpiExConvertToInteger (Operand[1], &TempDesc, WalkState); break; case ACPI_TYPE_STRING: - Status = AcpiExConvertToString (Operand[1], &Operand[1], 16, ACPI_UINT32_MAX, WalkState); + Status = AcpiExConvertToString (Operand[1], &TempDesc, 16, ACPI_UINT32_MAX, WalkState); break; case ACPI_TYPE_BUFFER: - Status = AcpiExConvertToBuffer (Operand[1], &Operand[1], WalkState); + Status = AcpiExConvertToBuffer (Operand[1], &TempDesc, WalkState); break; default: @@ -431,14 +431,69 @@ AcpiExOpcode_2A_1T_1R ( * (Both are Integer, String, or Buffer), and we can now perform the * concatenation. */ - Status = AcpiExDoConcatenate (Operand[0], Operand[1], &ReturnDesc, WalkState); + Status = AcpiExDoConcatenate (Operand[0], TempDesc, &ReturnDesc, WalkState); + if (TempDesc != Operand[1]) + { + AcpiUtRemoveReference (TempDesc); + } break; case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */ - Status = AcpiExConvertToString (Operand[0], &ReturnDesc, 16, - (UINT32) Operand[1]->Integer.Value, WalkState); + /* + * Input object is guaranteed to be a buffer at this point (it may have + * been converted.) Copy the raw buffer data to a new object of type String. + */ + + /* Get the length of the new string */ + + Length = 0; + if (Operand[1]->Integer.Value == 0) + { + /* Handle optional length value */ + + Operand[1]->Integer.Value = ACPI_INTEGER_MAX; + } + + while ((Length < Operand[0]->Buffer.Length) && + (Length < Operand[1]->Integer.Value) && + (Operand[0]->Buffer.Pointer[Length])) + { + Length++; + } + + if (Length > ACPI_MAX_STRING_CONVERSION) + { + Status = AE_AML_STRING_LIMIT; + goto Cleanup; + } + + /* Create the internal return object */ + + ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING); + if (!ReturnDesc) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Allocate a new string buffer (Length + 1 for null terminator) */ + + ReturnDesc->String.Pointer = ACPI_MEM_CALLOCATE (Length + 1); + if (!ReturnDesc->String.Pointer) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Copy the raw buffer data with no transform */ + + ACPI_MEMCPY (ReturnDesc->String.Pointer, Operand[0]->Buffer.Pointer, Length); + + /* Set the string length */ + + ReturnDesc->String.Length = Length; break; diff --git a/sys/contrib/dev/acpica/exresnte.c b/sys/contrib/dev/acpica/exresnte.c index 4b4c8ff..cb38295 100644 --- a/sys/contrib/dev/acpica/exresnte.c +++ b/sys/contrib/dev/acpica/exresnte.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution - * $Revision: 57 $ + * $Revision: 59 $ * *****************************************************************************/ @@ -118,7 +118,6 @@ #define __EXRESNTE_C__ #include "acpi.h" -#include "amlcode.h" #include "acdispat.h" #include "acinterp.h" #include "acnamesp.h" @@ -181,6 +180,16 @@ AcpiExResolveNodeToValue ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p Type=%X\n", Node, SourceDesc, EntryType)); + if (EntryType == INTERNAL_TYPE_ALIAS) + { + /* There is always exactly one level of indirection */ + + Node = (ACPI_NAMESPACE_NODE *) Node->Object; + SourceDesc = AcpiNsGetAttachedObject (Node); + EntryType = AcpiNsGetType ((ACPI_HANDLE) Node); + *ObjectPtr = Node; + } + /* * Several object types require no further processing: * 1) Devices rarely have an attached object, return the Node @@ -306,7 +315,7 @@ AcpiExResolveNodeToValue ( break; - /* TYPE_Any is untyped, and thus there is no object associated with it */ + /* TYPE_ANY is untyped, and thus there is no object associated with it */ case ACPI_TYPE_ANY: diff --git a/sys/contrib/dev/acpica/exresolv.c b/sys/contrib/dev/acpica/exresolv.c index b9972c0..9b8b610 100644 --- a/sys/contrib/dev/acpica/exresolv.c +++ b/sys/contrib/dev/acpica/exresolv.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution - * $Revision: 115 $ + * $Revision: 116 $ * *****************************************************************************/ @@ -121,6 +121,7 @@ #include "amlcode.h" #include "acdispat.h" #include "acinterp.h" +#include "acnamesp.h" #define _COMPONENT ACPI_EXECUTER @@ -383,3 +384,180 @@ AcpiExResolveObjectToValue ( } +/******************************************************************************* + * + * FUNCTION: AcpiExResolveMultiple + * + * PARAMETERS: WalkState - Current state (contains AML opcode) + * Operand - Starting point for resolution + * ReturnType - Where the object type is returned + * ReturnDesc - Where the resolved object is returned + * + * RETURN: Status + * + * DESCRIPTION: Return the base object and type. Traverse a reference list if + * necessary to get to the base object. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiExResolveMultiple ( + ACPI_WALK_STATE *WalkState, + ACPI_OPERAND_OBJECT *Operand, + ACPI_OBJECT_TYPE *ReturnType, + ACPI_OPERAND_OBJECT **ReturnDesc) +{ + ACPI_OPERAND_OBJECT *ObjDesc = (void *) Operand; + ACPI_NAMESPACE_NODE *Node; + ACPI_OBJECT_TYPE Type; + + + ACPI_FUNCTION_TRACE ("ExGetObjectType"); + + + /* + * For reference objects created via the RefOf or Index operators, + * we need to get to the base object (as per the ACPI specification + * of the ObjectType and SizeOf operators). This means traversing + * the list of possibly many nested references. + */ + while (ACPI_GET_OBJECT_TYPE (ObjDesc) == INTERNAL_TYPE_REFERENCE) + { + switch (ObjDesc->Reference.Opcode) + { + case AML_REF_OF_OP: + + /* Dereference the reference pointer */ + + Node = ObjDesc->Reference.Object; + + /* All "References" point to a NS node */ + + if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) + { + return_ACPI_STATUS (AE_AML_INTERNAL); + } + + /* Get the attached object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + /* No object, use the NS node type */ + + Type = AcpiNsGetType (Node); + goto Exit; + } + + /* Check for circular references */ + + if (ObjDesc == Operand) + { + return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE); + } + break; + + + case AML_INDEX_OP: + + /* Get the type of this reference (index into another object) */ + + Type = ObjDesc->Reference.TargetType; + if (Type != ACPI_TYPE_PACKAGE) + { + goto Exit; + } + + /* + * The main object is a package, we want to get the type + * of the individual package element that is referenced by + * the index. + * + * This could of course in turn be another reference object. + */ + ObjDesc = *(ObjDesc->Reference.Where); + break; + + + case AML_INT_NAMEPATH_OP: + + /* Dereference the reference pointer */ + + Node = ObjDesc->Reference.Node; + + /* All "References" point to a NS node */ + + if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) + { + return_ACPI_STATUS (AE_AML_INTERNAL); + } + + /* Get the attached object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + /* No object, use the NS node type */ + + Type = AcpiNsGetType (Node); + goto Exit; + } + + /* Check for circular references */ + + if (ObjDesc == Operand) + { + return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE); + } + break; + + + case AML_DEBUG_OP: + + /* The Debug Object is of type "DebugObject" */ + + Type = ACPI_TYPE_DEBUG_OBJECT; + goto Exit; + + + default: + + ACPI_REPORT_ERROR (("AcpiExResolveMultiple: Unknown Reference subtype %X\n", + ObjDesc->Reference.Opcode)); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + } + + /* + * Now we are guaranteed to have an object that has not been created + * via the RefOf or Index operators. + */ + Type = ACPI_GET_OBJECT_TYPE (ObjDesc); + + +Exit: + /* Convert internal types to external types */ + + switch (Type) + { + case INTERNAL_TYPE_REGION_FIELD: + case INTERNAL_TYPE_BANK_FIELD: + case INTERNAL_TYPE_INDEX_FIELD: + + Type = ACPI_TYPE_FIELD_UNIT; + break; + + default: + /* No change to Type required */ + break; + } + + *ReturnType = Type; + if (ReturnDesc) + { + *ReturnDesc = ObjDesc; + } + return_ACPI_STATUS (AE_OK); +} + + diff --git a/sys/contrib/dev/acpica/exresop.c b/sys/contrib/dev/acpica/exresop.c index a3702d3..92592e6 100644 --- a/sys/contrib/dev/acpica/exresop.c +++ b/sys/contrib/dev/acpica/exresop.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresop - AML Interpreter operand/object resolution - * $Revision: 55 $ + * $Revision: 58 $ * *****************************************************************************/ @@ -121,7 +121,6 @@ #include "amlcode.h" #include "acparser.h" #include "acinterp.h" -#include "acnamesp.h" #define _COMPONENT ACPI_EXECUTER @@ -433,6 +432,10 @@ AcpiExResolveOperands ( return_ACPI_STATUS (Status); } + /* Get the resolved object */ + + ObjDesc = *StackPtr; + /* * Check the resulting object (value) type */ @@ -493,21 +496,31 @@ AcpiExResolveOperands ( /* * Need an operand of type ACPI_TYPE_INTEGER, * But we can implicitly convert from a STRING or BUFFER + * Aka - "Implicit Source Operand Conversion" */ - Status = AcpiExConvertToInteger (*StackPtr, StackPtr, WalkState); + Status = AcpiExConvertToInteger (ObjDesc, StackPtr, WalkState); if (ACPI_FAILURE (Status)) { if (Status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - AcpiUtGetObjectTypeName (*StackPtr), *StackPtr)); + AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } return_ACPI_STATUS (Status); } + + if (ObjDesc != *StackPtr) + { + /* + * We just created a new object, remove a reference + * on the original operand object + */ + AcpiUtRemoveReference (ObjDesc); + } goto NextOperand; @@ -516,21 +529,31 @@ AcpiExResolveOperands ( /* * Need an operand of type ACPI_TYPE_BUFFER, * But we can implicitly convert from a STRING or INTEGER + * Aka - "Implicit Source Operand Conversion" */ - Status = AcpiExConvertToBuffer (*StackPtr, StackPtr, WalkState); + Status = AcpiExConvertToBuffer (ObjDesc, StackPtr, WalkState); if (ACPI_FAILURE (Status)) { if (Status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - AcpiUtGetObjectTypeName (*StackPtr), *StackPtr)); + AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } return_ACPI_STATUS (Status); } + + if (ObjDesc != *StackPtr) + { + /* + * We just created a new object, remove a reference + * on the original operand object + */ + AcpiUtRemoveReference (ObjDesc); + } goto NextOperand; @@ -539,21 +562,31 @@ AcpiExResolveOperands ( /* * Need an operand of type ACPI_TYPE_STRING, * But we can implicitly convert from a BUFFER or INTEGER + * Aka - "Implicit Source Operand Conversion" */ - Status = AcpiExConvertToString (*StackPtr, StackPtr, 16, ACPI_UINT32_MAX, WalkState); + Status = AcpiExConvertToString (ObjDesc, StackPtr, 16, ACPI_UINT32_MAX, WalkState); if (ACPI_FAILURE (Status)) { if (Status == AE_TYPE) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - AcpiUtGetObjectTypeName (*StackPtr), *StackPtr)); + AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } return_ACPI_STATUS (Status); } + + if (ObjDesc != *StackPtr) + { + /* + * We just created a new object, remove a reference + * on the original operand object + */ + AcpiUtRemoveReference (ObjDesc); + } goto NextOperand; @@ -561,7 +594,7 @@ AcpiExResolveOperands ( /* Need an operand of type INTEGER, STRING or BUFFER */ - switch (ACPI_GET_OBJECT_TYPE (*StackPtr)) + switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) { case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: @@ -573,7 +606,7 @@ AcpiExResolveOperands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Integer/String/Buffer], found [%s] %p\n", - AcpiUtGetObjectTypeName (*StackPtr), *StackPtr)); + AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -583,51 +616,17 @@ AcpiExResolveOperands ( case ARGI_DATAOBJECT: /* * ARGI_DATAOBJECT is only used by the SizeOf operator. - * Need a buffer, string, package, or Node reference. + * Need a buffer, string, package, or RefOf reference. * * The only reference allowed here is a direct reference to * a namespace node. */ - if (ACPI_GET_OBJECT_TYPE (*StackPtr) == INTERNAL_TYPE_REFERENCE) - { - if (!(*StackPtr)->Reference.Node) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Needed [Node Reference], found [%p]\n", - *StackPtr)); - - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - - /* Get the object attached to the node */ - - TempNode = AcpiNsGetAttachedObject ((*StackPtr)->Reference.Node); - if (!TempNode) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Node [%p] has no attached object\n", - (*StackPtr)->Reference.Node)); - - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - - /* - * Swap the reference object with the node's object. Must add - * a reference to the node object, and remove a reference from - * the original reference object. - */ - AcpiUtAddReference (TempNode); - AcpiUtRemoveReference (*StackPtr); - (*StackPtr) = TempNode; - } - - /* Need a buffer, string, package */ - - switch (ACPI_GET_OBJECT_TYPE (*StackPtr)) + switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) { case ACPI_TYPE_PACKAGE: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: + case INTERNAL_TYPE_REFERENCE: /* Valid operand */ break; @@ -635,7 +634,7 @@ AcpiExResolveOperands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Buf/Str/Pkg], found [%s] %p\n", - AcpiUtGetObjectTypeName (*StackPtr), *StackPtr)); + AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -646,7 +645,7 @@ AcpiExResolveOperands ( /* Need a buffer or package or (ACPI 2.0) String */ - switch (ACPI_GET_OBJECT_TYPE (*StackPtr)) + switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) { case ACPI_TYPE_PACKAGE: case ACPI_TYPE_STRING: @@ -658,7 +657,7 @@ AcpiExResolveOperands ( default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed [Buf/Str/Pkg], found [%s] %p\n", - AcpiUtGetObjectTypeName (*StackPtr), *StackPtr)); + AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -670,7 +669,7 @@ AcpiExResolveOperands ( /* Unknown type */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Internal - Unknown ARGI type %X\n", + "Internal - Unknown ARGI (required operand) type %X\n", ThisArgType)); return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/sys/contrib/dev/acpica/exstore.c b/sys/contrib/dev/acpica/exstore.c index d89abba..92caf43 100644 --- a/sys/contrib/dev/acpica/exstore.c +++ b/sys/contrib/dev/acpica/exstore.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exstore - AML Interpreter object store support - * $Revision: 169 $ + * $Revision: 172 $ * *****************************************************************************/ @@ -199,7 +199,7 @@ AcpiExStore ( return_ACPI_STATUS (AE_OK); } - /*lint: -fallthrough */ + /*lint -fallthrough */ default: @@ -387,6 +387,13 @@ AcpiExStoreObjectToIndex ( { AcpiUtRemoveReference (ObjDesc); *(IndexDesc->Reference.Where) = NewDesc; + + /* If same as the original source, add a reference */ + + if (NewDesc == SourceDesc) + { + AcpiUtAddReference (NewDesc); + } } break; @@ -560,8 +567,12 @@ AcpiExStoreObjectToNode ( * Store the new NewDesc as the new value of the Name, and set * the Name's type to that of the value being stored in it. * SourceDesc reference count is incremented by AttachObject. + * + * Note: This may change the type of the node if an explicit store + * has been performed such that the node/object type has been + * changed. */ - Status = AcpiNsAttachObject (Node, NewDesc, TargetType); + Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Store %s into %s via Convert/Attach\n", diff --git a/sys/contrib/dev/acpica/exstoren.c b/sys/contrib/dev/acpica/exstoren.c index 422734d..712fcdd 100644 --- a/sys/contrib/dev/acpica/exstoren.c +++ b/sys/contrib/dev/acpica/exstoren.c @@ -3,7 +3,7 @@ * * Module Name: exstoren - AML Interpreter object store support, * Store to Node (namespace object) - * $Revision: 50 $ + * $Revision: 51 $ * *****************************************************************************/ @@ -309,6 +309,16 @@ AcpiExStoreObjectToObject ( { return_ACPI_STATUS (Status); } + + if (SourceDesc == ActualSrcDesc) + { + /* + * No conversion was performed. Return the SourceDesc as the + * new object. + */ + *NewDesc = SourceDesc; + return_ACPI_STATUS (AE_OK); + } } /* diff --git a/sys/contrib/dev/acpica/exstorob.c b/sys/contrib/dev/acpica/exstorob.c index ab8181d..9a3bee8 100644 --- a/sys/contrib/dev/acpica/exstorob.c +++ b/sys/contrib/dev/acpica/exstorob.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exstorob - AML Interpreter object store support, store to object - * $Revision: 44 $ + * $Revision: 45 $ * *****************************************************************************/ @@ -182,7 +182,6 @@ AcpiExStoreBufferToBuffer ( ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length); } - else { /* @@ -198,7 +197,6 @@ AcpiExStoreBufferToBuffer ( /* Copy flags */ TargetDesc->Buffer.Flags = SourceDesc->Buffer.Flags; - return (AE_OK); } @@ -239,16 +237,17 @@ AcpiExStoreStringToString ( */ if (Length < TargetDesc->String.Length) { - /* Clear old string and copy in the new one */ - - ACPI_MEMSET (TargetDesc->String.Pointer, 0, TargetDesc->String.Length); + /* + * String will fit in existing buffer. + * Clear old string and copy in the new one + */ + ACPI_MEMSET (TargetDesc->String.Pointer, 0, TargetDesc->String.Length + 1); ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length); } - else { /* - * Free the current buffer, then allocate a buffer + * Free the current buffer, then allocate a new buffer * large enough to hold the value */ if (TargetDesc->String.Pointer && @@ -260,16 +259,18 @@ AcpiExStoreStringToString ( ACPI_MEM_FREE (TargetDesc->String.Pointer); } - TargetDesc->String.Pointer = ACPI_MEM_ALLOCATE ((ACPI_SIZE) Length + 1); + TargetDesc->String.Pointer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) Length + 1); if (!TargetDesc->String.Pointer) { return (AE_NO_MEMORY); } - TargetDesc->String.Length = Length; ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length); } + /* Set the new target length */ + + TargetDesc->String.Length = Length; return (AE_OK); } diff --git a/sys/contrib/dev/acpica/nsdump.c b/sys/contrib/dev/acpica/nsdump.c index 5194477..99e52c3 100644 --- a/sys/contrib/dev/acpica/nsdump.c +++ b/sys/contrib/dev/acpica/nsdump.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 139 $ + * $Revision: 141 $ * *****************************************************************************/ @@ -214,7 +214,7 @@ AcpiNsDumpPathname ( Status = AcpiNsHandleToPathname (Handle, &Buffer); if (ACPI_SUCCESS (Status)) { - AcpiOsPrintf ("%s %s (Node %p)\n", Msg, Buffer.Pointer, Handle); + AcpiOsPrintf ("%s %s (Node %p)\n", Msg, (char *) Buffer.Pointer, Handle); ACPI_MEM_FREE (Buffer.Pointer); } @@ -370,10 +370,10 @@ AcpiNsDumpOneObject ( { case ACPI_TYPE_PROCESSOR: - AcpiOsPrintf (" ID %hd Addr %.4X Len %.4X\n", + AcpiOsPrintf (" ID %X Len %.4X Addr %p\n", ObjDesc->Processor.ProcId, - ObjDesc->Processor.Address, - ObjDesc->Processor.Length); + ObjDesc->Processor.Length, + (char *) ObjDesc->Processor.Address); break; @@ -385,8 +385,8 @@ AcpiNsDumpOneObject ( case ACPI_TYPE_METHOD: - AcpiOsPrintf (" Args %hd Len %.4X Aml %p \n", - ObjDesc->Method.ParamCount, + AcpiOsPrintf (" Args %X Len %.4X Aml %p\n", + (UINT32) ObjDesc->Method.ParamCount, ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart); break; @@ -514,6 +514,11 @@ AcpiNsDumpOneObject ( break; + case INTERNAL_TYPE_ALIAS: + + AcpiOsPrintf (" Target %4.4s (%p)\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Name.Ascii, ObjDesc); + break; + default: AcpiOsPrintf (" Object %p\n", ObjDesc); @@ -608,9 +613,9 @@ AcpiNsDumpOneObject ( /* If there is an attached object, display it */ - DbgLevel = AcpiDbgLevel; + DbgLevel = AcpiDbgLevel; AcpiDbgLevel = 0; - ObjDesc = AcpiNsGetAttachedObject (ThisNode); + ObjDesc = AcpiNsGetAttachedObject (ThisNode); AcpiDbgLevel = DbgLevel; /* Dump attached objects */ @@ -786,7 +791,7 @@ AcpiNsDumpTables ( * If the name space has not been initialized, * there is nothing to dump. */ - ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "name space not initialized!\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n")); return_VOID; } diff --git a/sys/contrib/dev/acpica/nsdumpdv.c b/sys/contrib/dev/acpica/nsdumpdv.c index 944cc72..c1d010d 100644 --- a/sys/contrib/dev/acpica/nsdumpdv.c +++ b/sys/contrib/dev/acpica/nsdumpdv.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 3 $ + * $Revision: 4 $ * *****************************************************************************/ @@ -119,7 +119,6 @@ #include "acpi.h" #include "acnamesp.h" -#include "acparser.h" #define _COMPONENT ACPI_NAMESPACE diff --git a/sys/contrib/dev/acpica/nsload.c b/sys/contrib/dev/acpica/nsload.c index b644241..90e39f6 100644 --- a/sys/contrib/dev/acpica/nsload.c +++ b/sys/contrib/dev/acpica/nsload.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsload - namespace loading/expanding/contracting procedures - * $Revision: 58 $ + * $Revision: 59 $ * *****************************************************************************/ @@ -118,7 +118,6 @@ #include "acpi.h" #include "acnamesp.h" -#include "amlcode.h" #include "acparser.h" #include "acdispat.h" diff --git a/sys/contrib/dev/acpica/nsutils.c b/sys/contrib/dev/acpica/nsutils.c index a786de7..6e87aba 100644 --- a/sys/contrib/dev/acpica/nsutils.c +++ b/sys/contrib/dev/acpica/nsutils.c @@ -2,7 +2,7 @@ * * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing * parents and siblings and Scope manipulation - * $Revision: 112 $ + * $Revision: 113 $ * *****************************************************************************/ @@ -128,6 +128,57 @@ /******************************************************************************* * + * FUNCTION: AcpiNsReportError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * ComponentId - Caller's component ID (for error output) + * Message - Error message to use on failure + * + * RETURN: None + * + * DESCRIPTION: Print warning message + * + ******************************************************************************/ + +void +AcpiNsReportError ( + NATIVE_CHAR *ModuleName, + UINT32 LineNumber, + UINT32 ComponentId, + char *InternalName, + ACPI_STATUS LookupStatus) +{ + ACPI_STATUS Status; + char *Name; + + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalName, NULL, &Name); + + AcpiOsPrintf ("%8s-%04d: *** Error: Looking up ", + ModuleName, LineNumber); + + if (Name) + { + AcpiOsPrintf ("[%s]", Name); + } + else + { + AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]"); + } + + AcpiOsPrintf (" in namespace, %s\n", + AcpiFormatException (LookupStatus)); + + if (Name) + { + ACPI_MEM_FREE (Name); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiNsValidRootPrefix * * PARAMETERS: Prefix - Character to be checked diff --git a/sys/contrib/dev/acpica/psxface.c b/sys/contrib/dev/acpica/psxface.c index 7a30ed2..d566a4b 100644 --- a/sys/contrib/dev/acpica/psxface.c +++ b/sys/contrib/dev/acpica/psxface.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psxface - Parser external interfaces - * $Revision: 65 $ + * $Revision: 66 $ * *****************************************************************************/ @@ -120,7 +120,6 @@ #include "acparser.h" #include "acdispat.h" #include "acinterp.h" -#include "amlcode.h" #include "acnamesp.h" diff --git a/sys/contrib/dev/acpica/rsdump.c b/sys/contrib/dev/acpica/rsdump.c index b024347..38f52fc 100644 --- a/sys/contrib/dev/acpica/rsdump.c +++ b/sys/contrib/dev/acpica/rsdump.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: rsdump - Functions to display the resource structures. - * $Revision: 33 $ + * $Revision: 34 $ * ******************************************************************************/ @@ -976,20 +976,25 @@ AcpiRsDumpAddress64 ( ACPI_ADDRESS_FIXED == Address64Data->MaxAddressFixed ? "" : "not "); - AcpiOsPrintf (" Granularity: %16X\n", - Address64Data->Granularity); + AcpiOsPrintf (" Granularity: %8.8X%8.8X\n", + ACPI_HIDWORD (Address64Data->Granularity), + ACPI_LODWORD (Address64Data->Granularity)); - AcpiOsPrintf (" Address range min: %16X\n", - Address64Data->MinAddressRange); + AcpiOsPrintf (" Address range min: %8.8X%8.8X\n", + ACPI_HIDWORD (Address64Data->MinAddressRange), + ACPI_HIDWORD (Address64Data->MinAddressRange)); - AcpiOsPrintf (" Address range max: %16X\n", - Address64Data->MaxAddressRange); + AcpiOsPrintf (" Address range max: %8.8X%8.8X\n", + ACPI_HIDWORD (Address64Data->MaxAddressRange), + ACPI_HIDWORD (Address64Data->MaxAddressRange)); - AcpiOsPrintf (" Address translation offset: %16X\n", - Address64Data->AddressTranslationOffset); + AcpiOsPrintf (" Address translation offset: %8.8X%8.8X\n", + ACPI_HIDWORD (Address64Data->AddressTranslationOffset), + ACPI_HIDWORD (Address64Data->AddressTranslationOffset)); - AcpiOsPrintf (" Address Length: %16X\n", - Address64Data->AddressLength); + AcpiOsPrintf (" Address Length: %8.8X%8.8X\n", + ACPI_HIDWORD (Address64Data->AddressLength), + ACPI_HIDWORD (Address64Data->AddressLength)); if(0xFF != Address64Data->ResourceSource.Index) { diff --git a/sys/contrib/dev/acpica/tbxface.c b/sys/contrib/dev/acpica/tbxface.c index 374e12c..d83f2c1 100644 --- a/sys/contrib/dev/acpica/tbxface.c +++ b/sys/contrib/dev/acpica/tbxface.c @@ -2,7 +2,7 @@ * * Module Name: tbxface - Public interfaces to the ACPI subsystem * ACPI table oriented interfaces - * $Revision: 58 $ + * $Revision: 59 $ * *****************************************************************************/ @@ -192,7 +192,7 @@ AcpiLoadTables (void) goto ErrorExit; } - ACPI_DEBUG_PRINT ((ACPI_DB_OK, "ACPI Tables successfully loaded\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_OK, "ACPI Tables successfully acquired\n")); /* Load the namespace from the tables */ diff --git a/sys/contrib/dev/acpica/utclib.c b/sys/contrib/dev/acpica/utclib.c index c94a70b..b404912 100644 --- a/sys/contrib/dev/acpica/utclib.c +++ b/sys/contrib/dev/acpica/utclib.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmclib - Local implementation of C library functions - * $Revision: 46 $ + * $Revision: 47 $ * *****************************************************************************/ @@ -144,7 +144,7 @@ ******************************************************************************/ -UINT32 +ACPI_SIZE AcpiUtStrlen ( const NATIVE_CHAR *String) { @@ -219,7 +219,7 @@ NATIVE_CHAR * AcpiUtStrncpy ( NATIVE_CHAR *DstString, const NATIVE_CHAR *SrcString, - NATIVE_UINT Count) + ACPI_SIZE Count) { NATIVE_CHAR *String = DstString; @@ -257,7 +257,7 @@ AcpiUtStrncpy ( * ******************************************************************************/ -UINT32 +int AcpiUtStrcmp ( const NATIVE_CHAR *String1, const NATIVE_CHAR *String2) @@ -294,7 +294,7 @@ int AcpiUtStrncmp ( const NATIVE_CHAR *String1, const NATIVE_CHAR *String2, - NATIVE_UINT Count) + ACPI_SIZE Count) { @@ -306,7 +306,7 @@ AcpiUtStrncmp ( } } - return ((Count == ACPI_INTEGER_MAX) ? 0 : ((unsigned char) *String1 - + return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *String1 - (unsigned char) *String2)); } @@ -365,7 +365,7 @@ NATIVE_CHAR * AcpiUtStrncat ( NATIVE_CHAR *DstString, const NATIVE_CHAR *SrcString, - NATIVE_UINT Count) + ACPI_SIZE Count) { NATIVE_CHAR *String; @@ -412,7 +412,7 @@ void * AcpiUtMemcpy ( void *Dest, const void *Src, - NATIVE_UINT Count) + ACPI_SIZE Count) { NATIVE_CHAR *New = (NATIVE_CHAR *) Dest; NATIVE_CHAR *Old = (NATIVE_CHAR *) Src; @@ -448,7 +448,7 @@ void * AcpiUtMemset ( void *Dest, NATIVE_UINT Value, - NATIVE_UINT Count) + ACPI_SIZE Count) { NATIVE_CHAR *New = (NATIVE_CHAR *) Dest; diff --git a/sys/contrib/dev/acpica/utcopy.c b/sys/contrib/dev/acpica/utcopy.c index 172504e..aa8cf35 100644 --- a/sys/contrib/dev/acpica/utcopy.c +++ b/sys/contrib/dev/acpica/utcopy.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utcopy - Internal to external object translation utilities - * $Revision: 103 $ + * $Revision: 104 $ * *****************************************************************************/ @@ -117,7 +117,6 @@ #define __UTCOPY_C__ #include "acpi.h" -#include "acnamesp.h" #include "amlcode.h" diff --git a/sys/contrib/dev/acpica/utdebug.c b/sys/contrib/dev/acpica/utdebug.c index 78548c6..b791d24 100644 --- a/sys/contrib/dev/acpica/utdebug.c +++ b/sys/contrib/dev/acpica/utdebug.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utdebug - Debug print routines - * $Revision: 104 $ + * $Revision: 105 $ * *****************************************************************************/ @@ -250,7 +250,7 @@ AcpiUtDebugPrint ( if (ACPI_LV_THREADS & AcpiDbgLevel) { - AcpiOsPrintf ("[%04lX] ", ThreadId, AcpiGbl_NestingLevel, DbgInfo->ProcName); + AcpiOsPrintf ("[%04lX] ", ThreadId); } AcpiOsPrintf ("[%02ld] %-22.22s: ", AcpiGbl_NestingLevel, DbgInfo->ProcName); @@ -620,7 +620,7 @@ AcpiUtDumpBuffer ( { /* Print current offset */ - AcpiOsPrintf ("%05X ", i); + AcpiOsPrintf ("%05X ", (UINT32) i); /* Print 16 hex chars */ diff --git a/sys/contrib/dev/acpica/utinit.c b/sys/contrib/dev/acpica/utinit.c index 1d9d231..181512a 100644 --- a/sys/contrib/dev/acpica/utinit.c +++ b/sys/contrib/dev/acpica/utinit.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utinit - Common ACPI subsystem initialization - * $Revision: 113 $ + * $Revision: 114 $ * *****************************************************************************/ @@ -149,7 +149,7 @@ AcpiUtFadtRegisterError ( ACPI_REPORT_WARNING ( ("Invalid FADT value %s=%X at offset %X FADT=%p\n", - RegisterName, Value, Offset, AcpiGbl_FADT)); + RegisterName, Value, (UINT32) Offset, AcpiGbl_FADT)); } diff --git a/sys/contrib/dev/acpica/utmisc.c b/sys/contrib/dev/acpica/utmisc.c index 4ff0eb7..c132f27 100644 --- a/sys/contrib/dev/acpica/utmisc.c +++ b/sys/contrib/dev/acpica/utmisc.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmisc - common utility procedures - * $Revision: 80 $ + * $Revision: 84 $ * ******************************************************************************/ @@ -119,8 +119,6 @@ #include "acpi.h" #include "acnamesp.h" -#include "amlcode.h" -#include "acinterp.h" #define _COMPONENT ACPI_UTILITIES @@ -1536,3 +1534,4 @@ AcpiUtReportInfo ( } + |