summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-10-23 21:28:03 +0000
committerwollman <wollman@FreeBSD.org>1994-10-23 21:28:03 +0000
commit7b8e09399aded7c12a148b104ccf05419e73ba88 (patch)
treec2370b235711beb410091996b92230bc38cd2a7e /sys/amd64
parent5727d2fc7e7202ade434ecfa3f1e91a6f714d47e (diff)
downloadFreeBSD-src-7b8e09399aded7c12a148b104ccf05419e73ba88.zip
FreeBSD-src-7b8e09399aded7c12a148b104ccf05419e73ba88.tar.gz
Finished device configuration database work for all ISA devices (except `ze')
and all SCSI devices (except that it's not done quite the way I want). New information added includes: - A text description of the device - A ``state''---unknown, unconfigured, idle, or busy - A generic parent device (with support in the m.i. code) - An interrupt mask type field (which will hopefully go away) so that . ``doconfig'' can be written This requires a new version of the `lsdev' program as well (next commit).
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/fpu.c28
-rw-r--r--sys/amd64/isa/isa.c14
-rw-r--r--sys/amd64/isa/npx.c28
3 files changed, 65 insertions, 5 deletions
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index 98e2276..991bfd9 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.13 1994/09/22 14:44:16 davidg Exp $
+ * $Id: npx.c,v 1.14 1994/10/08 22:27:58 phk Exp $
*/
#include "npx.h"
@@ -43,11 +43,14 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/proc.h>
+#include <sys/devconf.h>
+#include <sys/ioctl.h>
+
#include <machine/cpu.h>
#include <machine/pcb.h>
#include <machine/trap.h>
-#include <sys/ioctl.h>
#include <machine/specialreg.h>
+
#include <i386/isa/icu.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/isa.h>
@@ -302,6 +305,26 @@ npxprobe1(dvp)
return (-1);
}
+static struct kern_devconf kdc_npx[NNPX] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "npx", 0, { MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
+ &kdc_isa0, /* parent */
+ 0, /* parentdata */
+ DC_UNKNOWN, /* not supported */
+ "Floating-point unit"
+} };
+
+static inline void
+npx_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_npx[id->id_unit] = kdc_npx[0];
+ kdc_npx[id->id_unit].kdc_unit = id->id_unit;
+ kdc_npx[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_npx[id->id_unit]);
+}
+
/*
* Attach routine - announce which it is, and wire into system
*/
@@ -318,6 +341,7 @@ npxattach(dvp)
}
}
npxinit(__INITIAL_NPXCW__);
+ npx_registerdev(dvp);
return (1); /* XXX unused */
}
diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c
index 90dd24d..e2b0028 100644
--- a/sys/amd64/isa/isa.c
+++ b/sys/amd64/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.30 1994/10/19 01:59:06 wollman Exp $
+ * $Id: isa.c,v 1.31 1994/10/19 21:57:51 bde Exp $
*/
/*
@@ -106,6 +106,16 @@ inthand2_t *intr_handler[ICU_LEN];
u_int intr_mask[ICU_LEN];
int intr_unit[ICU_LEN];
+struct kern_devconf kdc_isa0 = {
+ 0, 0, 0, /* filled in by dev_attach */
+ "isa", 0, { MDDT_BUS, 0 },
+ 0, 0, 0, BUS_EXTERNALLEN,
+ 0, /* no parent yet; parent should be CPU */
+ 0, /* no parentdata */
+ DC_BUSY, /* busses are always busy */
+ "ISA or EISA bus"
+};
+
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
&IDTVEC(fastintr2), &IDTVEC(fastintr3),
@@ -270,6 +280,8 @@ void
isa_configure() {
struct isa_device *dvp;
+ dev_attach(&kdc_isa0);
+
splhigh();
enable_intr();
INTREN(IRQ_SLAVE);
diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c
index 98e2276..991bfd9 100644
--- a/sys/amd64/isa/npx.c
+++ b/sys/amd64/isa/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.13 1994/09/22 14:44:16 davidg Exp $
+ * $Id: npx.c,v 1.14 1994/10/08 22:27:58 phk Exp $
*/
#include "npx.h"
@@ -43,11 +43,14 @@
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/proc.h>
+#include <sys/devconf.h>
+#include <sys/ioctl.h>
+
#include <machine/cpu.h>
#include <machine/pcb.h>
#include <machine/trap.h>
-#include <sys/ioctl.h>
#include <machine/specialreg.h>
+
#include <i386/isa/icu.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/isa.h>
@@ -302,6 +305,26 @@ npxprobe1(dvp)
return (-1);
}
+static struct kern_devconf kdc_npx[NNPX] = { {
+ 0, 0, 0, /* filled in by dev_attach */
+ "npx", 0, { MDDT_ISA, 0 },
+ isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
+ &kdc_isa0, /* parent */
+ 0, /* parentdata */
+ DC_UNKNOWN, /* not supported */
+ "Floating-point unit"
+} };
+
+static inline void
+npx_registerdev(struct isa_device *id)
+{
+ if(id->id_unit)
+ kdc_npx[id->id_unit] = kdc_npx[0];
+ kdc_npx[id->id_unit].kdc_unit = id->id_unit;
+ kdc_npx[id->id_unit].kdc_isa = id;
+ dev_attach(&kdc_npx[id->id_unit]);
+}
+
/*
* Attach routine - announce which it is, and wire into system
*/
@@ -318,6 +341,7 @@ npxattach(dvp)
}
}
npxinit(__INITIAL_NPXCW__);
+ npx_registerdev(dvp);
return (1); /* XXX unused */
}
OpenPOWER on IntegriCloud