X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Facpi%2Fplatform%2Faclinux.h;h=7f1e92930b6258b75e931daac2e25f657441dd27;hb=refs%2Fheads%2Fvserver;hp=82db061afdaa97751f78f3717450794909aa799a;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 82db061af..7f1e92930 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,27 +44,35 @@ #ifndef __ACLINUX_H__ #define __ACLINUX_H__ -#define ACPI_OS_NAME "Linux" - #define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 #ifdef __KERNEL__ -#include #include #include +#include #include #include #include #include #include +#include +#include +#include + +/* Host-dependent types and defines */ -#define strtoul simple_strtoul +#define ACPI_MACHINE_WIDTH BITS_PER_LONG +#define acpi_cache_t struct kmem_cache +#define acpi_spinlock spinlock_t * +#define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); +#define strtoul simple_strtoul -#define ACPI_MACHINE_WIDTH BITS_PER_LONG +/* Full namespace pathname length limit - arbitrary */ +#define ACPI_PATHNAME_MAX 256 -#else /* !__KERNEL__ */ +#else /* !__KERNEL__ */ #include #include @@ -83,10 +91,40 @@ #define ACPI_USE_NATIVE_DIVIDE #endif -#endif /* __KERNEL__ */ +#define __cdecl +#define ACPI_FLUSH_CPU_CACHE() +#endif /* __KERNEL__ */ /* Linux uses GCC */ #include "acgcc.h" -#endif /* __ACLINUX_H__ */ +#define acpi_cpu_flags unsigned long + +#define acpi_thread_id struct task_struct * + +static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; } + +/* + * The irqs_disabled() check is for resume from RAM. + * Interrupts are off during resume, just like they are for boot. + * However, boot has (system_state != SYSTEM_RUNNING) + * to quiet __might_sleep() in kmalloc() and resume does not. + */ +#include +static inline void *acpi_os_allocate(acpi_size size) { + return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +} +static inline void *acpi_os_allocate_zeroed(acpi_size size) { + return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +} + +static inline void *acpi_os_acquire_object(acpi_cache_t * cache) { + return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); +} + +#define ACPI_ALLOCATE(a) acpi_os_allocate(a) +#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) +#define ACPI_FREE(a) kfree(a) + +#endif /* __ACLINUX_H__ */