ACPICA: Cleanup updated comments.

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 558 lines of 20121018 divergence.diff.

This patch reduces the source code diff between Linux and ACPICA by
cleaning the comments that already have been updated in ACPICA.

There is no extra indentation done in this patch. Even the empty line
deletions and insertions are also splitted into another cleanup patch so
that this patch can be easily reviewed, and the binary differences can be
held to a lowest level.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Update compilation environment settings.

This patch does not affect the generation of the Linux binary.
This patch decreases 300 lines of 20121018 divergence.diff.

This patch updates architecture specific environment settings for compiling
ACPICA as such enhancement already has been done in ACPICA.

Note that the appended compiler default settings in the
<acpi/platform/acenv.h> will deprecate some of the macros defined in the
architecture specific <asm/acpi.h>. Thus two of the <asm/acpi.h> headers
have been cleaned up in this patch accordingly.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Update codes under disabled build options.

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 170 lines of 20121018 divergence.diff.

This patch updates ACPICA codes surrounded by some disabled build options
so that the source code diff between Linux and ACPICA can be reduced.

Some of these build options may never be used in the kernel, so they may
be deleted entirely in future patches.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Cleanup source to reduce differences between Linux and ACPICA.

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 389 lines of 20121018 divergence.diff.

This patch reduces source code diff caused by the simple code maintenance
work:
1. Deletion of the unused include files.
2. Deletion of the deprecated codes blocks.
3. Repositioning of the code blocks.
4. Replacing the values with the well defined macros.
5. Replacing the types with the equivalent types.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Cleanup indentation to reduce differences between Linux and ACPICA.

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 210 lines of 20121018 divergence.diff.

The ACPICA source codes uses a totally different indentation style from the
Linux to be compatible with other users (operating systems or BIOS).

Indentation differences are critical to the release automation. There are
two causes related to the "indentation" that are affecting the release
automation:
1. The ACPICA -> Linux release process is:
     ACPICA source -- acpisrc - hierarchy - indent ->
     linuxized ACPICA source -- diff ->
     linuxized ACPICA patch (x) -- human intervention ->
     linuxized ACPICA patch (o)
     Where
       'x' means "cannot be directly applied to the Linux"
       'o' means "can be directly applied to the Linux"
   Different "indent" version or "indent" options used in the "indent"
   step will lead to different divergences.
   The version of "indent" used for the current release process is:
     GNU indent 2.2.11
   The options of "indent" used for the current release process is:
     -npro -kr -i8 -ts8 -sob -l80 -ss -ncs
2. Manual indentation prettifying work in the Linux side will also harm the
   automatically generated linuxized ACPICA patches, making them impossible
   to apply directly.

This patch fixes source code differences caused by the two causes so that
the "human intervention" can be reduced in the future.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Cleanup coding style to reduce differences between Linux and ACPICA.

This is a cosmetic patch only. Comparison of the resulting binary showed
only line number differences.

This patch does not affect the generation of the Linux binary.
This patch decreases 314 lines of 20121018 divergence.diff.

ACPICA core uses ()'s on return statements. This is a known and committed
differences from Linux standard coding style.

This patch cleans up the Linux side ACPICA code to use this codying style
in order to reduce the source code differences between Linux and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Fix broken call depth tracing logic.

This patch does not affect the generation of the Linux binary.
This patch decreases 26 lines of 20121018 divergence.diff.

The ACPICA uses a call depth tracing mechanism by wrapping the return
statements with return macros and marking the entrance with
ACPI_FUNCTION_TRACE_ macros. There are other ACPI_FUNCTION_ macros used
to mark the functions not using this tracing mechanism.

This patch fixes broken call depth tracing logic.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Enhance error messages.

This patch decreases 29 lines of 20121018 divergence.diff.

This patch updates error messages that already have been enhanced in
ACPICA. This patch can also help to reduce the source code differences
between Linux and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Update initialization codes.

This patch decreases 18 lines of 20121018 divergence.diff.

This patch updates initialization codes as they are already been updated in
ACPICA. This can also help to reduce source code differences between Linux
and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Fix possible memory leak.

Ensure cleanup after a memory allocation failure in dsmethod.c.
Original Linux change from Jesper Juhl.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: 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.
https://www.acpica.org/bugzilla/show_bug.cgi?id=943

Signed-off-by: Chao Guan <chao.guan@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: 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.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: 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.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Disassembler: Add new ACPI 5 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.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: 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).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: 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.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Resource Manager: update template walking with ACPI_NEXT_RESOURCE.

Cleanup the ACPI_NEXT_RESOURCE macro.  Update AcpiWalkResources
to use ACPI_NEXT_RESOURCE.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: AcpiGetObjectInfo: optimize exit for mutex failure.

No need for a goto to the bottom of the function, simply return
the status code immediately.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: Update version to 20121114.

Version 20121114.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: 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.)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>