aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power/acpi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-11-16tools/power/acpi: Remove direct kernel source include referenceLv Zheng5-34/+53
Avoid breaking cross-compiled ACPI tools builds by rearranging the handling of kernel header files. This patch also contains OUTPUT/srctree cleanups in order to make above fix working for various build environments. Fixes: e323c02dee59 (ACPICA: MSVC9: Fix <sys/stat.h> inclusion order issue) Reported-and-tested-by: Yisheng Xie <xieyisheng1@huawei.com> Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-10ACPICA: Cleanup for all string-to-integer conversionsBob Moore3-4/+6
ACPICA commit e2e72a351201fd58e4694418859ae2c247dafca0 Consolidate multiple versions of strtoul64 to one common version. limit possible bases to either 10 or 16. Handles both implicit and explicit conversions. Added a 2-character ascii-to-hex function for GPEs and buffers. Adds a new file, utstrtoul64.c Link: https://github.com/acpica/acpica/commit/e2e72a35 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>
2016-08-13ACPICA: Clib: Eliminate acpi_os_XXXFile()/acpi_log_error and link clibrary fxxx()/errno/perror() insteadLv Zheng7-295/+81
ACPICA commit 189429fb7d06cdb89043ae32d615faf553467f1d This patch follows new ACPICA design, eliminates old portable OSLs, and implements fopen/fread/fwrite/fclose/fseek/ftell for GNU EFI environment. This patch also eliminates acpi_log_error(), convering them into fprintf(stderr)/perror(). Lv Zheng. Link: https://github.com/acpica/acpica/commit/189429fb Link: https://bugs.acpica.org/show_bug.cgi?id=1302 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>
2016-08-13ACPICA: Clib: Add -nostdinc support for EFI layerLv Zheng2-5/+4
ACPICA commit d261d40ea168f8e4c4e3986de720b8651c4aba1c This patch adds sprintf()/snprintf()/vsnprintf()/printf()/vfprintf() support for OSPMs that have ACPI_USE_SYSTEM_CLIBRARY defined but do not have ACPI_USE_STANDARD_HEADERS defined. -iwithprefix include is required to include <stdarg.h> which contains compiler specific implementation of vargs when -nostdinc is specified. -fno-builtin is required for GCC to avoid optimization performed printf(). This optimization cannot be automatically disabled by specifying -nostdlib. Please refer to the first link below for the details. However, the build option changes do not affect Linux kernel builds and are not included. Lv Zheng. Link: http://www.ciselant.de/projects/gcc_printf/gcc_printf.html Link: https://github.com/acpica/acpica/commit/d261d40e Link: https://bugs.acpica.org/show_bug.cgi?id=1302 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>
2016-08-13ACPICA: MSVC9: Fix <sys/stat.h> inclusion order issueLv Zheng3-2/+1
ACPICA commit 9bb265c2afb9910e46f820d6759648580edabd09 When /Za is specified, headers of some Windows SDKs contain bugs breaking VC builds, and MSVC9's default SDK is one of such header-buggy library. In order to solve this issue, many VC developers stop using /Za. However we've been asked to have this fixed without removing /Za. In MSVC9 default SDK, this issue can be fixed by restricting <sys/stat.h> to be the last standard file included by every source file in the projects. This patch thus moves <sys/stat.h> inclusion to "acapps.h", so that this issue can be fixed by ensuring that "acapps.h" is always the last standard file included by all of the ACPICA source files. This is in fact also a useful cleanup because applications can only include one header (e.x., acpidump.h) instead of including acapps.h separately. Lv Zheng. Except some harmless header inclusion re-ordering, Linux kernel is not affected by this change. Link: https://github.com/acpica/acpica/commit/9bb265c2 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>
2016-08-13ACPICA: Clib/EFI: Fix wrong order of standard integer types/IO handlesLv Zheng2-6/+0
ACPICA commit 7f9b359b7c78c69b07f62eb2d58f710c351fd75d EFI header should use standard C library stuffs (integer types and IO handles) rather than implementing such standard stuffs. This patch fixes this issue by: 1. Implementing standard integer types for ACPI_USE_STANDARD_HADERS=n; 2. Defining EFI types using standard integer types and standard IO handles; 3. Tuning header inclusion order and environment definition order; 4. Removing wrong standard header inclusion from ACPICA core files; 5. Moving several application headers from acpidump.h to acenv.h. This patch corrects some of them. Lv Zheng. Except some harmless header inclusion re-ordering, Linux kernel is not affected by this change. Link: https://github.com/acpica/acpica/commit/7f9b359b Link: https://bugs.acpica.org/show_bug.cgi?id=1300 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>
2016-08-13ACPICA: Clib: Fix build issues when ACPI_USE_STANDARD_HEADERS is not defined by converting size_t to acpi_sizeLv Zheng1-2/+2
ACPICA commit 7cf411136c69ef0b8f184b96599eb45c15b89226 When standard size_t is not defined due to ACPI_USE_STANDARD_HEADERS=n, we shouldn't use size_t, but should use acpi_size instead. This fixes such build issue. Lv Zheng. Link: https://github.com/acpica/acpica/commit/7cf41113 Link: https://bugs.acpica.org/show_bug.cgi?id=1296 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>
2016-08-13ACPICA: acpidump: Fix a duplicate variable definitionLv Zheng2-6/+1
ACPICA commit 080f99d5b29313380accd00d2b9768e809eb417b acpi_gbl_integer_byte_width has already been instantiated by ACPI_GLOBAL() in acglobal.h. Lv Zheng. Link: https://github.com/acpica/acpica/commit/080f99d5 Link: https://bugs.acpica.org/show_bug.cgi?id=1301 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>
2016-08-13ACPICA: OSL: Add correct acpi_gbl_debug_timeout export to allow acpiexec to linkLv Zheng1-3/+0
ACPICA commit 408198c8c9786f9f104ee925020c3ab1701906e4 The acpi_gbl_debug_timeout which is used by acpiexec -et option now is only implemented in oswinxf.c and used for WIN32 builds. This makes it very difficult to remember that we need to add this variable to other os specific layer files in order for linking. This patch makes it a global option dependent on ACPI_APPLICATION so that it can always be linked by the applications. Lv Zheng. Link: https://github.com/acpica/acpica/commit/408198c8 Link: https://bugs.acpica.org/show_bug.cgi?id=1295 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>
2016-08-13ACPICA: iASL/Disassembler: Add a check for missing filenameBob Moore1-1/+1
ACPICA commit fc0f12b1eff6253f83e599a7ee1765fcc8e42dcc Add check for required filename for the -d and -da options. ACPICA BZ 1285. Link: https://github.com/acpica/acpica/commit/fc0f12b1 Link: https://bugs.acpica.org/show_bug.cgi?id=1285 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>
2016-06-23tools/acpi: use CROSS_COMPILE to define prefixAndy Shevchenko1-3/+4
CROSS_COMPILE can be considered as standard definition for toolchain prefix when cross-compiling. Use it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-05-16Merge branches 'acpi-pci', 'acpi-misc' and 'acpi-tools'Rafael J. Wysocki1-2/+2
* acpi-pci: ACPI,PCI,IRQ: remove SCI penalize function ACPI,PCI,IRQ: remove redundant code in acpi_irq_penalty_init() ACPI,PCI,IRQ: reduce static IRQ array size to 16 ACPI,PCI,IRQ: reduce resource requirements * acpi-misc: ACPI / sysfs: fix error code in get_status() ACPI / device_sysfs: Clean up checkpatch errors ACPI / device_sysfs: Change _SUN and _STA show functions error return to EIO ACPI / device_sysfs: Add sysfs support for _HRV hardware revision arm64: defconfig: Enable ACPI ACPI / ARM64: Remove EXPERT dependency for ACPI on ARM64 ACPI / ARM64: Don't enable ACPI by default on ARM64 acer-wmi: Use acpi_dev_found() eeepc-wmi: Use acpi_dev_found() ACPI / utils: Rename acpi_dev_present() * acpi-tools: tools/power/acpi: close file only if it is open
2016-05-05ACPICA: Move all ASCII utilities to a common fileBob Moore2-1/+8
ACPICA commit ba60e4500053010bf775d58f6f61febbdb94d817 New file is utascii.c Link: https://github.com/acpica/acpica/commit/ba60e450 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>
2016-05-05ACPICA: Divergence: remove unwanted spaces for typedefLv Zheng3-37/+36
ACPICA commit b2294cae776f5a66a7697414b21949d307e6856f This patch removes unwanted spaces for typedef. This solution doesn't cover function types. Note that the linuxize result of this commit is very giant and should have many conflicts against the current Linux upstream. Thus it is required to modify the linuxize result of this commit and the commits around it manually in order to have them merged to the Linux upstream. Since this is very costy, we should do this only once, and if we can't ensure to do this only once, we need to revert the Linux code to the wrong indentation result before merging the linuxize result of this commit. Lv Zheng. Link: https://github.com/acpica/acpica/commit/b2294cae 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>
2016-04-09tools/power/acpi: close file only if it is openLv Zheng1-2/+2
The logic on the test for a valid fd to close is incorrect. This was just a mistake and was pointed out by Colin Ian King. Link: https://patchwork.kernel.org/patch/8620201/ Original-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-05ACPICA: Utilities: Update for strtoul64 mergerBob Moore2-2/+4
ACPICA commit 795e136d2ac77c1c8b091fba019b5fe36a44a323 Fixes a problem with the merger of the two internal versions of this function. Make the maximum integer width (32-bit or 64-bit) a parameter to the function so that it no longer exclusively uses the integer width specified in the DSDT/SSDT. ACPICA BZ 1260 Link: https://github.com/acpica/acpica/commit/795e136d 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>
2016-04-05ACPICA: Add support for QNX 6.6 platformWill Miles1-1/+1
ACPICA commit 37a1dec2391272251e59948c16c60713183ae78f Link: https://github.com/acpica/acpica/commit/37a1dec2 Signed-off-by: Will Miles <wmiles@sgl.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>
2016-01-15ACPICA: Additional 2016 copyright changesBob Moore11-11/+11
All tool/utility signons. Dual-license module header. 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>
2016-01-01ACPICA: getopt: Comment update, no functional changeBob Moore1-0/+1
ACPICA commit 0d784a90bc3aac75227c4459c3553de18b9ebe7a Document one of the option string operators. Link: https://github.com/acpica/acpica/commit/0d784a90 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>
2016-01-01ACPICA: Core: Major update for code formatting, no functional changesBob Moore3-0/+17
ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72 Mostly indentation inconsistencies across the code. Split some long lines, etc. Link: https://github.com/acpica/acpica/commit/dfa39447 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>
2015-12-15tools/power/acpi: Add userspace AML interface supportLv Zheng3-8/+473
This patch adds a userspace tool to access Linux kernel AML debugger interface. Tow modes are supported by this tool: 1. Interactive: Users are able to launch a debugging shell to talk with in-kernel AML debugger. Note that it's user duty to ensure kernel runtime integrity by using this debugging tool: A. Some control methods evaluated by the users may result in kernel panics if those control methods shouldn't be evaluated by the OSPMs according to the current BIOS/OS configurations. B. Currently if a single stepping evaluation couldn't run to an end, then the synchronization primitives acquired by the evaluation may block normal OSPM control method evaluations. 2. Batch: Users are able to execute debugger commands in a script. Note that in addition to the above duties, it's user duty to ensure script runtime integrity by using this debugging tool in this mode: C. Currently only those commands that are not used for single stepping are suitable to be used in this mode. D. If the execution of the command may cause a failure that could result in an endless kernel execution, the execution of the script may also get blocked. To exit the utility, currently "exit/quit" commands are recommended, but ctrl-C" can also be used. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-10-22ACPICA: iASL: General cleanup of the file suffix #definesBob Moore1-1/+1
ACPICA commit bed456ed2976bdaafdef406b982fdf6c539befc0 Removed some extraneous defines, reordered others. Link: https://github.com/acpica/acpica/commit/bed456ed 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>
2015-07-31tools/power/acpi: Enable build for EC userspace toolLv Zheng2-27/+22
This patch allows EC userspace tool to be built as an ACPI tool. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-31tools/power/acpi: Add descend support in ACPI tools MakefileLv Zheng4-151/+199
This patch splits tools/power/acpi/Makefile to support descend compling for ACPI tools. In this patch tools/ec related stuff is removed as it is originally not enabled. Also a missing .o (utnonansi.o) is added to the acpidump/Makefile. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-01ACPICA: De-macroize calls to standard C library functionsBob Moore4-15/+15
ACPICA commit 3b1026e0bdd3c32eb6d5d313f3ba0b1fee7597b4 ACPICA commit 00f0dc83f5cfca53b27a3213ae0d7719b88c2d6b ACPICA commit 47d22a738d0e19fd241ffe4e3e9d4e198e4afc69 Across all of ACPICA. Replace C library macros such as ACPI_STRLEN with the standard names such as strlen. The original purpose for these macros is long since obsolete. Also cast various invocations as necessary. Bob Moore, Jung-uk Kim, Lv Zheng. Link: https://github.com/acpica/acpica/commit/3b1026e0 Link: https://github.com/acpica/acpica/commit/00f0dc83 Link: https://github.com/acpica/acpica/commit/47d22a73 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-01ACPI / acpidump: Update acpidump manualLv Zheng1-5/+12
This patch updates acpidump manual according to the recent changes. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-01ACPICA: acpidump: Convert the default behavior to dump from /sys/firmware/acpi/tablesLv Zheng2-4/+13
ACPICA commit 04c3bd7e9d6aeb2b3edebe99c90dc271ae4e6353 In order to work without any additional option to dump tables when /dev/mem doesn't exist, this patch switches the default behavior of acpidump to dump from /sys/firmware/acpi/tables. Reported by Al Stone, Fixed by Lv Zheng. Link: https://github.com/acpica/acpica/commit/04c3bd7e Reported-by: Al Stone <ahs3@redhat.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>
2015-07-01ACPICA: acpidump: Allow customized tables to be dumped without accessing /dev/memLv Zheng1-43/+46
ACPICA commit ab29013cfa2424140446aff196a70b211ab343a9 The /dev/mem can be configured out, in which case, acpidump should still work with "-c" option as tables can be found in /sys/firmware/acpi/tables. This patch allows acpidump to work without /dev/mem. This patch has been tested with "acpidump -c" and "acpidump -c -n FADT". And it worked as expected. Lv Zheng. Link: https://github.com/acpica/acpica/commit/ab29013c Reported-by: Al Stone <ahs3@redhat.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>
2015-07-01ACPICA: Add dragon_fly support to unix file mapping fileSascha Wildner1-1/+1
ACPICA commit 795b215d6fd062386f0a1c23dff9ffa244683c4f ACPICA BZ 1130 This patch doesn't affect Linux kernel. Link: https://bugs.acpica.org/show_bug.cgi?id=1130 Link: https://github.com/acpica/acpica/commit/795b215d 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>
2015-04-14ACPICA: Fix a sscanf format string.Bob Moore1-1/+1
ACPICA commit 84f3569db7accc576ace2dae81d101467254fe9d Was using %d instead of properly using %u. This patch only affects acpidump tool. Link: https://github.com/acpica/acpica/commit/84f3569d 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>
2015-04-14ACPICA: Unix: Cleanup to use ACPI_TO_INTEGER() to calc page offset.Lv Zheng1-1/+1
ACPICA commit 9e2d8180f4d5e61949b17513bae8aff6412f62dd The offset calculation needn't convert a pointer to a special integer type. So this patch uses ACPI_TO_INTEGER() instead. This patch only affects acpidump tool. Link: https://github.com/acpica/acpica/commit/9e2d8180 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>
2015-02-05ACPICA: Update Copyright headers to 2015David E. Box11-11/+11
ACPICA commit 8990e73ab2aa15d6a0068b860ab54feff25bee36 Link: https://github.com/acpica/acpica/commit/8990e73a 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-10-21ACPICA: acpiexec: Do not put STDIN into raw mode unless it is a terminal.Bob Moore1-0/+8
Eliminate an error message for batch-mode processing on unix systems. ACPICA BZ 1114. This patch is mainly for fixing the issues of acpiexec which is not in the Linux upstream. Link: https://bugs.acpica.org/show_bug.cgi?id=1114 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: acpidump: Add ACPI 1.0 RSDP support.Lv Zheng1-1/+1
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-07-08ACPICA: utprint/oslibcfs: cleanup - no functional changeBob Moore1-15/+15
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: OSL: Update acpidump to reduce source code differencesLv Zheng2-7/+27
This patch is a result of an ACPICA commit to enables acpidump for EFI. For Linux kernel, this patch is a no-op. It is only required by the ACPICA release process to reduce the source code differences between the Linux kernel and the ACPICA upstream. 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 Zheng3-9/+11
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: acpidump: Replace file IOs with new APIs to improve portabilityLv Zheng4-72/+69
The new APIs are enabled to offer a portable layer to access files: 1. acpi_os_XXX_file_XXX: Wrapper of fopen/fclose/fread/fwrite 2. acpi_os_printf: Wrapper of printf 3. acpi_log_error: Wrapper of fprintf(stderr) This patch deploys such mechanisms to acpidump to improve the portability of this tool. 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: Remove exit() from generic layer to improve portabilityLv Zheng1-18/+32
This patch removes exit() from generic acpidump code to improve the portability of this tool. 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: Add memory/string OSL usage to improve portabilityLv Zheng2-13/+14
This patch adds code to use generic OSL for acpidump to improve the portability of this tool. 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 Zheng2-9/+8
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 Zheng2-9/+14
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-4/+4
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: Add formatted printing APIsLv Zheng1-0/+7
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: Add portable file IO to improve portabilityLv Zheng1-0/+214
This patch adds portable file IO to generic OSL to improve the portability of the applications. A portable application may use different file IO interfaces than the standard C library ones. This patch thus introduces an abstract file IO layer into the generic OSL. Note that this patch does not introduce users of such interfaces, further patches should introduce users one by one carefully with build tests performed. 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 Zheng4-22/+1306
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-1/+1
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: acpidump: Add support for ACPI 1.0 GUID in LinuxLv Zheng1-7/+41
For older EFI platforms, searches for the RSDP using ACPI 1.0 GUID if the 2.0 GUID search fails. Signed-off-by: Lv Zheng <lv.zheng@intel.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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-06-03Merge branches 'acpi-tools' and 'pm-tools'Rafael J. Wysocki3-0/+262
* acpi-tools: ACPI / tools: Introduce ec_access.c - tool to access the EC * pm-tools: cpupower: Remove mc and smt power aware scheduler info/settings cpupower: cpupower info -b should return 0 on success, not the perf bias value cpupower: If root, try to load msr driver on x86 if /dev/cpu/0/msr is not available cpupower: Install recently added cpupower-idle-{set, info} manpages cpupower: Introduce idle state disable-by-latency and enable-all cpupower: Remove all manpages on make uninstall cpupower: Remove dead link to homepage, and update the targets built. cpupower: Rename cpufrequtils -> cpupower, and libcpufreq -> libcpupower. PM / tools: cpupower: add option to display values without round offs tools / power: turbostat: Drop temperature checks
2014-05-29ACPICA: acpidump: Fix repetitive table dump in -n mode.Lv Zheng1-0/+4
In "-n" mode, reserved tables (RSDP/RSDT/XSDT/DSDT/FACS) are dumped multiple times due a missing instance check in osl_get_bios_table(). This patch fixes this issue. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>