aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-10-21ACPICA: iASL/Disassembler: Add support for hardware summary mapfiles.Bob Moore1-0/+34
Adds support for both iASL and the disassembler to create a hardware and connection summary mapfile (via the -lm option.) Linux isn't affected by this patch because iASL is not in the Linux upstream. 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-10-21ACPICA: Events: Reduce source code difference for the ACPI_EVENT_FLAG_HANDLE renaming.Lv Zheng2-2/+2
This patch is partial linuxized result of the following ACPICA commit: ACPICA commit: a73b66c6aa1846d055bb6390d9c9b9902f7d804d Subject: Add "has handler" flag to event/gpe status interfaces. This change adds a new flag, ACPI_EVENT_FLAGS_HAS_HANDLER to the acpi_get_event_status and acpi_get_gpe_status external interfaces. It is set if the event/gpe currently has a handler associated with it. This patch contains the code to rename ACPI_EVENT_FLAG_HANDLE to ACPI_EVENT_FLAG_HAS_HANDLER, and the corresponding updates of its usages. Link: https://github.com/acpica/acpica/commit/a73b66c6 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-10-21ACPICA: Events: Reduce source code difference for the ACPI_EVENT_FLAG_HANDLE support.Lv Zheng3-17/+33
This patch is a partial linuxized result of the following ACPICA commit: ACPICA commit: a73b66c6aa1846d055bb6390d9c9b9902f7d804d Subject: Add "has handler" flag to event/gpe status interfaces. This change adds a new flag, ACPI_EVENT_FLAGS_HAS_HANDLER to the acpi_get_event_status and acpi_get_gpe_status external interfaces. It is set if the event/gpe currently has a handler associated with it. This commit back ports ACPI_EVENT_FLAG_HANDLE from Linux upstream to ACPICA, the flag along with its support code currently can only be found in the Linux upstream and is used by the ACPI sysfs GPE interfaces and the ACPI bus scanning support. Link: https://github.com/acpica/acpica/commit/a73b66c6 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-10-21ACPICA: Events: Update GPE handler removal, match behavior of handler install.Lv Zheng1-3/+5
The originally_enabled check is not paired between acpi_install_gpe_handler() and acpi_remove_gpe_handler(). In ACPICA upstream, there is code to protect original enabled state for ACPI_GPE_DISPATCH_NOTIFY and this commit fixes an issue for this feature. Link: https://github.com/acpica/acpica/commit/967f314c 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-10-21ACPICA: Events: Reduce source code difference in acpi_install_gpe_handler().Lv Zheng1-1/+9
There is a sanity check in ACPICA upstream, complaining mis-matched interrupt type for originally enabled GPEs that are going to be dispatched by OSPM handlers. This is only a warning message noting developers such conflict between BIOS and OSPM. This patch ports this warning message from ACPICA upstream to reduce source code difference between Linux and ACPICA upstream. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-10-21ACPICA: Events: Reduce indent divergences of events files.Lv Zheng7-25/+25
This patch reduces indent divergences first in order to reduce human intervention work for the follow-up linuxized event patches. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-10-21ACPICA: acpidump: Add ACPI 1.0 RSDP support.Lv Zheng2-1/+34
The acpidump currently always uses ACPI 2.0 format to dump RSDP, this patch adds ACPI 1.0 RSDP support. Link: https://bugs.acpica.org/show_bug.cgi?id=1097 Link: https://bugs.acpica.org/show_bug.cgi?id=1103 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Reported-and-tested-by: Rudolf Marek <r.marek@assembler.cz> Reported-and-tested-by: Rafal <fatwildcat@gmail.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-09-30ACPICA: Introduce acpi_enable_all_wakeup_gpes()Rafael J. Wysocki1-0/+32
Add a routine for host OSes to enable all wakeup GPEs and disable all of the non-wakeup ones at the same time. It will be used for the handling of GPE wakeup from suspend-to-idle in Linux. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-09-30ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block()Rafael J. Wysocki1-4/+4
Since acpi_hw_enable_wakeup_gpe_block() is currently always called after disabling all GPEs, it can actually write zeros to all non-wakeup enable bits unconditionally. That will be useful going forward for disabling runtime GPEs and enabling wakeup GPEs in one go instead of doing that in two steps (disable runtime and enable wakeup) which in theory may lead to a loss of a wakeup event. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-09-29Merge back earlier 'acpica' material for v3.18.Rafael J. Wysocki1-1/+3
2014-09-24ACPICA: Update to GPIO region handler interface.Bob Moore6-16/+104
Changes to correct several GPIO issues: 1) The update_rule in a GPIO field definition is now ignored; a read-modify-write operation is never performed for GPIO fields. (Internally, this means that the field assembly/disassembly code is completely bypassed for GPIO.) 2) The Address parameter passed to a GPIO region handler is now the bit offset of the field from a previous Connection() operator. Thus, it becomes a "Pin Number Index" into the Connection() resource descriptor. 3) The bit_width parameter passed to a GPIO region handler is now the exact bit width of the GPIO field. Thus, it can be interpreted as "number of pins". Overall, we can now say that the region handler interface to GPIO handlers is a raw "bit/pin" addressed interface, not a byte-addressed interface like the system_memory handler interface. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: 3.15+ <stable@vger.kernel.org> # 3.15+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-09-03ACPICA: Disassembler: Fix for gpio_int interrupt polarity flags.Bob Moore1-1/+3
The field is actually 2 bits, not 1. 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-09-02ACPICA: ACPI 5.1: Add support for runtime validation of _DSD package.Mika Westerberg1-0/+39
Adds ACPICA kernel runtime support to validate contents/format of the _DSD package, similar to the iASL support. Ported by Mika Westerberg. Signed-off-by: Mika Westerberg <mika.westerberg@linux.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>
2014-08-05Merge branch 'acpica'Rafael J. Wysocki12-58/+272
* acpica: ACPICA: Update version to 20140724. ACPICA: ACPI 5.1: Update for PCCT table changes. ACPICA/ARM: ACPI 5.1: Update for GTDT table changes. ACPICA/ARM: ACPI 5.1: Update for MADT changes. ACPICA/ARM: ACPI 5.1: Update for FADT changes. ACPICA: ACPI 5.1: Support for the _CCA predifined name. ACPICA: ACPI 5.1: New notify value for System Affinity Update. ACPICA: ACPI 5.1: Support for the _DSD predefined name. ACPICA: Debug object: Add current value of Timer() to debug line prefix. ACPICA: acpihelp: Add UUID support, restructure some existing files. ACPICA: Utilities: Fix local printf issue. ACPICA: Tables: Update for DMAR table changes. ACPICA: Remove some extraneous printf arguments. ACPICA: Update for comments/formatting. No functional changes. ACPICA: Disassembler: Add support for the ToUUID opererator (macro). ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro. ACPICA: Work around an ancient GCC bug.
2014-07-31ACPICA: ACPI 5.1: Support for the _CCA predifined name.Bob Moore1-0/+3
Full support for _CCA. 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-07-31ACPICA: ACPI 5.1: New notify value for System Affinity Update.Bob Moore1-2/+3
New value for the Notify() operator. 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-07-31ACPICA: ACPI 5.1: Support for the _DSD predefined name.David E. Box1-1/+12
Adds full support for _DSD. David Box. Signed-off-by: David E. Box <david.e.box@linux.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>
2014-07-31ACPICA: Debug object: Add current value of Timer() to debug line prefix.Bob Moore1-1/+10
Simplifies timing of things like control method execution. [zetalog: fixing 64-bit division link error] 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-07-31ACPICA: acpihelp: Add UUID support, restructure some existing files.Bob Moore6-28/+217
This adds a -u option to acpi_help to display all known ACPI UUIDs. Some existing files in the core code have been restructured. Three new files. [zetalog: changing drivers/acpi/acpica/Makefile accordingly] 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-07-31ACPICA: Utilities: Fix local printf issue.Lv Zheng1-0/+3
The bug can be reproduced by using a format that do not have the width.prec specified after a format that have the width.prec specified. The second formatted output will be wrong. The root cause is acpi_ut_vsnprintf() doesn't reset the specifiers to the default values. This patch fixes this issue. BZ 1094. Reported by Yizhe Wang, fixed by Lv Zheng. Since acpi_ut_vprintf() is only enabled for specific OSPM now, this patch doesn't affect Linux kernel. Link: https://bugs.acpica.org/show_bug.cgi?id=1094 Reported-and-tested-by: Yizhe Wang <yizhe.wang@intel.com> 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-07-31ACPICA: Remove some extraneous printf arguments.Sascha Wildner2-5/+4
Arguments that have no associated % format specifier. Apparently these are not caught by any current compilers. ACPICA BZ 1090. Sascha Wildner. Currently, this patch only affects applications under the toos/power/acpi folder. Link: https://bugs.acpica.org/show_bug.cgi?id=1090 Signed-off-by: Sascha Wildner <swildner@gmail.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>
2014-07-31ACPICA: Update for comments/formatting. No functional changes.Bob Moore1-12/+10
Fix some issues detected by acpisrc utility. 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-07-31ACPICA: Disassembler: Add support for the ToUUID opererator (macro).Bob Moore1-6/+7
This change adds support to disassemble a UUID back to the original ToUUID operator. It will detect a UUID within a standard AML Buffer. Also, a description of the UUID is emitted for "known" UUIDs, defined as UUIDs that are defined in the ACPI specification. Since this is a change for disassembler which is not shipped in the Linux kernel, the Linux kernel is not affected. 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-07-31ACPICA: Work around an ancient GCC bug.Bob Moore1-3/+3
warning: cast from function call of type 'char *' to non-matching type 'long unsigned int' Since acpi_ut_format_number() hasn't been enabled for the Linux kernel, this patch doesn't affect the Linux kernel. 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-07-27Merge branch 'acpi-headers'Rafael J. Wysocki1-1/+1
* acpi-headers: ACPI: Add support to force header inclusion rules for <acpi/acpi.h>. ACPI / SFI: Fix wrong <acpi/acpi.h> inclusion in SFI/ACPI wrapper - table definitions. ACPICA: Linux: Allow ACPICA inclusion for CONFIG_ACPI=n builds. ACPICA: Linux: Add support to exclude <asm/acenv.h> inclusion. ACPICA: Linux: Add stub implementation of ACPICA 64-bit mathematics. ACPICA: Linux: Add stub support for Linux specific variables and functions.
2014-07-23ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake.Rafael J. Wysocki1-0/+47
ACPICA commit c49dbfed2bc069d0038ea7e1294409bfde7c2c8c Some potential callers of acpi_setup_gpe_for_wake may know in advance that there won't be any notify handlers installed for device wake notifications from the given GPE (one example is a button GPE in Linux). For these cases, acpi_mark_gpe_for_wake should be used instead of acpi_setup_gpe_for_wake. This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to setup implicit wake notification for it (since there's no handler method). Rafael Wysocki. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-07-23ACPICA: GPEs: Do not allow enable for GPEs that have no handler(s).Rafael J. Wysocki1-3/+11
ACPICA commit 23b5a8542283af28c3a3a4e3f81096d6e2569faa There is no point in enabling a GPE that has no handler or GPE method. At worst, it can cause GPE floods. Rafael Wysocki. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2014-07-23ACPI: Add support to force header inclusion rules for <acpi/acpi.h>.Lv Zheng1-1/+1
As there is only CONFIG_ACPI=n processing in the <linux/acpi.h>, it is not safe to include <acpi/acpi.h> directly for source out of Linux ACPI subsystems. This patch adds error messaging to warn developers of such wrong inclusions. In order not to be bisected and reverted as a wrong commit, warning messages are carefully split into a seperate patch other than the wrong inclusion cleanups. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-09ACPICA: Fix a regression for deletion of Alias() objects.Bob Moore1-10/+9
Fixes a regression introduced by commit e23d9b829754 (ACPICA: Namespace: Properly null terminate objects detached from a namespace node) In the case of Alias namespace nodes, the node simply points to the aliased node via the Object field; thus we cannot assume that the object is an operand object. Fixes: e23d9b829754 (ACPICA: Namespace: Properly null terminate objects detached from a namespace node) 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-07-08ACPICA: Hardware: back port of a recursive locking fixLv Zheng1-1/+2
This patch is a back port result of the following Linux commit: Commit: f7f71cfbf0c276ee3d8d856d0f35a41aed997fa4 Author: Rakib Mullick <rakib.mullick@gmail.com> Subject: ACPI: Fix possible recursive locking in hwregs.c As a result of different coding style rules, the back ported code generates source code differences between the Linux kernel and the ACPICA upstream. This patch reduces such source code differences. 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-07-08ACPICA: utprint/oslibcfs: cleanup - no functional changeBob Moore1-16/+28
Some cleanup and comment update. 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-07-08ACPICA: Executer: Fix trivial issues in acpi_get_serial_access_bytes()Lv Zheng1-2/+2
This patch fixes trivial issues in acpi_get_serial_access_bytes(), no real functional bugs. 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-07-08ACPICA: acpidump: Reduce freopen() invocations to improve portabilityLv Zheng2-0/+135
This patch reduces the requirement of invoking freopen() in acpidump in order to reduce the porting effort of acpidump. This patch achieves this by turning all acpi_os_printf(stdout) into acpi_ut_file_printf(gbl_output_file). 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-07-08ACPICA: Common: Enhance acpi_getopt() to improve portabilityLv Zheng1-0/+2
This patch enhances acpi_getopt() by converting the standard C library invocations into portable ACPI string APIs and acpi_log_error() to improve portability. 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-07-08ACPICA: Common: Enhance cm_get_file_size() to improve portabilityLv Zheng1-1/+1
This patch uses abstract file IO and acpi_log_error() APIs to enhance cm_get_file_size() so that applications that invoke this API could have portability improved. With actual references added to abstract file IO and acpi_log_error(), the applications need to link oslibcfs.o, utdebug.o, utexcep.o, utmath.o, utprint.o and utxferror.o. It is also required to add acpi_os_initialize() invocations if an application starts to use acpi_log_error(). acpidump has already invoked acpi_os_initialize() in this way. 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-07-08ACPICA: Application: Enhance ACPI_USAGE_xxx/ACPI_OPTION with acpi_os_printf() to improve portabilityLv Zheng1-2/+5
This patch enhances ACPI_USAGE_xxx/ACPI_OPTION macros to use portable acpi_os_printf() so that usage functions for applications no longer rely on the printf() API. To use acpi_os_printf() exported by osunixxf.c as a replacement of printf(), applications need to initialize acpi_gbl_output_file to stdout and initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT. The latter is automatically done by ACPI_INIT_GLOBAL(), applications need to link utglobal.o to utilize this mechanism. For GCC, assigning stdout to acpi_gbl_output_file using ACPI_INIT_GLOBAL() is not possible as stdout is not a constant in GCC environment. As an alternative solution, stdout assignment has been put into acpi_os_initialize(). Thus acpi_os_initialize() need to be invoked very early by the applications to initialize the default output of acpi_os_printf() to keep behavior consistency. acpidump has already invoked acpi_os_initialize() in this way. 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-07-08ACPICA: Utilities: Introduce acpi_log_error() to improve portabilityLv Zheng1-0/+26
Invocations like fprintf(stderr) and perror() are not portable, this patch introduces acpi_log_error() as a replacement, it is implemented using new portable API - acpi_ut_file_vprintf(). Note that though acpi_os_initialize() need to be invoked prior than using this new API, since no users are introduced in this patch, such invocations are not added for applications that link utprint.c in this patch. Futher patches that introduce users of acpi_log_error() should take care of this. This patch is only useful for ACPICA applications, most of which are not shipped in the Linux kernel. Note that follow-up commits will update acpidump to use this new API to improve portability. 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-07-08ACPICA: Utilities: Add formatted printing APIsLv Zheng4-1/+674
This patch introduces formatted printing APIs to handle ACPICA specific formatted print requirements. Currently only specific OSPMs will use this customized printing support, Linux kernel doesn't use these APIs at this time. It will be enabled for Linux kernel resident ACPICA after being well tested. So currently this patch is a no-op. The specific formatted printing APIs are useful to ACPICA as: 1. Some portable applications do not link standard C library, so they cannot use standard formatted print APIs directly. 2. Platform specific printing format may differ and thus not portable, for example, u64 is %ull for Linux kernel and is %uI64 for some MSVC versions. 3. Platform specific printing format may conflict with ACPICA's usages while it is not possible for ACPICA developers to test their code for all platforms. For example, developers may generate %pRxxx while Linux kernel treats %pR as structured resource printing and decodes variable argument as a "struct resource" pointer. This patch solves above issues by introducing the new APIs. Note that users of such APIs are not introduced in this patch. Users of acpi_os_file_vprintf()/acpi_ut_file_printf() need to invoke acpi_os_initialize(), this should be taken care by the further patches where such users are introduced. 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-07-08ACPICA: OSL: Clean up acpi_os_printf()/acpi_os_vprintf() stubsLv Zheng3-3/+2
This patch is mainly for acpidump where there are redundant acpi_os_printf()/acpi_os_vprintf() stubs implemented. This patch cleans up such specific implementation by linking acpidump to osunixxf.c/oswinxf.c. To make acpi_os_printf() exported by osunixxf.c/oswinxf.c to behave as the old acpidump specific ones, applications need to: 1. Initialize acpi_gbl_db_output_flags to ACPI_DB_CONSOLE_OUTPUT. This is automatically done by ACPI_INIT_GLOBAL(), applications need to link utglobal.o to utilize this mechanism. 2. Initialize acpi_gbl_output_file to stdout. For GCC, assigning stdout to acpi_gbl_output_file using ACPI_INIT_GLOBAL() is not possible as stdout is not a constant in GCC environment. As an alternative solution, stdout assignment is put into acpi_os_initialize(). Thus acpi_os_initialize() need to be invoked very early by the applications to initialize the default output of acpi_os_printf(). This patch also releases osunixxf.c to the Linux kernel. 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-07-08ACPICA: Utilities: Cleanup DEFINE_ACPI_GLOBALS by moving acpi_ut_init_global() from utglobal.c to utinit.cLv Zheng2-146/+146
The utglobal.c is used to define and initialize global variables. It makes sense if just adding utglobal.o to applications that are using such variables. But acpi_ut_init_globals() is preventing us from doing so as this initialization function references other components' initializations code, which leads to the requirement that many files should also get linked if one wants to link utglobal.o. It is possible to just move acpi_ut_init_global() to utinit.c for applications that require this function to link. By linking utglobal.o, we can stop defining DEFINE_ACPI_GLOBALS for applications (currently only acpidump is affected). 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-07-08ACPICA: Namespace: Properly null terminate objects detached from a namespace nodeDavid E. Box1-0/+11
Fixes a bug exposed by an ACPICA unit test around the acpi_attach_data()/acpi_detach_data() APIs where the failure to null terminate a detached object led to the creation of a circular linked list (and infinite looping) when the object is reattached. Reported in acpica bugzilla #1063 Link: https://bugs.acpica.org/show_bug.cgi?id=1063 Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: 3.15+ <stable@vger.kernel.org> # 3.15+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-08ACPICA: Utilities: Validate full RSDP headerDavid E. Box1-12/+7
Implement proper RSDP validation in acpi_ut_read_table(). Prevents a segmentation fault that can occur if a user passes the wrong file to iasl. This patch is only useful for iasl, which is not shipped in the Linux kernel. After the new table reading utility functions are well tested, acpidump can also switch to use the generic acpi_ut_read_table_xxx() APIs. Currently this patch is no-op as acpidump does not link to the new APIs. Signed-off-by: David E. Box <david.e.box@linux.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>
2014-07-08ACPICA: Utilities: Add support to read table from filesLv Zheng4-4/+346
After the new table reading utility functions are well tested, acpidump can also switch to use the generic acpi_ut_read_table_xxx() APIs. Currently this patch is no-op as acpidump does not link to the new APIs. This patch is only useful for ACPICA applications, most of which are not shipped in the Linux kernel. 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-07-08ACPICA: Utilities: Fix an issue with non-native ACPI_IS_PRINT()Lv Zheng1-1/+1
An error was found in the ACPICA provided non-native ACPI_IS_PRINT() causing the following difference with the native isprint() implementation: The GNU libc isprint('\n') test result: isprint(0x20) is FALSE The Linux kernel isprint('\n') test result: ACPI: isprint(0x20) is FALSE The _acpi_ctype isprint('\n') test result: isprint(0x20) is TRUE The ACPI_IS_PRINT() macro generated for _acpi_ctype is wrong. It should use _ACPI_XS instead of _ACPI_SP. _ACPI_XS is white space only. Other space characters should be non printable. This patch fixes this issue. For OSPMs that are using native standard isprint() implementations, this patch is a no-op. 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-07-08ACPICA: Utilities: Fix memory leak in acpi_ut_copy_iobject_to_iobjectDavid E. Box1-0/+6
Adds return status check on copy routines to delete the allocated destination object if either copy fails. Reported by Colin Ian King on bugs.acpica.org, Bug 1087. The last applicable commit: Commit: 3371c19c294a4cb3649aa4e84606be8a1d999e61 Subject: ACPICA: Remove ACPI_GET_OBJECT_TYPE macro Link: https://bugs.acpica.org/show_bug.cgi?id=1087 Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: 3.9+ <stable@vger.kernel.org> # 3.9+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-07-07ACPICA: Events: Fix edge-triggered GPE by disabling before acknowledging it.Lv Zheng1-15/+17
Due to ACPI specificiation 5, chapter 5.6.4 General-Purpose Event Handling, OSPMs need to disable GPE before clearing the status bit for edge-triggered GPEs. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Tested-by: Gareth Williams <gareth@garethwilliams.me.uk> Tested-by: Steffen Weber <steffen.weber@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-06-03ACPICA: Namespace: Remove _PRP method support.Lv Zheng1-6/+0
The _PRP method is not going to be a part of the ACPI standard. This patch removes its support code introduced by the following commits: 1. ACPICA: Predefined names: Add support for the _PRP method. 2. ACPICA: Update for _PRP predefined name. 3. ACPICA: Add support for _LPD and _PRP methods. 4. ACPICA: Back port of _PRP update. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-06-01ACPICA: Tables: Add mechanism to control early table checksum verification.Lv Zheng4-26/+61
It is reported that Linux x86 kernel cannot map large tables. The following large SSDT table on such platform fails to pass checksum verification and cannot be installed: ACPI: SSDT 0x00000000B9638018 07A0C4 (v02 INTEL S2600CP 00004000 INTL 20100331) It sounds strange that in the 64-bit virtual memory address space, we cannot map a single ACPI table to do checksum verification. The root cause is: 1. ACPICA doesn't split IO memory mapping and table mapping; 2. Linux x86 OSL implements acpi_os_map_memory() using a size limited fix-map mechanism during early boot stage, which is more suitable for only IO mappings. ACPICA originally only mapped table header for signature validation, and this header mapping is required by OSL override mechanism. There was no checksum verification because we could not map the whole table using this OSL. While the following ACPICA commit enforces checksum verification by mapping the whole table during Linux boot stage and it finally triggers this issue on some platforms: Commit: 86dfc6f339886559d80ee0d4bd20fe5ee90450f0 Subject: ACPICA: Tables: Fix table checksums verification before installation. Before doing further cleanups for the OSL table mapping and override implementation, this patch introduces an option for such OSPMs to temporarily discard the checksum verification feature. It then can be re-enabled easily when the ACPICA and the underlying OSL is ready. This patch also deletes a comment around the limitation of mappings because it is not correct. The limitation is not how many times we can map in the early stage, but the OSL mapping facility may not be suitable for mapping the ACPI tables and thus may complain us the size limitation. The acpi_tb_verify_table() is renamed to acpi_tb_verify_temp_table() due to the work around added, it now only applies to the table descriptor that hasn't been installed and cannot be used in other cases. Lv Zheng. Tested-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-05-07ACPICA: Events: Update GPE handling and initialization code.Bob Moore6-37/+43
1) Eliminate most use of GAS structs, since they are not needed for GPEs. 2) Allow raw GPE numbers > 255. 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-05-07ACPICA: Remove extraneous error message for large number of GPEs.Bob Moore1-18/+33
Fixes a problem where an extraneous error message was emitted during initialization if there is a GPE block larger than 255 bits. Any GPE block larger than 120 GPEs could generate the error. 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>