Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/include Add a new include file with some ACPI ...
details: https://anonhg.NetBSD.org/src/rev/17fbf54f10dc
branches: trunk
changeset: 547042:17fbf54f10dc
user: fvdl <fvdl%NetBSD.org@localhost>
date: Sun May 11 21:05:19 2003 +0000
description:
Add a new include file with some ACPI MD macros, to move i386 specific
stuff out of acnetbsd.h
diffstat:
sys/arch/i386/include/acpi_func.h | 44 +++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diffs (48 lines):
diff -r 637c3efdce20 -r 17fbf54f10dc sys/arch/i386/include/acpi_func.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/include/acpi_func.h Sun May 11 21:05:19 2003 +0000
@@ -0,0 +1,44 @@
+/* $NetBSD: acpi_func.h,v 1.1 2003/05/11 21:05:19 fvdl Exp $ */
+
+#include <machine/cpufunc.h>
+
+#if 0
+#define ACPI_DISABLE_IRQS() disable_intr()
+#define ACPI_ENABLE_IRQS() enable_intr()
+#endif
+
+#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()
Home |
Main Index |
Thread Index |
Old Index