Commit graph

128 commits

Author SHA1 Message Date
Lv Zheng d5caf1cdc4 ACPICA: OSL: Add configurability for memory allocation macros.
OSPMs like Linux trend to include all header files but leave empty stub
macros for a feature that is not configured during build.

For macros defined without other symbols referencesd it is safe to leave
them without protections.

By investigation, there are only the following internal/external
symbols referenced by the ACPICA macros:
1. C library symbols, including string, ctype, stdarg APIs.  Since such
   symbols are always accessbile in the kernel source tree, it is safe to
   leave macros referencing them without protected for Linux.
2. ACPICA OSL symbols, such symbols are designed to be used only by ACPICA
   internal APIs.  And there are macros directly referencing mutex and
   memory allocation OSL symbols.  We need to examine the external usages
   of such macros.
   For macros referencing the mutex OSL symbols, fortunately, there is no
   external user directly invoking such macros.
   ========================================================================
   !! IMPORTANT !!
   ========================================================================
   For macros referencing memory allocation OSL symbols -
    1. 'free' - ACPI_FREE
    2. 'alloc' - ACPI_ALLOCATE, ACPI_ALLOCATE_ZEROED, ACPI_ALLOCATE_BUFFER,
                 ACPI_ALLOCATE_LOCAL_BUFFER
   there are external users directly invoking 'alloc' macros.  And the more
   complicated situation is the reversals of such macros are not ACPI_FREE
   but acpi_os_free (or kfree) in Linux.  Though we can define such macros
   into no-op, we in fact cannot define their reversals into no-op.
   This patch adds mechanism to protect ACPICA memory allocation APIs for
   Linux so that acpi_os_free (or kfree) invoked in Linux can have a zero
   address returned by 'alloc' macros to free.  In this
   way, acpi_os_free (or kfree) can be converted into no-op.
   ========================================================================
3. ACPI_OFFSET and other macros that would access structure members, we
   need to check if such structure members are not accessible under a
   specific configuration.  Fortunately, currently Linux doesn't use such
   structure members when CONFIG_ACPI is disabled.

This patch thus only adds mechanism useful for implementing stubs for
ACPICA provided macros - the configurability of memory allocation APIs.

This patch doesn't include code for Linux to use this new mechanism, thus
no functional changes.  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>
2014-05-07 00:55:00 +02:00
Robert Moore 6e59608483 ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)."
This reverts commit aae576e5faefa8ba70647efa320d4747b6375f1e.
Push and Pop are not portable "enough", and caused problems for
some ACPICA customers.

Signed-off-by: Robert 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>
2014-03-18 01:53:45 +01:00
Bob Moore 4ac4c5fad8 ACPICA: Headers: Deploy #pragma pack (push) and (pop).
Use push and pop to both guarantee that the correct alignment is used,
and to restore the alignment to whatever it was before the header
was included.

It is reported that the #pragma pack(push/pop) directives are not supported
by the specific GCCs, but this patch still doesn't affect kernel build
as there are already #pragma pack([1]) directives used in the old ACPICA
headers, which means there shouldn't be GCCs that are currently used to
compile the ACPI kernels do not support #pragma pack() directives.

References: https://bugs.acpica.org/show_bug.cgi?id=1058
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>
2014-02-27 00:45:59 +01:00
Lv Zheng e252652fb2 ACPICA: acpidump: Remove integer types translation protection.
Remove translation protection for applications as Linux tools folder will
start to use such types.

In Linux kernel source tree, after removing this translation protection,
the u8/u16/u32/u64/s32/s64 typedefs are exposed for both __KERNEL__ builds
and !__KERNEL__ builds (tools/power/acpi) and the original definitions of
ACPI_UINT8/16/32/64_MAX are changed.

For !__KERNEL__ builds, this kind of defintions should already been tested
by the distribution vendors that are distributing binary ACPICA package and
we've achieved the successful built/run test result in the kernel source
tree.

For __KERNEL__ builds, there are 2 things affected:
1. u8/u16/u32/u64/s32/s64 type definitions:
   Since Linux has already type defined u8/u16/u32/u64/s32/s64 in
   include/uapi/asm-generic/int-ll64.h for __KERNEL__.  In order not to
   introduce build regressions where the 2 typedefs are differed,
   ACPI_USE_SYSTEM_INTTYPES is introduced to mask out ACPICA's typedefs.
   It must be defined for Linux __KERNEL__ builds.
2. ACPI_UINT8/16/32/64_MAX definitions:
   Before applying this change:
     ACPI_UINT8_MAX: sizeof (UINT8)
      UINT8: unsigned char
     ACPI_UINT16_MAX: sizeof (UINT16)
      UINT16: unsigned short
     ACPI_UINT32_MAX: sizeof (UINT32)
      INT32: int
      UINT32: unsigned int
     ACPI_UINT64_MAX: sizeof (UINT64)
      INT64: COMPILER_DEPENDENT_INT64
       COMPILER_DEPENDENT_INT64: signed long (IA64) or
                                 signed long long (IA32)
      UINT64: COMPILER_DEPENDENT_UINT64
       COMPILER_DEPENDENT_UINT64: unsigned long (IA64) or
                                  unsigned long long (IA32)
   After applying this change:
     ACPI_UINT8_MAX: sizeof (u8)
      u8: unsigned char
      UINT8: (removed from actypes.h)
     ACPI_UINT16_MAX: sizeof (u16)
      u16: unsigned short
      UINT16: (removed from actypes.h)
     ACPI_UINT32_MAX: sizeof (u32)
      INT32/UINT32: (removed from actypes.h)
      s32: signed int
      u32: unsigned int
     ACPI_UINT64_MAX: sizeof (u64)
      INT64/UINT64: (removed from actypes.h)
      u64: unsigned long long
      s64: signed long long
      COMPILER_DEPENDENT_INT64: signed long (IA64) (not used any more)
                                signed long long (IA32) (not used any more)
      COMPILER_DEPENDENT_UINT64: unsigned long (IA64) (not used any more)
                                 unsigned long long (IA32) (not used any more)
   All definitions are equal except ACPI_UINT64_MAX for CONFIG_IA64.  It
   is changed from sizeof(unsigned long) to sizeof(unsigned long long).
   By investigation, 64bit Linux kernel build is LP64 compliant, i.e.,
   sizeof(long) and (pointer) are 64.  As sizeof(unsigned long) equals to
   sizeof(unsigned long long) on IA64 platform where CONFIG_64BIT cannot be
   disabled, this change actually will not affect the value of
   ACPI_UINT64_MAX on IA64 platforms.

This patch is necessary for the ACPICA's acpidump tool to build
correctly.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-13 16:21:15 +01:00
Bob Moore fbb7a2dc2b ACPICA: Update ACPICA copyrights to 2014.
Update ACPICA copyrights to 2014. Includes all source headers and
signons for the various tools.

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>
2014-02-11 00:30:25 +01:00
Lv Zheng bb3fec146c ACPICA: Remove unused ACPI_FREE_BUFFER macro. No functional change.
This macro is no longer used by ACPICA and it is not public.
Also update comments related to the use of ACPI_ALLOCATE_BUFFER and
the use of acpi_os_free (kfree is equivalent and prefered in the
kernel) to free the buffer.

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>
2014-01-08 15:31:36 +01:00
Lv Zheng efb835429f ACPICA: Update acpidump related header file changes.
This patch updates header files used by acpidump to reduce the
source code differences between Linux and ACPICA upstream.

This patch does not affect the generation of the Linux kernel binary.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-10-31 14:37:35 +01:00
Lv Zheng 9187a415fd ACPICA: Add new statistics interface.
This patch ports new counters and statistics interface, already
implemented in ACPICA upstream, to Linux.  That helps to reduce
source code differences between Linux and ACPICA upstream.

[rjw: Changelog]
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-10-31 14:37:33 +01:00
Lv Zheng d21f600b0e ACPICA: Deploy ACPI_EXPORT_SYMBOL_INIT for main ACPICA initialization interfaces.
This changes can reduce source code differences between Linux and ACPICA
upstream to help improving the release automation.

The side effect of applying this patch in Linux is:
1. Some ACPICA initialization/termination APIs are no longer exported in
   Linux, these include:
    acpi_load_tables
    acpi_initialize_subsystem
    acpi_enable_subsystem
    acpi_initialize_objects
    acpi_terminate
2. This patch does not affect the following APIs as they are currently not
   marked with ACPI_EXPORT_SYMBOL in Linux:
    acpi_reallocate_root_table
    acpi_initialize_tables
Such functions should not be exported as they are internal to ACPI
subsystem in Linux, and will only be invoked inside of ACPI subsystem's
initialization routines marked with __init and termination routines marked
with __exit.  While on other OSPMs, such functions may still need to be
exported.

Thus this patch adds the configurability for ACPICA, so that it leaves
OSPMs to determine if the __init/__exit marked functions should be exported
or not.  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>
2013-10-31 14:35:39 +01:00
Bob Moore bb1cab3d52 ACPICA: Clarify ACPI_FREE_BUFFER usage.
Add a comment to clarify reason for using ACPI_FREE_BUFFER directly
instead of ACPI_FREE.

In addition to that, change one instance in which ACPI_FREE_BUFFER()
should be used instead of ACPI_FREE().

[rjw: Subject and changelog]
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>
2013-10-31 14:35:33 +01:00
Bob Moore e07fcfd89f ACPICA: Hardcode access width for the reset register.
The ACPI spec requires the reset register width to be 8, so we
now hardcode it and ignore the FADT value. This provides/maintains
compatibility with other ACPI implementations that have allowed
BIOS code with bad register width values to go unnoticed.
Matthew Garett, Bob Moore, Lv Zheng.

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>
2013-10-30 12:24:22 +01:00
Lv Zheng b3c86c30ef ACPICA: Cleanup memory allocation macros and configurability.
In the common case, the ACPI_ALLOCATE and related macros now resolve
directly to their respective acpi_os* OSL interfaces. Two options:
1) The ACPI_ALLOCATE_ZEROED macro defaults to a simple local implementation
   by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
2) For ACPI execution simulation environment (AcpiExec) which is not
   shipped with the Linux kernel, the macros can optionally be resolved to
   the local interfaces that track each allocation (used to immediately
   detect memory leaks).

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>
2013-10-30 12:24:21 +01:00
Bob Moore c53ae3a60c ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument.
The SCI interrupt number is not needed for the SCI handlers, and was
just unnecessary overhead.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-24 01:46:25 +02:00
Lv Zheng cacba86573 ACPICA: Tables: Cleanup RSDP signature codes.
This patch introduces new macors to handle RSDP signature and cleans up the
affected codes.  Lv Zheng.
Some updates are only used for ACPICA utilities which are not shipped in
the kernel yet.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-24 01:46:24 +02:00
Lv Zheng a2fd4b4b4e ACPICA: Add support for host-installed SCI handlers.
This change adds support to allow hosts to install System Control
Interrupt handlers. Certain ACPI functionality requires the host
to handle raw SCIs. For example, the "SCI Doorbell" that is defined
for memory power state support requires the host device driver to
handle SCIs to examine if the doorbell has been activated. Multiple
SCI handlers can be installed to allow for future expansion.
Debugger support is included.
Lv Zheng, Bob Moore. ACPICA BZ 1032.

Bug summary:
It is reported when the PCC (Platform Communication Channel, via
MPST table, defined in ACPI specification 5.0) subchannel responds
to the host, it issues an SCI and the host must probe the subchannel
for channel status.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-24 01:46:24 +02:00
Lv Zheng 2641f54080 ACPICA: Fix divergences of the commit - ACPICA: Expose OSI version.
The original commit 242b2287cd "ACPICA:
expose OSI version" triggers build errors in ACPICA when it is back
ported.  The patch removes the divergences between Linux and upstream
ACPICA resulting from that.

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>
2013-08-13 13:13:09 +02:00
Lv Zheng 2cf9f5bcc8 ACPICA: Add acpi_update_interfaces() public interface
Add new API to allow OSPM to disable/enable specific types of _OSI
interface strings.

ACPICA does not have the knowledge about whether an _OSI interface
string is an OS vendor string or a feature group string and there
isn't any API interface to allow OSPM to install a new interface
string as a feature group string.
This patch simply adds all feature group strings defined by ACPI
specification into the acpi_default_supported_interfaces with
ACPI_OSI_FEATURE flag set to fix this gap.  This patch also adds
codes to keep their default states as ACPI_OSI_INVALID before the
initialization and after the termination.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Conflicts:
	include/acpi/actypes.h (with commit 242b228)
2013-07-23 04:06:03 +02:00
Bob Moore 2c48e3eacb ACPICA: Remove restriction of 256 maximum GPEs in any GPE block
The FADT can support over 1000 GPEs, so remove any restriction
on the GPE numbers.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-07-23 01:06:49 +02:00
Aaron Lu 242b2287cd ACPICA: expose OSI version
Expose acpi_gbl_osi_data so that code outside of ACPICA can check
the value of the last successfull _OSI call.  The definitions for
OSI versions are moved to actypes.h so that other components can
access them too.

Based on a patch from Matthew Garrett which in turn was based on
an earlier patch from Seth Forshee.

[rjw: Changelog]
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-07-18 01:29:14 +02:00
Rafael J. Wysocki c940c8ce1d Merge branch 'acpi-assorted'
* acpi-assorted: (21 commits)
  ACPI / thermal: do not always return THERMAL_TREND_RAISING for active trip points
  ACPI: video: correct acpi_video_bus_add error processing
  ACPI: Fix wrong parameter passed to memblock_reserve
  acpi: video: enhance the quirk detect logic of _BQC
  ACPI: update comments for acpi_event_status
  ACPI: remove "config ACPI_DEBUG_FUNC_TRACE"
  PCI / ACPI: Don't query OSC support with all possible controls
  ACPI / processor_thermal: avoid null pointer deference error
  ACPI / fan: avoid null pointer deference error
  ACPI / video: Fix applying indexed initial brightness value.
  ACPI / video: Make logic a little easier to understand.
  ACPI / video: Fix brightness control initialization for some laptops.
  ACPI: Use resource_size() in osl.c
  ACPI / acpi_pad: Used PTR_RET
  ACPI: suppress compiler warning in container.c
  ACPI: suppress compiler warning in battery.c
  ACPI: suppress compiler warnings in processor_throttling.c
  ACPI: suppress compiler warnings in button.c
  ACPI: replace kmalloc+memcpy with kmemdup
  ACPI: Remove acpi_pci_bind_root() definition
  ...
2013-04-28 01:54:08 +02:00
Zhang Rui 34f8f1031c ACPI: update comments for acpi_event_status
ACPI_EVENT_FLAG_HANDLE is a flag for acpi_event_status.
When it is set, it indicates that the ACPI event,
either GPE or fixed event, is associated with a handler.

Update the comments to reflect this flag.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-04-21 23:57:28 +02:00
Jung-uk Kim 3cf24497f4 ACPICA: Fix a long-standing bug in local cache
Since 20060317, the pointer to next object is the first element in
 its common header.  Remove bogus LinkOffset from ACPI_MEMORY_LIST
 and directly use NextObject.

Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
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>
2013-03-12 00:45:04 +01:00
Bob Moore 25f044e645 ACPICA: Update ACPICA copyrights to 2013
Includes all source headers and signons for the various tools.

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>
2013-01-25 13:30:47 +01:00
Lv Zheng b43e1065ca ACPICA: Cleanup table handler naming conflicts.
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 44 lines of 20121114 divergence.diff.

There are naming conflicts between Linux and ACPICA on table handlers. This
patch cleans up this conflicts to reduce the source code diff between Linux
and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-01-11 13:10:16 +01:00
Lv Zheng 4f84291668 ACPICA: Cleanup PM_TIMER_FREQUENCY definition.
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 13 lines of 20121114 divergence.diff.

There is updates in ACPICA for PM_TIMER_FREQUENCY macro, this patch cleans
up the usage of this macro in Linux. This patch can also reduce the source
code diff between Linux and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-01-10 12:36:23 +01:00
Bob Moore c41679a448 ACPICA: Add time macros for various timer/time manipulation.
Constants for time manipulation, including constants for the 100
nanosecond timers. Chao Guan, Bob Moore, Lv Zheng.

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>
2013-01-10 12:36:20 +01:00
Bob Moore afb1bbee80 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>
2013-01-10 12:36:19 +01:00
Lv Zheng 739dcbb90a 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>
2013-01-10 12:36:17 +01:00
Lv Zheng 75c8044fb3 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>
2013-01-10 12:36:17 +01:00
Bob Moore 413fc3f592 ACPICA: AcpiGetObjectInfo: Add support for ACPI 5 _SUB method
Now calls _SUB in addition to the other ID methods: _HID, _CID,
and _UID.

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>
2012-11-15 00:31:30 +01:00
Bob Moore ff60027174 ACPICA: Add ACPI_MOVE_NAME macro to optimize 4-byte ACPI_NAME copies
Resolves to a 32-bit move for the normal case, strncpy on machines
that do not support misaligned transfers.

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>
2012-11-15 00:31:28 +01:00
Lv Zheng 1f86e8c1c9 ACPICA: Fix indent caused divergences.
New version of "indent" program will generate different outputs that
will lead to the divergences between the Linux and the ACPICA.
This patch fixes such divergences caused by the "indent" program.
The version of the "indent" used for this patch is "GNU indent 2.2.11".

This patch will not affect the generated vmlinux binary.
This will decrease 581 lines of 20120913 divergence.diff.

Signed-off-by: Robert 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>
2012-11-15 00:31:23 +01:00
Lv Zheng 644ef74e6d ACPICA: Fix AcpiSrc caused divergences.
There are definitions that can been converted into new styles by
the recent AcpiSrc while they remain the old styles in the Linux.
This patch fixes those definitions that will be converted by the
AcpiSrc.

This patch will not affect the generated vmlinux binary.
This will decrease 97 lines of 20120913 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-11-15 00:31:23 +01:00
Lv Zheng 78e25fef27 ACPICA: Fix divergences of definition conflicts.
There are conflicts in the "acpi_device_id*" definitions between the
Linux and the ACPICA.  The definitions of acpi_device_id* in ACPICA
have been changed to the "acpi_pnp_device_id*".  This patch changes
the corresponding "acpica_device_id*" definitiions in the Linux.

This patch will not affect the generated vmlinx binary.
This will decrease 298 lines of 20120913 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-11-15 00:31:22 +01:00
Feng Tang a950c135e5 ACPI: delelte more BFS/GTS related definition and code
This is a follow on for commmit 3f6f49c7 "ACPI: delete _GTS/_BFS support"
to do more cleanup.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-09-21 00:26:16 -04:00
Len Brown 3f6f49c785 ACPI: delete _GTS/_BFS support
_GTS and _BFS were added to the suspend/resume flow
in the ACPI 2.0 specification.

Linux dutifully implemented _GTS and _BFS.
We discovered that it was rarely seen in systems
in the field.  Further, some of those systems had
AML so bogus that it could never work -- proof that
no other operating system supports _GTS and _BFS.
So we made _GTS and _BFS optional via modparam,
and disabled them by default.

But we've had to complicate some code to keep
this support in the kernel, as these methods are defined
to be evaluated very close to sleep entry and exit.
Indeed, no other AML is ever evaluated with interrupts off.

We have submitted a proposal for _GTS and _BFS
to be officially removed from the ACPI specification
on the next revision.  Here we remove it from Linux.

Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-07-30 21:11:25 -04:00
Bob Moore ba494beeaa ACPICA: AcpiSrc: Fix some translation issues for Linux conversion
Fixes issues like this:

i_aSL -> iASL
00-7_f -> 00-7F
local_fADT -> local_FADT
execute_oSI -> execute_OSI

Also, in function headers, the parameters are now translated to
lower case (with underscores if necessary.)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-07-17 00:05:51 -04:00
Bob Moore 75e7386b10 ACPICA: Update header files copyrights to 2012
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-07-17 00:05:50 -04:00
Bob Moore 43e1c6892c ACPICA: ACPI 5/iASL: Add support for PCC keyword
Adds support for the PCC keyword for the Register() resource
descriptor macro.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-01 11:51:52 -04:00
Bob Moore 86ed4bc83a ACPICA: Add support for multiple notify handlers
This change adds support to allow multiple notify handlers on
Device, ThermalZone, and Processor objects. Also re-worked
and restructured the entire notify support code for handler
installation, handler removal, notify event queuing, and notify
dispatch to handler.

Extends and updates original commit 3f0be67("ACPI / ACPICA: Multiple
system notify handlers per device") by Rafael Wysocki.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-01 11:51:50 -04:00
Lin Ming 1cc0c998fd ACPI: Fix D3hot v D3cold confusion
Before this patch, ACPI_STATE_D3 incorrectly referenced D3hot
in some places, but D3cold in other places.

After this patch, ACPI_STATE_D3 always means ACPI_STATE_D3_COLD;
and all references to D3hot use ACPI_STATE_D3_HOT.

ACPI's _PR3 method is used to enter both D3hot and D3cold states.
What distinguishes D3hot from D3cold is the presence _PR3
(Power Resources for D3hot)  If these resources are all ON,
then the state is D3hot.  If _PR3 is not present,
or all _PR0 resources for the devices are OFF,
then the state is D3cold.

This patch applies after Linux-3.4-rc1.
A future syntax cleanup may remove ACPI_STATE_D3
to emphasize that it always means ACPI_STATE_D3_COLD.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-05-05 01:19:52 -04:00
Lin Ming 8a73b17e4c ACPICA: Sleep/Wake interfaces: optionally execute _GTS and _BFS
Enhanced the sleep/wake interfaces to optionally execute the
_GTS method (Going To Sleep), and the _BFS method (Back From
Sleep).  Windows apparently does not execute these methods, and
therefore these methods are often untested. It has been seen on
some systems where the execution of these methods causes errors
and also prevents the machine from entering S5. It is therefore
suggested that host operating systems do not execute these methods
by default. In the future, perhaps these methods can be optionally
executed based on the age of the system and/or what is the newest
version of Windows that the BIOS asks for via _OSI.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-26 21:16:25 -04:00
Bob Moore 72a8887a35 ACPICA: Add table-driven dispatch for sleep/wake functions
Simplifies the code, especially the compile-time
ACPI_REDUCED_HARDWARE option.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-22 01:45:05 -04:00
Bob Moore ea143604c5 ACPICA: ACPI 5: Update debug output for new notify values
Add new notify values, add support for "hardware specific" notifies.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-03-22 01:44:57 -04:00
Bob Moore 2da120b684 ACPI 5.0: Support for GeneralPurposeIo and GenericSerialBus operation region
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-01-17 03:36:29 -05:00
Bob Moore 9ce81784c9 ACPI 5.0: Implement Connection() and AccessAs() changes
Support within the interpreter and operation region dispatch.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-01-17 03:36:29 -05:00
Rafael J. Wysocki 4505a2015f ACPI: Drop ACPI_NO_HARDWARE_INIT
ACPI_NO_HARDWARE_INIT is only used by acpi_early_init() and
acpi_bus_init() when calling acpi_enable_subsystem(), but
acpi_enable_subsystem() doesn't check that flag, so it can be
dropped.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-11-06 20:32:31 -05:00
Len Brown 6288cf1e76 Merge branches 'acpica', 'aml-custom', 'bugzilla-16548', 'bugzilla-20242', 'd3-cold', 'ec-asus' and 'thermal-fix' into release 2011-05-29 04:38:48 -04:00
Lin Ming 28c2103dad ACPI: Add D3 cold state
_SxW returns an Integer containing the lowest D-state supported in state
Sx. If OSPM has not indicated that it supports _PR3, then the value “3”
corresponds to D3.  If it has indicated _PR3 support, the value “3”
represents D3hot and the value “4” represents D3cold.

Linux does set _OSC._PR3, so we should fix it to expect that _SxW can
return 4.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-05-29 02:21:08 -04:00
Bob Moore e2066ca1b2 ACPICA: Execute an orphan _REG method under the EC device
This change will force the execution of a _REG method underneath
the EC device even if there is no corresponding operation region
of type EmbeddedControl. Fixes a problem seen on some machines
and apparently is compatible with Windows behavior.

http://www.acpica.org/bugzilla/show_bug.cgi?id=875

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2011-05-09 22:16:12 -04:00