diff options
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/fpu.c | 28 | ||||
-rw-r--r-- | sys/amd64/isa/isa.c | 14 | ||||
-rw-r--r-- | sys/amd64/isa/npx.c | 28 |
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 */ } |