aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/platform/aclinux.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/platform/aclinux.h')
-rw-r--r--include/acpi/platform/aclinux.h49
1 files changed, 36 insertions, 13 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 2e6d54569ee..47faf27913a 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -49,30 +49,27 @@
49 49
50#ifdef __KERNEL__ 50#ifdef __KERNEL__
51 51
52#include <linux/config.h>
53#include <linux/string.h> 52#include <linux/string.h>
54#include <linux/kernel.h> 53#include <linux/kernel.h>
54#include <linux/module.h>
55#include <linux/ctype.h> 55#include <linux/ctype.h>
56#include <asm/system.h> 56#include <asm/system.h>
57#include <asm/atomic.h> 57#include <asm/atomic.h>
58#include <asm/div64.h> 58#include <asm/div64.h>
59#include <asm/acpi.h> 59#include <asm/acpi.h>
60#include <linux/slab.h>
61#include <linux/spinlock_types.h>
62#include <asm/current.h>
60 63
61#define strtoul simple_strtoul 64/* Host-dependent types and defines */
62
63#define ACPI_MACHINE_WIDTH BITS_PER_LONG
64
65/* Type(s) for the OSL */
66 65
67#ifdef ACPI_USE_LOCAL_CACHE 66#define ACPI_MACHINE_WIDTH BITS_PER_LONG
68#define acpi_cache_t struct acpi_memory_list 67#define acpi_cache_t kmem_cache_t
69#else 68#define acpi_spinlock spinlock_t *
70#include <linux/slab.h> 69#define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol);
71#define acpi_cache_t kmem_cache_t 70#define strtoul simple_strtoul
72#endif
73 71
74/* Full namespace pathname length limit - arbitrary */ 72/* Full namespace pathname length limit - arbitrary */
75
76#define ACPI_PATHNAME_MAX 256 73#define ACPI_PATHNAME_MAX 256
77 74
78#else /* !__KERNEL__ */ 75#else /* !__KERNEL__ */
@@ -104,4 +101,30 @@
104 101
105#define acpi_cpu_flags unsigned long 102#define acpi_cpu_flags unsigned long
106 103
104#define acpi_thread_id struct task_struct *
105
106static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; }
107
108/*
109 * The irqs_disabled() check is for resume from RAM.
110 * Interrupts are off during resume, just like they are for boot.
111 * However, boot has (system_state != SYSTEM_RUNNING)
112 * to quiet __might_sleep() in kmalloc() and resume does not.
113 */
114#include <acpi/actypes.h>
115static inline void *acpi_os_allocate(acpi_size size) {
116 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
117}
118static inline void *acpi_os_allocate_zeroed(acpi_size size) {
119 return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
120}
121
122static inline void *acpi_os_acquire_object(acpi_cache_t * cache) {
123 return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
124}
125
126#define ACPI_ALLOCATE(a) acpi_os_allocate(a)
127#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
128#define ACPI_FREE(a) kfree(a)
129
107#endif /* __ACLINUX_H__ */ 130#endif /* __ACLINUX_H__ */