summaryrefslogtreecommitdiff
path: root/source/include/platform/aclinux.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/include/platform/aclinux.h')
-rw-r--r--source/include/platform/aclinux.h113
1 files changed, 89 insertions, 24 deletions
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
index edd45567e0f6..b6a7e1791f38 100644
--- a/source/include/platform/aclinux.h
+++ b/source/include/platform/aclinux.h
@@ -111,13 +111,22 @@
#ifdef __KERNEL__
#include <acpi/actypes.h>
+
+ACPI_STATUS __init AcpiOsInitialize (
+ void);
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsInitialize
+
+ACPI_STATUS __exit AcpiOsTerminate (
+ void);
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsTerminate
+
/*
- * Overrides for in-kernel ACPICA
+ * Memory allocation/deallocation
*/
-static inline acpi_thread_id acpi_os_get_thread_id(void)
-{
- return (ACPI_THREAD_ID) (unsigned long) current;
-}
+
+/* Use native linux version of acpi_os_allocate_zeroed */
+
+#define USE_NATIVE_ALLOCATE_ZEROED
/*
* The irqs_disabled() check is for resume from RAM.
@@ -125,25 +134,49 @@ 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.
*/
-static inline void *acpi_os_allocate(acpi_size size)
+static inline void *
+AcpiOsAllocate (
+ ACPI_SIZE Size)
{
- return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
+ return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocate
-static inline void *acpi_os_allocate_zeroed(acpi_size size)
+static inline void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE Size)
{
- return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
+ return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocateZeroed
-static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
+static inline void
+AcpiOsFree (
+ void *Memory)
{
- return kmem_cache_zalloc(cache,
- irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
+ kfree (Memory);
}
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsFree
-#define ACPI_ALLOCATE(a) acpi_os_allocate(a)
-#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
-#define ACPI_FREE(a) kfree(a)
+static inline void *
+AcpiOsAcquireObject (
+ ACPI_CACHE_T *Cache)
+{
+ return kmem_cache_zalloc (Cache,
+ irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
+}
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsAcquireObject
+
+/*
+ * Overrides for in-kernel ACPICA
+ */
+static inline ACPI_THREAD_ID
+AcpiOsGetThreadId (
+ void)
+{
+ return (ACPI_THREAD_ID) (unsigned long) current;
+}
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetThreadId
#ifndef CONFIG_PREEMPT
/*
@@ -164,16 +197,48 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
* all locks to the name of the argument of acpi_os_create_lock(), which
* prevents lockdep from reporting false positives for ACPICA locks.
*/
-#define AcpiOsCreateLock(__handle) \
-({ \
- spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
- \
- if (lock) { \
- *(__handle) = lock; \
- spin_lock_init(*(__handle)); \
- } \
- lock ? AE_OK : AE_NO_MEMORY; \
+#define AcpiOsCreateLock(__Handle) \
+({ \
+ spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
+ if (Lock) { \
+ *(__Handle) = Lock; \
+ spin_lock_init(*(__Handle)); \
+ } \
+ Lock ? AE_OK : AE_NO_MEMORY; \
})
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsCreateLock
+
+void __iomem *
+AcpiOsMapMemory (
+ ACPI_PHYSICAL_ADDRESS Where,
+ ACPI_SIZE Length);
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsMapMemory
+
+void
+AcpiOsUnmapMemory (
+ void __iomem *LogicalAddress,
+ ACPI_SIZE Size);
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsUnmapMemory
+
+/* OSL interfaces used by debugger/disassembler */
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsReadable
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsWritable
+
+/* OSL interfaces used by utilities */
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsRedirectOutput
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetLine
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByName
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByIndex
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByAddress
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsOpenDirectory
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetNextFilename
+#define ACPI_USE_NATIVE_DECLARED_AcpiOsCloseDirectory
+
+/* OSL interfaces added by Linux */
+
+#ifdef EXPORT_ACPI_INTERFACES
+#include <linux/export.h>
+#endif
#endif /* __KERNEL__ */