diff options
Diffstat (limited to 'include/acpi/platform/aclinux.h')
| -rw-r--r-- | include/acpi/platform/aclinux.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 277d35bced03..47faf27913a5 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
| @@ -58,11 +58,14 @@ | |||
| 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> | 60 | #include <linux/slab.h> |
| 61 | #include <linux/spinlock_types.h> | ||
| 62 | #include <asm/current.h> | ||
| 61 | 63 | ||
| 62 | /* Host-dependent types and defines */ | 64 | /* Host-dependent types and defines */ |
| 63 | 65 | ||
| 64 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG | 66 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG |
| 65 | #define acpi_cache_t kmem_cache_t | 67 | #define acpi_cache_t kmem_cache_t |
| 68 | #define acpi_spinlock spinlock_t * | ||
| 66 | #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); | 69 | #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); |
| 67 | #define strtoul simple_strtoul | 70 | #define strtoul simple_strtoul |
| 68 | 71 | ||
| @@ -98,8 +101,30 @@ | |||
| 98 | 101 | ||
| 99 | #define acpi_cpu_flags unsigned long | 102 | #define acpi_cpu_flags unsigned long |
| 100 | 103 | ||
| 101 | #define acpi_thread_id u32 | 104 | #define acpi_thread_id struct task_struct * |
| 102 | 105 | ||
| 103 | static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } | 106 | static 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> | ||
| 115 | static inline void *acpi_os_allocate(acpi_size size) { | ||
| 116 | return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); | ||
| 117 | } | ||
| 118 | static inline void *acpi_os_allocate_zeroed(acpi_size size) { | ||
| 119 | return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); | ||
| 120 | } | ||
| 121 | |||
| 122 | static 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) | ||
| 104 | 129 | ||
| 105 | #endif /* __ACLINUX_H__ */ | 130 | #endif /* __ACLINUX_H__ */ |
