diff options
author | Robert Moore <Robert.Moore@intel.com> | 2012-10-17 11:39:19 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2012-10-17 11:39:19 -0700 |
commit | 3938951e5584fd8f9b376c4f9345157755910aca (patch) | |
tree | bb6e9a14b263ca8ceacde5190afa80fb69ce3151 | |
parent | 8e7a8753827660c3dd1f571f3185610402b756f0 (diff) | |
download | acpica-3938951e5584fd8f9b376c4f9345157755910aca.tar.gz |
Divergence: Backport linux version of aclinux.h to ACPICA.
Backport changes made in Linux aclinux.h back to ACPICA to reduce divergence
of the ACPICA base code from Linux.
Following commits are involved:
1. Lin Ming <ming.m.lin@intel.com>
ACPICA: Make acpi_thread_id no longer configurable, always u64
2. Thomas Gleixner <tglx@linutronix.de>
acpi: fix bogus preemption logic
https://bugzilla.kernel.org/show_bug.cgi?id=16210
3. Arun Sharma <asharma@fb.com>
atomic: use <linux/atomic.h>
This will decrease 71 lines of 20120913 divergence.diff.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arun Sharma <asharma@fb.com>
-rw-r--r-- | source/include/platform/aclinux.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h index 4df044969..08009d6e8 100644 --- a/source/include/platform/aclinux.h +++ b/source/include/platform/aclinux.h @@ -127,11 +127,9 @@ #include <linux/string.h> #include <linux/kernel.h> -#include <linux/module.h> #include <linux/ctype.h> #include <linux/sched.h> -#include <asm/system.h> -#include <asm/atomic.h> +#include <linux/atomic.h> #include <asm/div64.h> #include <asm/acpi.h> #include <linux/slab.h> @@ -159,18 +157,17 @@ /* Host-dependent types and defines for user-space ACPICA */ #define ACPI_FLUSH_CPU_CACHE() +#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) #if defined(__ia64__) || defined(__x86_64__) #define ACPI_MACHINE_WIDTH 64 #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) #else #define ACPI_MACHINE_WIDTH 32 #define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_UINT64 unsigned long long #define ACPI_USE_NATIVE_DIVIDE -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread)) #endif #ifndef __cdecl @@ -185,12 +182,13 @@ #ifdef __KERNEL__ +#include <acpi/actypes.h> /* * Overrides for in-kernel ACPICA */ static inline acpi_thread_id acpi_os_get_thread_id(void) { - return current; + return (ACPI_THREAD_ID) (unsigned long) current; } /* @@ -199,7 +197,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) * However, boot has (system_state != SYSTEM_RUNNING) * to quiet __might_sleep() in kmalloc() and resume does not. */ -#include <acpi/actypes.h> static inline void *acpi_os_allocate(acpi_size size) { return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); @@ -220,13 +217,17 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) #define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) #define ACPI_FREE(a) kfree(a) -/* Used within ACPICA to show where it is safe to preempt execution */ - +#ifndef CONFIG_PREEMPT +/* + * Used within ACPICA to show where it is safe to preempt execution + * when CONFIG_PREEMPT=n + */ #define ACPI_PREEMPTION_POINT() \ do { \ if (!irqs_disabled()) \ cond_resched(); \ } while (0) +#endif #endif /* __KERNEL__ */ |