summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1993-09-14 17:28:06 +0000
committermycroft <mycroft@NetBSD.org>1993-09-14 17:28:06 +0000
commitfd156a97fad6527da04d756e480d6b13200328cb (patch)
tree550c8a26d74ba4d3620de2bb5d974def511a21e3 /sys/dev
parent019b759766bd206ccc7b990cfd36e23f17040eb2 (diff)
New i386 code.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/isa/isavar.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/sys/dev/isa/isavar.h b/sys/dev/isa/isavar.h
new file mode 100644
index 00000000000..32b7d71b683
--- /dev/null
+++ b/sys/dev/isa/isavar.h
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 1992 Berkeley Software Design, Inc. All rights reserved.
+ * The Berkeley Software Design Inc. software License Agreement specifies
+ * the terms and conditions for redistribution.
+ *
+ * BSDI $Id: isavar.h,v 1.1 1993/09/14 17:32:42 mycroft Exp $
+ */
+
+/*
+ * ISA driver attach arguments
+ */
+struct isa_attach_args {
+ u_short ia_iobase; /* base i/o address */
+ u_short ia_iosize; /* span of ports used */
+ u_short ia_irq; /* interrupt request */
+ u_short ia_drq; /* DMA request */
+ caddr_t ia_maddr; /* physical i/o mem addr */
+ u_int ia_msize; /* size of i/o memory */
+ void *ia_aux; /* driver specific */
+};
+
+/*
+ * per-device ISA variables
+ */
+struct isadev {
+ struct device *id_dev; /* back pointer to generic */
+ struct isadev *id_bchain; /* forward link in bus chain */
+};
+
+/*
+ * ISA masterbus
+ */
+struct isa_softc {
+ struct device sc_dev; /* base device */
+ struct isadev *sc_isadev; /* list of all children */
+};
+
+#define cf_iobase cf_loc[0]
+#define cf_iosize cf_loc[1]
+#define cf_maddr cf_loc[2]
+#define cf_msize cf_loc[3]
+#define cf_irq cf_loc[4]
+#define cf_drq cf_loc[5]
+
+/*
+ * Interrupt handler chains. Interrupt handlers should return 0 for
+ * `not I', 1 (`I took care of it'), or -1 (`I guess it was mine, but
+ * I wasn't expecting it'). intr_establish() inserts a handler into
+ * the list. The handler is called with its (single) argument.
+ */
+struct intrhand {
+ int (*ih_fun)();
+ void *ih_arg;
+ u_long ih_count;
+ struct intrhand *ih_next;
+} *intrhand[16];
+
+void intr_establish __P((int intr, struct intrhand *, enum devclass));
+
+/*
+ * software conventions
+ */
+typedef enum { BUS_ISA, BUS_EISA, BUS_MCA } isa_type;
+
+extern caddr_t atdevbase; /* kernel virtual address of "hole" */
+extern isa_type isa_bustype; /* type of bus */
+
+/*
+ * Given a kernel virtual address for some location
+ * in the "hole" I/O space, return a physical address.
+ */
+#define ISA_PHYSADDR(v) ((caddr_t) ((u_long)(v) - atdevbase + IOM_BEGIN))
+/*
+ * Given a physical address in the "hole",
+ * return a kernel virtual address.
+ */
+#define ISA_HOLE_VADDR(p) ((caddr_t) ((u_long)(p) - IOM_BEGIN + atdevbase))