10560 Commits

Author SHA1 Message Date
Robert Moore
e121b46018 Fix some typos in comments. No functional change.
Lv Zheng.
2012-11-26 10:09:44 -08:00
Robert Moore
59b9a857b8 Update ** pointers in some of the various walk functions.
Cleans up the pointers and eliminates some divergences from Linux.
Does not effect any external interfaces. Lv Zheng.
2012-11-21 12:03:27 -08:00
Robert Moore
f252e085cb iASL: Disallow method call as argument to ObjectType ASL operator.
This change tracks an errata to the ACPI 5.0 document. The AML grammar
will not allow the interpreter to differentiate between a method and a
method invocation when these are used as an argument to the ObjectType
operator.

The ACPI specification change is to disallow a method invocation
(UserTerm) for the ObjectType operator.
2012-11-21 08:29:11 -08:00
Robert Moore
0d63ea609d Unix user-space OSL: Fix problem with WaitSemaphore.
This fixes a problem with WaitSemaphore where the timeout always
expires immediately if the semaphore is not available.

The default code uses sem_timedwait to support semaphore timeouts. However, the
full implementation is incorrect. sem_timedwait uses an absolute time value,
not a relative time value. Therefore, clock_gettime must be called first in
order to get the current time. The timeout value must be added to the current
time in order to get the absolute time -- which then becomes the latest we are
willing to wait for the semaphore.

Currently, the incorrect implementation will always timeout immediately. This
is not a huge problem, since this OSL is only used for the user-space ACPICA
utilities, but the ASLTS test suite does depend on the correct behavior for
approximately 20 tests.

ACPICA BZ 990.
2012-11-21 08:25:55 -08:00
Robert Moore
9d5b05ed66 Lint changes, no functional change.
Some changes from lint.
2012-11-16 08:25:01 -08:00
Robert Moore
93f9f86221 Add root node optimization to internal get namespace node function.
Detect a request for the root node (a lone backslash) up front before
invoking a full namespace lookup.
2012-11-15 12:59:12 -08:00
Robert Moore
29e066e019 Eliminate some small unnecessary pathname functions.
Removed several small pathname functions to increase efficiency.
Essentially, they replace a function call with a single compare.
2012-11-15 12:55:12 -08:00
Robert Moore
ba435d1085 Change exception code for LoadTable operator.
For the case where one of the input strings is too long, change
the returned exception code from AE_BAD_PARAMETER to
AE_AML_STRING_LIMIT.
2012-11-15 12:29:56 -08:00
Robert Moore
d5160d9d0d Debugger: Fix missing error message regression.
Fixes a problem where any errors when getting the handle of a pathname
to be executed are ignored.
2012-11-14 14:03:01 -08:00
Robert Moore
648a8378b5 Debugger: Code cleanup and rename some local variables.
General cleanup.
2012-11-14 13:08:42 -08:00
Robert Moore
5825c3a802 Debugger: Update for new resource interface.
Update to use/exercise the new AcpiWalkResourceBuffer.
2012-11-14 12:56:52 -08:00
Robert Moore
76a480aa64 Resources: New interface, AcpiWalkResourceBuffer.
Implements a new interface for walking resource lists that it
at a lower level than the existing AcpiWalkResources.
(Method is not executed.)
2012-11-14 12:55:26 -08:00
Robert Moore
03eda6d584 Update version to 20121114.
Version 20121114.
2012-11-14 08:19:05 -08:00
Robert Moore
067bda1c3f iASL: Update namespace output for resource fields.
Add a referenced/not_referenced notification.
2012-11-13 12:51:46 -08:00
Robert Moore
dbfa50ac62 AcpiBin: Fix for the dump-to-hex function.
Now correctly output the table name header so that AcpiXtract
recognizes the output file/table.
2012-11-08 13:51:05 -08:00
Robert Moore
898b052723 iASL/Tools: Standardize use of stream I/O functions.
1) Check for I/O error after every fopen/fread/fwrite
2) Ensure proper order of size/count params for fread/fwrite
3) Use test of Actual != Requested after all fwrite, most fread
4) Standardize I/O error messages

Improve reliability and maintainability of the code.
Bob Moore, Lv Zheng.
2012-11-08 13:27:52 -08:00
Robert Moore
29f4970e2f Tools: Replace low-level I/O with stream I/O functions.
Replace open/read/write/close with the stream I/O equivalents
fopen/fread/fwrite/fclose for portability and performance
Lv Zheng, Bob Moore.
2012-11-08 08:45:29 -08:00
Robert Moore
56037d01c3 AcpiBin: Display compared headers side-by-side.
Improvement over displaying one header after the other.
2012-11-06 13:08:57 -08:00
Robert Moore
568c54255b AcpiGetObjectInfo: optimize exit for mutex failure.
No need for a goto to the bottom of the function, simply return
the status code immediately.
2012-11-06 08:20:36 -08:00
Robert Moore
c181ce2d1f Resource Manager: update template walking with ACPI_NEXT_RESOURCE.
Cleanup the ACPI_NEXT_RESOURCE macro.
Update AcpiWalkResources to use ACPI_NEXT_RESOURCE.
Lv Zheng.
2012-11-02 13:06:50 -07:00
Robert Moore
f16551e06a Enhance the ACPI_GETx and ACPI_SETx macros.
Improve the implementation of the macros.
Change the SETx macros to the style of (destination, source).
Also add ACPI_CASTx companion macros.
Lv Zheng.
2012-11-02 12:52:46 -07:00
Robert Moore
e13146b9f1 Disassembler: Prevent duplicate External() statements.
During generation of external statements, prevent similar pathnames
that are actually duplicates, such as these:
External (\ABCD)
External (ABCD)
Remove all leading '\' characters from pathnames during the external
statement generation so that duplicates will be detected and tossed.
2012-11-02 12:20:30 -07:00
Robert Moore
b6b0e3adb8 Add macros to extract flag bits from resource descriptors.
Improves readability and maintainability of the code.
Fixes a problem with the UART serial bus descriptor for the
number of data bits flags (was incorrectly 2 bits, should be 3).
2012-11-02 09:35:10 -07:00
Robert Moore
f80327f38f Debugger: Remove a couple inadvertent "//" comments.
Missed during previous checkin.
2012-11-02 08:49:45 -07:00
Robert Moore
ef93444b93 Disassembler: Add new ACPI 5.0 interrupt sharing flags.
This changes adds the ShareAndWake and ExclusiveAndWake flags
which were added to the Irq, Interrupt, and Gpio resource
descriptors in ACPI 5.0.
2012-11-01 16:52:03 -07:00
Robert Moore
a3e95d8f8e iASL: Remove obsolete -2 option flag.
Originally intended to force the compiler/disassembler into an
ACPI 2.0 mode, this was never implemented and the entire concept
is now obsolete.
2012-10-31 14:16:18 -07:00
Robert Moore
aea0bdbeb9 Disassembler: Add "Disasm" for a synonym for Disassemble command.
Ease-of-use change.
2012-10-31 14:03:47 -07:00
Robert Moore
adb8709e05 Debugger: Major update for the Disassemble<method> command.
This command was downreved and did not properly disassemble control
methods with any reasonable complexity. This fix brings the
command up to the same level as the rest of the disassembler.
Adds one new file, dmdeferred.c, which is existing code that is
now common with the main disassembler and the debugger disassembl
command.
2012-10-31 13:57:20 -07:00
Robert Moore
9435ca866f Disassembler: Fix for external declaration generation
Fixes a problem where an incorrect pathname could be generated
for an external declaration if the original reference to the object
includes leading carats.
2012-10-31 13:42:35 -07:00
Robert Moore
f8d496aa61 Performance: Remove function tracing from critical allocation functions.
Tracing is no longer needed for many of the low-level function.
Removing the trace mechanism from these functions improves
performance a small amount, also simplifies the debug trace
output.
2012-10-25 10:20:37 -07:00
Robert Moore
3860f05120 AcpiSrc: Add error check after call to write().
Ensure a write error is not missed.
2012-10-25 09:36:08 -07:00
Robert Moore
891867802d iASL: Move parser entry prototype to avoid duplicate declaration.
Newer versions of Bison emit this prototype, so move the prototype
out of the iASL header to where it is actually used in order
to avoid a duplicate declaration.
2012-10-25 09:21:17 -07:00
Robert Moore
9458732b14 iASL: Update readme file for new versions of bison/flex.
Add supported versions for linux as well as windows.
2012-10-25 08:51:44 -07:00
Robert Moore
33c99ff24b iASL: Add check for return value from fwrite().
Ensure that the fwrite did not fail.
2012-10-25 08:50:57 -07:00
Robert Moore
49dec9f2b8 Performance enhancement for ACPI package objects.
This change greatly increases the performance of package objects
within the interpreter. It changes the processing of reference
counts for packages by optimizing for the most common case where
the package subobjects are either integers, strings, or buffers.
Increases the performance of the ASLTS test suite by 1.5X.
Chao Guan. ACPICA BZ 943.
2012-10-24 12:59:50 -07:00
Robert Moore
05432f7a2f Fix possible memory leak.
Ensure cleanup after a memory allocation failure in dsmethod.c.
Original Linux change from Jesper Juhl.
2012-10-23 09:33:10 -07:00
Robert Moore
27d3c34f82 Update version to 20121018.
Version 20121018.
2012-10-18 12:19:01 -07:00
Robert Moore
e611add6c7 Add two new readme files.
1) Summary file for all other readme files
2) How to add a new ACPI table to ACPICA
2012-10-18 10:44:44 -07:00
Robert Moore
36706d9097 iASL: Update help message screen.
Update various options.
2012-10-18 10:10:20 -07:00
Robert Moore
85605310e4 iASL: Update template for MPST table.
Emit new template based upon recent header changes for MPST.
2012-10-18 10:02:45 -07:00
Robert Moore
5e59e2fdef Divergence: Backport Linux lockdep fix to ACPICA.
Backport changes made in Linux aclinux.h to ACPICA to reduce divergence
of the ACPICA base code from Linux.

Following commits are involved:
1. Rafael J. Wysocki <rjw@sisk.pl>
   ACPI: Fix lockdep false positives in acpi_power_off()
   https://bugzilla.kernel.org/show_bug.cgi?id=38152

This will decrease 29 lines of 20120913 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <len.brown@intel.com>
2012-10-17 11:41:53 -07:00
Robert Moore
3938951e55 Divergence: Backport linux version of aclinux.h to ACPICA.
Backport changes made in Linux aclinux.h back to ACPICA to reduce divergence
of the ACPICA base code from Linux.

Following commits are involved:
1. Lin Ming <ming.m.lin@intel.com>
   ACPICA: Make acpi_thread_id no longer configurable, always u64
2. Thomas Gleixner <tglx@linutronix.de>
   acpi: fix bogus preemption logic
   https://bugzilla.kernel.org/show_bug.cgi?id=16210
3. Arun Sharma <asharma@fb.com>
   atomic: use <linux/atomic.h>

This will decrease 71 lines of 20120913 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arun Sharma <asharma@fb.com>
2012-10-17 11:39:19 -07:00
Robert Moore
8e7a875382 AcpiGetObjectInfo: Add support for ACPI 5.0 _SUB method.
Now calls _SUB in addition to the other ID methods: _HID, _CID,
and _UID.
2012-10-17 10:24:40 -07:00
Robert Moore
a889648796 Change ACPI_DEVICE_ID to ACPI_PNP_DEVICE_ID.
Also changed ACPI_DEVICE_ID_LIST to ACPI_PNP_DEVICE_ID_LIST. These
changes prevent name collisions on hosts that reserve the *_DEVICE_ID
(or *DeviceId) names for their various drivers. Affects the
AcpiGetObjectInfo external interface, and other internal interfaces
as well.
2012-10-17 08:04:28 -07:00
Robert Moore
37dd560cc4 Update for 64-bit generation of recent error message changes.
Fix for errors on printf changes on 64-bit platforms and gcc.
2012-10-16 08:01:57 -07:00
Robert Moore
fe0d1f9f5a Fix externalize name to complete migration to ACPI_MOVE_NAME.
Fix for name segment copy and validation.
2012-10-12 14:17:02 -07:00
Robert Moore
4322675fc9 Add starting offset parameter to common dump buffer routine.
Rename the dump buffer routines. Offset parameter can specify
the buffer starting offset that is used when displaying each
line of the buffer.
2012-10-12 13:44:40 -07:00
Robert Moore
ef898130ec Deploy ACPI_MOVE_NAME across ACPICA source base.
Replaces instances of strncpy(...,4) for ACPI_NAMEs.
ACPI_MOVE_NAME optimizes these to a single 32-bit copy on machines
that support misaligned transfers.
2012-10-12 12:54:03 -07:00
Robert Moore
d4fa24b0bf Update support for ACPI 5.0 MPST table.
Fixes some problems introduced by late changes to the table as it
was added to the ACPI 5.0 specification.
Both the table compiler and the disassembler and the main header
support for the table.
2012-10-12 12:21:06 -07:00
Robert Moore
7f49766105 Enhance error reporting for invalid opcodes and bad ACPI_NAMEs.
For disassembler, dump the 48 bytes surrounding the invalid opcode.
Fix incorrect table offset reported for invalid opcodes.
Report original 32-bit value for bad ACPI_NAMEs.
2012-10-12 12:11:12 -07:00