diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-27 17:52:05 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-27 17:52:05 -0400 |
| commit | 7e1c1a82f505e79a85a822a377bd3369e676ac2d (patch) | |
| tree | cdb9234e3f803d4c34c543a78c3711b26a292bfc | |
| parent | 92a18409ba03c1f810b831919596122c60586bc5 (diff) | |
| parent | 417b4a73b62760db67512892c32f8acc008ab54e (diff) | |
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.
| -rw-r--r-- | arch/ia64/include/asm/acenv.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/acenv.h | 4 | ||||
| -rw-r--r-- | drivers/acpi/acpica/Makefile | 2 | ||||
| -rw-r--r-- | drivers/acpi/bus.c | 3 | ||||
| -rw-r--r-- | include/acpi/acpixf.h | 28 | ||||
| -rw-r--r-- | include/acpi/platform/aclinux.h | 12 | ||||
| -rw-r--r-- | include/acpi/platform/aclinuxex.h | 22 | ||||
| -rw-r--r-- | include/linux/acpi.h | 6 | ||||
| -rw-r--r-- | include/linux/sfi_acpi.h | 3 |
9 files changed, 55 insertions, 29 deletions
diff --git a/arch/ia64/include/asm/acenv.h b/arch/ia64/include/asm/acenv.h index 3f9eaeec9873..35ff13afbf34 100644 --- a/arch/ia64/include/asm/acenv.h +++ b/arch/ia64/include/asm/acenv.h | |||
| @@ -19,8 +19,6 @@ | |||
| 19 | 19 | ||
| 20 | /* Asm macros */ | 20 | /* Asm macros */ |
| 21 | 21 | ||
| 22 | #ifdef CONFIG_ACPI | ||
| 23 | |||
| 24 | static inline int | 22 | static inline int |
| 25 | ia64_acpi_acquire_global_lock(unsigned int *lock) | 23 | ia64_acpi_acquire_global_lock(unsigned int *lock) |
| 26 | { | 24 | { |
| @@ -51,6 +49,4 @@ ia64_acpi_release_global_lock(unsigned int *lock) | |||
| 51 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ | 49 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ |
| 52 | ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) | 50 | ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) |
| 53 | 51 | ||
| 54 | #endif | ||
| 55 | |||
| 56 | #endif /* _ASM_IA64_ACENV_H */ | 52 | #endif /* _ASM_IA64_ACENV_H */ |
diff --git a/arch/x86/include/asm/acenv.h b/arch/x86/include/asm/acenv.h index 66873297e9f5..1b010a859b8b 100644 --- a/arch/x86/include/asm/acenv.h +++ b/arch/x86/include/asm/acenv.h | |||
| @@ -18,8 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | #define ACPI_FLUSH_CPU_CACHE() wbinvd() | 19 | #define ACPI_FLUSH_CPU_CACHE() wbinvd() |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_ACPI | ||
| 22 | |||
| 23 | int __acpi_acquire_global_lock(unsigned int *lock); | 21 | int __acpi_acquire_global_lock(unsigned int *lock); |
| 24 | int __acpi_release_global_lock(unsigned int *lock); | 22 | int __acpi_release_global_lock(unsigned int *lock); |
| 25 | 23 | ||
| @@ -44,6 +42,4 @@ int __acpi_release_global_lock(unsigned int *lock); | |||
| 44 | : "=r"(n_hi), "=r"(n_lo) \ | 42 | : "=r"(n_hi), "=r"(n_lo) \ |
| 45 | : "0"(n_hi), "1"(n_lo)) | 43 | : "0"(n_hi), "1"(n_lo)) |
| 46 | 44 | ||
| 47 | #endif | ||
| 48 | |||
| 49 | #endif /* _ASM_X86_ACENV_H */ | 45 | #endif /* _ASM_X86_ACENV_H */ |
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index 6b9ec239d578..4be4cc94572d 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Makefile for ACPICA Core interpreter | 2 | # Makefile for ACPICA Core interpreter |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | ccflags-y := -Os | 5 | ccflags-y := -Os -DBUILDING_ACPICA |
| 6 | ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT | 6 | ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT |
| 7 | 7 | ||
| 8 | # use acpi.o to put all files here into acpi.o modparam namespace | 8 | # use acpi.o to put all files here into acpi.o modparam namespace |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index c5bc8cfe09fa..8581f5b84f48 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -477,9 +477,6 @@ static int __init acpi_bus_init_irq(void) | |||
| 477 | return 0; | 477 | return 0; |
| 478 | } | 478 | } |
| 479 | 479 | ||
| 480 | u8 acpi_gbl_permanent_mmap; | ||
| 481 | |||
| 482 | |||
| 483 | void __init acpi_early_init(void) | 480 | void __init acpi_early_init(void) |
| 484 | { | 481 | { |
| 485 | acpi_status status; | 482 | acpi_status status; |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 508e5649dda9..c3f38bc459e1 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
| @@ -53,8 +53,6 @@ | |||
| 53 | #include <acpi/actbl.h> | 53 | #include <acpi/actbl.h> |
| 54 | #include <acpi/acbuffer.h> | 54 | #include <acpi/acbuffer.h> |
| 55 | 55 | ||
| 56 | extern u8 acpi_gbl_permanent_mmap; | ||
| 57 | |||
| 58 | /***************************************************************************** | 56 | /***************************************************************************** |
| 59 | * | 57 | * |
| 60 | * Macros used for ACPICA globals and configuration | 58 | * Macros used for ACPICA globals and configuration |
| @@ -889,17 +887,25 @@ ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) | |||
| 889 | /* | 887 | /* |
| 890 | * Divergences | 888 | * Divergences |
| 891 | */ | 889 | */ |
| 892 | acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); | 890 | ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap); |
| 891 | |||
| 892 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
| 893 | acpi_get_id(acpi_handle object, | ||
| 894 | acpi_owner_id * out_type)) | ||
| 893 | 895 | ||
| 894 | acpi_status acpi_unload_table_id(acpi_owner_id id); | 896 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id)) |
| 895 | 897 | ||
| 896 | acpi_status | 898 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 897 | acpi_get_table_with_size(acpi_string signature, | 899 | acpi_get_table_with_size(acpi_string signature, |
| 898 | u32 instance, struct acpi_table_header **out_table, | 900 | u32 instance, |
| 899 | acpi_size *tbl_size); | 901 | struct acpi_table_header |
| 902 | **out_table, | ||
| 903 | acpi_size *tbl_size)) | ||
| 900 | 904 | ||
| 901 | acpi_status | 905 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 902 | acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data, | 906 | acpi_get_data_full(acpi_handle object, |
| 903 | void (*callback)(void *)); | 907 | acpi_object_handler handler, |
| 908 | void **data, | ||
| 909 | void (*callback)(void *))) | ||
| 904 | 910 | ||
| 905 | #endif /* __ACXFACE_H__ */ | 911 | #endif /* __ACXFACE_H__ */ |
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 @@ | |||
| 44 | #ifndef __ACLINUX_H__ | 44 | #ifndef __ACLINUX_H__ |
| 45 | #define __ACLINUX_H__ | 45 | #define __ACLINUX_H__ |
| 46 | 46 | ||
| 47 | #ifdef __KERNEL__ | ||
| 48 | |||
| 49 | /* ACPICA external files should not include ACPICA headers directly. */ | ||
| 50 | |||
| 51 | #if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H) | ||
| 52 | #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead." | ||
| 53 | #endif | ||
| 54 | |||
| 55 | #endif | ||
| 56 | |||
| 47 | /* Common (in-kernel/user-space) ACPICA configuration */ | 57 | /* Common (in-kernel/user-space) ACPICA configuration */ |
| 48 | 58 | ||
| 49 | #define ACPI_USE_SYSTEM_CLIBRARY | 59 | #define ACPI_USE_SYSTEM_CLIBRARY |
| @@ -70,7 +80,9 @@ | |||
| 70 | #ifdef EXPORT_ACPI_INTERFACES | 80 | #ifdef EXPORT_ACPI_INTERFACES |
| 71 | #include <linux/export.h> | 81 | #include <linux/export.h> |
| 72 | #endif | 82 | #endif |
| 83 | #ifdef CONFIG_ACPI | ||
| 73 | #include <asm/acenv.h> | 84 | #include <asm/acenv.h> |
| 85 | #endif | ||
| 74 | 86 | ||
| 75 | #ifndef CONFIG_ACPI | 87 | #ifndef CONFIG_ACPI |
| 76 | 88 | ||
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 @@ | |||
| 46 | 46 | ||
| 47 | #ifdef __KERNEL__ | 47 | #ifdef __KERNEL__ |
| 48 | 48 | ||
| 49 | #ifndef ACPI_USE_NATIVE_DIVIDE | ||
| 50 | |||
| 51 | #ifndef ACPI_DIV_64_BY_32 | ||
| 52 | #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ | ||
| 53 | do { \ | ||
| 54 | u64 (__n) = ((u64) n_hi) << 32 | (n_lo); \ | ||
| 55 | (r32) = do_div ((__n), (d32)); \ | ||
| 56 | (q32) = (u32) (__n); \ | ||
| 57 | } while (0) | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #ifndef ACPI_SHIFT_RIGHT_64 | ||
| 61 | #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ | ||
| 62 | do { \ | ||
| 63 | (n_lo) >>= 1; \ | ||
| 64 | (n_lo) |= (((n_hi) & 1) << 31); \ | ||
| 65 | (n_hi) >>= 1; \ | ||
| 66 | } while (0) | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #endif | ||
| 70 | |||
| 49 | /* | 71 | /* |
| 50 | * Overrides for in-kernel ACPICA | 72 | * Overrides for in-kernel ACPICA |
| 51 | */ | 73 | */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 358c01b971db..5320153c311b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -29,17 +29,17 @@ | |||
| 29 | #include <linux/ioport.h> /* for struct resource */ | 29 | #include <linux/ioport.h> /* for struct resource */ |
| 30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 31 | 31 | ||
| 32 | #ifdef CONFIG_ACPI | ||
| 33 | |||
| 34 | #ifndef _LINUX | 32 | #ifndef _LINUX |
| 35 | #define _LINUX | 33 | #define _LINUX |
| 36 | #endif | 34 | #endif |
| 35 | #include <acpi/acpi.h> | ||
| 36 | |||
| 37 | #ifdef CONFIG_ACPI | ||
| 37 | 38 | ||
| 38 | #include <linux/list.h> | 39 | #include <linux/list.h> |
| 39 | #include <linux/mod_devicetable.h> | 40 | #include <linux/mod_devicetable.h> |
| 40 | #include <linux/dynamic_debug.h> | 41 | #include <linux/dynamic_debug.h> |
| 41 | 42 | ||
| 42 | #include <acpi/acpi.h> | ||
| 43 | #include <acpi/acpi_bus.h> | 43 | #include <acpi/acpi_bus.h> |
| 44 | #include <acpi/acpi_drivers.h> | 44 | #include <acpi/acpi_drivers.h> |
| 45 | #include <acpi/acpi_numa.h> | 45 | #include <acpi/acpi_numa.h> |
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h index 4723bbfa1c26..a6e555cbe05c 100644 --- a/include/linux/sfi_acpi.h +++ b/include/linux/sfi_acpi.h | |||
| @@ -63,8 +63,6 @@ | |||
| 63 | #include <linux/sfi.h> | 63 | #include <linux/sfi.h> |
| 64 | 64 | ||
| 65 | #ifdef CONFIG_SFI | 65 | #ifdef CONFIG_SFI |
| 66 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ | ||
| 67 | |||
| 68 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, | 66 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, |
| 69 | char *oem_table_id, | 67 | char *oem_table_id, |
| 70 | int (*handler)(struct acpi_table_header *)); | 68 | int (*handler)(struct acpi_table_header *)); |
| @@ -78,7 +76,6 @@ static inline int __init acpi_sfi_table_parse(char *signature, | |||
| 78 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); | 76 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); |
| 79 | } | 77 | } |
| 80 | #else /* !CONFIG_SFI */ | 78 | #else /* !CONFIG_SFI */ |
| 81 | |||
| 82 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, | 79 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, |
| 83 | char *oem_table_id, | 80 | char *oem_table_id, |
| 84 | int (*handler)(struct acpi_table_header *)) | 81 | int (*handler)(struct acpi_table_header *)) |
