Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi/acpica/Subsystem * #if 0 ACPI_DISABLE_IRQS() an...



details:   https://anonhg.NetBSD.org/src/rev/956388700c9f
branches:  trunk
changeset: 532822:956388700c9f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jun 15 18:59:03 2002 +0000

description:
* #if 0 ACPI_DISABLE_IRQS() and ACPI_ENABLE_IRQS(); they're not used.
* Fill in ACPI_ACQUIRE_GLOBAL_LOCK() and ACPI_RELEASE_GLOBAL_LOCK()
  (copied from FreeBSD just to get it working -- room for improvement,
  here).

diffstat:

 sys/dev/acpi/acpica/Subsystem/acnetbsd.h |  40 ++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r 6c6660ed6b70 -r 956388700c9f sys/dev/acpi/acpica/Subsystem/acnetbsd.h
--- a/sys/dev/acpi/acpica/Subsystem/acnetbsd.h  Sat Jun 15 18:27:20 2002 +0000
+++ b/sys/dev/acpi/acpica/Subsystem/acnetbsd.h  Sat Jun 15 18:59:03 2002 +0000
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acnetbsd.h - OS specific defines, etc.
- *       $Revision: 1.2 $
+ *       $Revision: 1.3 $
  *
  *****************************************************************************/
 
@@ -162,12 +162,44 @@
 #ifdef __i386__
 #include <machine/cpufunc.h>
 
+#if 0
 #define        ACPI_DISABLE_IRQS()             disable_intr()
 #define        ACPI_ENABLE_IRQS()              enable_intr()
+#endif
 
-/* XXX */
-#define        ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)
-#define        ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)
+#define        ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
+do { \
+       int dummy; \
+       __asm __volatile( \
+       "1:     movl (%1),%%eax         ;" \
+       "       movl %%eax,%%edx        ;" \
+       "       andl %2,%%edx           ;" \
+       "       btsl $0x1,%%edx         ;" \
+       "       adcl $0x0,%%edx         ;" \
+       "       lock                    ;" \
+       "       cmpxchgl %%edx,(%1)     ;" \
+       "       jnz 1b                  ;" \
+       "       cmpb $0x3,%%dl          ;" \
+       "       sbbl %%eax,%%eax        " \
+       : "=a" (Acq), "=c" (dummy) \
+       : "c" (GLptr), "i" (~1L) \
+       : "dx"); \
+} while (0)
+
+#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
+do { \
+       int dummy; \
+       __asm __volatile( \
+       "1:     movl (%1),%%eax         ;" \
+       "       andl %2,%%edx           ;" \
+       "       lock                    ;" \
+       "       cmpxchgl %%edx,(%1)     ;" \
+       "       jnz 1b                  ;" \
+       "       andl $0x1,%%eax         ;" \
+       : "=a" (Acq), "=c" (dummy) \
+       : "c" (GLptr), "i" (~3L) \
+       : "dx"); \
+} while (0)
 
 #define        ACPI_FLUSH_CPU_CACHE()          wbinvd()
 #endif /* __i386__ */



Home | Main Index | Thread Index | Old Index