summaryrefslogtreecommitdiff
path: root/sys/dev/isa/isa.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/isa/isa.c')
-rw-r--r--sys/dev/isa/isa.c75
1 files changed, 74 insertions, 1 deletions
diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c
index 3d7516f46d7..75b7ac34e9c 100644
--- a/sys/dev/isa/isa.c
+++ b/sys/dev/isa/isa.c
@@ -1,6 +1,38 @@
-/* $OpenBSD: isa.c,v 1.24 1997/12/25 12:06:47 downsj Exp $ */
+/* $OpenBSD: isa.c,v 1.25 1997/12/25 13:18:07 downsj Exp $ */
/* $NetBSD: isa.c,v 1.85 1996/05/14 00:31:04 thorpej Exp $ */
+/*
+ * Copyright (c) 1997, Jason Downs. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Jason Downs for the
+ * OpenBSD system.
+ * 4. Neither the name(s) of the author(s) nor the name OpenBSD
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
/*-
* Copyright (c) 1993, 1994 Charles Hannum. All rights reserved.
*
@@ -185,3 +217,44 @@ isa_intr_typename(type)
panic("isa_intr_typename: invalid type %d", type);
}
}
+
+#ifdef DIAGNOSTIC
+void
+isa_drq_alloc(vsp, drq)
+ void *vsp;
+ int drq;
+{
+ struct isa_softc *sc = vsp;
+
+ if (drq < 0 || drq > 7)
+ panic("isa_drq_alloc: drq %d out of range\n", drq);
+
+ sc->sc_drq |= (1 << drq);
+}
+
+void
+isa_drq_free(vsp, drq)
+ void *vsp;
+ int drq;
+{
+ struct isa_softc *sc = vsp;
+
+ if (drq < 0 || drq > 7)
+ panic("isa_drq_free: drq %d out of range\n", drq);
+
+ sc->sc_drq &= ~(1 << drq);
+}
+
+int
+isa_drq_isfree(vsp, drq)
+ void *vsp;
+ int drq;
+{
+ struct isa_softc *sc = vsp;
+
+ if (drq < 0 || drq > 7)
+ panic("isa_drq_isfree: drq %d out of range\n", drq);
+
+ return (!(sc->sc_drq << drq) & 1);
+}
+#endif /* DIAGNOSTIC */