diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-28 01:52:05 +0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-28 01:52:05 +0400 |
commit | 7e1c1a82f505e79a85a822a377bd3369e676ac2d (patch) | |
tree | cdb9234e3f803d4c34c543a78c3711b26a292bfc /include/acpi/platform | |
parent | 92a18409ba03c1f810b831919596122c60586bc5 (diff) | |
parent | 417b4a73b62760db67512892c32f8acc008ab54e (diff) | |
download | linux-7e1c1a82f505e79a85a822a377bd3369e676ac2d.tar.xz |
Merge branch 'acpi-headers'
* 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.
Diffstat (limited to 'include/acpi/platform')
-rw-r--r-- | include/acpi/platform/aclinux.h | 12 | ||||
-rw-r--r-- | include/acpi/platform/aclinuxex.h | 22 |
2 files changed, 34 insertions, 0 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index cd1f052d55bb..1ba7c190c2cc 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -44,6 +44,16 @@ #ifndef __ACLINUX_H__ #define __ACLINUX_H__ +#ifdef __KERNEL__ + +/* ACPICA external files should not include ACPICA headers directly. */ + +#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H) +#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead." +#endif + +#endif + /* Common (in-kernel/user-space) ACPICA configuration */ #define ACPI_USE_SYSTEM_CLIBRARY @@ -70,7 +80,9 @@ #ifdef EXPORT_ACPI_INTERFACES #include <linux/export.h> #endif +#ifdef CONFIG_ACPI #include <asm/acenv.h> +#endif #ifndef CONFIG_ACPI diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h index 191e741cfa0e..568d4b886712 100644 --- a/include/acpi/platform/aclinuxex.h +++ b/include/acpi/platform/aclinuxex.h @@ -46,6 +46,28 @@ #ifdef __KERNEL__ +#ifndef ACPI_USE_NATIVE_DIVIDE + +#ifndef ACPI_DIV_64_BY_32 +#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ + do { \ + u64 (__n) = ((u64) n_hi) << 32 | (n_lo); \ + (r32) = do_div ((__n), (d32)); \ + (q32) = (u32) (__n); \ + } while (0) +#endif + +#ifndef ACPI_SHIFT_RIGHT_64 +#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ + do { \ + (n_lo) >>= 1; \ + (n_lo) |= (((n_hi) & 1) << 31); \ + (n_hi) >>= 1; \ + } while (0) +#endif + +#endif + /* * Overrides for in-kernel ACPICA */ |