summaryrefslogtreecommitdiffstats
path: root/source/include/platform
diff options
context:
space:
mode:
Diffstat (limited to 'source/include/platform')
-rw-r--r--source/include/platform/aclinux.h122
1 files changed, 76 insertions, 46 deletions
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
index b6a7e17..f56aff1 100644
--- a/source/include/platform/aclinux.h
+++ b/source/include/platform/aclinux.h
@@ -58,11 +58,13 @@
#include <linux/ctype.h>
#include <linux/sched.h>
#include <linux/atomic.h>
-#include <asm/div64.h>
-#include <asm/acpi.h>
+#include <linux/math64.h>
#include <linux/slab.h>
#include <linux/spinlock_types.h>
-#include <asm/current.h>
+#ifdef EXPORT_ACPI_INTERFACES
+#include <linux/export.h>
+#endif
+#include <asm/acpi.h>
/* Host-dependent types and defines for in-kernel ACPICA */
@@ -85,7 +87,7 @@
/* Host-dependent types and defines for user-space ACPICA */
#define ACPI_FLUSH_CPU_CACHE()
-#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
+#define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
#if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__)
#define ACPI_MACHINE_WIDTH 64
@@ -110,24 +112,31 @@
#ifdef __KERNEL__
+
+/*
+ * FIXME: Inclusion of actypes.h
+ * Linux kernel need this before defining inline OSL interfaces as
+ * actypes.h need to be included to find ACPICA type definitions.
+ * Since from ACPICA's perspective, the actypes.h should be included after
+ * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue.
+ */
#include <acpi/actypes.h>
+/*
+ * Overrides for in-kernel ACPICA
+ */
ACPI_STATUS __init AcpiOsInitialize (
void);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsInitialize
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
-ACPI_STATUS __exit AcpiOsTerminate (
+ACPI_STATUS AcpiOsTerminate (
void);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsTerminate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
/*
* Memory allocation/deallocation
*/
-/* Use native linux version of acpi_os_allocate_zeroed */
-
-#define USE_NATIVE_ALLOCATE_ZEROED
-
/*
* The irqs_disabled() check is for resume from RAM.
* Interrupts are off during resume, just like they are for boot.
@@ -140,7 +149,9 @@ AcpiOsAllocate (
{
return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
+
+/* Use native linux version of AcpiOsAllocateZeroed */
static inline void *
AcpiOsAllocateZeroed (
@@ -148,7 +159,8 @@ AcpiOsAllocateZeroed (
{
return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocateZeroed
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
+#define USE_NATIVE_ALLOCATE_ZEROED
static inline void
AcpiOsFree (
@@ -156,7 +168,7 @@ AcpiOsFree (
{
kfree (Memory);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsFree
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
static inline void *
AcpiOsAcquireObject (
@@ -165,20 +177,18 @@ AcpiOsAcquireObject (
return kmem_cache_zalloc (Cache,
irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsAcquireObject
+#define ACPI_USE_ALTERNATE_PROTOTYPE_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
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
#ifndef CONFIG_PREEMPT
+
/*
* Used within ACPICA to show where it is safe to preempt execution
* when CONFIG_PREEMPT=n
@@ -188,6 +198,7 @@ AcpiOsGetThreadId (
if (!irqs_disabled()) \
cond_resched(); \
} while (0)
+
#endif
/*
@@ -198,47 +209,66 @@ AcpiOsGetThreadId (
* 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 ACPI_USE_NATIVE_DECLARED_AcpiOsCreateLock
+ ({ \
+ spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
+ if (Lock) { \
+ *(__Handle) = Lock; \
+ spin_lock_init(*(__Handle)); \
+ } \
+ Lock ? AE_OK : AE_NO_MEMORY; \
+ })
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
void __iomem *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsMapMemory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
void
AcpiOsUnmapMemory (
void __iomem *LogicalAddress,
ACPI_SIZE Size);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsUnmapMemory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
+
+/*
+ * OSL interfaces used by debugger/disassembler
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
+
+/*
+ * OSL interfaces used by utilities
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
-/* OSL interfaces used by debugger/disassembler */
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsReadable
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsWritable
+/*
+ * OSL interfaces added by Linux
+ */
+void
+EarlyAcpiOsUnmapMemory (
+ void __iomem *Virt,
+ ACPI_SIZE Size);
-/* 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
+void
+AcpiOsGpeCount (
+ UINT32 GpeNumber);
-/* OSL interfaces added by Linux */
+void
+AcpiOsFixedEventCount (
+ UINT32 FixedEventNumber);
-#ifdef EXPORT_ACPI_INTERFACES
-#include <linux/export.h>
-#endif
+ACPI_STATUS
+AcpiOsHotplugExecute (
+ ACPI_OSD_EXEC_CALLBACK Function,
+ void *Context);
#endif /* __KERNEL__ */
OpenPOWER on IntegriCloud