aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/platform/aclinuxex.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-10-22ACPI: Enable build of AML interpreter debuggerLv Zheng1-0/+5
This patch enables ACPICA debugger files using a configurable CONFIG_ACPI_DEBUGGER configuration item. Those debugger related code that was originally masked as ACPI_FUTURE_USAGE now gets unmasked. Necessary OSL stubs are also added in this patch: 1. acpi_os_readable(): This should be arch specific in Linux, while this patch doesn't introduce real implementation and a complex mechanism to allow architecture specific acpi_os_readable() to be implemented to validate the address. It may be done by future commits. 2. acpi_os_get_line(): This is used to obtain debugger command input. This patch only introduces a simple KDB concept example in it and the example should be co-working with the code implemented in acpi_os_printf(). Since this KDB example won't be compiled unless ENABLE_DEBUGGER is defined and it seems Linux has already stopped to use ENABLE_DEBUGGER, thus do not expect it can work properly. This patch also cleans up all other ACPI_FUTURE_USAGE surroundings accordingly. 1. Since linkage error can be automatically detected, declaration in the headers needn't be surrounded by ACPI_FUTURE_USAGE. So only the following separate exported fuction bodies are masked by this macro (other exported fucntions may have already been masked at entire module level via drivers/acpi/acpica/Makefile): acpi_install_exception_handler() acpi_subsystem_status() acpi_get_system_info() acpi_get_statistics() acpi_install_initialization_handler() 2. Since strip can automatically zap the no-user functions, functions that are not marked with ACPI_EXPORT_SYMBOL() needn't get surrounded by ACPI_FUTURE_USAGE. So the following function which is not used by Linux kernel now won't get surrounded by this macro: acpi_ps_get_name() Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-02-05ACPICA: Update Copyright headers to 2015David E. Box1-1/+1
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-07-23ACPICA: Linux: Add stub implementation of ACPICA 64-bit mathematics.Lv Zheng1-0/+22
This patch adds default 64-bit mathematics in aclinux.h using do_div(). As do_div() can be used for all Linux architectures, this can also be used as stub macros for ACPICA 64-bit mathematics. These macros are required by drivers/acpi/utmath.c when ACPI_USE_NATIVE_DIVIDE is not defined. It is used by ACPICA, so currently this is only meaningful to CONFIG_ACPI builds. So the kernel will not use these macros unless CONFIG_ACPI is defined and ACPI_USE_DIVIDE is not defined. For 64-bit kernels: In include/acpi/actypes.h, for ACPI_MACHINE_WIDTH=64, ACPI_USE_NATIVE_DIVIDE will be defined, thus these macros are not used. In include/acpi/platform/aclinux.h, for __KERNEL__ surrounded code, ACPI_MACHINE_WIDTH is defined to be BITS_PER_LONG. So all 64-bit kernels do not use these macros. For 32-bit kernels: As mentioned above, these macros will be used when BITS_PER_LONG is 32. Thus currently the i328 kernels are the only users for these macros. But they won't use this default implementation provided by this patch, because in arch/x86/include/asm/acenv.h, there are already overrides implemented. So these default macros are not used by 32-bit x86 (i386) kernels. These macros will only be used by future non x86 32-bit architectures that try to support ACPI in Linux kernel. During the period they do not have arch specific implementations of such macros, we can avoid build errors for them. And since they can see ACPICA functioning without implementing any arch specific environment tunings, we can also avoid function errors for them. As this implementation is not performance friendly, those architectures still need to implement real support in the end. Signed-off-by: Lv Zheng <lv.zheng@intel.com> [rjw: Changelog] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-05-27ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem.Lv Zheng1-4/+0
ACPICA doesn't include protections around address space checking, Linux build tests always complain increased sparse warnings around ACPICA internal acpi_os_map/unmap_memory() invocations. This patch tries to fix this issue permanently. There are 2 choices left for us to solve this issue: 1. Add __iomem address space awareness into ACPICA. 2. Remove sparse checker of __iomem from ACPICA source code. This patch chooses solution 2, because: 1. Most of the acpi_os_map/unmap_memory() invocations are used for ACPICA. table mappings, which in fact are not IO addresses. 2. The only IO addresses usage is for "system memory space" mapping code in: drivers/acpi/acpica/exregion.c drivers/acpi/acpica/evrgnini.c drivers/acpi/acpica/exregion.c The mapped address is accessed in the handler of "system memory space" - acpi_ex_system_memory_space_handler(). This function in fact can be changed to invoke acpi_os_read/write_memory() so that __iomem can always be type-casted in the OSL layer. According to the above investigation, we drew the following conclusion: It is not a good idea to introduce __iomem address space awareness into ACPICA mostly in order to protect non-IO addresses. We can simply remove __iomem for acpi_os_map/unmap_memory() to remove __iomem checker for ACPICA code. Then we need to enforce external usages to invoke other APIs that are aware of __iomem address space. The external usages are: drivers/acpi/apei/einj.c drivers/acpi/acpi_extlog.c drivers/char/tpm/tpm_acpi.c drivers/acpi/nvs.c This patch thus performs cleanups in this way: 1. Add acpi_os_map/unmap_iomem() to be invoked by non-ACPICA code. 2. Remove __iomem from acpi_os_map/unmap_memory(). Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-05-27ACPICA: Linux headers: Add <acpi/platform/aclinuxex.h>Lv Zheng1-0/+116
From ACPICA's perspective, <acpi/actypes.h> should be included after inclusion of <acpi/platform/acenv.h>. But currently in Linux, <acpi/platform/aclinux.h> included by <acpi/platform/acenv.h> has included <acpi/actypes.h> to find ACPICA types for inline functions. This causes the following problem: 1. Redundant code in <asm/acpi.h> and <acpi/platform/aclinux.h>: Linux must be careful to keep conditions for <acpi/actypes.h> inclusion consistent with the conditions for <acpi/platform/aclinux.h> inclusion. Which finally leads to the issue that we have to keep many useless macro definitions in <acpi/platform/aclinux.h> or <asm/acpi.h>. Such conditions include: COMPILER_DEPENDENT_UINT64 COMPILER_DEPENDENT_INT64 ACPI_INLINE ACPI_SYSTEM_XFACE ACPI_EXTERNAL_XFACE ACPI_INTERNAL_XFACE ACPI_INTERNAL_VAR_XFACE ACPI_MUTEX_TYPE DEBUGGER_THREADING ACPI_ACQUIRE_GLOBAL_LOCK ACPI_RELEASE_GLOBAL_LOCK ACPI_FLUSH_CPU_CACHE They have default implementations in <include/acpi/platform/acenv.h> while Linux need to keep a copy in <asm/acpi.h> to avoid build errors. This patch introduces <acpi/platform/aclinuxex.h> to fix this issue by splitting conditions and declarations (most of them are inline functions) into 2 header files so that the wrong inclusion of <acpi/actypes.h> can be removed from <acpi/platform/aclinux.h>. This patch also removes old ACPI_NATIVE_INTERFACE_HEADER mechanism which is not preferred by Linux and adds the platform/acenvex.h to be the solution to solve this issue. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>