kernel/acpi: Solve ACPI_DEBUG_{CACHE,LOCKS,MEMMAP} building better.
authorSascha Wildner <saw@online.de>
Sat, 28 Jun 2014 13:31:31 +0000 (15:31 +0200)
committerSascha Wildner <saw@online.de>
Sat, 28 Jun 2014 13:31:52 +0000 (15:31 +0200)
ACPICA 20140627 added a mechanism for having a platform dependent
header that is included _after_ ACPICA headers are included.

So we can now solve compilation with ACPI_DEBUG_{CACHE,LOCKS,MEMMAP}
by adding a new acdragonflyex.h header for the prototypes of the
debug flavors of AcpiOsReleaseObject(), AcpiOsAcquireLock(),
AcpiOsMapMemory() and AcpiOsUnmapMemory() instead of having to put
them into the vendor code (like I did in 3b92a84dc0def, which this
commit reverts).

sys/contrib/dev/acpica/source/include/acpiosxf.h
sys/contrib/dev/acpica/source/include/platform/acdragonflyex.h [copied from sys/contrib/dev/acpica/source/include/platform/acenvex.h with 73% similarity]
sys/contrib/dev/acpica/source/include/platform/acenvex.h

index a006759..3888b48 100644 (file)
@@ -150,14 +150,6 @@ AcpiOsAcquireLock (
     ACPI_SPINLOCK           Handle);
 #endif
 
-#ifdef ACPI_DEBUG_LOCKS
-ACPI_CPU_FLAGS
-_AcpiOsAcquireLock (
-    ACPI_SPINLOCK           Handle,
-    const char              *func,
-    int                     line);
-#endif
-
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock
 void
 AcpiOsReleaseLock (
@@ -268,21 +260,6 @@ AcpiOsUnmapMemory (
     ACPI_SIZE               Size);
 #endif
 
-#ifdef ACPI_DEBUG_MEMMAP
-void *
-_AcpiOsMapMemory (
-    ACPI_PHYSICAL_ADDRESS   Where,
-    ACPI_SIZE               Length,
-    const char              *caller,
-    int line);
-void
-_AcpiOsUnmapMemory (
-    void                    *LogicalAddress,
-    ACPI_SIZE               Length,
-    const char              *caller,
-    int                     line);
-#endif
-
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress
 ACPI_STATUS
 AcpiOsGetPhysicalAddress (
@@ -328,14 +305,6 @@ AcpiOsReleaseObject (
     void                    *Object);
 #endif
 
-#ifdef ACPI_DEBUG_CACHE
-ACPI_STATUS
-_AcpiOsReleaseObject (
-    ACPI_CACHE_T            *Cache,
-    void                    *Object,
-    const char              *func,
-    int                     line);
-#endif
 
 /*
  * Interrupt handlers
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: acenvex.h - Extra host and compiler configuration
+ * Name: acdragonflyex.h - Extra OS specific defines, etc. for DragonFly
  *
  *****************************************************************************/
 
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#ifndef __ACENVEX_H__
-#define __ACENVEX_H__
+#ifndef __ACDRAGONFLYEX_H__
+#define __ACDRAGONFLYEX_H__
 
-/*! [Begin] no source code translation */
+#ifdef _KERNEL
 
-/******************************************************************************
- *
- * Extra host configuration files. All ACPICA headers are included before
- * including these files.
- *
- *****************************************************************************/
+#ifdef ACPI_DEBUG_CACHE
+ACPI_STATUS
+_AcpiOsReleaseObject (
+    ACPI_CACHE_T               *Cache,
+    void                       *Object,
+    const char                 *func,
+    int                                line);
+#endif
+
+#ifdef ACPI_DEBUG_LOCKS
+ACPI_CPU_FLAGS
+_AcpiOsAcquireLock (
+    ACPI_SPINLOCK              Spin,
+    const char                 *func,
+    int                                line);
+#endif
 
-#if defined(_LINUX) || defined(__linux__)
-#include "aclinuxex.h"
+#ifdef ACPI_DEBUG_MEMMAP
+void *
+_AcpiOsMapMemory (
+    ACPI_PHYSICAL_ADDRESS      Where,
+    ACPI_SIZE                  Length,
+    const char                 *caller,
+    int                                line);
 
+void
+_AcpiOsUnmapMemory (
+    void                       *LogicalAddress,
+    ACPI_SIZE                  Length,
+    const char                 *caller,
+    int                                line);
 #endif
 
-/*! [End] no source code translation !*/
+#endif /* _KERNEL */
 
-#endif /* __ACENVEX_H__ */
+#endif /* __ACDRAGONFLYEX_H__ */
index a1de87f..f3ab5c0 100644 (file)
@@ -56,6 +56,9 @@
 #if defined(_LINUX) || defined(__linux__)
 #include "aclinuxex.h"
 
+#elif defined(__DragonFly__)
+#include "acdragonflyex.h"
+
 #endif
 
 /*! [End] no source code translation !*/