summaryrefslogtreecommitdiffstats
path: root/sys/dev/cy
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-02-11 10:44:09 +0000
committermarkm <markm@FreeBSD.org>2001-02-11 10:44:09 +0000
commit4e9c36b3003ffcfb812ef0bea8d7504d6a422c13 (patch)
tree3590416bf784163b3ca3a8bc2452bde5c704d0ad /sys/dev/cy
parent0f9088da5625e8088bdbd7b3587fdadb265b1482 (diff)
downloadFreeBSD-src-4e9c36b3003ffcfb812ef0bea8d7504d6a422c13.zip
FreeBSD-src-4e9c36b3003ffcfb812ef0bea8d7504d6a422c13.tar.gz
RIP <machine/lock.h>.
Some things needed bits of <i386/include/lock.h> - cy.c now has its own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK() has been moved to <i386/include/apic.h> (AKA <machine/apic.h>). Reviewed by: jhb
Diffstat (limited to 'sys/dev/cy')
-rw-r--r--sys/dev/cy/cy.c22
-rw-r--r--sys/dev/cy/cy_isa.c22
2 files changed, 42 insertions, 2 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 374b932..9a56e2d 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -80,7 +80,6 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/syslog.h>
-#include <machine/lock.h>
#include <machine/psl.h>
#include <i386/isa/isa_device.h>
@@ -91,6 +90,27 @@
#error "The cy device requires the old isa compatibility shims"
#endif
+#ifdef SMP
+
+#include <machine/smptests.h> /** xxx_LOCK */
+
+#ifdef USE_COMLOCK
+#define COM_LOCK() mtx_lock_spin(&com_mtx)
+#define COM_UNLOCK() mtx_unlock_spin(&com_mtx)
+#else
+#define COM_LOCK()
+#define COM_UNLOCK()
+#endif /* USE_COMLOCK */
+
+#else /* SMP */
+
+#define COM_LOCK()
+#define COM_UNLOCK()
+
+#endif /* SMP */
+
+extern struct mtx com_mtx;
+
/*
* Dictionary so that I can name everything *sio* or *com* to compare with
* sio.c. There is also lots of ugly formatting and unnecessary ifdefs to
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 374b932..9a56e2d 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -80,7 +80,6 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/syslog.h>
-#include <machine/lock.h>
#include <machine/psl.h>
#include <i386/isa/isa_device.h>
@@ -91,6 +90,27 @@
#error "The cy device requires the old isa compatibility shims"
#endif
+#ifdef SMP
+
+#include <machine/smptests.h> /** xxx_LOCK */
+
+#ifdef USE_COMLOCK
+#define COM_LOCK() mtx_lock_spin(&com_mtx)
+#define COM_UNLOCK() mtx_unlock_spin(&com_mtx)
+#else
+#define COM_LOCK()
+#define COM_UNLOCK()
+#endif /* USE_COMLOCK */
+
+#else /* SMP */
+
+#define COM_LOCK()
+#define COM_UNLOCK()
+
+#endif /* SMP */
+
+extern struct mtx com_mtx;
+
/*
* Dictionary so that I can name everything *sio* or *com* to compare with
* sio.c. There is also lots of ugly formatting and unnecessary ifdefs to
OpenPOWER on IntegriCloud