Remove GPLed fpemulation, old rp, old awe and pcic.
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Mon, 31 Jan 2005 23:44:35 +0000 (23:44 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Mon, 31 Jan 2005 23:44:35 +0000 (23:44 +0000)
dgb is still in, until the persons having the hardware decide that
digi(4) works for them.

Correct spelling of deprecation.

130 files changed:
sys/bus/isa/i386/isa_compat.h
sys/conf/files
sys/conf/files.amd64
sys/conf/files.i386
sys/conf/files.pc98
sys/conf/options
sys/conf/options.amd64
sys/conf/options.i386
sys/conf/options.pc98
sys/config/LINT
sys/dev/pccard/pcic/Makefile [deleted file]
sys/dev/pccard/pcic/i82365.c [deleted file]
sys/dev/pccard/pcic/i82365_isa.c [deleted file]
sys/dev/pccard/pcic/i82365reg.h [deleted file]
sys/dev/pccard/pcic/i82365var.h [deleted file]
sys/dev/serial/rp2/rp.c [deleted file]
sys/dev/serial/rp2/rpreg.h [deleted file]
sys/dev/serial/rp2/rpvar.h [deleted file]
sys/dev/sound/isa/i386/dev_table.h
sys/dev/sound/isa/i386/sound_calls.h
sys/dev/sound/isa/i386/soundcard.c
sys/i386/conf/LINT
sys/i386/gnu/fpemul/Changelog [deleted file]
sys/i386/gnu/fpemul/README [deleted file]
sys/i386/gnu/fpemul/control_w.h [deleted file]
sys/i386/gnu/fpemul/div_small.s [deleted file]
sys/i386/gnu/fpemul/errors.c [deleted file]
sys/i386/gnu/fpemul/exception.h [deleted file]
sys/i386/gnu/fpemul/fpu_arith.c [deleted file]
sys/i386/gnu/fpemul/fpu_asm.h [deleted file]
sys/i386/gnu/fpemul/fpu_aux.c [deleted file]
sys/i386/gnu/fpemul/fpu_emu.h [deleted file]
sys/i386/gnu/fpemul/fpu_entry.c [deleted file]
sys/i386/gnu/fpemul/fpu_etc.c [deleted file]
sys/i386/gnu/fpemul/fpu_proto.h [deleted file]
sys/i386/gnu/fpemul/fpu_system.h [deleted file]
sys/i386/gnu/fpemul/fpu_trig.c [deleted file]
sys/i386/gnu/fpemul/get_address.c [deleted file]
sys/i386/gnu/fpemul/load_store.c [deleted file]
sys/i386/gnu/fpemul/math_emu.h [deleted file]
sys/i386/gnu/fpemul/poly_2xm1.c [deleted file]
sys/i386/gnu/fpemul/poly_atan.c [deleted file]
sys/i386/gnu/fpemul/poly_div.s [deleted file]
sys/i386/gnu/fpemul/poly_l2.c [deleted file]
sys/i386/gnu/fpemul/poly_mul64.s [deleted file]
sys/i386/gnu/fpemul/poly_sin.c [deleted file]
sys/i386/gnu/fpemul/poly_tan.c [deleted file]
sys/i386/gnu/fpemul/polynomial.s [deleted file]
sys/i386/gnu/fpemul/reg_add_sub.c [deleted file]
sys/i386/gnu/fpemul/reg_compare.c [deleted file]
sys/i386/gnu/fpemul/reg_constant.c [deleted file]
sys/i386/gnu/fpemul/reg_constant.h [deleted file]
sys/i386/gnu/fpemul/reg_div.s [deleted file]
sys/i386/gnu/fpemul/reg_ld_str.c [deleted file]
sys/i386/gnu/fpemul/reg_mul.c [deleted file]
sys/i386/gnu/fpemul/reg_norm.s [deleted file]
sys/i386/gnu/fpemul/reg_round.s [deleted file]
sys/i386/gnu/fpemul/reg_u_add.s [deleted file]
sys/i386/gnu/fpemul/reg_u_div.s [deleted file]
sys/i386/gnu/fpemul/reg_u_mul.s [deleted file]
sys/i386/gnu/fpemul/reg_u_sub.s [deleted file]
sys/i386/gnu/fpemul/status_w.h [deleted file]
sys/i386/gnu/fpemul/version.h [deleted file]
sys/i386/gnu/fpemul/wm_shrx.s [deleted file]
sys/i386/gnu/fpemul/wm_sqrt.s [deleted file]
sys/i386/gnu/isa/dgb.c
sys/i386/gnu/isa/sound/awe_compat.h [deleted file]
sys/i386/gnu/isa/sound/awe_config.h [deleted file]
sys/i386/gnu/isa/sound/awe_hw.h [deleted file]
sys/i386/gnu/isa/sound/awe_version.h [deleted file]
sys/i386/gnu/isa/sound/awe_voice.h [deleted file]
sys/i386/gnu/isa/sound/awe_wave.c [deleted file]
sys/i386/i386/userconfig.c
sys/i386/isa/ic/i82365.h [deleted file]
sys/i386/isa/npx.c
sys/i386/isa/sound/local.h
sys/platform/pc32/gnu/fpemul/Changelog [deleted file]
sys/platform/pc32/gnu/fpemul/README [deleted file]
sys/platform/pc32/gnu/fpemul/control_w.h [deleted file]
sys/platform/pc32/gnu/fpemul/div_small.s [deleted file]
sys/platform/pc32/gnu/fpemul/errors.c [deleted file]
sys/platform/pc32/gnu/fpemul/exception.h [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_arith.c [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_asm.h [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_aux.c [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_emu.h [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_entry.c [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_etc.c [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_proto.h [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_system.h [deleted file]
sys/platform/pc32/gnu/fpemul/fpu_trig.c [deleted file]
sys/platform/pc32/gnu/fpemul/get_address.c [deleted file]
sys/platform/pc32/gnu/fpemul/load_store.c [deleted file]
sys/platform/pc32/gnu/fpemul/math_emu.h [deleted file]
sys/platform/pc32/gnu/fpemul/poly_2xm1.c [deleted file]
sys/platform/pc32/gnu/fpemul/poly_atan.c [deleted file]
sys/platform/pc32/gnu/fpemul/poly_div.s [deleted file]
sys/platform/pc32/gnu/fpemul/poly_l2.c [deleted file]
sys/platform/pc32/gnu/fpemul/poly_mul64.s [deleted file]
sys/platform/pc32/gnu/fpemul/poly_sin.c [deleted file]
sys/platform/pc32/gnu/fpemul/poly_tan.c [deleted file]
sys/platform/pc32/gnu/fpemul/polynomial.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_add_sub.c [deleted file]
sys/platform/pc32/gnu/fpemul/reg_compare.c [deleted file]
sys/platform/pc32/gnu/fpemul/reg_constant.c [deleted file]
sys/platform/pc32/gnu/fpemul/reg_constant.h [deleted file]
sys/platform/pc32/gnu/fpemul/reg_div.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_ld_str.c [deleted file]
sys/platform/pc32/gnu/fpemul/reg_mul.c [deleted file]
sys/platform/pc32/gnu/fpemul/reg_norm.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_round.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_u_add.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_u_div.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_u_mul.s [deleted file]
sys/platform/pc32/gnu/fpemul/reg_u_sub.s [deleted file]
sys/platform/pc32/gnu/fpemul/status_w.h [deleted file]
sys/platform/pc32/gnu/fpemul/version.h [deleted file]
sys/platform/pc32/gnu/fpemul/wm_shrx.s [deleted file]
sys/platform/pc32/gnu/fpemul/wm_sqrt.s [deleted file]
sys/platform/pc32/gnu/isa/dgb.c
sys/platform/pc32/gnu/isa/sound/awe_compat.h [deleted file]
sys/platform/pc32/gnu/isa/sound/awe_config.h [deleted file]
sys/platform/pc32/gnu/isa/sound/awe_hw.h [deleted file]
sys/platform/pc32/gnu/isa/sound/awe_version.h [deleted file]
sys/platform/pc32/gnu/isa/sound/awe_voice.h [deleted file]
sys/platform/pc32/gnu/isa/sound/awe_wave.c [deleted file]
sys/platform/pc32/i386/userconfig.c
sys/platform/pc32/isa/ic/i82365.h [deleted file]
sys/platform/pc32/isa/npx.c
sys/platform/pc32/isa/sound/local.h

index cac9c6c..47d5c23 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/isa/isa_compat.h,v 1.27.2.11 2002/10/05 18:31:48 scottl Exp $
- * $DragonFly: src/sys/bus/isa/i386/isa_compat.h,v 1.6 2004/02/21 06:37:05 dillon Exp $
+ * $DragonFly: src/sys/bus/isa/i386/isa_compat.h,v 1.7 2005/01/31 23:44:34 joerg Exp $
  */
 
 #include "use_vt.h"
@@ -38,7 +38,6 @@
 #include "use_sb.h"
 #include "use_sbxvi.h"
 #include "use_sbmidi.h"
-#include "use_awe.h"
 #include "use_gus.h"
 #include "use_mss.h"
 #include "use_css.h"
@@ -58,7 +57,6 @@
 #include "use_dgb.h"
 #include "use_labpc.h"
 #include "use_rc.h"
-#include "use_rp.h"
 #include "use_tw.h"
 #include "use_asc.h"
 #include "use_stl.h"
@@ -80,7 +78,6 @@ extern struct isa_driver pasdriver;
 extern struct isa_driver  sbdriver;
 extern struct isa_driver sbxvidriver;
 extern struct isa_driver sbmididriver;
-extern struct isa_driver awedriver;
 extern struct isa_driver gusdriver;
 extern struct isa_driver mssdriver;
 extern struct isa_driver cssdriver;
@@ -205,9 +202,6 @@ static struct old_isa_driver old_drivers[] = {
 #if NSBMIDI > 0
        { INTR_TYPE_MISC, &sbmididriver },
 #endif
-#if NAWE > 0
-       { INTR_TYPE_MISC, &awedriver },
-#endif
 #if NGUS > 0
        { INTR_TYPE_MISC, &gusdriver },
 #endif
index 36f9e1f..a6717a6 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/conf/files,v 1.340.2.137 2003/06/04 17:10:30 sam Exp $
-# $DragonFly: src/sys/conf/files,v 1.84 2005/01/14 03:25:31 dillon Exp $
+# $DragonFly: src/sys/conf/files,v 1.85 2005/01/31 23:44:34 joerg Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -253,8 +253,6 @@ dev/pccard/pccbb/pccbb.c            optional cbb
 dev/pccard/cardbus/cardbus.c           optional cardbus
 dev/pccard/cardbus/cardbus_cis.c       optional cardbus
 dev/pccard/exca/exca.c                 optional cbb
-dev/pccard/pcic/i82365.c               optional pcic pccard
-dev/pccard/pcic/i82365_isa.c           optional pcic pccard isa
 
 dev/disk/advansys/adv_eisa.c           optional adv eisa
 dev/disk/advansys/adv_pci.c            optional adv pci
index 0f843c5..bb234c0 100644 (file)
@@ -2,7 +2,7 @@
 # files marked standard are always included.
 #
 # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $
-# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.3 2004/04/29 12:11:15 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/files.amd64,v 1.4 2005/01/31 23:44:34 joerg Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -125,7 +125,6 @@ vfs/smbfs/smbfs_subr.c              optional        smbfs
 vfs/smbfs/smbfs_vfsops.c               optional        smbfs
 vfs/smbfs/smbfs_vnops.c                optional        smbfs
 i386/gnu/isa/dgb.c             optional        dgb
-i386/gnu/isa/sound/awe_wave.c  optional        awe
 i386/apm/apm.c                 optional        apm
 i386/i386/atomic.c             standard                                \
        compile-with    "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
@@ -212,7 +211,6 @@ i386/isa/pmtimer.c                  optional        acpica
 # XXX drhodus
 i386/isa/prof_machdep.c                        optional        profiling-routine
 dev/serial/rc/rc.c                     optional        rc
-dev/serial/rp2/rp.c                    optional        rp
 dev/disk/scd/scd.c                     optional        scd
 dev/sound/isa/i386/ad1848.c            optional        css
 dev/sound/isa/i386/ad1848.c            optional        gus
index 2126fe3..6621f3a 100644 (file)
@@ -2,7 +2,7 @@
 # files marked standard are always included.
 #
 # $FreeBSD: src/sys/conf/files.i386,v 1.307.2.38 2003/01/02 20:41:33 kan Exp $
-# $DragonFly: src/sys/conf/Attic/files.i386,v 1.26 2004/07/27 08:09:55 asmodai Exp $
+# $DragonFly: src/sys/conf/Attic/files.i386,v 1.27 2005/01/31 23:44:34 joerg Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -145,39 +145,7 @@ vfs/smbfs/smbfs_smb.c              optional        smbfs
 vfs/smbfs/smbfs_subr.c         optional        smbfs
 vfs/smbfs/smbfs_vfsops.c               optional        smbfs
 vfs/smbfs/smbfs_vnops.c                optional        smbfs
-i386/gnu/fpemul/div_small.s    optional        gpl_math_emulate
-i386/gnu/fpemul/errors.c       optional        gpl_math_emulate
-i386/gnu/fpemul/fpu_arith.c    optional        gpl_math_emulate
-i386/gnu/fpemul/fpu_aux.c      optional        gpl_math_emulate
-i386/gnu/fpemul/fpu_entry.c    optional        gpl_math_emulate
-i386/gnu/fpemul/fpu_etc.c      optional        gpl_math_emulate
-i386/gnu/fpemul/fpu_trig.c     optional        gpl_math_emulate
-i386/gnu/fpemul/get_address.c  optional        gpl_math_emulate
-i386/gnu/fpemul/load_store.c   optional        gpl_math_emulate
-i386/gnu/fpemul/poly_2xm1.c    optional        gpl_math_emulate
-i386/gnu/fpemul/poly_atan.c    optional        gpl_math_emulate
-i386/gnu/fpemul/poly_div.s     optional        gpl_math_emulate
-i386/gnu/fpemul/poly_l2.c      optional        gpl_math_emulate
-i386/gnu/fpemul/poly_mul64.s   optional        gpl_math_emulate
-i386/gnu/fpemul/poly_sin.c     optional        gpl_math_emulate
-i386/gnu/fpemul/poly_tan.c     optional        gpl_math_emulate
-i386/gnu/fpemul/polynomial.s   optional        gpl_math_emulate
-i386/gnu/fpemul/reg_add_sub.c  optional        gpl_math_emulate
-i386/gnu/fpemul/reg_compare.c  optional        gpl_math_emulate
-i386/gnu/fpemul/reg_constant.c optional        gpl_math_emulate
-i386/gnu/fpemul/reg_div.s      optional        gpl_math_emulate
-i386/gnu/fpemul/reg_ld_str.c   optional        gpl_math_emulate
-i386/gnu/fpemul/reg_mul.c      optional        gpl_math_emulate
-i386/gnu/fpemul/reg_norm.s     optional        gpl_math_emulate
-i386/gnu/fpemul/reg_round.s    optional        gpl_math_emulate
-i386/gnu/fpemul/reg_u_add.s    optional        gpl_math_emulate
-i386/gnu/fpemul/reg_u_div.s    optional        gpl_math_emulate
-i386/gnu/fpemul/reg_u_mul.s    optional        gpl_math_emulate
-i386/gnu/fpemul/reg_u_sub.s    optional        gpl_math_emulate
-i386/gnu/fpemul/wm_shrx.s      optional        gpl_math_emulate
-i386/gnu/fpemul/wm_sqrt.s      optional        gpl_math_emulate
 i386/gnu/isa/dgb.c             optional        dgb
-i386/gnu/isa/sound/awe_wave.c  optional        awe
 i386/apm/apm.c                 optional        apm
 i386/i386/atomic.c             standard                                \
        compile-with    "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
@@ -292,7 +260,6 @@ i386/isa/pmtimer.c                  optional        acpica pmtimer
 # XXX drhodus
 i386/isa/prof_machdep.c                        optional        profiling-routine
 dev/serial/rc/rc.c                     optional        rc
-dev/serial/rp2/rp.c                    optional        rp
 dev/disk/scd/scd.c                     optional        scd
 dev/sound/isa/i386/ad1848.c            optional        css
 dev/sound/isa/i386/ad1848.c            optional        gus
index e54c3ba..6cb6ef4 100644 (file)
@@ -4,7 +4,7 @@
 # modified for PC-9801
 #
 # $FreeBSD: src/sys/conf/files.pc98,v 1.140.2.44 2003/02/10 13:11:50 nyan Exp $
-# $DragonFly: src/sys/conf/Attic/files.pc98,v 1.6 2004/04/29 12:11:15 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/files.pc98,v 1.7 2005/01/31 23:44:34 joerg Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -124,39 +124,7 @@ fs/smbfs/smbfs_smb.c               optional        smbfs
 fs/smbfs/smbfs_subr.c          optional        smbfs
 fs/smbfs/smbfs_vfsops.c                optional        smbfs
 fs/smbfs/smbfs_vnops.c         optional        smbfs
-gnu/i386/fpemul/div_small.s    optional        gpl_math_emulate
-gnu/i386/fpemul/errors.c       optional        gpl_math_emulate
-gnu/i386/fpemul/fpu_arith.c    optional        gpl_math_emulate
-gnu/i386/fpemul/fpu_aux.c      optional        gpl_math_emulate
-gnu/i386/fpemul/fpu_entry.c    optional        gpl_math_emulate
-gnu/i386/fpemul/fpu_etc.c      optional        gpl_math_emulate
-gnu/i386/fpemul/fpu_trig.c     optional        gpl_math_emulate
-gnu/i386/fpemul/get_address.c  optional        gpl_math_emulate
-gnu/i386/fpemul/load_store.c   optional        gpl_math_emulate
-gnu/i386/fpemul/poly_2xm1.c    optional        gpl_math_emulate
-gnu/i386/fpemul/poly_atan.c    optional        gpl_math_emulate
-gnu/i386/fpemul/poly_div.s     optional        gpl_math_emulate
-gnu/i386/fpemul/poly_l2.c      optional        gpl_math_emulate
-gnu/i386/fpemul/poly_mul64.s   optional        gpl_math_emulate
-gnu/i386/fpemul/poly_sin.c     optional        gpl_math_emulate
-gnu/i386/fpemul/poly_tan.c     optional        gpl_math_emulate
-gnu/i386/fpemul/polynomial.s   optional        gpl_math_emulate
-gnu/i386/fpemul/reg_add_sub.c  optional        gpl_math_emulate
-gnu/i386/fpemul/reg_compare.c  optional        gpl_math_emulate
-gnu/i386/fpemul/reg_constant.c optional        gpl_math_emulate
-gnu/i386/fpemul/reg_div.s      optional        gpl_math_emulate
-gnu/i386/fpemul/reg_ld_str.c   optional        gpl_math_emulate
-gnu/i386/fpemul/reg_mul.c      optional        gpl_math_emulate
-gnu/i386/fpemul/reg_norm.s     optional        gpl_math_emulate
-gnu/i386/fpemul/reg_round.s    optional        gpl_math_emulate
-gnu/i386/fpemul/reg_u_add.s    optional        gpl_math_emulate
-gnu/i386/fpemul/reg_u_div.s    optional        gpl_math_emulate
-gnu/i386/fpemul/reg_u_mul.s    optional        gpl_math_emulate
-gnu/i386/fpemul/reg_u_sub.s    optional        gpl_math_emulate
-gnu/i386/fpemul/wm_shrx.s      optional        gpl_math_emulate
-gnu/i386/fpemul/wm_sqrt.s      optional        gpl_math_emulate
 gnu/i386/isa/dgb.c             optional        dgb
-gnu/i386/isa/sound/awe_wave.c  optional        awe
 pc98/apm/apm.c                 optional        apm
 pc98/apm/apm_bioscall.s                optional        apm
 i386/i386/atomic.c             standard                                \
index 1539328..072bf39 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/conf/options,v 1.191.2.53 2003/06/04 17:56:58 sam Exp $
-# $DragonFly: src/sys/conf/options,v 1.28 2004/12/08 20:36:39 joerg Exp $
+# $DragonFly: src/sys/conf/options,v 1.29 2005/01/31 23:44:34 joerg Exp $
 #
 #        On the handling of kernel options
 #
@@ -531,4 +531,4 @@ DCONS_FORCE_CONSOLE opt_dcons.h
 DCONS_FORCE_GDB                opt_dcons.h
 
 # depricated drivers and options
-I_WANT_DEPRICATED_STUFF        opt_depricated.h
+I_WANT_DEPRECATED_STUFF        opt_deprecated.h
index e6ff8f1..ac09a79 100644 (file)
@@ -1,10 +1,9 @@
 # $FreeBSD: src/sys/conf/options.i386,v 1.132.2.18 2003/03/14 21:22:35 jhb Exp $
-# $DragonFly: src/sys/conf/Attic/options.amd64,v 1.2 2004/04/29 12:11:15 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/options.amd64,v 1.3 2005/01/31 23:44:34 joerg Exp $
 
 DISABLE_PSE
 IDE_DELAY
 MATH_EMULATE           opt_math_emulate.h
-GPL_MATH_EMULATE       opt_math_emulate.h
 PMAP_SHPGPERPROC       opt_pmap.h
 PPC_PROBE_CHIPSET      opt_ppc.h
 PPC_DEBUG              opt_ppc.h
@@ -103,8 +102,6 @@ PSM_HOOKRESUME              opt_psm.h
 PSM_RESETAFTERSUSPEND  opt_psm.h
 PSM_DEBUG              opt_psm.h
 
-PCIC_RESUME_RESET      opt_pcic.h
-
 PUC_FASTINTR           opt_puc.h
 
 ATKBD_DFLT_KEYMAP      opt_atkbd.h
index 6102186..8c5d365 100644 (file)
@@ -1,10 +1,9 @@
 # $FreeBSD: src/sys/conf/options.i386,v 1.132.2.18 2003/03/14 21:22:35 jhb Exp $
-# $DragonFly: src/sys/conf/Attic/options.i386,v 1.8 2004/09/21 13:02:51 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/options.i386,v 1.9 2005/01/31 23:44:34 joerg Exp $
 
 DISABLE_PSE
 IDE_DELAY
 MATH_EMULATE           opt_math_emulate.h
-GPL_MATH_EMULATE       opt_math_emulate.h
 PMAP_SHPGPERPROC       opt_pmap.h
 PPC_PROBE_CHIPSET      opt_ppc.h
 PPC_DEBUG              opt_ppc.h
@@ -108,8 +107,6 @@ PSM_HOOKRESUME              opt_psm.h
 PSM_RESETAFTERSUSPEND  opt_psm.h
 PSM_DEBUG              opt_psm.h
 
-PCIC_RESUME_RESET      opt_pcic.h
-
 PUC_FASTINTR           opt_puc.h
 
 ATKBD_DFLT_KEYMAP      opt_atkbd.h
index a14b2d0..c68e6b3 100644 (file)
@@ -1,10 +1,9 @@
 # $FreeBSD: src/sys/conf/options.pc98,v 1.103.2.17 2003/03/14 21:22:35 jhb Exp $
-# $DragonFly: src/sys/conf/Attic/options.pc98,v 1.6 2004/04/29 12:11:15 joerg Exp $
+# $DragonFly: src/sys/conf/Attic/options.pc98,v 1.7 2005/01/31 23:44:34 joerg Exp $
 
 DISABLE_PSE
 IDE_DELAY
 MATH_EMULATE           opt_math_emulate.h
-GPL_MATH_EMULATE       opt_math_emulate.h
 PMAP_SHPGPERPROC       opt_pmap.h
 PPC_PROBE_CHIPSET      opt_ppc.h
 PPC_DEBUG              opt_ppc.h
@@ -97,8 +96,6 @@ PSM_HOOKRESUME                opt_psm.h
 PSM_RESETAFTERSUSPEND  opt_psm.h
 PSM_DEBUG              opt_psm.h
 
-PCIC_RESUME_RESET      opt_pcic.h
-
 PUC_FASTINTR           opt_puc.h
 
 KBD_DISABLE_KEYMAP_LOAD        opt_kbd.h
index c166ddc..07b04b8 100644 (file)
@@ -3,7 +3,7 @@
 #      as much of the source tree as it can.
 #
 # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $
-# $DragonFly: src/sys/config/LINT,v 1.45 2005/01/10 19:37:23 joerg Exp $
+# $DragonFly: src/sys/config/LINT,v 1.46 2005/01/31 23:44:35 joerg Exp $
 #
 # NB: You probably don't want to try running a kernel built from this
 # file.  Instead, you should start from GENERIC, and add options from
@@ -268,14 +268,8 @@ options    CYRIX_CACHE_REALLY_WORKS
 
 #
 # A math emulator is mandatory if you wish to run on hardware which
-# does not have a floating-point processor.  Pick either the original,
-# bogus (but freely-distributable) math emulator, or a much more
-# fully-featured but GPL-licensed emulator taken from Linux.
-#
+# does not have a floating-point processor.
 options        MATH_EMULATE            #Support for x87 emulation
-# Don't enable both of these in a real config.
-#options       GPL_MATH_EMULATE        #Support for x87 emulation via
-                                       #new math emulator
 \f
 #####################################################################
 # COMPATIBILITY OPTIONS                                             
@@ -1537,7 +1531,6 @@ options   NATM                    #native ATM
 #device sb0    at isa? port 0x220 irq 5 drq 1
 #device sbxvi0 at isa? drq 5
 #device sbmidi0        at isa? port 0x330
-#device awe0   at isa? port 0x620
 #device gus0   at isa? port 0x220 irq 12 drq 1
 ##device gus0  at isa? port 0x220 irq 12 drq 1 flags 0x3
 #device mss0   at isa? port 0x530 irq 10 drq 1
@@ -2084,15 +2077,10 @@ options         BKTR_NEW_MSP34XX_DRIVER
 # PCCARD/PCMCIA
 #
 # pccard: pccard slots
-# pcic: isa/pccard bridge (OLDCARD)
-# cardbus/cbb: cardbus bridge (NEWCARD)
+# cardbus/cbb: cardbus bridge
 device         pccard
 device         cardbus
 device         cbb
-#device                pcic
-
-# You may need to reset all pccards after resuming
-options        PCIC_RESUME_RESET       # reset after resume
 
 #
 # Laptop/Notebook options:
diff --git a/sys/dev/pccard/pcic/Makefile b/sys/dev/pccard/pcic/Makefile
deleted file mode 100644 (file)
index 12276f1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# $DragonFly: src/sys/dev/pccard/pcic/Attic/Makefile,v 1.1 2004/02/10 07:55:47 joerg Exp $
-
-KMOD=   pcic
-SRCS=   i82365.c i82365_isa.c \
-       device_if.h bus_if.h isa_if.h power_if.h card_if.h
-NOMAN=
-
-.include <bsd.kmod.mk>
diff --git a/sys/dev/pccard/pcic/i82365.c b/sys/dev/pccard/pcic/i82365.c
deleted file mode 100644 (file)
index 88aeb04..0000000
+++ /dev/null
@@ -1,1526 +0,0 @@
-/*     $NetBSD: i82365.c,v 1.25 1999/10/15 06:07:27 haya Exp $ */
-/* $FreeBSD: src/sys/dev/pcic/i82365.c,v 1.37 2002/11/17 04:52:37 imp Exp $ */
-/* $DragonFly: src/sys/dev/pccard/pcic/Attic/i82365.c,v 1.2 2004/12/08 20:36:39 joerg Exp $ */
-
-/*
- * Copyright (c) 1997 Marc Horowitz.  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 Marc Horowitz.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-#include "opt_depricated.h"
-#ifndef I_WANT_DEPRICATED_STUFF
-#error "Add options I_WANT_DEPRICATED_STUFF to your kernel config and send a mail to kernel@"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/module.h>
-#include <sys/kernel.h>
-#include <sys/queue.h>
-#include <sys/types.h>
-
-#include <sys/bus.h>
-#include <machine/bus.h>
-#include <sys/rman.h>
-#include <machine/resource.h>
-
-#include <machine/clock.h>
-
-#include <sys/wait.h>
-#include <sys/unistd.h>
-#include <sys/kthread.h>
-
-/* We shouldn't need to include the following, but sadly we do for now */
-/* XXX */
-#include <bus/pccard/pccardreg.h>
-#include <bus/pccard/pccardvar.h>
-
-#include <dev/pccard/pcic/i82365reg.h>
-#include <dev/pccard/pcic/i82365var.h>
-
-#include "card_if.h"
-
-#define PCICDEBUG
-
-#ifdef PCICDEBUG
-int    pcic_debug = 1;
-#define        DPRINTF(arg) if (pcic_debug) printf arg; else ;
-#define DEVPRINTF(arg) if (pcic_debug) device_printf arg; else ;
-#else
-#define        DPRINTF(arg)
-#define        DEVPRINTF(arg)
-#endif
-
-#define VERBOSE(arg) if (bootverbose) printf arg; else ;
-
-#define N(a)   (sizeof(a)/sizeof(a[0]))
-
-#define        PCIC_VENDOR_UNKNOWN             0
-#define        PCIC_VENDOR_I82365SLR0          1
-#define        PCIC_VENDOR_I82365SLR1          2
-#define        PCIC_VENDOR_CIRRUS_PD6710       3
-#define        PCIC_VENDOR_CIRRUS_PD672X       4
-
-#define PCIC_H2SOFTC(h) ((struct pcic_softc *)h->sc)
-/*
- * Individual drivers will allocate their own memory and io regions. Memory
- * regions must be a multiple of 4k, aligned on a 4k boundary.
- */
-
-#define        PCIC_MEM_ALIGN  PCIC_MEM_PAGESIZE
-
-static void    pcic_init_socket(struct pcic_handle *);
-static void    pcic_intr_socket(struct pcic_handle *);
-
-static int     pcic_activate(device_t dev);
-static void    pcic_intr(void *arg);
-
-static void    pcic_attach_card(struct pcic_handle *);
-static void    pcic_detach_card(struct pcic_handle *);
-
-static void    pcic_chip_do_mem_map(struct pcic_handle *, int);
-static void    pcic_chip_do_io_map(struct pcic_handle *, int);
-
-void   pcic_create_event_thread(void *);
-void   pcic_event_thread(void *);
-
-void   pcic_queue_event(struct pcic_handle *, int);
-
-static void    pcic_wait_ready(struct pcic_handle *);
-
-static u_int8_t st_pcic_read(struct pcic_handle *, int);
-static void st_pcic_write(struct pcic_handle *, int, u_int8_t);
-
-/* XXX Should really be dynamic XXX */
-static struct pcic_handle *handles[20];
-static struct pcic_handle **lasthandle = handles;
-
-static struct pcic_handle *
-pcic_get_handle(device_t dev, device_t child)
-{
-       if (dev == child)
-               return NULL;
-       while (child && device_get_parent(child) != dev)
-               child = device_get_parent(child);
-       if (child == NULL)
-               return NULL;
-       return ((struct pcic_handle *) device_get_ivars(child));
-}
-
-int
-pcic_ident_ok(int ident)
-{
-       /* this is very empirical and heuristic */
-
-       if ((ident == 0) || (ident == 0xff) || (ident & PCIC_IDENT_ZERO))
-               return (0);
-
-       if ((ident & PCIC_IDENT_IFTYPE_MASK) != PCIC_IDENT_IFTYPE_MEM_AND_IO) {
-#ifdef DIAGNOSTIC
-               printf("pcic: does not support memory and I/O cards, "
-                   "ignored (ident=%0x)\n", ident);
-#endif
-               return (0);
-       }
-       return (1);
-}
-
-int
-pcic_vendor(struct pcic_handle *h)
-{
-       int reg;
-
-       /*
-        * the chip_id of the cirrus toggles between 11 and 00 after a write.
-        * weird.
-        */
-
-       pcic_write(h, PCIC_CIRRUS_CHIP_INFO, 0);
-       reg = pcic_read(h, -1);
-
-       if ((reg & PCIC_CIRRUS_CHIP_INFO_CHIP_ID) ==
-           PCIC_CIRRUS_CHIP_INFO_CHIP_ID) {
-               reg = pcic_read(h, -1);
-               if ((reg & PCIC_CIRRUS_CHIP_INFO_CHIP_ID) == 0) {
-                       if (reg & PCIC_CIRRUS_CHIP_INFO_SLOTS)
-                               return (PCIC_VENDOR_CIRRUS_PD672X);
-                       else
-                               return (PCIC_VENDOR_CIRRUS_PD6710);
-               }
-       }
-
-       reg = pcic_read(h, PCIC_IDENT);
-
-       if ((reg & PCIC_IDENT_REV_MASK) == PCIC_IDENT_REV_I82365SLR0)
-               return (PCIC_VENDOR_I82365SLR0);
-       else
-               return (PCIC_VENDOR_I82365SLR1);
-
-       return (PCIC_VENDOR_UNKNOWN);
-}
-
-char *
-pcic_vendor_to_string(int vendor)
-{
-       switch (vendor) {
-       case PCIC_VENDOR_I82365SLR0:
-               return ("Intel 82365SL Revision 0");
-       case PCIC_VENDOR_I82365SLR1:
-               return ("Intel 82365SL Revision 1");
-       case PCIC_VENDOR_CIRRUS_PD6710:
-               return ("Cirrus PD6710");
-       case PCIC_VENDOR_CIRRUS_PD672X:
-               return ("Cirrus PD672X");
-       }
-
-       return ("Unknown controller");
-}
-
-static int
-pcic_activate(device_t dev)
-{
-       struct pcic_softc *sc = PCIC_SOFTC(dev);
-       int err;
-
-       sc->port_rid = 0;
-       sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid,
-           0, ~0, PCIC_IOSIZE, RF_ACTIVE);
-       if (!sc->port_res) {
-               device_printf(dev, "Cannot allocate ioport\n");
-               return ENOMEM;
-       }
-
-       sc->irq_rid = 0;
-       sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->irq_rid, 
-           0, ~0, 1, RF_ACTIVE);
-       if (sc->irq_res) {
-               sc->irq = rman_get_start(sc->irq_res);
-               if ((err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, 
-                   pcic_intr, sc, &sc->intrhand)) != 0) {
-                       device_printf(dev, "Cannot setup intr\n");
-                       pcic_deactivate(dev);
-                       return err;
-               }
-       } else {
-               printf("Polling not supported\n");
-               /* XXX Do polling */
-               return (ENXIO);
-       }
-
-       /* XXX This might not be needed in future, get it directly from
-        * XXX parent */
-       sc->mem_rid = 0;
-       sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, 
-           0, ~0, 1 << 13, RF_ACTIVE);
-       if (sc->mem_res == NULL) {
-               device_printf(dev, "Cannot allocate mem\n");
-               pcic_deactivate(dev);
-               return ENOMEM;
-       }
-
-       sc->iot = rman_get_bustag(sc->port_res);
-       sc->ioh = rman_get_bushandle(sc->port_res);;
-       sc->memt = rman_get_bustag(sc->mem_res);
-       sc->memh = rman_get_bushandle(sc->mem_res);;
-       
-       return (0);
-}
-
-void
-pcic_deactivate(device_t dev)
-{
-       struct pcic_softc *sc = PCIC_SOFTC(dev);
-       
-       if (sc->intrhand)
-               bus_teardown_intr(dev, sc->irq_res, sc->intrhand);
-       sc->intrhand = 0;
-       if (sc->port_res)
-               bus_release_resource(dev, SYS_RES_IOPORT, sc->port_rid, 
-                   sc->port_res);
-       sc->port_res = 0;
-       if (sc->irq_res)
-               bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, 
-                   sc->irq_res);
-       sc->irq_res = 0;
-       if (sc->mem_res)
-               bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, 
-                   sc->mem_res);
-       sc->mem_res = 0;
-       return;
-}
-
-int
-pcic_attach(device_t dev)
-{
-       struct pcic_softc *sc = PCIC_SOFTC(dev);
-       struct pcic_handle *h;
-       int vendor, count, i, reg, error;
-
-       sc->dev = dev;
-
-       /* Activate our resources */
-       if ((error = pcic_activate(dev)) != 0) {
-               printf("pcic_attach (active) returns %d\n", error);
-               return error;
-       }
-
-       /* now check for each controller/socket */
-
-       /*
-        * this could be done with a loop, but it would violate the
-        * abstraction...  --- unknown
-        * I don't see the abstraction... --imp
-        */
-
-       count = 0;
-
-       VERBOSE(("pcic ident regs:"));
-
-       sc->handle[0].sc = sc;
-       sc->handle[0].sock = C0SA;
-       /* initialise pcic_read and pcic_write functions */
-       sc->handle[0].ph_read = st_pcic_read;
-       sc->handle[0].ph_write = st_pcic_write;
-       sc->handle[0].ph_bus_t = sc->iot;
-       sc->handle[0].ph_bus_h = sc->ioh;
-       if (pcic_ident_ok(reg = pcic_read(&sc->handle[0], PCIC_IDENT))) {
-               sc->handle[0].flags = PCIC_FLAG_SOCKETP;
-               count++;
-       } else {
-               sc->handle[0].flags = 0;
-       }
-       sc->handle[0].laststate = PCIC_LASTSTATE_EMPTY;
-
-       VERBOSE((" 0x%02x", reg));
-
-       sc->handle[1].sc = sc;
-       sc->handle[1].sock = C0SB;
-       /* initialise pcic_read and pcic_write functions */
-       sc->handle[1].ph_read = st_pcic_read;
-       sc->handle[1].ph_write = st_pcic_write;
-       sc->handle[1].ph_bus_t = sc->iot;
-       sc->handle[1].ph_bus_h = sc->ioh;
-       if (pcic_ident_ok(reg = pcic_read(&sc->handle[1], PCIC_IDENT))) {
-               sc->handle[1].flags = PCIC_FLAG_SOCKETP;
-               count++;
-       } else {
-               sc->handle[1].flags = 0;
-       }
-       sc->handle[1].laststate = PCIC_LASTSTATE_EMPTY;
-
-       VERBOSE((" 0x%02x", reg));
-
-       /*
-        * The CL-PD6729 has only one controller and always returns 0
-        * if you try to read from the second one. Maybe pcic_ident_ok
-        * shouldn't accept 0?
-        */
-       sc->handle[2].sc = sc;
-       sc->handle[2].sock = C1SA;
-       /* initialise pcic_read and pcic_write functions */
-       sc->handle[2].ph_read = st_pcic_read;
-       sc->handle[2].ph_write = st_pcic_write;
-       sc->handle[2].ph_bus_t = sc->iot;
-       sc->handle[2].ph_bus_h = sc->ioh;
-       if (pcic_vendor(&sc->handle[0]) != PCIC_VENDOR_CIRRUS_PD672X ||
-           pcic_read(&sc->handle[2], PCIC_IDENT) != 0) {
-               if (pcic_ident_ok(reg = pcic_read(&sc->handle[2],
-                                                 PCIC_IDENT))) {
-                       sc->handle[2].flags = PCIC_FLAG_SOCKETP;
-                       count++;
-               } else {
-                       sc->handle[2].flags = 0;
-               }
-               sc->handle[2].laststate = PCIC_LASTSTATE_EMPTY;
-
-               VERBOSE((" 0x%02x", reg));
-
-               sc->handle[3].sc = sc;
-               sc->handle[3].sock = C1SB;
-               /* initialise pcic_read and pcic_write functions */
-               sc->handle[3].ph_read = st_pcic_read;
-               sc->handle[3].ph_write = st_pcic_write;
-               sc->handle[3].ph_bus_t = sc->iot;
-               sc->handle[3].ph_bus_h = sc->ioh;
-               if (pcic_ident_ok(reg = pcic_read(&sc->handle[3],
-                                                 PCIC_IDENT))) {
-                       sc->handle[3].flags = PCIC_FLAG_SOCKETP;
-                       count++;
-               } else {
-                       sc->handle[3].flags = 0;
-               }
-               sc->handle[3].laststate = PCIC_LASTSTATE_EMPTY;
-
-               VERBOSE((" 0x%02x\n", reg));
-       } else {
-               sc->handle[2].flags = 0;
-               sc->handle[3].flags = 0;
-       }
-
-       if (count == 0) {
-               printf("pcic_attach: attach found no sockets\n");
-               return (ENXIO);
-       }
-
-       /* establish the interrupt */
-
-       /* XXX block interrupts? */
-
-       for (i = 0; i < PCIC_NSLOTS; i++) {
-               /*
-                * this should work, but w/o it, setting tty flags hangs at
-                * boot time.
-                */
-               if (sc->handle[i].flags & PCIC_FLAG_SOCKETP)
-               {
-                       STAILQ_INIT(&sc->handle[i].events);
-                       pcic_write(&sc->handle[i], PCIC_CSC_INTR, 0);
-                       pcic_read(&sc->handle[i], PCIC_CSC);
-               }
-       }
-
-       if ((sc->handle[0].flags & PCIC_FLAG_SOCKETP) ||
-           (sc->handle[1].flags & PCIC_FLAG_SOCKETP)) {
-               vendor = pcic_vendor(&sc->handle[0]);
-
-               device_printf(dev, "controller 0 (%s) has ",
-                      pcic_vendor_to_string(vendor));
-
-               if ((sc->handle[0].flags & PCIC_FLAG_SOCKETP) &&
-                   (sc->handle[1].flags & PCIC_FLAG_SOCKETP))
-                       printf("sockets A and B\n");
-               else if (sc->handle[0].flags & PCIC_FLAG_SOCKETP)
-                       printf("socket A only\n");
-               else
-                       printf("socket B only\n");
-
-               if (sc->handle[0].flags & PCIC_FLAG_SOCKETP)
-                       sc->handle[0].vendor = vendor;
-               if (sc->handle[1].flags & PCIC_FLAG_SOCKETP)
-                       sc->handle[1].vendor = vendor;
-       }
-       if ((sc->handle[2].flags & PCIC_FLAG_SOCKETP) ||
-           (sc->handle[3].flags & PCIC_FLAG_SOCKETP)) {
-               vendor = pcic_vendor(&sc->handle[2]);
-
-               device_printf(dev, "controller 1 (%s) has ",
-                      pcic_vendor_to_string(vendor));
-
-               if ((sc->handle[2].flags & PCIC_FLAG_SOCKETP) &&
-                   (sc->handle[3].flags & PCIC_FLAG_SOCKETP))
-                       printf("sockets A and B\n");
-               else if (sc->handle[2].flags & PCIC_FLAG_SOCKETP)
-                       printf("socket A only\n");
-               else
-                       printf("socket B only\n");
-
-               if (sc->handle[2].flags & PCIC_FLAG_SOCKETP)
-                       sc->handle[2].vendor = vendor;
-               if (sc->handle[3].flags & PCIC_FLAG_SOCKETP)
-                       sc->handle[3].vendor = vendor;
-       }
-
-       for (i = 0; i < PCIC_NSLOTS; i++) {
-               if ((sc->handle[i].flags & PCIC_FLAG_SOCKETP) == 0)
-                       continue;
-               h = &sc->handle[i];
-               /* initialize the rest of the handle */
-               h->shutdown = 0;
-               h->memalloc = 0;
-               h->ioalloc = 0;
-               h->ih_irq = 0;
-               h->sc = sc;
-               h->dev = device_add_child(dev, "pccard", -1);
-               device_set_ivars(h->dev, h);
-               pcic_init_socket(h);
-       }
-
-       /*
-        * Probe and attach any children as were configured above.
-        */
-       error = bus_generic_attach(dev);
-       if (error)
-               pcic_deactivate(dev);
-       return error;
-}
-
-void
-pcic_create_event_thread(void *arg)
-{
-       struct pcic_handle *h = arg;
-       const char *cs;
-
-       switch (h->sock) {
-       case C0SA:
-               cs = "0,0";
-               break;
-       case C0SB:
-               cs = "0,1";
-               break;
-       case C1SA:
-               cs = "1,0";
-               break;
-       case C1SB:
-               cs = "1,1";
-               break;
-       default:
-               panic("pcic_create_event_thread: unknown pcic socket");
-       }
-
-       if (kthread_create(pcic_event_thread, h, &h->event_thread,
-           "%s,%s", device_get_name(PCIC_H2SOFTC(h)->dev), cs)) {
-               device_printf(PCIC_H2SOFTC(h)->dev,
-                   "cannot create event thread for sock 0x%02x\n", h->sock);
-               panic("pcic_create_event_thread");
-       }
-}
-
-void
-pcic_event_thread(void *arg)
-{
-       struct pcic_handle *h = arg;
-       struct pcic_event *pe;
-       int s;
-       struct pcic_softc *sc = h->sc;
-
-       while (h->shutdown == 0) {
-               s = splhigh();
-               if ((pe = STAILQ_FIRST(&h->events)) == NULL) {
-                       splx(s);
-                       (void) tsleep(&h->events, 0, "pcicev", 0);
-                       continue;
-               } else {
-                       splx(s);
-                       /* sleep .25s to be enqueued chatterling interrupts */
-                       (void) tsleep((caddr_t)pcic_event_thread, 0, "pcicss", hz/4);
-               }
-               s = splhigh();
-               STAILQ_REMOVE_HEAD_UNTIL(&h->events, pe, pe_q);
-               splx(s);
-
-               switch (pe->pe_type) {
-               case PCIC_EVENT_INSERTION:
-                       s = splhigh();
-                       while (1) {
-                               struct pcic_event *pe1, *pe2;
-
-                               if ((pe1 = STAILQ_FIRST(&h->events)) == NULL)
-                                       break;
-                               if (pe1->pe_type != PCIC_EVENT_REMOVAL)
-                                       break;
-                               if ((pe2 = STAILQ_NEXT(pe1, pe_q)) == NULL)
-                                       break;
-                               if (pe2->pe_type == PCIC_EVENT_INSERTION) {
-                                       STAILQ_REMOVE_HEAD_UNTIL(&h->events, pe1, pe_q);
-                                       free(pe1, M_TEMP);
-                                       STAILQ_REMOVE_HEAD_UNTIL(&h->events, pe2, pe_q);
-                                       free(pe2, M_TEMP);
-                               }
-                       }
-                       splx(s);
-                               
-                       DEVPRINTF((h->dev, "insertion event\n"));
-                       pcic_attach_card(h);
-                       break;
-
-               case PCIC_EVENT_REMOVAL:
-                       s = splhigh();
-                       while (1) {
-                               struct pcic_event *pe1, *pe2;
-
-                               if ((pe1 = STAILQ_FIRST(&h->events)) == NULL)
-                                       break;
-                               if (pe1->pe_type != PCIC_EVENT_INSERTION)
-                                       break;
-                               if ((pe2 = STAILQ_NEXT(pe1, pe_q)) == NULL)
-                                       break;
-                               if (pe2->pe_type == PCIC_EVENT_REMOVAL) {
-                                       STAILQ_REMOVE_HEAD_UNTIL(&h->events, pe1, pe_q);
-                                       free(pe1, M_TEMP);
-                                       STAILQ_REMOVE_HEAD_UNTIL(&h->events, pe2, pe_q);
-                                       free(pe2, M_TEMP);
-                               }
-                       }
-                       splx(s);
-
-                       DEVPRINTF((h->dev, "removal event\n"));
-                       pcic_detach_card(h);
-                       break;
-
-               default:
-                       panic("pcic_event_thread: unknown event %d",
-                           pe->pe_type);
-               }
-               free(pe, M_TEMP);
-       }
-
-       h->event_thread = NULL;
-
-       /* In case parent is waiting for us to exit. */
-       wakeup(sc);
-
-       kthread_exit();
-}
-
-void
-pcic_init_socket(struct pcic_handle *h)
-{
-       int reg;
-       struct pcic_softc *sc = h->sc;
-
-       /*
-        * queue creation of a kernel thread to handle insert/removal events.
-        */
-       *lasthandle++ = h;
-
-       /* set up the card to interrupt on card detect */
-
-       pcic_write(h, PCIC_CSC_INTR, (sc->irq << PCIC_CSC_INTR_IRQ_SHIFT) |
-           PCIC_CSC_INTR_CD_ENABLE);
-       pcic_write(h, PCIC_INTR, 0);
-       pcic_read(h, PCIC_CSC);
-
-       /* unsleep the cirrus controller */
-
-       if ((h->vendor == PCIC_VENDOR_CIRRUS_PD6710) ||
-           (h->vendor == PCIC_VENDOR_CIRRUS_PD672X)) {
-               reg = pcic_read(h, PCIC_CIRRUS_MISC_CTL_2);
-               if (reg & PCIC_CIRRUS_MISC_CTL_2_SUSPEND) {
-                       DEVPRINTF((sc->dev, "socket %02x was suspended\n",
-                           h->sock));
-                       reg &= ~PCIC_CIRRUS_MISC_CTL_2_SUSPEND;
-                       pcic_write(h, PCIC_CIRRUS_MISC_CTL_2, reg);
-               }
-       }
-       h->laststate = PCIC_LASTSTATE_EMPTY;
-
-#if 0
-/* XXX */
-/*     Should do this later */
-/* maybe as part of interrupt routing verification */
-       if ((reg & PCIC_IF_STATUS_CARDDETECT_MASK) ==
-           PCIC_IF_STATUS_CARDDETECT_PRESENT) {
-               pcic_attach_card(h);
-               h->laststate = PCIC_LASTSTATE_PRESENT;
-       } else {
-               h->laststate = PCIC_LASTSTATE_EMPTY;
-       }
-#endif
-}
-
-static void
-pcic_intr(void *arg)
-{
-       struct pcic_softc *sc = arg;
-       int i;
-
-       for (i = 0; i < PCIC_NSLOTS; i++)
-               if (sc->handle[i].flags & PCIC_FLAG_SOCKETP)
-                       pcic_intr_socket(&sc->handle[i]);
-}
-
-static void
-pcic_intr_socket(struct pcic_handle *h)
-{
-       int cscreg;
-
-       cscreg = pcic_read(h, PCIC_CSC);
-
-       cscreg &= (PCIC_CSC_GPI | PCIC_CSC_CD | PCIC_CSC_READY | 
-           PCIC_CSC_BATTWARN | PCIC_CSC_BATTDEAD);
-
-       if (cscreg & PCIC_CSC_GPI) {
-               DEVPRINTF((h->dev, "%02x GPI\n", h->sock));
-       }
-       if (cscreg & PCIC_CSC_CD) {
-               int statreg;
-
-               statreg = pcic_read(h, PCIC_IF_STATUS);
-
-               DEVPRINTF((h->dev, "%02x CD %x\n", h->sock, statreg));
-
-               if ((statreg & PCIC_IF_STATUS_CARDDETECT_MASK) ==
-                   PCIC_IF_STATUS_CARDDETECT_PRESENT) {
-                       if (h->laststate != PCIC_LASTSTATE_PRESENT) {
-                               DEVPRINTF((h->dev, 
-                                   "enqueing INSERTION event\n"));
-                               pcic_queue_event(h, PCIC_EVENT_INSERTION);
-                       }
-                       h->laststate = PCIC_LASTSTATE_PRESENT;
-               } else {
-                       if (h->laststate == PCIC_LASTSTATE_PRESENT) {
-                               /* Deactivate the card now. */
-                               DEVPRINTF((h->dev, "detaching card\n"));
-                               pcic_detach_card(h);
-                               DEVPRINTF((h->dev,"enqueing REMOVAL event\n"));
-                               pcic_queue_event(h, PCIC_EVENT_REMOVAL);
-                       }
-                       h->laststate = ((statreg & PCIC_IF_STATUS_CARDDETECT_MASK) == 0)
-                               ? PCIC_LASTSTATE_EMPTY : PCIC_LASTSTATE_HALF;
-               }
-       }
-       if (cscreg & PCIC_CSC_READY) {
-               DEVPRINTF((h->dev, "%02x READY\n", h->sock));
-               /* shouldn't happen */
-       }
-       if (cscreg & PCIC_CSC_BATTWARN) {
-               DEVPRINTF((h->dev, "%02x BATTWARN\n", h->sock));
-       }
-       if (cscreg & PCIC_CSC_BATTDEAD) {
-               DEVPRINTF((h->dev, "%02x BATTDEAD\n", h->sock));
-       }
-}
-
-void
-pcic_queue_event(struct pcic_handle *h, int event)
-{
-       struct pcic_event *pe;
-       int s;
-
-       pe = malloc(sizeof(*pe), M_TEMP, M_NOWAIT);
-       if (pe == NULL)
-               panic("pcic_queue_event: can't allocate event");
-
-       pe->pe_type = event;
-       s = splhigh();
-       STAILQ_INSERT_TAIL(&h->events, pe, pe_q);
-       splx(s);
-       wakeup(&h->events);
-}
-
-static void
-pcic_attach_card(struct pcic_handle *h)
-{
-       if (!(h->flags & PCIC_FLAG_CARDP)) {
-               /* call the MI attach function */
-               CARD_ATTACH_CARD(h->dev);
-               h->flags |= PCIC_FLAG_CARDP;
-       } else {
-               DPRINTF(("pcic_attach_card: already attached\n"));
-       }
-}
-
-static void
-pcic_detach_card(struct pcic_handle *h)
-{
-       if (h->flags & PCIC_FLAG_CARDP) {
-               h->flags &= ~PCIC_FLAG_CARDP;
-               /* call the MI detach function */
-               CARD_DETACH_CARD(h->dev);
-       }
-}
-
-static int 
-pcic_chip_mem_alloc(struct pcic_handle *h, struct resource *r, bus_size_t size,
-    struct pccard_mem_handle *pcmhp)
-{
-       bus_space_handle_t memh;
-       bus_addr_t addr;
-       bus_size_t sizepg;
-       int mask;
-       struct pcic_softc *sc = h->sc;
-
-       /* out of sc->memh, allocate as many pages as necessary */
-
-       /* convert size to PCIC pages */
-       sizepg = (size + (PCIC_MEM_ALIGN - 1)) / PCIC_MEM_ALIGN;
-       if (sizepg > PCIC_MAX_MEM_PAGES)
-               return (1);
-
-       mask = (1 << sizepg) - 1;
-
-       addr = rman_get_start(r);
-       memh = addr;
-       pcmhp->memt = sc->memt;
-       pcmhp->memh = memh;
-       pcmhp->addr = addr;
-       pcmhp->size = size;
-       pcmhp->realsize = sizepg * PCIC_MEM_PAGESIZE;
-       return (0);
-}
-
-static void 
-pcic_chip_mem_free(struct pcic_handle *h, struct pccard_mem_handle *pcmhp)
-{
-}
-
-static struct mem_map_index_st {
-       int     sysmem_start_lsb;
-       int     sysmem_start_msb;
-       int     sysmem_stop_lsb;
-       int     sysmem_stop_msb;
-       int     cardmem_lsb;
-       int     cardmem_msb;
-       int     memenable;
-} mem_map_index[] = {
-       {
-               PCIC_SYSMEM_ADDR0_START_LSB,
-               PCIC_SYSMEM_ADDR0_START_MSB,
-               PCIC_SYSMEM_ADDR0_STOP_LSB,
-               PCIC_SYSMEM_ADDR0_STOP_MSB,
-               PCIC_CARDMEM_ADDR0_LSB,
-               PCIC_CARDMEM_ADDR0_MSB,
-               PCIC_ADDRWIN_ENABLE_MEM0,
-       },
-       {
-               PCIC_SYSMEM_ADDR1_START_LSB,
-               PCIC_SYSMEM_ADDR1_START_MSB,
-               PCIC_SYSMEM_ADDR1_STOP_LSB,
-               PCIC_SYSMEM_ADDR1_STOP_MSB,
-               PCIC_CARDMEM_ADDR1_LSB,
-               PCIC_CARDMEM_ADDR1_MSB,
-               PCIC_ADDRWIN_ENABLE_MEM1,
-       },
-       {
-               PCIC_SYSMEM_ADDR2_START_LSB,
-               PCIC_SYSMEM_ADDR2_START_MSB,
-               PCIC_SYSMEM_ADDR2_STOP_LSB,
-               PCIC_SYSMEM_ADDR2_STOP_MSB,
-               PCIC_CARDMEM_ADDR2_LSB,
-               PCIC_CARDMEM_ADDR2_MSB,
-               PCIC_ADDRWIN_ENABLE_MEM2,
-       },
-       {
-               PCIC_SYSMEM_ADDR3_START_LSB,
-               PCIC_SYSMEM_ADDR3_START_MSB,
-               PCIC_SYSMEM_ADDR3_STOP_LSB,
-               PCIC_SYSMEM_ADDR3_STOP_MSB,
-               PCIC_CARDMEM_ADDR3_LSB,
-               PCIC_CARDMEM_ADDR3_MSB,
-               PCIC_ADDRWIN_ENABLE_MEM3,
-       },
-       {
-               PCIC_SYSMEM_ADDR4_START_LSB,
-               PCIC_SYSMEM_ADDR4_START_MSB,
-               PCIC_SYSMEM_ADDR4_STOP_LSB,
-               PCIC_SYSMEM_ADDR4_STOP_MSB,
-               PCIC_CARDMEM_ADDR4_LSB,
-               PCIC_CARDMEM_ADDR4_MSB,
-               PCIC_ADDRWIN_ENABLE_MEM4,
-       },
-};
-
-static void 
-pcic_chip_do_mem_map(struct pcic_handle *h, int win)
-{
-       int reg;
-
-       pcic_write(h, mem_map_index[win].sysmem_start_lsb,
-           (h->mem[win].addr >> PCIC_SYSMEM_ADDRX_SHIFT) & 0xff);
-       pcic_write(h, mem_map_index[win].sysmem_start_msb,
-           ((h->mem[win].addr >> (PCIC_SYSMEM_ADDRX_SHIFT + 8)) &
-           PCIC_SYSMEM_ADDRX_START_MSB_ADDR_MASK));
-
-#if 0
-       /* XXX do I want 16 bit all the time? */
-       PCIC_SYSMEM_ADDRX_START_MSB_DATASIZE_16BIT;
-#endif
-
-       pcic_write(h, mem_map_index[win].sysmem_stop_lsb,
-           ((h->mem[win].addr + h->mem[win].size) >>
-           PCIC_SYSMEM_ADDRX_SHIFT) & 0xff);
-       pcic_write(h, mem_map_index[win].sysmem_stop_msb,
-           (((h->mem[win].addr + h->mem[win].size) >>
-           (PCIC_SYSMEM_ADDRX_SHIFT + 8)) &
-           PCIC_SYSMEM_ADDRX_STOP_MSB_ADDR_MASK) |
-           PCIC_SYSMEM_ADDRX_STOP_MSB_WAIT2);
-
-       pcic_write(h, mem_map_index[win].cardmem_lsb,
-           (h->mem[win].offset >> PCIC_CARDMEM_ADDRX_SHIFT) & 0xff);
-       pcic_write(h, mem_map_index[win].cardmem_msb,
-           ((h->mem[win].offset >> (PCIC_CARDMEM_ADDRX_SHIFT + 8)) &
-           PCIC_CARDMEM_ADDRX_MSB_ADDR_MASK) |
-           ((h->mem[win].kind == PCCARD_MEM_ATTR) ?
-           PCIC_CARDMEM_ADDRX_MSB_REGACTIVE_ATTR : 0));
-
-       reg = pcic_read(h, PCIC_ADDRWIN_ENABLE);
-       reg |= (mem_map_index[win].memenable | PCIC_ADDRWIN_ENABLE_MEMCS16);
-       pcic_write(h, PCIC_ADDRWIN_ENABLE, reg);
-
-       DELAY(100);
-
-#ifdef PCICDEBUG
-       {
-               int r1, r2, r3, r4, r5, r6;
-
-               r1 = pcic_read(h, mem_map_index[win].sysmem_start_msb);
-               r2 = pcic_read(h, mem_map_index[win].sysmem_start_lsb);
-               r3 = pcic_read(h, mem_map_index[win].sysmem_stop_msb);
-               r4 = pcic_read(h, mem_map_index[win].sysmem_stop_lsb);
-               r5 = pcic_read(h, mem_map_index[win].cardmem_msb);
-               r6 = pcic_read(h, mem_map_index[win].cardmem_lsb);
-
-               DPRINTF(("pcic_chip_do_mem_map window %d: %02x%02x %02x%02x "
-                   "%02x%02x\n", win, r1, r2, r3, r4, r5, r6));
-       }
-#endif
-}
-
-static int 
-pcic_chip_mem_map(struct pcic_handle *h, int kind, bus_addr_t card_addr,
-    bus_size_t size, struct pccard_mem_handle *pcmhp, bus_addr_t *offsetp,
-    int *windowp)
-{
-       bus_addr_t busaddr;
-       long card_offset;
-       int i, win;
-
-       win = -1;
-       for (i = 0; i < N(mem_map_index); i++) {
-               if ((h->memalloc & (1 << i)) == 0) {
-                       win = i;
-                       h->memalloc |= (1 << i);
-                       break;
-               }
-       }
-
-       if (win == -1)
-               return (1);
-
-       *windowp = win;
-       busaddr = pcmhp->addr;
-
-       /*
-        * compute the address offset to the pccard address space for the
-        * pcic.  this is intentionally signed.  The masks and shifts below
-        * will cause TRT to happen in the pcic registers.  Deal with making
-        * sure the address is aligned, and return the alignment offset.
-        */
-
-       *offsetp = card_addr % PCIC_MEM_ALIGN;
-       card_addr -= *offsetp;
-
-       DPRINTF(("pcic_chip_mem_map window %d bus %lx+%lx+%lx at card addr "
-           "%lx\n", win, (u_long) busaddr, (u_long) * offsetp, (u_long) size,
-           (u_long) card_addr));
-
-       /*
-        * include the offset in the size, and decrement size by one, since
-        * the hw wants start/stop
-        */
-       size += *offsetp - 1;
-
-       card_offset = (((long) card_addr) - ((long) busaddr));
-
-       h->mem[win].addr = busaddr;
-       h->mem[win].size = size;
-       h->mem[win].offset = card_offset;
-       h->mem[win].kind = kind;
-
-       pcic_chip_do_mem_map(h, win);
-
-       return (0);
-}
-
-static void 
-pcic_chip_mem_unmap(struct pcic_handle *h, int window)
-{
-       int reg;
-
-       if (window >= N(mem_map_index))
-               panic("pcic_chip_mem_unmap: window out of range");
-
-       reg = pcic_read(h, PCIC_ADDRWIN_ENABLE);
-       reg &= ~mem_map_index[window].memenable;
-       pcic_write(h, PCIC_ADDRWIN_ENABLE, reg);
-
-       h->memalloc &= ~(1 << window);
-}
-
-static int 
-pcic_chip_io_alloc(struct pcic_handle *h, bus_addr_t start, bus_size_t size,
-    bus_size_t align, struct pccard_io_handle *pcihp)
-{
-       bus_space_tag_t iot;
-       bus_space_handle_t ioh;
-       bus_addr_t ioaddr;
-       int flags = 0;
-
-       /*
-        * Allocate some arbitrary I/O space.
-        */
-       iot = h->ph_bus_t;
-       ioaddr = start;
-       if (start) {
-               ioh = start;
-               DPRINTF(("pcic_chip_io_alloc map port %lx+%lx\n",
-                   (u_long) ioaddr, (u_long) size));
-       } else {
-               flags |= PCCARD_IO_ALLOCATED;
-               ioh = start;
-               DPRINTF(("pcic_chip_io_alloc alloc port %lx+%lx\n",
-                   (u_long) ioaddr, (u_long) size));
-       }
-
-       pcihp->iot = iot;
-       pcihp->ioh = ioh;
-       pcihp->addr = ioaddr;
-       pcihp->size = size;
-       pcihp->flags = flags;
-
-       return (0);
-}
-
-static void 
-pcic_chip_io_free(struct pcic_handle *h, struct pccard_io_handle *pcihp)
-{
-}
-
-
-static struct io_map_index_st {
-       int     start_lsb;
-       int     start_msb;
-       int     stop_lsb;
-       int     stop_msb;
-       int     ioenable;
-       int     ioctlmask;
-       int     ioctlbits[3];           /* indexed by PCCARD_WIDTH_* */
-}               io_map_index[] = {
-       {
-               PCIC_IOADDR0_START_LSB,
-               PCIC_IOADDR0_START_MSB,
-               PCIC_IOADDR0_STOP_LSB,
-               PCIC_IOADDR0_STOP_MSB,
-               PCIC_ADDRWIN_ENABLE_IO0,
-               PCIC_IOCTL_IO0_WAITSTATE | PCIC_IOCTL_IO0_ZEROWAIT |
-               PCIC_IOCTL_IO0_IOCS16SRC_MASK | PCIC_IOCTL_IO0_DATASIZE_MASK,
-               {
-                       PCIC_IOCTL_IO0_IOCS16SRC_CARD,
-                       PCIC_IOCTL_IO0_IOCS16SRC_DATASIZE |
-                           PCIC_IOCTL_IO0_DATASIZE_8BIT,
-                       PCIC_IOCTL_IO0_IOCS16SRC_DATASIZE |
-                           PCIC_IOCTL_IO0_DATASIZE_16BIT,
-               },
-       },
-       {
-               PCIC_IOADDR1_START_LSB,
-               PCIC_IOADDR1_START_MSB,
-               PCIC_IOADDR1_STOP_LSB,
-               PCIC_IOADDR1_STOP_MSB,
-               PCIC_ADDRWIN_ENABLE_IO1,
-               PCIC_IOCTL_IO1_WAITSTATE | PCIC_IOCTL_IO1_ZEROWAIT |
-               PCIC_IOCTL_IO1_IOCS16SRC_MASK | PCIC_IOCTL_IO1_DATASIZE_MASK,
-               {
-                       PCIC_IOCTL_IO1_IOCS16SRC_CARD,
-                       PCIC_IOCTL_IO1_IOCS16SRC_DATASIZE |
-                           PCIC_IOCTL_IO1_DATASIZE_8BIT,
-                       PCIC_IOCTL_IO1_IOCS16SRC_DATASIZE |
-                           PCIC_IOCTL_IO1_DATASIZE_16BIT,
-               },
-       },
-};
-
-static void 
-pcic_chip_do_io_map(struct pcic_handle *h, int win)
-{
-       int reg;
-
-       DPRINTF(("pcic_chip_do_io_map win %d addr %lx size %lx width %d\n",
-           win, (long) h->io[win].addr, (long) h->io[win].size,
-           h->io[win].width * 8));
-
-       pcic_write(h, io_map_index[win].start_lsb, h->io[win].addr & 0xff);
-       pcic_write(h, io_map_index[win].start_msb,
-           (h->io[win].addr >> 8) & 0xff);
-
-       pcic_write(h, io_map_index[win].stop_lsb,
-           (h->io[win].addr + h->io[win].size - 1) & 0xff);
-       pcic_write(h, io_map_index[win].stop_msb,
-           ((h->io[win].addr + h->io[win].size - 1) >> 8) & 0xff);
-
-       reg = pcic_read(h, PCIC_IOCTL);
-       reg &= ~io_map_index[win].ioctlmask;
-       reg |= io_map_index[win].ioctlbits[h->io[win].width];
-       pcic_write(h, PCIC_IOCTL, reg);
-
-       reg = pcic_read(h, PCIC_ADDRWIN_ENABLE);
-       reg |= io_map_index[win].ioenable;
-       pcic_write(h, PCIC_ADDRWIN_ENABLE, reg);
-}
-
-static int 
-pcic_chip_io_map(struct pcic_handle *h, int width, bus_addr_t offset,
-    bus_size_t size, struct pccard_io_handle *pcihp, int *windowp)
-{
-       bus_addr_t ioaddr = pcihp->addr + offset;
-       int i, win;
-#ifdef PCICDEBUG
-       static char *width_names[] = { "auto", "io8", "io16" };
-#endif
-
-       /* XXX Sanity check offset/size. */
-
-       win = -1;
-       for (i = 0; i < N(io_map_index); i++) {
-               if ((h->ioalloc & (1 << i)) == 0) {
-                       win = i;
-                       h->ioalloc |= (1 << i);
-                       break;
-               }
-       }
-
-       if (win == -1)
-               return (1);
-
-       *windowp = win;
-
-       DPRINTF(("pcic_chip_io_map window %d %s port %lx+%lx\n",
-                win, width_names[width], (u_long) ioaddr, (u_long) size));
-
-       h->io[win].addr = ioaddr;
-       h->io[win].size = size;
-       h->io[win].width = width;
-
-       pcic_chip_do_io_map(h, win);
-
-       return (0);
-}
-
-static void 
-pcic_chip_io_unmap(struct pcic_handle *h, int window)
-{
-       int reg;
-
-       if (window >= N(io_map_index))
-               panic("pcic_chip_io_unmap: window out of range");
-
-       reg = pcic_read(h, PCIC_ADDRWIN_ENABLE);
-       reg &= ~io_map_index[window].ioenable;
-       pcic_write(h, PCIC_ADDRWIN_ENABLE, reg);
-
-       h->ioalloc &= ~(1 << window);
-}
-
-static void
-pcic_wait_ready(struct pcic_handle *h)
-{
-       int i;
-
-       for (i = 0; i < 10000; i++) {
-               if (pcic_read(h, PCIC_IF_STATUS) & PCIC_IF_STATUS_READY)
-                       return;
-               DELAY(500);
-#ifdef PCICDEBUG
-               if (pcic_debug) {
-                       if ((i>5000) && (i%100 == 99))
-                               printf(".");
-               }
-#endif
-       }
-
-#ifdef DIAGNOSTIC
-       printf("pcic_wait_ready: ready never happened, status = %02x\n",
-           pcic_read(h, PCIC_IF_STATUS));
-#endif
-}
-
-int
-pcic_enable_socket(device_t dev, device_t child)
-{
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-       int cardtype, reg, win;
-
-       /* this bit is mostly stolen from pcic_attach_card */
-
-       /* power down the socket to reset it, clear the card reset pin */
-
-       pcic_write(h, PCIC_PWRCTL, 0);
-
-       /* 
-        * wait 300ms until power fails (Tpf).  Then, wait 100ms since
-        * we are changing Vcc (Toff).
-        */
-       DELAY((300 + 100) * 1000);
-
-#ifdef VADEM_POWER_HACK
-       bus_space_write_1(sc->iot, sc->ioh, PCIC_REG_INDEX, 0x0e);
-       bus_space_write_1(sc->iot, sc->ioh, PCIC_REG_INDEX, 0x37);
-       printf("prcr = %02x\n", pcic_read(h, 0x02));
-       printf("cvsr = %02x\n", pcic_read(h, 0x2f));
-       printf("DANGER WILL ROBINSON!  Changing voltage select!\n");
-       pcic_write(h, 0x2f, pcic_read(h, 0x2f) & ~0x03);
-       printf("cvsr = %02x\n", pcic_read(h, 0x2f));
-#endif
-       
-       /* power up the socket */
-
-       pcic_write(h, PCIC_PWRCTL, PCIC_PWRCTL_DISABLE_RESETDRV
-                          | PCIC_PWRCTL_PWR_ENABLE);
-
-       /*
-        * wait 100ms until power raise (Tpr) and 20ms to become
-        * stable (Tsu(Vcc)).
-        *
-        * some machines require some more time to be settled
-        * (300ms is added here).
-        */
-       DELAY((100 + 20 + 300) * 1000);
-
-       pcic_write(h, PCIC_PWRCTL, PCIC_PWRCTL_DISABLE_RESETDRV | PCIC_PWRCTL_OE
-                          | PCIC_PWRCTL_PWR_ENABLE);
-       pcic_write(h, PCIC_INTR, 0);
-
-       /*
-        * hold RESET at least 10us.
-        */
-       DELAY(10);
-
-       /* clear the reset flag */
-
-       pcic_write(h, PCIC_INTR, PCIC_INTR_RESET);
-
-       /* wait 20ms as per pc card standard (r2.01) section 4.3.6 */
-
-       DELAY(20000);
-
-       /* wait for the chip to finish initializing */
-
-#ifdef DIAGNOSTIC
-       reg = pcic_read(h, PCIC_IF_STATUS);
-       if (!(reg & PCIC_IF_STATUS_POWERACTIVE)) {
-               printf("pcic_chip_socket_enable: status %x", reg);
-       }
-#endif
-
-       pcic_wait_ready(h);
-
-       /* zero out the address windows */
-       pcic_write(h, PCIC_ADDRWIN_ENABLE, 0);
-
-       /* set the card type */
-       CARD_GET_TYPE(h->dev, &cardtype);
-
-       reg = pcic_read(h, PCIC_INTR);
-       reg &= ~(PCIC_INTR_CARDTYPE_MASK | PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE);
-       reg |= ((cardtype == PCCARD_IFTYPE_IO) ?
-               PCIC_INTR_CARDTYPE_IO :
-               PCIC_INTR_CARDTYPE_MEM);
-       reg |= h->ih_irq;
-       pcic_write(h, PCIC_INTR, reg);
-
-       DEVPRINTF((h->dev, "pcic_chip_socket_enable cardtype %s %02x\n",
-           ((cardtype == PCCARD_IFTYPE_IO) ? "io" : "mem"), reg));
-
-       /* reinstall all the memory and io mappings */
-
-       for (win = 0; win < PCIC_MEM_WINS; win++)
-               if (h->memalloc & (1 << win))
-                       pcic_chip_do_mem_map(h, win);
-
-       for (win = 0; win < PCIC_IO_WINS; win++)
-               if (h->ioalloc & (1 << win))
-                       pcic_chip_do_io_map(h, win);
-
-       return 0;
-}
-
-int
-pcic_disable_socket(device_t dev, device_t child)
-{
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-
-       /* power down the socket */
-
-       pcic_write(h, PCIC_PWRCTL, 0);
-
-       /*
-        * wait 300ms until power fails (Tpf).
-        */
-       DELAY(300 * 1000);
-
-       return 0;
-}
-
-static u_int8_t
-st_pcic_read(struct pcic_handle *h, int idx)
-{
-       if (idx != -1) {
-               bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX, 
-                   h->sock + idx);
-       }
-       return bus_space_read_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA);
-}
-
-static void
-st_pcic_write(struct pcic_handle *h, int idx, u_int8_t data)
-{
-       if (idx != -1) {
-               bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX, 
-                   h->sock + idx);
-       }
-
-       bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA, data);
-}
-
-int
-pcic_activate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-       int err;
-       int sz;
-       int win;
-       bus_addr_t off;
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-
-       sz = rman_get_size(r);
-       switch (type) {
-       case SYS_RES_IOPORT:
-               win = rid;
-               err = pcic_chip_io_map(h, 0, 0, sz, &h->io[rid], &win);
-               if (err) {
-                       pcic_chip_io_free(h, &h->io[rid]);
-                       return err;
-               }
-               break;
-       case SYS_RES_MEMORY: 
-               err = pcic_chip_mem_map(h, 0, 0, sz, &h->mem[rid], &off, &win);
-               if (err) {
-                       pcic_chip_mem_free(h, &h->mem[rid]);
-                       return err;
-               }
-               break;
-       default:
-               break;
-       }
-       err = bus_generic_activate_resource(device_get_parent(dev), child,
-           type, rid, r);
-       return (err);
-}
-
-int
-pcic_deactivate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-       int err = 0;
-
-       switch (type) {
-       case SYS_RES_IOPORT:
-               pcic_chip_io_unmap(h, rid);
-               break;
-       case SYS_RES_MEMORY: 
-               pcic_chip_mem_unmap(h, rid);
-       default:
-               break;
-       }
-       err = bus_generic_deactivate_resource(device_get_parent(dev), child,
-           type, rid, r);
-       return (err);
-}
-
-int
-pcic_setup_intr(device_t dev, device_t child, struct resource *irqres,
-    int flags, driver_intr_t intr, void *arg, void **cookiep)
-{
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-       int reg;
-       int irq;
-       int err;
-
-       err = bus_generic_setup_intr(device_get_parent(dev), child, irqres,
-           flags, intr, arg, cookiep);
-       if (!err)
-               return (err);
-
-       irq = rman_get_start(irqres);
-       reg = pcic_read(h, PCIC_INTR);
-       reg &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE);
-       reg |= irq;
-       pcic_write(h, PCIC_INTR, reg);
-
-       h->ih_irq = irq;
-
-       device_printf(dev, "card irq %d\n", irq);
-
-       return 0;
-}
-
-int
-pcic_teardown_intr(device_t dev, device_t child, struct resource *irq,
-    void *cookiep)
-{
-       int reg;
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-
-       h->ih_irq = 0;
-
-       reg = pcic_read(h, PCIC_INTR);
-       reg &= ~(PCIC_INTR_IRQ_MASK | PCIC_INTR_ENABLE);
-       pcic_write(h, PCIC_INTR, reg);
-
-       return (bus_generic_teardown_intr(device_get_parent(dev), child, irq,
-           cookiep));
-}
-
-struct resource *
-pcic_alloc_resource(device_t dev, device_t child, int type, int *rid,
-    u_long start, u_long end, u_long count, u_int flags)
-{
-       int sz;
-       int err;
-       struct resource *r;
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-
-       /* Nearly default */
-       if (type == SYS_RES_MEMORY && start == 0 && end == ~0 && count != 1) {
-               start = 0xd0000;        /* XXX */
-               end = 0xdffff;
-       }
-
-       r = bus_generic_alloc_resource(dev, child, type, rid, start, end,
-           count, flags);
-       if (r == NULL)
-               return r;
-       sz = rman_get_size(r);
-       switch (type) {
-       case SYS_RES_IOPORT:
-               err = pcic_chip_io_alloc(h, rman_get_start(r), sz, 0,
-                   &h->io[*rid]);
-               if (err) {
-                       bus_generic_release_resource(dev, child, type, *rid, 
-                           r);
-                       return 0;
-               }
-               break;
-       case SYS_RES_MEMORY: 
-               err = pcic_chip_mem_alloc(h, r, sz, &h->mem[*rid]);
-               if (err) {
-                       bus_generic_release_resource(dev, child, type, *rid,
-                           r);
-                       return 0;
-               }
-               break;
-       default:
-               break;
-       }
-       return r;
-}
-
-int
-pcic_release_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-
-       switch (type) {
-       case SYS_RES_IOPORT:
-               pcic_chip_io_free(h, &h->io[rid]);
-               break;
-       case SYS_RES_MEMORY: 
-               pcic_chip_mem_free(h, &h->mem[rid]);
-       default:
-               break;
-       }
-       return bus_generic_release_resource(dev, child, type, rid, r);
-}
-
-int
-pcic_suspend(device_t dev)
-{
-       /*
-        * Do nothing for now, maybe in time do what FreeBSD's current 
-        * pccard code does and detach my children.  That's the safest thing
-        * to do since we don't want to wake up and have different hardware
-        * in the slots.
-        */
-
-       return 0;
-}
-
-int
-pcic_resume(device_t dev)
-{
-       /* Need to port pcic_power from newer netbsd versions of this file */
-
-       return 0;
-}
-
-int
-pcic_set_res_flags(device_t dev, device_t child, int type, int rid, 
-    u_int32_t flags)
-{
-       struct pcic_handle *h = pcic_get_handle(dev, child);
-
-       if (type != SYS_RES_MEMORY)
-               return (EINVAL);
-       h->mem[rid].kind = PCCARD_MEM_ATTR;
-       pcic_chip_do_mem_map(h, rid);
-
-       return 0;
-}
-
-int
-pcic_set_memory_offset(device_t dev, device_t child, int rid, u_int32_t offset,
-    u_int32_t *deltap)
-{
-       /* XXX BAD XXX */
-       return EIO;
-}
-
-static void
-pcic_start_threads(void *arg)
-{
-       struct pcic_handle **walker;
-       walker = handles;
-       while (*walker) {
-               pcic_create_event_thread(*walker++);
-       }
-}
-
-int
-pcic_detach(device_t dev)
-{
-       device_t *kids;
-       int nkids;
-       int i;
-       int ret;
-
-       pcic_deactivate(dev);
-       ret = bus_generic_detach(dev);
-       if (ret != 0)
-               return (ret);
-       /*
-        * Normally, one wouldn't delete the children.  However, detach
-        * merely detaches the children w/o deleting them.  So if
-        * we were to reattach, we add additional children and wind up
-        * with duplicates.  So, we remove them here following the
-        * implicit "if you add it in attach, you should delete it in
-        * detach" rule that may or may not be documented.
-        */
-       device_get_children(dev, &kids, &nkids);
-       for (i = 0; i < nkids; i++) {
-               if ((ret = device_delete_child(dev, kids[i])) != 0)
-                       device_printf(dev, "delete of %s failed: %d\n",
-                               device_get_nameunit(kids[i]), ret);
-       }
-       free(kids, M_TEMP);
-       return 0;
-}
-
-SYSINIT(pcic, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, pcic_start_threads, 0);
-MODULE_VERSION(pcic, 1);
diff --git a/sys/dev/pccard/pcic/i82365_isa.c b/sys/dev/pccard/pcic/i82365_isa.c
deleted file mode 100644 (file)
index 22d8b08..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*     $NetBSD: i82365_isasubr.c,v 1.3 1999/10/15 06:07:27 haya Exp $  */
-/*     $NetBSD: i82365_isa.c,v 1.11 1998/06/09 07:25:00 thorpej Exp $  */
-/* $FreeBSD: src/sys/dev/pcic/i82365_isa.c,v 1.24 2002/05/30 17:37:46 takawata Exp $ */
-/* $DragonFly: src/sys/dev/pccard/pcic/Attic/i82365_isa.c,v 1.1 2004/02/10 07:55:47 joerg Exp $ */
-
-/*
- * Copyright (c) 1998 Bill Sommerfeld.  All rights reserved.
- * Copyright (c) 1997 Marc Horowitz.  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 Marc Horowitz.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/module.h>
-#include <sys/kernel.h>
-#include <sys/queue.h>
-#include <sys/types.h>
-
-#include <sys/bus.h>
-#include <machine/bus.h>
-#include <sys/rman.h>
-#include <machine/resource.h>
-
-#include <bus/isa/isavar.h>
-
-#include <bus/pccard/pccardreg.h>
-#include <bus/pccard/pccardvar.h>
-
-#include <dev/pccard/pcic/i82365reg.h>
-#include <dev/pccard/pcic/i82365var.h>
-
-#include "power_if.h"
-#include "card_if.h"
-
-/*****************************************************************************
- * Configurable parameters.
- *****************************************************************************/
-
-/*
- * Default I/O allocation range.  If both are set to non-zero, these
- * values will be used instead.  Otherwise, the code attempts to probe
- * the bus width.  Systems with 10 address bits should use 0x300 and 0xff.
- * Systems with 12 address bits (most) should use 0x400 and 0xbff.
- */
-
-#ifndef PCIC_ISA_ALLOC_IOBASE
-#define        PCIC_ISA_ALLOC_IOBASE           0
-#endif
-
-#ifndef PCIC_ISA_ALLOC_IOSIZE
-#define        PCIC_ISA_ALLOC_IOSIZE           0
-#endif
-
-int    pcic_isa_alloc_iobase = PCIC_ISA_ALLOC_IOBASE;
-int    pcic_isa_alloc_iosize = PCIC_ISA_ALLOC_IOSIZE;
-
-
-/*
- * Default IRQ allocation bitmask.  This defines the range of allowable
- * IRQs for PCCARD slots.  Useful if order of probing would screw up other
- * devices, or if PCIC hardware/cards have trouble with certain interrupt
- * lines.
- *
- * We disable IRQ 10 by default, since some common laptops (namely, the
- * NEC Versa series) reserve IRQ 10 for the docking station SCSI interface.
- */
-
-#ifndef PCIC_ISA_INTR_ALLOC_MASK
-#define        PCIC_ISA_INTR_ALLOC_MASK        0xfbff
-#endif
-
-int    pcic_isa_intr_alloc_mask = PCIC_ISA_INTR_ALLOC_MASK;
-
-/*****************************************************************************
- * End of configurable parameters.
- *****************************************************************************/
-
-#define PCICISADEBUG 1
-
-#ifdef PCICISADEBUG
-int    pcicisa_debug = PCICISADEBUG;
-#define        DPRINTF(arg) if (pcicisa_debug) printf arg;
-#define        DEVPRINTF(arg) if (pcicisa_debug) device_printf arg;
-#else
-#define        DPRINTF(arg)
-#define        DEVPRINTF(arg)
-#endif
-
-static struct isa_pnp_id pcic_ids[] = {
-       {PCIC_PNP_ACTIONTEC,            NULL},          /* AEI0218 */
-       {PCIC_PNP_IBM3765,              NULL},          /* IBM3765 */
-       {PCIC_PNP_82365,                NULL},          /* PNP0E00 */
-       {PCIC_PNP_CL_PD6720,            NULL},          /* PNP0E01 */
-       {PCIC_PNP_VLSI_82C146,          NULL},          /* PNP0E02 */
-       {PCIC_PNP_82365_CARDBUS,        NULL},          /* PNP0E03 */
-       {PCIC_PNP_SCM_SWAPBOX,          NULL},          /* SCM0469 */
-       {0}
-};
-
-static void
-pcic_isa_bus_width_probe (device_t dev)
-{
-       struct pcic_softc *sc = PCIC_SOFTC(dev);
-       bus_space_handle_t ioh_high;
-       int i, iobuswidth, tmp1, tmp2;
-       int rid;
-       u_long base;
-       u_int32_t length;
-       bus_space_tag_t iot;
-       bus_space_handle_t ioh;
-       struct resource *r;
-
-       base = rman_get_start(sc->port_res);
-       length = rman_get_size(sc->port_res);
-       iot = sc->iot;
-       ioh = sc->ioh;
-
-       /*
-        * figure out how wide the isa bus is.  Do this by checking if the
-        * pcic controller is mirrored 0x400 above where we expect it to be.
-        */
-
-       iobuswidth = 12;
-       rid = 1;
-       r = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, base + 0x400,
-           base + 0x400 + length, length, RF_ACTIVE);
-       if (!r) {
-               printf("Can't allocated mirror area for pcic bus width probe\n");
-               return;
-       }
-       ioh_high = rman_get_bushandle(r);
-       for (i = 0; i < PCIC_NSLOTS; i++) {
-               if (sc->handle[i].flags & PCIC_FLAG_SOCKETP) {
-                       /*
-                        * read the ident flags from the normal space and
-                        * from the mirror, and compare them
-                        */
-
-                       bus_space_write_1(iot, ioh, PCIC_REG_INDEX,
-                           sc->handle[i].sock + PCIC_IDENT);
-                       tmp1 = bus_space_read_1(iot, ioh, PCIC_REG_DATA);
-
-                       bus_space_write_1(iot, ioh_high, PCIC_REG_INDEX,
-                           sc->handle[i].sock + PCIC_IDENT);
-                       tmp2 = bus_space_read_1(iot, ioh_high, PCIC_REG_DATA);
-
-                       if (tmp1 == tmp2)
-                               iobuswidth = 10;
-               }
-       }
-       bus_release_resource(dev, SYS_RES_IOPORT, rid, r);
-
-       /*
-        * XXX mycroft recommends I/O space range 0x400-0xfff .  I should put
-        * this in a header somewhere
-        */
-
-       /*
-        * XXX some hardware doesn't seem to grok addresses in 0x400 range--
-        * apparently missing a bit or more of address lines. (e.g.
-        * CIRRUS_PD672X with Linksys EthernetCard ne2000 clone in TI
-        * TravelMate 5000--not clear which is at fault)
-        * 
-        * Add a kludge to detect 10 bit wide buses and deal with them,
-        * and also a config file option to override the probe.
-        */
-
-       if (iobuswidth == 10) {
-               sc->iobase = 0x300;
-               sc->iosize = 0x0ff;
-       } else {
-#if 0
-               /*
-                * This is what we'd like to use, but...
-                */
-               sc->iobase = 0x400;
-               sc->iosize = 0xbff;
-#else
-               /*
-                * ...the above bus width probe doesn't always work.
-                * So, experimentation has shown the following range
-                * to not lose on systems that 0x300-0x3ff loses on
-                * (e.g. the NEC Versa 6030X).
-                */
-               sc->iobase = 0x330;
-               sc->iosize = 0x0cf;
-#endif
-       }
-
-       DEVPRINTF((dev, "bus_space_alloc range 0x%04lx-0x%04lx (probed)\n",
-           (long) sc->iobase, (long) sc->iobase + sc->iosize));
-
-       if (pcic_isa_alloc_iobase && pcic_isa_alloc_iosize) {
-               sc->iobase = pcic_isa_alloc_iobase;
-               sc->iosize = pcic_isa_alloc_iosize;
-
-               DEVPRINTF((dev, "bus_space_alloc range 0x%04lx-0x%04lx "
-                   "(config override)\n", (long) sc->iobase,
-                   (long) sc->iobase + sc->iosize));
-       }
-}
-
-#if 0
-static int
-pcic_isa_check(device_t dev, u_int16_t addr)
-{
-       bus_space_tag_t iot;
-       bus_space_handle_t ioh;
-       int val, found;
-       int rid;
-       struct resource *res;
-
-       rid = 0;
-       res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, addr, addr,
-           PCIC_IOSIZE, RF_ACTIVE);
-       if (!res)
-               return(ENXIO);
-       iot = rman_get_bustag(res);
-       ioh = rman_get_bushandle(res);
-       found = 0;
-
-       /*
-        * this could be done with a loop, but it would violate the
-        * abstraction
-        */
-       bus_space_write_1(iot, ioh, PCIC_REG_INDEX, C0SA + PCIC_IDENT);
-       val = bus_space_read_1(iot, ioh, PCIC_REG_DATA);
-       if (pcic_ident_ok(val))
-               found++;
-
-       bus_space_write_1(iot, ioh, PCIC_REG_INDEX, C0SB + PCIC_IDENT);
-       val = bus_space_read_1(iot, ioh, PCIC_REG_DATA);
-       if (pcic_ident_ok(val))
-               found++;
-
-       bus_space_write_1(iot, ioh, PCIC_REG_INDEX, C1SA + PCIC_IDENT);
-       val = bus_space_read_1(iot, ioh, PCIC_REG_DATA);
-       if (pcic_ident_ok(val))
-               found++;
-
-       bus_space_write_1(iot, ioh, PCIC_REG_INDEX, C1SB + PCIC_IDENT);
-       val = bus_space_read_1(iot, ioh, PCIC_REG_DATA);
-       if (pcic_ident_ok(val))
-               found++;
-
-       bus_release_resource(dev, SYS_RES_IOPORT, rid, res);
-
-       return (found);
-}
-#endif
-
-static int
-pcic_isa_probe(device_t dev)
-{
-       int error;
-       struct resource *res;
-       int rid;
-       int i;
-       u_long mem;
-
-       /* Check isapnp ids */
-       error = ISA_PNP_PROBE(device_get_parent(dev), dev, pcic_ids);
-       if (error == ENXIO)
-               return (ENXIO);
-
-       /* If we had some other problem. */
-       if (!(error == 0 || error == ENOENT))
-               return (error);
-
-       /* If we have the resources we need then we're good to go. */
-       if (bus_get_resource_start(dev, SYS_RES_IOPORT, 0) == 0)
-               return (ENXIO);
-       rid = 0;
-       res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE);
-       if (res == NULL) {
-               /*
-                * No IRQ specified, find one.  This can be due to the PnP
-                * data not specifying any IRQ
-                */
-               for (i = 0; i < 16; i++) {
-                       if (((1 << i) & PCIC_INTR_IRQ_VALIDMASK) == 0)
-                               continue;
-                       res = bus_alloc_resource(dev, SYS_RES_IRQ,
-                           &rid, i, i, 1, RF_ACTIVE);
-                       if (res != NULL)
-                               break;
-               }
-               if (res == NULL)
-                       return (ENXIO);
-               mem = rman_get_start(res);
-               bus_release_resource(dev, SYS_RES_IRQ, rid, res);       
-               bus_set_resource(dev, SYS_RES_IRQ, 0, i, 1);
-       } else {
-               bus_release_resource(dev, SYS_RES_IRQ, rid, res);
-       }
-       /* XXX This might not be needed in future, get it directly from
-        * XXX parent */
-       rid = 0;
-       res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 
-           1 << 13, RF_ACTIVE);
-       if (res == NULL) {
-               /*
-                * We failed to get memory.  Since this XXX comment above
-                * indicates that this is transient, we try to get a hunk
-                * of memory in the isa hole.  Sure would be nice if there
-                * were some MI constants for this.
-                */
-               res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 
-                   0xa0000, 0xdffff, 1 << 13, RF_ACTIVE);
-               if (res != NULL) {
-                       mem = rman_get_start(res);
-                       bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
-                       bus_set_resource(dev, SYS_RES_MEMORY, 0, mem, 1 << 13);
-               }
-       } else {
-               bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
-       }
-       if (res == NULL) {
-               device_printf(dev, "Cannot allocate mem\n");
-               return ENOMEM;
-       }
-       return (0);
-}
-
-static int
-pcic_isa_attach(device_t dev)
-{
-       int err = 0;
-
-       if ((err = pcic_attach(dev)) == 0)
-               pcic_isa_bus_width_probe (dev);
-       return err;
-}
-
-static int
-pcic_isa_detach(device_t dev)
-{
-       pcic_detach(dev);
-       return 0;
-}
-
-static device_method_t pcic_isa_methods[] = {
-       /* Device interface */
-       DEVMETHOD(device_probe,         pcic_isa_probe),
-       DEVMETHOD(device_attach,        pcic_isa_attach),
-       DEVMETHOD(device_detach,        pcic_isa_detach),
-       DEVMETHOD(device_shutdown,      bus_generic_shutdown),
-       DEVMETHOD(device_suspend,       pcic_suspend),
-       DEVMETHOD(device_resume,        pcic_resume),
-
-       /* Bus Interface */
-       DEVMETHOD(bus_driver_added,     bus_generic_driver_added),
-       DEVMETHOD(bus_print_child,      bus_generic_print_child),
-       DEVMETHOD(bus_alloc_resource,   pcic_alloc_resource),
-       DEVMETHOD(bus_release_resource, pcic_release_resource),
-       DEVMETHOD(bus_activate_resource, pcic_activate_resource),
-       DEVMETHOD(bus_deactivate_resource, pcic_deactivate_resource),
-       DEVMETHOD(bus_setup_intr,       pcic_setup_intr),
-       DEVMETHOD(bus_teardown_intr,    pcic_teardown_intr),
-
-       /* pccard/cardbus interface */
-       DEVMETHOD(card_set_res_flags, pcic_set_res_flags),
-       DEVMETHOD(card_set_memory_offset, pcic_set_memory_offset),
-
-       /* Power Interface */
-       DEVMETHOD(power_enable_socket,  pcic_enable_socket),
-       DEVMETHOD(power_disable_socket, pcic_disable_socket),
-       { 0, 0 }
-};
-
-static driver_t pcic_driver = {
-       "pcic",
-       pcic_isa_methods,
-       sizeof(struct pcic_softc)
-};
-
-static devclass_t pcic_devclass;
-
-DRIVER_MODULE(pcic, isa, pcic_driver, pcic_devclass, 0, 0);
-MODULE_DEPEND(pcic, pccard, 1, 1, 1);
diff --git a/sys/dev/pccard/pcic/i82365reg.h b/sys/dev/pccard/pcic/i82365reg.h
deleted file mode 100644 (file)
index cfcafc0..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/*     $NetBSD: i82365reg.h,v 1.3 1998/12/20 17:53:28 nathanw Exp $    */
-/* $FreeBSD: src/sys/dev/pcic/i82365reg.h,v 1.10 2001/06/16 06:10:53 imp Exp $ */
-/* $DragonFly: src/sys/dev/pccard/pcic/Attic/i82365reg.h,v 1.1 2004/02/10 07:55:47 joerg Exp $ */
-
-/*
- * Copyright (c) 1997 Marc Horowitz.  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 Marc Horowitz.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-/*
- * All information is from the intel 82365sl PC Card Interface Controller
- * (PCIC) data sheet, marked "preliminary".  Order number 290423-002, January
- * 1993.
- */
-
-#define        PCIC_IOSIZE             2
-
-#define        PCIC_REG_INDEX          0
-#define        PCIC_REG_DATA           1
-
-/*
- * I/o ports
- */
-#define PCIC_INDEX0            0x3e0
-
-/*
- * The PCIC allows two chips to share the same address.  In order not to run
- * afoul of the netbsd device model, this driver will treat those chips as
- * the same device.
- */
-
-#define        PCIC_CHIP0_BASE         0x00
-#define        PCIC_CHIP1_BASE         0x80
-
-/* Each PCIC chip can drive two sockets */
-
-#define        PCIC_SOCKETA_INDEX      0x00
-#define        PCIC_SOCKETB_INDEX      0x40
-
-/* general setup registers */
-
-#define        PCIC_IDENT                              0x00    /* RO */
-#define        PCIC_IDENT_IFTYPE_MASK                  0xC0
-#define        PCIC_IDENT_IFTYPE_IO_ONLY               0x00
-#define        PCIC_IDENT_IFTYPE_MEM_ONLY              0x40
-#define        PCIC_IDENT_IFTYPE_MEM_AND_IO            0x80
-#define        PCIC_IDENT_IFTYPE_RESERVED              0xC0
-#define        PCIC_IDENT_ZERO                         0x30
-#define        PCIC_IDENT_REV_MASK                     0x0F
-#define        PCIC_IDENT_REV_I82365SLR0               0x02
-#define        PCIC_IDENT_REV_I82365SLR1               0x03
-
-#define        PCIC_IF_STATUS                          0x01    /* RO */
-#define        PCIC_IF_STATUS_GPI                      0x80 /* General Purpose Input */
-#define        PCIC_IF_STATUS_POWERACTIVE              0x40
-#define        PCIC_IF_STATUS_READY                    0x20 /* really READY/!BUSY */
-#define        PCIC_IF_STATUS_MEM_WP                   0x10
-#define        PCIC_IF_STATUS_CARDDETECT_MASK          0x0C
-#define        PCIC_IF_STATUS_CARDDETECT_PRESENT       0x0C
-#define        PCIC_IF_STATUS_BATTERY_MASK             0x03
-#define        PCIC_IF_STATUS_BATTERY_DEAD1            0x00
-#define        PCIC_IF_STATUS_BATTERY_DEAD2            0x01
-#define        PCIC_IF_STATUS_BATTERY_WARNING          0x02
-#define        PCIC_IF_STATUS_BATTERY_GOOD             0x03
-
-#define        PCIC_PWRCTL                             0x02    /* RW */
-#define        PCIC_PWRCTL_OE                          0x80    /* output enable */
-#define        PCIC_PWRCTL_DISABLE_RESETDRV            0x40
-#define        PCIC_PWRCTL_AUTOSWITCH_ENABLE           0x20
-#define        PCIC_PWRCTL_PWR_ENABLE                  0x10
-#define        PCIC_PWRCTL_VPP2_MASK                   0x0C
-/* XXX these are a little unclear from the data sheet */
-#define        PCIC_PWRCTL_VPP2_RESERVED               0x0C
-#define        PCIC_PWRCTL_VPP2_EN1                    0x08
-#define        PCIC_PWRCTL_VPP2_EN0                    0x04
-#define        PCIC_PWRCTL_VPP2_ENX                    0x00
-#define        PCIC_PWRCTL_VPP1_MASK                   0x03
-/* XXX these are a little unclear from the data sheet */
-#define        PCIC_PWRCTL_VPP1_RESERVED               0x03
-#define        PCIC_PWRCTL_VPP1_EN1                    0x02
-#define        PCIC_PWRCTL_VPP1_EN0                    0x01
-#define        PCIC_PWRCTL_VPP1_ENX                    0x00
-
-#define        PCIC_CSC                                0x04    /* RW */
-#define        PCIC_CSC_ZERO                           0xE0
-#define        PCIC_CSC_GPI                            0x10
-#define        PCIC_CSC_CD                             0x08 /* Card Detect Change */
-#define        PCIC_CSC_READY                          0x04
-#define        PCIC_CSC_BATTWARN                       0x02
-#define        PCIC_CSC_BATTDEAD                       0x01    /* for memory cards */
-#define        PCIC_CSC_RI                             0x01    /* for i/o cards */
-
-#define        PCIC_ADDRWIN_ENABLE                     0x06    /* RW */
-#define        PCIC_ADDRWIN_ENABLE_IO1                 0x80
-#define        PCIC_ADDRWIN_ENABLE_IO0                 0x40
-#define        PCIC_ADDRWIN_ENABLE_MEMCS16             0x20    /* rtfds if you care */
-#define        PCIC_ADDRWIN_ENABLE_MEM4                0x10
-#define        PCIC_ADDRWIN_ENABLE_MEM3                0x08
-#define        PCIC_ADDRWIN_ENABLE_MEM2                0x04
-#define        PCIC_ADDRWIN_ENABLE_MEM1                0x02
-#define        PCIC_ADDRWIN_ENABLE_MEM0                0x01
-
-#define        PCIC_CARD_DETECT                        0x16    /* RW */
-#define        PCIC_CARD_DETECT_RESERVED               0xC0
-#define        PCIC_CARD_DETECT_SW_INTR                0x20
-#define        PCIC_CARD_DETECT_RESUME_ENABLE          0x10
-#define        PCIC_CARD_DETECT_GPI_TRANSCTL           0x08
-#define        PCIC_CARD_DETECT_GPI_ENABLE             0x04
-#define        PCIC_CARD_DETECT_CFGRST_ENABLE          0x02
-#define        PCIC_CARD_DETECT_MEMDLY_INHIBIT         0x01
-
-/* interrupt registers */
-
-#define        PCIC_INTR                               0x03    /* RW */
-#define        PCIC_INTR_RI_ENABLE                     0x80
-#define        PCIC_INTR_RESET                         0x40    /* active low (zero) */
-#define        PCIC_INTR_CARDTYPE_MASK                 0x20
-#define        PCIC_INTR_CARDTYPE_IO                   0x20
-#define        PCIC_INTR_CARDTYPE_MEM                  0x00
-#define        PCIC_INTR_ENABLE                        0x10
-#define        PCIC_INTR_IRQ_MASK                      0x0F
-#define        PCIC_INTR_IRQ_SHIFT                     0
-#define        PCIC_INTR_IRQ_NONE                      0x00
-#define        PCIC_INTR_IRQ_RESERVED1                 0x01
-#define        PCIC_INTR_IRQ_RESERVED2                 0x02
-#define        PCIC_INTR_IRQ3                          0x03
-#define        PCIC_INTR_IRQ4                          0x04
-#define        PCIC_INTR_IRQ5                          0x05
-#define        PCIC_INTR_IRQ_RESERVED6                 0x06
-#define        PCIC_INTR_IRQ7                          0x07
-#define        PCIC_INTR_IRQ_RESERVED8                 0x08
-#define        PCIC_INTR_IRQ9                          0x09
-#define        PCIC_INTR_IRQ10                         0x0A
-#define        PCIC_INTR_IRQ11                         0x0B
-#define        PCIC_INTR_IRQ12                         0x0C
-#define        PCIC_INTR_IRQ_RESERVED13                0x0D
-#define        PCIC_INTR_IRQ14                         0x0E
-#define        PCIC_INTR_IRQ15                         0x0F
-
-#define        PCIC_INTR_IRQ_VALIDMASK                 0xDEB8 /* 1101 1110 1011 1000 */
-
-#define        PCIC_CSC_INTR                           0x05    /* RW */
-#define        PCIC_CSC_INTR_IRQ_MASK                  0xF0
-#define        PCIC_CSC_INTR_IRQ_SHIFT                 4
-#define        PCIC_CSC_INTR_IRQ_NONE                  0x00
-#define        PCIC_CSC_INTR_IRQ_RESERVED1             0x10
-#define        PCIC_CSC_INTR_IRQ_RESERVED2             0x20
-#define        PCIC_CSC_INTR_IRQ3                      0x30
-#define        PCIC_CSC_INTR_IRQ4                      0x40
-#define        PCIC_CSC_INTR_IRQ5                      0x50
-#define        PCIC_CSC_INTR_IRQ_RESERVED6             0x60
-#define        PCIC_CSC_INTR_IRQ7                      0x70
-#define        PCIC_CSC_INTR_IRQ_RESERVED8             0x80
-#define        PCIC_CSC_INTR_IRQ9                      0x90
-#define        PCIC_CSC_INTR_IRQ10                     0xA0
-#define        PCIC_CSC_INTR_IRQ11                     0xB0
-#define        PCIC_CSC_INTR_IRQ12                     0xC0
-#define        PCIC_CSC_INTR_IRQ_RESERVED13            0xD0
-#define        PCIC_CSC_INTR_IRQ14                     0xE0
-#define        PCIC_CSC_INTR_IRQ15                     0xF0
-#define        PCIC_CSC_INTR_CD_ENABLE                 0x08
-#define        PCIC_CSC_INTR_READY_ENABLE              0x04
-#define        PCIC_CSC_INTR_BATTWARN_ENABLE           0x02
-#define        PCIC_CSC_INTR_BATTDEAD_ENABLE           0x01    /* for memory cards */
-#define        PCIC_CSC_INTR_RI_ENABLE                 0x01    /* for I/O cards */
-
-#define        PCIC_CSC_INTR_IRQ_VALIDMASK             0xDEB8 /* 1101 1110 1011 1000 */
-
-/* I/O registers */
-
-#define        PCIC_IO_WINS                            2
-
-#define        PCIC_IOCTL                              0x07    /* RW */
-#define        PCIC_IOCTL_IO1_WAITSTATE                0x80
-#define        PCIC_IOCTL_IO1_ZEROWAIT                 0x40
-#define        PCIC_IOCTL_IO1_IOCS16SRC_MASK           0x20
-#define        PCIC_IOCTL_IO1_IOCS16SRC_CARD           0x20
-#define        PCIC_IOCTL_IO1_IOCS16SRC_DATASIZE       0x00
-#define        PCIC_IOCTL_IO1_DATASIZE_MASK            0x10
-#define        PCIC_IOCTL_IO1_DATASIZE_16BIT           0x10
-#define        PCIC_IOCTL_IO1_DATASIZE_8BIT            0x00
-#define        PCIC_IOCTL_IO0_WAITSTATE                0x08
-#define        PCIC_IOCTL_IO0_ZEROWAIT                 0x04
-#define        PCIC_IOCTL_IO0_IOCS16SRC_MASK           0x02
-#define        PCIC_IOCTL_IO0_IOCS16SRC_CARD           0x02
-#define        PCIC_IOCTL_IO0_IOCS16SRC_DATASIZE       0x00
-#define        PCIC_IOCTL_IO0_DATASIZE_MASK            0x01
-#define        PCIC_IOCTL_IO0_DATASIZE_16BIT           0x01
-#define        PCIC_IOCTL_IO0_DATASIZE_8BIT            0x00
-
-#define        PCIC_IOADDR0_START_LSB                  0x08
-#define        PCIC_IOADDR0_START_MSB                  0x09
-#define        PCIC_IOADDR0_STOP_LSB                   0x0A
-#define        PCIC_IOADDR0_STOP_MSB                   0x0B
-#define        PCIC_IOADDR1_START_LSB                  0x0C
-#define        PCIC_IOADDR1_START_MSB                  0x0D
-#define        PCIC_IOADDR1_STOP_LSB                   0x0E
-#define        PCIC_IOADDR1_STOP_MSB                   0x0F
-
-/* memory registers */
-
-/*
- * memory window addresses refer to bits A23-A12 of the ISA system memory
- * address.  This is a shift of 12 bits.  The LSB contains A19-A12, and the
- * MSB contains A23-A20, plus some other bits.
- */
-
-#define        PCIC_MEM_WINS                           5
-
-#define        PCIC_MEM_SHIFT                          12
-#define        PCIC_MEM_PAGESIZE                       (1<<PCIC_MEM_SHIFT)
-
-#define        PCIC_SYSMEM_ADDRX_SHIFT                         PCIC_MEM_SHIFT
-#define        PCIC_SYSMEM_ADDRX_START_MSB_DATASIZE_MASK       0x80
-#define        PCIC_SYSMEM_ADDRX_START_MSB_DATASIZE_16BIT      0x80
-#define        PCIC_SYSMEM_ADDRX_START_MSB_DATASIZE_8BIT       0x00
-#define        PCIC_SYSMEM_ADDRX_START_MSB_ZEROWAIT            0x40
-#define        PCIC_SYSMEM_ADDRX_START_MSB_SCRATCH_MASK        0x30
-#define        PCIC_SYSMEM_ADDRX_START_MSB_ADDR_MASK           0x0F
-
-#define        PCIC_SYSMEM_ADDRX_STOP_MSB_WAIT_MASK            0xC0
-#define        PCIC_SYSMEM_ADDRX_STOP_MSB_WAIT0                0x00
-#define        PCIC_SYSMEM_ADDRX_STOP_MSB_WAIT1                0x40
-#define        PCIC_SYSMEM_ADDRX_STOP_MSB_WAIT2                0x80
-#define        PCIC_SYSMEM_ADDRX_STOP_MSB_WAIT3                0xC0
-#define        PCIC_SYSMEM_ADDRX_STOP_MSB_ADDR_MASK            0x0F
-
-/*
- * The card side of a memory mapping consists of bits A19-A12 of the card
- * memory address in the LSB, and A25-A20 plus some other bits in the MSB.
- * Again, the shift is 12 bits.
- */
-
-#define        PCIC_CARDMEM_ADDRX_SHIFT                PCIC_MEM_SHIFT
-#define        PCIC_CARDMEM_ADDRX_MSB_WP               0x80
-#define        PCIC_CARDMEM_ADDRX_MSB_REGACTIVE_MASK   0x40
-#define        PCIC_CARDMEM_ADDRX_MSB_REGACTIVE_ATTR   0x40
-#define        PCIC_CARDMEM_ADDRX_MSB_REGACTIVE_COMMON 0x00
-#define        PCIC_CARDMEM_ADDRX_MSB_ADDR_MASK        0x3F
-
-#define        PCIC_SYSMEM_ADDR0_START_LSB             0x10
-#define        PCIC_SYSMEM_ADDR0_START_MSB             0x11
-#define        PCIC_SYSMEM_ADDR0_STOP_LSB              0x12
-#define        PCIC_SYSMEM_ADDR0_STOP_MSB              0x13
-
-#define        PCIC_CARDMEM_ADDR0_LSB                  0x14
-#define        PCIC_CARDMEM_ADDR0_MSB                  0x15
-
-/* #define     PCIC_RESERVED                   0x17 */
-
-#define        PCIC_SYSMEM_ADDR1_START_LSB             0x18
-#define        PCIC_SYSMEM_ADDR1_START_MSB             0x19
-#define        PCIC_SYSMEM_ADDR1_STOP_LSB              0x1A
-#define        PCIC_SYSMEM_ADDR1_STOP_MSB              0x1B
-
-#define        PCIC_CARDMEM_ADDR1_LSB                  0x1C
-#define        PCIC_CARDMEM_ADDR1_MSB                  0x1D
-
-#define        PCIC_SYSMEM_ADDR2_START_LSB             0x20
-#define        PCIC_SYSMEM_ADDR2_START_MSB             0x21
-#define        PCIC_SYSMEM_ADDR2_STOP_LSB              0x22
-#define        PCIC_SYSMEM_ADDR2_STOP_MSB              0x23
-
-#define        PCIC_CARDMEM_ADDR2_LSB                  0x24
-#define        PCIC_CARDMEM_ADDR2_MSB                  0x25
-
-/* #define     PCIC_RESERVED                   0x26 */
-/* #define     PCIC_RESERVED                   0x27 */
-
-#define        PCIC_SYSMEM_ADDR3_START_LSB             0x28
-#define        PCIC_SYSMEM_ADDR3_START_MSB             0x29
-#define        PCIC_SYSMEM_ADDR3_STOP_LSB              0x2A
-#define        PCIC_SYSMEM_ADDR3_STOP_MSB              0x2B
-
-#define        PCIC_CARDMEM_ADDR3_LSB                  0x2C
-#define        PCIC_CARDMEM_ADDR3_MSB                  0x2D
-
-/* #define     PCIC_RESERVED                   0x2E */
-/* #define     PCIC_RESERVED                   0x2F */
-
-#define        PCIC_SYSMEM_ADDR4_START_LSB             0x30
-#define        PCIC_SYSMEM_ADDR4_START_MSB             0x31
-#define        PCIC_SYSMEM_ADDR4_STOP_LSB              0x32
-#define        PCIC_SYSMEM_ADDR4_STOP_MSB              0x33
-
-#define        PCIC_CARDMEM_ADDR4_LSB                  0x34
-#define        PCIC_CARDMEM_ADDR4_MSB                  0x35
-
-/* #define     PCIC_RESERVED                   0x36 */
-/* #define     PCIC_RESERVED                   0x37 */
-/* #define     PCIC_RESERVED                   0x38 */
-/* #define     PCIC_RESERVED                   0x39 */
-/* #define     PCIC_RESERVED                   0x3A */
-/* #define     PCIC_RESERVED                   0x3B */
-/* #define     PCIC_RESERVED                   0x3C */
-/* #define     PCIC_RESERVED                   0x3D */
-/* #define     PCIC_RESERVED                   0x3E */
-/* #define     PCIC_RESERVED                   0x3F */
-
-/* cardbus extensions - memory window page registers */
-
-#define        PCIC_MEMREG_WIN_SHIFT                   24
-#define        PCIC_SYSMEM_ADDR0_WIN                   0x40
-#define        PCIC_SYSMEM_ADDR1_WIN                   0x41
-#define        PCIC_SYSMEM_ADDR2_WIN                   0x42
-#define        PCIC_SYSMEM_ADDR3_WIN                   0x43
-#define        PCIC_SYSMEM_ADDR4_WIN                   0x44
-
-/* vendor-specific registers */
-
-#define        PCIC_INTEL_GLOBAL_CTL                   0x1E    /* RW */
-#define        PCIC_INTEL_GLOBAL_CTL_RESERVED          0xF0
-#define        PCIC_INTEL_GLOBAL_CTL_IRQ14PULSE_ENABLE 0x08
-#define        PCIC_INTEL_GLOBAL_CTL_EXPLICIT_CSC_ACK  0x04
-#define        PCIC_INTEL_GLOBAL_CTL_IRQLEVEL_ENABLE   0x02
-#define        PCIC_INTEL_GLOBAL_CTL_POWERDOWN         0x01
-
-#define        PCIC_CIRRUS_MISC_CTL_2                  0x1E
-#define        PCIC_CIRRUS_MISC_CTL_2_SUSPEND          0x04
-
-#define        PCIC_CIRRUS_CHIP_INFO                   0x1F
-#define        PCIC_CIRRUS_CHIP_INFO_CHIP_ID           0xC0
-#define        PCIC_CIRRUS_CHIP_INFO_SLOTS             0x20
-#define        PCIC_CIRRUS_CHIP_INFO_REV               0x1F
-
-#define PCIC_CIRRUS_EXTENDED_INDEX             0x2E
-#define PCIC_CIRRUS_EXTENDED_DATA              0x2F
-#define PCIC_CIRRUS_EXT_CONTROL_1              0x03
-#define PCIC_CIRRUS_EXT_CONTROL_1_PCI_INTR_MASK        0x18
-
-/* Plug and play */
-#define PCIC_PNP_ACTIONTEC     0x1802A904      /* AEI0218 */
-#define PCIC_PNP_IBM3765       0x65374d24      /* IBM3765 */
-#define PCIC_PNP_82365         0x000ED041      /* PNP0E00 */
-#define PCIC_PNP_CL_PD6720     0x010ED041      /* PNP0E01 */
-#define PCIC_PNP_VLSI_82C146   0x020ED041      /* PNP0E02 */
-#define PCIC_PNP_82365_CARDBUS 0x030ED041      /* PNP0E03 */
-#define PCIC_PNP_SCM_SWAPBOX   0x69046d4c      /* SMC0469 */
-
-/* C-Bus PnP Definitions */
-#define PCIC_NEC_PC9801_102    0x9180a3b8      /* NEC8091 PC-9801-102 */
-#define        PCIC_NEC_PC9821RA_E01   0x2181a3b8      /* NEC8121 PC-9821RA-E01 */
diff --git a/sys/dev/pccard/pcic/i82365var.h b/sys/dev/pccard/pcic/i82365var.h
deleted file mode 100644 (file)
index b335f02..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*     $NetBSD: i82365var.h,v 1.8 1999/10/15 06:07:27 haya Exp $       */
-/* $FreeBSD: src/sys/dev/pcic/i82365var.h,v 1.26 2001/01/07 16:31:07 imp Exp $ */
-/* $DragonFly: src/sys/dev/pccard/pcic/Attic/i82365var.h,v 1.1 2004/02/10 07:55:47 joerg Exp $ */
-
-
-/*
- * Copyright (c) 1997 Marc Horowitz.  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 Marc Horowitz.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- */
-
-#include <bus/pccard/pccardreg.h>
-
-#include <dev/pccard/pcic/i82365reg.h>
-
-struct proc;
-
-struct pcic_event {
-       STAILQ_ENTRY(pcic_event) pe_q;
-       int pe_type;
-};
-
-/* pe_type */
-#define        PCIC_EVENT_INSERTION    0
-#define        PCIC_EVENT_REMOVAL      1
-
-struct proc;
-
-struct pcic_handle {
-       void *sc;
-       device_t dev;
-       bus_space_tag_t ph_bus_t;       /* I/O or MEM?  I don't mind */
-       bus_space_handle_t ph_bus_h;
-       u_int8_t (*ph_read)(struct pcic_handle*, int);
-       void (*ph_write)(struct pcic_handle *, int, u_int8_t);
-
-       int     vendor;
-       int     sock;
-       int     flags;
-       int     laststate;
-       int     memalloc;
-       struct pccard_mem_handle mem[PCIC_MEM_WINS];    /* XXX BAD XXX */
-       int     ioalloc;
-       struct pccard_io_handle io[PCIC_IO_WINS];       /* XXX BAD XXX */
-       int     ih_irq;
-
-       int shutdown;
-       struct thread *event_thread;
-       STAILQ_HEAD(, pcic_event) events;
-};
-
-#define        PCIC_FLAG_SOCKETP       0x0001
-#define        PCIC_FLAG_CARDP         0x0002
-
-#define PCIC_LASTSTATE_PRESENT 0x0002
-#define PCIC_LASTSTATE_HALF            0x0001
-#define PCIC_LASTSTATE_EMPTY   0x0000
-
-#define        C0SA PCIC_CHIP0_BASE+PCIC_SOCKETA_INDEX
-#define        C0SB PCIC_CHIP0_BASE+PCIC_SOCKETB_INDEX
-#define        C1SA PCIC_CHIP1_BASE+PCIC_SOCKETA_INDEX
-#define        C1SB PCIC_CHIP1_BASE+PCIC_SOCKETB_INDEX
-
-/*
- * This is sort of arbitrary.  It merely needs to be "enough". It can be
- * overridden in the conf file, anyway.
- */
-
-#define        PCIC_MEM_PAGES  4
-#define        PCIC_MEMSIZE    PCIC_MEM_PAGES*PCIC_MEM_PAGESIZE
-
-#define        PCIC_NSLOTS     4
-
-struct pcic_softc {
-       device_t dev;
-
-       bus_space_tag_t memt;
-       bus_space_handle_t memh;
-       bus_space_tag_t iot;
-       bus_space_handle_t ioh;
-
-       void            *intrhand;
-       struct resource *irq_res;
-       int             irq_rid;
-       struct resource *mem_res;
-       int             mem_rid;
-       struct resource *port_res;
-       int             port_rid;
-
-#define PCIC_MAX_MEM_PAGES     (8 * sizeof(int))
-
-       /* used by memory window mapping functions */
-       bus_addr_t membase;
-
-       /*
-        * used by io window mapping functions.  These can actually overlap
-        * with another pcic, since the underlying extent mapper will deal
-        * with individual allocations.  This is here to deal with the fact
-        * that different busses have different real widths (different pc
-        * hardware seems to use 10 or 12 bits for the I/O bus).
-        */
-       bus_addr_t iobase;
-       bus_addr_t iosize;
-
-       int     irq;
-       void    *ih;
-
-       struct pcic_handle handle[PCIC_NSLOTS];
-};
-
-
-int    pcic_ident_ok(int);
-int    pcic_vendor(struct pcic_handle *);
-char   *pcic_vendor_to_string(int);
-
-int    pcic_attach(device_t dev);
-
-#define pcic_read(h, idx)      (*(h)->ph_read)((h), (idx))
-#define pcic_write(h, idx, data) (*(h)->ph_write)((h), (idx), (data))
-
-/*
- * bus/device/etc routines
- */
-int pcic_activate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r);
-struct resource *pcic_alloc_resource(device_t dev, device_t child, int type,
-    int *rid, u_long start, u_long end, u_long count, u_int flags);
-void pcic_deactivate(device_t dev);
-int pcic_deactivate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r);
-int pcic_detach(device_t dev);
-int pcic_release_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r);
-int pcic_setup_intr(device_t dev, device_t child, struct resource *irq,
-    int flags, driver_intr_t intr, void *arg, void **cookiep);
-int pcic_teardown_intr(device_t dev, device_t child, struct resource *irq,
-    void *cookiep);
-int pcic_suspend(device_t dev);
-int pcic_resume(device_t dev);
-int pcic_enable_socket(device_t dev, device_t child);
-int pcic_disable_socket(device_t dev, device_t child);
-int pcic_set_res_flags(device_t dev, device_t child, int type, int rid, 
-    u_int32_t flags);
-int pcic_set_memory_offset(device_t dev, device_t child, int rid,
-    u_int32_t offset, u_int32_t *deltap);
-
-#define PCIC_SOFTC(d) (struct pcic_softc *) device_get_softc(d)
diff --git a/sys/dev/serial/rp2/rp.c b/sys/dev/serial/rp2/rp.c
deleted file mode 100644 (file)
index 03a34b4..0000000
+++ /dev/null
@@ -1,1973 +0,0 @@
-/* 
- * Copyright (c) Comtrol Corporation <support@comtrol.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted prodived that the follwoing conditions
- * are met.
- * 1. Redistributions of source code must retain the above copyright 
- *    notive, this list of conditions and the following disclainer.
- * 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 prodided 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 Comtrol Corporation.
- * 4. The name of Comtrol Corporation may not be used to endorse or 
- *    promote products derived from this software without specific 
- *    prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY COMTROL CORPORATION ``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 COMTROL CORPORATION 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, LIFE 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.
- *
- * $FreeBSD: src/sys/i386/isa/rp.c,v 1.33.2.2 2001/02/26 04:23:10 jlemon Exp $
- * $DragonFly: src/sys/dev/serial/rp2/Attic/rp.c,v 1.15 2004/12/08 20:36:39 joerg Exp $
- */
-
-/* 
- * rp.c - for RocketPort FreeBSD
- */
-
-#include "opt_compat.h"
-#include "opt_depricated.h"
-#ifndef I_WANT_DEPRICATED_STUFF
-#error "Add options I_WANT_DEPRICATED_STUFF to your kernel config and send a mail to kernel@"
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/fcntl.h>
-#include <sys/malloc.h>
-#include <sys/tty.h>
-#include <sys/proc.h>
-#include <sys/conf.h>
-#include <sys/kernel.h>
-
-#include <bus/isa/i386/isa_device.h>
-
-#include <bus/pci/pcivar.h>
-
-#define ROCKET_C
-#include "rpreg.h"
-#include "rpvar.h"
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-static Byte_t RData[RDATASIZE] =
-{
-   0x00, 0x09, 0xf6, 0x82,
-   0x02, 0x09, 0x86, 0xfb,
-   0x04, 0x09, 0x00, 0x0a,
-   0x06, 0x09, 0x01, 0x0a,
-   0x08, 0x09, 0x8a, 0x13,
-   0x0a, 0x09, 0xc5, 0x11,
-   0x0c, 0x09, 0x86, 0x85,
-   0x0e, 0x09, 0x20, 0x0a,
-   0x10, 0x09, 0x21, 0x0a,
-   0x12, 0x09, 0x41, 0xff,
-   0x14, 0x09, 0x82, 0x00,
-   0x16, 0x09, 0x82, 0x7b,
-   0x18, 0x09, 0x8a, 0x7d,
-   0x1a, 0x09, 0x88, 0x81,
-   0x1c, 0x09, 0x86, 0x7a,
-   0x1e, 0x09, 0x84, 0x81,
-   0x20, 0x09, 0x82, 0x7c,
-   0x22, 0x09, 0x0a, 0x0a
-};
-
-static Byte_t RRegData[RREGDATASIZE]=
-{
-   0x00, 0x09, 0xf6, 0x82,            /* 00: Stop Rx processor */
-   0x08, 0x09, 0x8a, 0x13,            /* 04: Tx software flow control */
-   0x0a, 0x09, 0xc5, 0x11,            /* 08: XON char */
-   0x0c, 0x09, 0x86, 0x85,            /* 0c: XANY */
-   0x12, 0x09, 0x41, 0xff,            /* 10: Rx mask char */
-   0x14, 0x09, 0x82, 0x00,            /* 14: Compare/Ignore #0 */
-   0x16, 0x09, 0x82, 0x7b,            /* 18: Compare #1 */
-   0x18, 0x09, 0x8a, 0x7d,            /* 1c: Compare #2 */
-   0x1a, 0x09, 0x88, 0x81,            /* 20: Interrupt #1 */
-   0x1c, 0x09, 0x86, 0x7a,            /* 24: Ignore/Replace #1 */
-   0x1e, 0x09, 0x84, 0x81,            /* 28: Interrupt #2 */
-   0x20, 0x09, 0x82, 0x7c,            /* 2c: Ignore/Replace #2 */
-   0x22, 0x09, 0x0a, 0x0a             /* 30: Rx FIFO Enable */
-};
-
-static CONTROLLER_T sController[CTL_SIZE] =
-{
-   {-1,-1,0,0,0,0,0,0,0,0,0,{0,0,0,0},{0,0,0,0},{-1,-1,-1,-1},{0,0,0,0}},
-   {-1,-1,0,0,0,0,0,0,0,0,0,{0,0,0,0},{0,0,0,0},{-1,-1,-1,-1},{0,0,0,0}},
-   {-1,-1,0,0,0,0,0,0,0,0,0,{0,0,0,0},{0,0,0,0},{-1,-1,-1,-1},{0,0,0,0}},
-   {-1,-1,0,0,0,0,0,0,0,0,0,{0,0,0,0},{0,0,0,0},{-1,-1,-1,-1},{0,0,0,0}}
-};
-
-#if 0
-/* IRQ number to MUDBAC register 2 mapping */
-Byte_t sIRQMap[16] =
-{
-   0,0,0,0x10,0x20,0x30,0,0,0,0x40,0x50,0x60,0x70,0,0,0x80
-};
-#endif
-
-static Byte_t sBitMapClrTbl[8] =
-{
-   0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f
-};
-
-static Byte_t sBitMapSetTbl[8] =
-{
-   0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
-};
-
-static struct callout do_poll_ch;
-
-/***************************************************************************
-Function: sInitController
-Purpose:  Initialization of controller global registers and controller
-         structure.
-Call:    sInitController(CtlP,CtlNum,MudbacIO,AiopIOList,AiopIOListSize,
-                         IRQNum,Frequency,PeriodicOnly)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-         int CtlNum; Controller number
-         ByteIO_t MudbacIO; Mudbac base I/O address.
-         ByteIO_t *AiopIOList; List of I/O addresses for each AIOP.
-            This list must be in the order the AIOPs will be found on the
-            controller.  Once an AIOP in the list is not found, it is
-            assumed that there are no more AIOPs on the controller.
-         int AiopIOListSize; Number of addresses in AiopIOList
-         int IRQNum; Interrupt Request number.  Can be any of the following:
-                        0: Disable global interrupts
-                        3: IRQ 3
-                        4: IRQ 4
-                        5: IRQ 5
-                        9: IRQ 9
-                        10: IRQ 10
-                        11: IRQ 11
-                        12: IRQ 12
-                        15: IRQ 15
-         Byte_t Frequency: A flag identifying the frequency
-                  of the periodic interrupt, can be any one of the following:
-                     FREQ_DIS - periodic interrupt disabled
-                     FREQ_137HZ - 137 Hertz
-                     FREQ_69HZ - 69 Hertz
-                     FREQ_34HZ - 34 Hertz
-                     FREQ_17HZ - 17 Hertz
-                     FREQ_9HZ - 9 Hertz
-                     FREQ_4HZ - 4 Hertz
-                  If IRQNum is set to 0 the Frequency parameter is
-                  overidden, it is forced to a value of FREQ_DIS.
-         int PeriodicOnly: TRUE if all interrupts except the periodic
-                              interrupt are to be blocked.
-                           FALSE is both the periodic interrupt and
-                              other channel interrupts are allowed.
-                           If IRQNum is set to 0 the PeriodicOnly parameter is
-                              overidden, it is forced to a value of FALSE.
-Return:   int: Number of AIOPs on the controller, or CTLID_NULL if controller
-              initialization failed.
-
-Comments:
-         If periodic interrupts are to be disabled but AIOP interrupts
-         are allowed, set Frequency to FREQ_DIS and PeriodicOnly to FALSE.
-
-         If interrupts are to be completely disabled set IRQNum to 0.
-
-         Setting Frequency to FREQ_DIS and PeriodicOnly to TRUE is an
-         invalid combination.
-
-         This function performs initialization of global interrupt modes,
-         but it does not actually enable global interrupts.  To enable
-         and disable global interrupts use functions sEnGlobalInt() and
-         sDisGlobalInt().  Enabling of global interrupts is normally not
-         done until all other initializations are complete.
-
-         Even if interrupts are globally enabled, they must also be
-         individually enabled for each channel that is to generate
-         interrupts.
-
-Warnings: No range checking on any of the parameters is done.
-
-         No context switches are allowed while executing this function.
-
-         After this function all AIOPs on the controller are disabled,
-         they can be enabled with sEnAiop().
-*/
-int sInitController(   CONTROLLER_T *CtlP,
-                       int CtlNum,
-                       ByteIO_t MudbacIO,
-                       ByteIO_t *AiopIOList,
-                       int AiopIOListSize,
-                       int IRQNum,
-                       Byte_t Frequency,
-                       int PeriodicOnly)
-{
-       int             i;
-       ByteIO_t        io;
-
-   CtlP->CtlNum = CtlNum;
-   CtlP->BusType = isISA;
-   CtlP->CtlID = CTLID_0001;       /* controller release 1 */
-
-   CtlP->MBaseIO = MudbacIO;
-   CtlP->MReg1IO = MudbacIO + 1;
-   CtlP->MReg2IO = MudbacIO + 2;
-   CtlP->MReg3IO = MudbacIO + 3;
-#if 1
-   CtlP->MReg2 = 0;                /* interrupt disable */
-   CtlP->MReg3 = 0;                /* no periodic interrupts */
-#else
-   if(sIRQMap[IRQNum] == 0)           /* interrupts globally disabled */
-   {
-      CtlP->MReg2 = 0;                /* interrupt disable */
-      CtlP->MReg3 = 0;                /* no periodic interrupts */
-   }
-   else
-   {
-      CtlP->MReg2 = sIRQMap[IRQNum];   /* set IRQ number */
-      CtlP->MReg3 = Frequency;        /* set frequency */
-      if(PeriodicOnly)                /* periodic interrupt only */
-      {
-        CtlP->MReg3 |= PERIODIC_ONLY;
-      }
-   }
-#endif
-   sOutB(CtlP->MReg2IO,CtlP->MReg2);
-   sOutB(CtlP->MReg3IO,CtlP->MReg3);
-   sControllerEOI(CtlP);              /* clear EOI if warm init */
-
-   /* Init AIOPs */
-   CtlP->NumAiop = 0;
-   for(i=0; i < AiopIOListSize; i++)
-   {
-      io = AiopIOList[i];
-      CtlP->AiopIO[i] = (WordIO_t)io;
-      CtlP->AiopIntChanIO[i] = io + _INT_CHAN;
-      sOutB(CtlP->MReg2IO,CtlP->MReg2 | (i & 0x03)); /* AIOP index */
-      sOutB(MudbacIO,(Byte_t)(io >> 6));       /* set up AIOP I/O in MUDBAC */
-      sEnAiop(CtlP,i);                        /* enable the AIOP */
-
-      CtlP->AiopID[i] = sReadAiopID(io);       /* read AIOP ID */
-      if(CtlP->AiopID[i] == AIOPID_NULL)       /* if AIOP does not exist */
-      {
-        sDisAiop(CtlP,i);                     /* disable AIOP */
-        break;                                /* done looking for AIOPs */
-      }
-
-      CtlP->AiopNumChan[i] = sReadAiopNumChan((WordIO_t)io); /* num channels in AIOP */
-      sOutW((WordIO_t)io + _INDX_ADDR,_CLK_PRE);      /* clock prescaler */
-      sOutB(io + _INDX_DATA,CLOCK_PRESC);
-      CtlP->NumAiop++;                        /* bump count of AIOPs */
-      sDisAiop(CtlP,i);                       /* disable AIOP */
-   }
-
-   if(CtlP->NumAiop == 0)
-      return(-1);
-   else
-      return(CtlP->NumAiop);
-}
-
-int sPCIInitController( CONTROLLER_T *CtlP,
-                       int CtlNum,
-                       ByteIO_t *AiopIOList,
-                       int AiopIOListSize,
-                       int IRQNum,
-                       Byte_t Frequency,
-                       int PeriodicOnly)
-{
-       int             i;
-       ByteIO_t        io;
-
-   CtlP->CtlNum = CtlNum;
-   CtlP->BusType = isPCI;
-   CtlP->CtlID = CTLID_0001;       /* controller release 1 */
-   CtlP->PCIIO = (WordIO_t)((ByteIO_t)AiopIOList[0] + _PCI_INT_FUNC);
-
-   sPCIControllerEOI(CtlP);
-
-   /* Init AIOPs */
-   CtlP->NumAiop = 0;
-   for(i=0; i < AiopIOListSize; i++)
-   {
-      io = AiopIOList[i];
-      CtlP->AiopIO[i] = (WordIO_t)io;
-      CtlP->AiopIntChanIO[i] = io + _INT_CHAN;
-
-      CtlP->AiopID[i] = sReadAiopID(io);       /* read AIOP ID */
-      if(CtlP->AiopID[i] == AIOPID_NULL)       /* if AIOP does not exist */
-      {
-        break;                                /* done looking for AIOPs */
-      }
-
-      CtlP->AiopNumChan[i] = sReadAiopNumChan((WordIO_t)io); /* num channels in AIOP */
-      sOutW((WordIO_t)io + _INDX_ADDR,_CLK_PRE);      /* clock prescaler */
-      sOutB(io + _INDX_DATA,CLOCK_PRESC);
-      CtlP->NumAiop++;                        /* bump count of AIOPs */
-   }
-
-   if(CtlP->NumAiop == 0)
-      return(-1);
-   else
-      return(CtlP->NumAiop);
-}
-
-/***************************************************************************
-Function: sReadAiopID
-Purpose:  Read the AIOP idenfication number directly from an AIOP.
-Call:    sReadAiopID(io)
-         ByteIO_t io: AIOP base I/O address
-Return:   int: Flag AIOPID_XXXX if a valid AIOP is found, where X
-                is replace by an identifying number.
-         Flag AIOPID_NULL if no valid AIOP is found
-Warnings: No context switches are allowed while executing this function.
-
-*/
-int sReadAiopID(ByteIO_t io)
-{
-   Byte_t AiopID;              /* ID byte from AIOP */
-
-   sOutB(io + _CMD_REG,RESET_ALL);     /* reset AIOP */
-   sOutB(io + _CMD_REG,0x0);
-   AiopID = sInB(io + _CHN_STAT0) & 0x07;
-   if(AiopID == 0x06)
-      return(1);
-   else                               /* AIOP does not exist */
-      return(-1);
-}
-
-/***************************************************************************
-Function: sReadAiopNumChan
-Purpose:  Read the number of channels available in an AIOP directly from
-         an AIOP.
-Call:    sReadAiopNumChan(io)
-         WordIO_t io: AIOP base I/O address
-Return:   int: The number of channels available
-Comments: The number of channels is determined by write/reads from identical
-         offsets within the SRAM address spaces for channels 0 and 4.
-         If the channel 4 space is mirrored to channel 0 it is a 4 channel
-         AIOP, otherwise it is an 8 channel.
-Warnings: No context switches are allowed while executing this function.
-*/
-int sReadAiopNumChan(WordIO_t io)
-{
-   Word_t x;
-
-   sOutDW((DWordIO_t)io + _INDX_ADDR,0x12340000L); /* write to chan 0 SRAM */
-   sOutW(io + _INDX_ADDR,0);      /* read from SRAM, chan 0 */
-   x = sInW(io + _INDX_DATA);
-   sOutW(io + _INDX_ADDR,0x4000);  /* read from SRAM, chan 4 */
-   if(x != sInW(io + _INDX_DATA))  /* if different must be 8 chan */
-      return(8);
-   else
-      return(4);
-}
-
-/***************************************************************************
-Function: sInitChan
-Purpose:  Initialization of a channel and channel structure
-Call:    sInitChan(CtlP,ChP,AiopNum,ChanNum)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-         CHANNEL_T *ChP; Ptr to channel structure
-         int AiopNum; AIOP number within controller
-         int ChanNum; Channel number within AIOP
-Return:   int: TRUE if initialization succeeded, FALSE if it fails because channel
-              number exceeds number of channels available in AIOP.
-Comments: This function must be called before a channel can be used.
-Warnings: No range checking on any of the parameters is done.
-
-         No context switches are allowed while executing this function.
-*/
-int sInitChan( CONTROLLER_T *CtlP,
-               CHANNEL_T *ChP,
-               int AiopNum,
-               int ChanNum)
-{
-   int i;
-   WordIO_t AiopIO;
-   WordIO_t ChIOOff;
-   Byte_t *ChR;
-   Word_t ChOff;
-   static Byte_t R[4];
-
-   if(ChanNum >= CtlP->AiopNumChan[AiopNum])
-      return(FALSE);                  /* exceeds num chans in AIOP */
-
-   /* Channel, AIOP, and controller identifiers */
-   ChP->CtlP = CtlP;
-   ChP->ChanID = CtlP->AiopID[AiopNum];
-   ChP->AiopNum = AiopNum;
-   ChP->ChanNum = ChanNum;
-
-   /* Global direct addresses */
-   AiopIO = CtlP->AiopIO[AiopNum];
-   ChP->Cmd = (ByteIO_t)AiopIO + _CMD_REG;
-   ChP->IntChan = (ByteIO_t)AiopIO + _INT_CHAN;
-   ChP->IntMask = (ByteIO_t)AiopIO + _INT_MASK;
-   ChP->IndexAddr = (DWordIO_t)AiopIO + _INDX_ADDR;
-   ChP->IndexData = AiopIO + _INDX_DATA;
-
-   /* Channel direct addresses */
-   ChIOOff = AiopIO + ChP->ChanNum * 2;
-   ChP->TxRxData = ChIOOff + _TD0;
-   ChP->ChanStat = ChIOOff + _CHN_STAT0;
-   ChP->TxRxCount = ChIOOff + _FIFO_CNT0;
-   ChP->IntID = (ByteIO_t)AiopIO + ChP->ChanNum + _INT_ID0;
-
-   /* Initialize the channel from the RData array */
-   for(i=0; i < RDATASIZE; i+=4)
-   {
-      R[0] = RData[i];
-      R[1] = RData[i+1] + 0x10 * ChanNum;
-      R[2] = RData[i+2];
-      R[3] = RData[i+3];
-      sOutDW(ChP->IndexAddr,*((DWord_t *)&R[0]));
-   }
-
-   ChR = ChP->R;
-   for(i=0; i < RREGDATASIZE; i+=4)
-   {
-      ChR[i] = RRegData[i];
-      ChR[i+1] = RRegData[i+1] + 0x10 * ChanNum;
-      ChR[i+2] = RRegData[i+2];
-      ChR[i+3] = RRegData[i+3];
-   }
-
-   /* Indexed registers */
-   ChOff = (Word_t)ChanNum * 0x1000;
-
-   ChP->BaudDiv[0] = (Byte_t)(ChOff + _BAUD);
-   ChP->BaudDiv[1] = (Byte_t)((ChOff + _BAUD) >> 8);
-   ChP->BaudDiv[2] = (Byte_t)BRD9600;
-   ChP->BaudDiv[3] = (Byte_t)(BRD9600 >> 8);
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->BaudDiv[0]);
-
-   ChP->TxControl[0] = (Byte_t)(ChOff + _TX_CTRL);
-   ChP->TxControl[1] = (Byte_t)((ChOff + _TX_CTRL) >> 8);
-   ChP->TxControl[2] = 0;
-   ChP->TxControl[3] = 0;
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxControl[0]);
-
-   ChP->RxControl[0] = (Byte_t)(ChOff + _RX_CTRL);
-   ChP->RxControl[1] = (Byte_t)((ChOff + _RX_CTRL) >> 8);
-   ChP->RxControl[2] = 0;
-   ChP->RxControl[3] = 0;
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->RxControl[0]);
-
-   ChP->TxEnables[0] = (Byte_t)(ChOff + _TX_ENBLS);
-   ChP->TxEnables[1] = (Byte_t)((ChOff + _TX_ENBLS) >> 8);
-   ChP->TxEnables[2] = 0;
-   ChP->TxEnables[3] = 0;
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxEnables[0]);
-
-   ChP->TxCompare[0] = (Byte_t)(ChOff + _TXCMP1);
-   ChP->TxCompare[1] = (Byte_t)((ChOff + _TXCMP1) >> 8);
-   ChP->TxCompare[2] = 0;
-   ChP->TxCompare[3] = 0;
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxCompare[0]);
-
-   ChP->TxReplace1[0] = (Byte_t)(ChOff + _TXREP1B1);
-   ChP->TxReplace1[1] = (Byte_t)((ChOff + _TXREP1B1) >> 8);
-   ChP->TxReplace1[2] = 0;
-   ChP->TxReplace1[3] = 0;
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxReplace1[0]);
-
-   ChP->TxReplace2[0] = (Byte_t)(ChOff + _TXREP2);
-   ChP->TxReplace2[1] = (Byte_t)((ChOff + _TXREP2) >> 8);
-   ChP->TxReplace2[2] = 0;
-   ChP->TxReplace2[3] = 0;
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxReplace2[0]);
-
-   ChP->TxFIFOPtrs = ChOff + _TXF_OUTP;
-   ChP->TxFIFO = ChOff + _TX_FIFO;
-
-   sOutB(ChP->Cmd,(Byte_t)ChanNum | RESTXFCNT); /* apply reset Tx FIFO count */
-   sOutB(ChP->Cmd,(Byte_t)ChanNum);  /* remove reset Tx FIFO count */
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->TxFIFOPtrs); /* clear Tx in/out ptrs */
-   sOutW(ChP->IndexData,0);
-   ChP->RxFIFOPtrs = ChOff + _RXF_OUTP;
-   ChP->RxFIFO = ChOff + _RX_FIFO;
-
-   sOutB(ChP->Cmd,(Byte_t)ChanNum | RESRXFCNT); /* apply reset Rx FIFO count */
-   sOutB(ChP->Cmd,(Byte_t)ChanNum);  /* remove reset Rx FIFO count */
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->RxFIFOPtrs); /* clear Rx out ptr */
-   sOutW(ChP->IndexData,0);
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->RxFIFOPtrs + 2); /* clear Rx in ptr */
-   sOutW(ChP->IndexData,0);
-   ChP->TxPrioCnt = ChOff + _TXP_CNT;
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->TxPrioCnt);
-   sOutB(ChP->IndexData,0);
-   ChP->TxPrioPtr = ChOff + _TXP_PNTR;
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->TxPrioPtr);
-   sOutB(ChP->IndexData,0);
-   ChP->TxPrioBuf = ChOff + _TXP_BUF;
-   sEnRxProcessor(ChP);               /* start the Rx processor */
-
-   return(TRUE);
-}
-
-/***************************************************************************
-Function: sStopRxProcessor
-Purpose:  Stop the receive processor from processing a channel.
-Call:    sStopRxProcessor(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-
-Comments: The receive processor can be started again with sStartRxProcessor().
-         This function causes the receive processor to skip over the
-         stopped channel.  It does not stop it from processing other channels.
-
-Warnings: No context switches are allowed while executing this function.
-
-         Do not leave the receive processor stopped for more than one
-         character time.
-
-         After calling this function a delay of 4 uS is required to ensure
-         that the receive processor is no longer processing this channel.
-*/
-void sStopRxProcessor(CHANNEL_T *ChP)
-{
-   Byte_t R[4];
-
-   R[0] = ChP->R[0];
-   R[1] = ChP->R[1];
-   R[2] = 0x0a;
-   R[3] = ChP->R[3];
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&R[0]);
-}
-
-/***************************************************************************
-Function: sFlushRxFIFO
-Purpose:  Flush the Rx FIFO
-Call:    sFlushRxFIFO(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   void
-Comments: To prevent data from being enqueued or dequeued in the Tx FIFO
-         while it is being flushed the receive processor is stopped
-         and the transmitter is disabled.  After these operations a
-         4 uS delay is done before clearing the pointers to allow
-         the receive processor to stop.  These items are handled inside
-         this function.
-Warnings: No context switches are allowed while executing this function.
-*/
-void sFlushRxFIFO(CHANNEL_T *ChP)
-{
-   int i;
-   Byte_t Ch;                  /* channel number within AIOP */
-   int RxFIFOEnabled;                 /* TRUE if Rx FIFO enabled */
-
-   if(sGetRxCnt(ChP) == 0)            /* Rx FIFO empty */
-      return;                         /* don't need to flush */
-
-   RxFIFOEnabled = FALSE;
-   if(ChP->R[0x32] == 0x08) /* Rx FIFO is enabled */
-   {
-      RxFIFOEnabled = TRUE;
-      sDisRxFIFO(ChP);                /* disable it */
-      for(i=0; i < 2000/200; i++)      /* delay 2 uS to allow proc to disable FIFO*/
-        sInB(ChP->IntChan);            /* depends on bus i/o timing */
-   }
-   sGetChanStatus(ChP);         /* clear any pending Rx errors in chan stat */
-   Ch = (Byte_t)sGetChanNum(ChP);
-   sOutB(ChP->Cmd,Ch | RESRXFCNT);     /* apply reset Rx FIFO count */
-   sOutB(ChP->Cmd,Ch);                /* remove reset Rx FIFO count */
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->RxFIFOPtrs); /* clear Rx out ptr */
-   sOutW(ChP->IndexData,0);
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->RxFIFOPtrs + 2); /* clear Rx in ptr */
-   sOutW(ChP->IndexData,0);
-   if(RxFIFOEnabled)
-      sEnRxFIFO(ChP);                 /* enable Rx FIFO */
-}
-
-/***************************************************************************
-Function: sFlushTxFIFO
-Purpose:  Flush the Tx FIFO
-Call:    sFlushTxFIFO(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   void
-Comments: To prevent data from being enqueued or dequeued in the Tx FIFO
-         while it is being flushed the receive processor is stopped
-         and the transmitter is disabled.  After these operations a
-         4 uS delay is done before clearing the pointers to allow
-         the receive processor to stop.  These items are handled inside
-         this function.
-Warnings: No context switches are allowed while executing this function.
-*/
-void sFlushTxFIFO(CHANNEL_T *ChP)
-{
-   int i;
-   Byte_t Ch;                  /* channel number within AIOP */
-   int TxEnabled;                     /* TRUE if transmitter enabled */
-
-   if(sGetTxCnt(ChP) == 0)            /* Tx FIFO empty */
-      return;                         /* don't need to flush */
-
-   TxEnabled = FALSE;
-   if(ChP->TxControl[3] & TX_ENABLE)
-   {
-      TxEnabled = TRUE;
-      sDisTransmit(ChP);              /* disable transmitter */
-   }
-   sStopRxProcessor(ChP);             /* stop Rx processor */
-   for(i = 0; i < 4000/200; i++)        /* delay 4 uS to allow proc to stop */
-      sInB(ChP->IntChan);      /* depends on bus i/o timing */
-   Ch = (Byte_t)sGetChanNum(ChP);
-   sOutB(ChP->Cmd,Ch | RESTXFCNT);     /* apply reset Tx FIFO count */
-   sOutB(ChP->Cmd,Ch);                /* remove reset Tx FIFO count */
-   sOutW((WordIO_t)ChP->IndexAddr,ChP->TxFIFOPtrs); /* clear Tx in/out ptrs */
-   sOutW(ChP->IndexData,0);
-   if(TxEnabled)
-      sEnTransmit(ChP);               /* enable transmitter */
-   sStartRxProcessor(ChP);            /* restart Rx processor */
-}
-
-/***************************************************************************
-Function: sWriteTxPrioByte
-Purpose:  Write a byte of priority transmit data to a channel
-Call:    sWriteTxPrioByte(ChP,Data)
-         CHANNEL_T *ChP; Ptr to channel structure
-         Byte_t Data; The transmit data byte
-
-Return:   int: 1 if the bytes is successfully written, otherwise 0.
-
-Comments: The priority byte is transmitted before any data in the Tx FIFO.
-
-Warnings: No context switches are allowed while executing this function.
-*/
-int sWriteTxPrioByte(CHANNEL_T *ChP, Byte_t Data)
-{
-   Byte_t DWBuf[4];            /* buffer for double word writes */
-   Word_t *WordPtr;         /* must be far because Win SS != DS */
-   DWordIO_t IndexAddr;
-
-   if(sGetTxCnt(ChP) > 1)             /* write it to Tx priority buffer */
-   {
-      IndexAddr = ChP->IndexAddr;
-      sOutW((WordIO_t)IndexAddr,ChP->TxPrioCnt); /* get priority buffer status */
-      if(sInB((ByteIO_t)ChP->IndexData) & PRI_PEND) /* priority buffer busy */
-        return(0);                    /* nothing sent */
-
-      WordPtr = (Word_t *)(&DWBuf[0]);
-      *WordPtr = ChP->TxPrioBuf;       /* data byte address */
-
-      DWBuf[2] = Data;                /* data byte value */
-      sOutDW(IndexAddr,*((DWord_t *)(&DWBuf[0]))); /* write it out */
-
-      *WordPtr = ChP->TxPrioCnt;       /* Tx priority count address */
-
-      DWBuf[2] = PRI_PEND + 1;        /* indicate 1 byte pending */
-      DWBuf[3] = 0;                   /* priority buffer pointer */
-      sOutDW(IndexAddr,*((DWord_t *)(&DWBuf[0]))); /* write it out */
-   }
-   else                               /* write it to Tx FIFO */
-   {
-      sWriteTxByte(sGetTxRxDataIO(ChP),Data);
-   }
-   return(1);                         /* 1 byte sent */
-}
-
-/***************************************************************************
-Function: sEnInterrupts
-Purpose:  Enable one or more interrupts for a channel
-Call:    sEnInterrupts(ChP,Flags)
-         CHANNEL_T *ChP; Ptr to channel structure
-         Word_t Flags: Interrupt enable flags, can be any combination
-            of the following flags:
-               TXINT_EN:   Interrupt on Tx FIFO empty
-               RXINT_EN:   Interrupt on Rx FIFO at trigger level (see
-                           sSetRxTrigger())
-               SRCINT_EN:  Interrupt on SRC (Special Rx Condition)
-               MCINT_EN:   Interrupt on modem input change
-               CHANINT_EN: Allow channel interrupt signal to the AIOP's
-                           Interrupt Channel Register.
-Return:   void
-Comments: If an interrupt enable flag is set in Flags, that interrupt will be
-         enabled.  If an interrupt enable flag is not set in Flags, that
-         interrupt will not be changed.  Interrupts can be disabled with
-         function sDisInterrupts().
-
-         This function sets the appropriate bit for the channel in the AIOP's
-         Interrupt Mask Register if the CHANINT_EN flag is set.  This allows
-         this channel's bit to be set in the AIOP's Interrupt Channel Register.
-
-         Interrupts must also be globally enabled before channel interrupts
-         will be passed on to the host.  This is done with function
-         sEnGlobalInt().
-
-         In some cases it may be desirable to disable interrupts globally but
-         enable channel interrupts.  This would allow the global interrupt
-         status register to be used to determine which AIOPs need service.
-*/
-void sEnInterrupts(CHANNEL_T *ChP,Word_t Flags)
-{
-   Byte_t Mask;                /* Interrupt Mask Register */
-
-   ChP->RxControl[2] |=
-      ((Byte_t)Flags & (RXINT_EN | SRCINT_EN | MCINT_EN));
-
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->RxControl[0]);
-
-   ChP->TxControl[2] |= ((Byte_t)Flags & TXINT_EN);
-
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxControl[0]);
-
-   if(Flags & CHANINT_EN)
-   {
-      Mask = sInB(ChP->IntMask) | sBitMapSetTbl[ChP->ChanNum];
-      sOutB(ChP->IntMask,Mask);
-   }
-}
-
-/***************************************************************************
-Function: sDisInterrupts
-Purpose:  Disable one or more interrupts for a channel
-Call:    sDisInterrupts(ChP,Flags)
-         CHANNEL_T *ChP; Ptr to channel structure
-         Word_t Flags: Interrupt flags, can be any combination
-            of the following flags:
-               TXINT_EN:   Interrupt on Tx FIFO empty
-               RXINT_EN:   Interrupt on Rx FIFO at trigger level (see
-                           sSetRxTrigger())
-               SRCINT_EN:  Interrupt on SRC (Special Rx Condition)
-               MCINT_EN:   Interrupt on modem input change
-               CHANINT_EN: Disable channel interrupt signal to the
-                           AIOP's Interrupt Channel Register.
-Return:   void
-Comments: If an interrupt flag is set in Flags, that interrupt will be
-         disabled.  If an interrupt flag is not set in Flags, that
-         interrupt will not be changed.  Interrupts can be enabled with
-         function sEnInterrupts().
-
-         This function clears the appropriate bit for the channel in the AIOP's
-         Interrupt Mask Register if the CHANINT_EN flag is set.  This blocks
-         this channel's bit from being set in the AIOP's Interrupt Channel
-         Register.
-*/
-void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags)
-{
-   Byte_t Mask;                /* Interrupt Mask Register */
-
-   ChP->RxControl[2] &=
-        ~((Byte_t)Flags & (RXINT_EN | SRCINT_EN | MCINT_EN));
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->RxControl[0]);
-   ChP->TxControl[2] &= ~((Byte_t)Flags & TXINT_EN);
-   sOutDW(ChP->IndexAddr,*(DWord_t *)&ChP->TxControl[0]);
-
-   if(Flags & CHANINT_EN)
-   {
-      Mask = sInB(ChP->IntMask) & sBitMapClrTbl[ChP->ChanNum];
-      sOutB(ChP->IntMask,Mask);
-   }
-}
-
-/*********************************************************************
-  Begin FreeBsd-specific driver code
-**********************************************************************/
-
-static int rpprobe (struct isa_device *);
-static int rpattach (struct isa_device *);
-
-static const char* rp_pciprobe(pcici_t tag, pcidi_t type);
-static void rp_pciattach(pcici_t tag, int unit);
-static u_long  rp_pcicount;
-
-static struct pci_device rp_pcidevice = {
-       "rp",
-       rp_pciprobe,
-       rp_pciattach,
-       &rp_pcicount,
-       NULL
-};
-
-COMPAT_PCI_DRIVER (rp_pci, rp_pcidevice);
-
-static timeout_t rpdtrwakeup;
-
-struct isa_driver rpdriver = {
-       rpprobe, rpattach, "rp"
-     };
-
-static char    driver_name[] = "rp";
-
-static d_open_t        rpopen;
-static d_close_t       rpclose;
-static d_write_t       rpwrite;
-static d_ioctl_t       rpioctl;
-
-#define        CDEV_MAJOR      81
-static struct cdevsw rp_cdevsw = {
-       /* name */      driver_name,
-       /* maj */       CDEV_MAJOR,
-       /* flags */     D_TTY | D_KQFILTER,
-       /* port */      NULL,
-       /* clone */     NULL,
-
-       /* open */      rpopen,
-       /* close */     rpclose,
-       /* read */      ttyread,
-       /* write */     rpwrite,
-       /* ioctl */     rpioctl,
-       /* poll */      ttypoll,
-       /* mmap */      nommap,
-       /* strategy */  nostrategy,
-       /* dump */      nodump,
-       /* psize */     nopsize,
-       /* kqfilter */  ttykqfilter
-};
-
-static int rp_controller_port = 0;
-static int rp_num_ports_open = 0;
-static int     ndevs = 0;
-static int     minor_to_unit[128];
-#if 0
-static struct  tty     rp_tty[128];
-#endif
-
-static int rp_num_ports[4];    /* Number of ports on each controller */
-
-#define _INLINE_ __inline
-#define POLL_INTERVAL 1
-
-#define CALLOUT_MASK           0x80
-#define CONTROL_MASK           0x60
-#define CONTROL_INIT_STATE     0x20
-#define CONTROL_LOCK_STATE     0x40
-#define DEV_UNIT(dev)  (MINOR_TO_UNIT(minor(dev))
-#define MINOR_MAGIC_MASK       (CALLOUT_MASK | CONTROL_MASK)
-#define MINOR_MAGIC(dev)       ((minor(dev)) & ~MINOR_MAGIC_MASK)
-#define IS_CALLOUT(dev)        (minor(dev) & CALLOUT_MASK)
-#define IS_CONTROL(dev)        (minor(dev) & CONTROL_MASK)
-
-#define RP_ISMULTIPORT(dev)    ((dev)->id_flags & 0x1)
-#define RP_MPMASTER(dev)       (((dev)->id_flags >> 8) & 0xff)
-#define RP_NOTAST4(dev)        ((dev)->id_flags & 0x04)
-
-static struct  rp_port *p_rp_addr[4];
-static struct  rp_port *p_rp_table[MAX_RP_PORTS];
-#define rp_addr(unit)  (p_rp_addr[unit])
-#define rp_table(port) (p_rp_table[port])
-
-/*
- * The top-level routines begin here
- */
-
-static int     rpparam (struct tty *, struct termios *);
-static void    rpstart (struct tty *);
-static void    rpstop (struct tty *, int);
-static void    rphardclose     (struct rp_port *);
-static void    rp_disc_optim   (struct tty *tp, struct termios *t,
-                                               struct rp_port  *rp);
-
-static _INLINE_ void rp_do_receive(struct rp_port *rp, struct tty *tp,
-                       CHANNEL_t *cp, unsigned int ChanStatus)
-{
-       int     spl;
-       unsigned        int     CharNStat;
-       int     ToRecv, ch;
-
-       ToRecv = sGetRxCnt(cp);
-       if(ToRecv == 0)
-               return;
-
-/*     If status indicates there are errored characters in the
-       FIFO, then enter status mode (a word in FIFO holds
-       characters and status)
-*/
-
-       if(ChanStatus & (RXFOVERFL | RXBREAK | RXFRAME | RXPARITY)) {
-               if(!(ChanStatus & STATMODE)) {
-                       ChanStatus |= STATMODE;
-                       sEnRxStatusMode(cp);
-               }
-       }
-/*
-       if we previously entered status mode then read down the
-       FIFO one word at a time, pulling apart the character and
-       the status. Update error counters depending on status.
-*/
-       if(ChanStatus & STATMODE) {
-               while(ToRecv) {
-                       if(tp->t_state & TS_TBLOCK) {
-                               break;
-                       }
-                       CharNStat = sInW(sGetTxRxDataIO(cp));
-                       ch = CharNStat & 0xff;
-
-                       if((CharNStat & STMBREAK) || (CharNStat & STMFRAMEH))
-                               ch |= TTY_FE;
-                       else if (CharNStat & STMPARITYH)
-                               ch |= TTY_PE;
-                       else if (CharNStat & STMRCVROVRH)
-                               rp->rp_overflows++;
-
-                       (*linesw[tp->t_line].l_rint)(ch, tp);
-                       ToRecv--;
-               }
-/*
-       After emtying FIFO in status mode, turn off status mode
-*/
-
-       if(sGetRxCnt(cp) == 0)
-               sDisRxStatusMode(cp);
-       }
-       else {
-               while (ToRecv) {
-                       if(tp->t_state & TS_TBLOCK) {
-                               break;
-                       }
-                       ch = (u_char) sInB(sGetTxRxDataIO(cp));
-                       spl = spltty();
-                       (*linesw[tp->t_line].l_rint)(ch, tp);
-                       splx(spl);
-                       ToRecv--;
-               }
-       }
-}
-
-static _INLINE_ void rp_handle_port(struct rp_port *rp)
-{
-       CHANNEL_t       *cp;
-       struct  tty     *tp;
-       unsigned        int     IntMask, ChanStatus;
-     /*        int     oldcts; */
-
-       if(!rp)
-               return;
-
-       cp = &rp->rp_channel;
-       tp = rp->rp_tty;
-       IntMask = sGetChanIntID(cp);
-       IntMask = IntMask & rp->rp_intmask;
-       ChanStatus = sGetChanStatus(cp);
-       if(IntMask & RXF_TRIG)
-               if(!(tp->t_state & TS_TBLOCK) && (tp->t_state & TS_CARR_ON) && (tp->t_state & TS_ISOPEN)) {
-                       rp_do_receive(rp, tp, cp, ChanStatus);
-               }
-       if(IntMask & DELTA_CD) {
-               if(ChanStatus & CD_ACT) {
-                       if(!(tp->t_state & TS_CARR_ON) ) {
-                               (void)(*linesw[tp->t_line].l_modem)(tp, 1);
-                       }
-               } else {
-                       if((tp->t_state & TS_CARR_ON)) {
-                               (void)(*linesw[tp->t_line].l_modem)(tp, 0);
-                               if((*linesw[tp->t_line].l_modem)(tp, 0) == 0) {
-                                       rphardclose(rp);
-                               }
-                       }
-               }
-       }
-/*     oldcts = rp->rp_cts;
-       rp->rp_cts = ((ChanStatus & CTS_ACT) != 0);
-       if(oldcts != rp->rp_cts) {
-               printf("CTS change (now %s)... on port %d\n", rp->rp_cts ? "on" : "off", rp->rp_port);
-       }
-*/
-}
-
-static void rp_do_poll(void *not_used)
-{
-       CONTROLLER_t    *ctl;
-       struct rp_port  *rp;
-       struct tty      *tp;
-       int     unit, aiop, ch, line, count;
-       unsigned char   CtlMask, AiopMask;
-
-       for(unit = 0; unit <= ndevs; unit++) {
-       rp = rp_addr(unit);
-       ctl = rp->rp_ctlp;
-       if(ctl->BusType == isPCI)
-               CtlMask = sPCIGetControllerIntStatus(ctl);
-       else
-               CtlMask = sGetControllerIntStatus(ctl);
-       for(aiop=0; CtlMask; CtlMask >>=1, aiop++) {
-               if(CtlMask & 1) {
-                       AiopMask = sGetAiopIntStatus(ctl, aiop);
-                       for(ch = 0; AiopMask; AiopMask >>=1, ch++) {
-                               if(AiopMask & 1) {
-                                       line = (unit << 5) | (aiop << 3) | ch;
-                                       rp = rp_table(line);
-                                       rp_handle_port(rp);
-                               }
-                       }
-               }
-       }
-
-       for(line = 0, rp = rp_addr(unit); line < rp_num_ports[unit];
-                       line++, rp++) {
-               tp = rp->rp_tty;
-               if((tp->t_state & TS_BUSY) && (tp->t_state & TS_ISOPEN)) {
-                       count = sGetTxCnt(&rp->rp_channel);
-                       if(count == 0)
-                               tp->t_state &= ~(TS_BUSY);
-                       if(!(tp->t_state & TS_TTSTOP) &&
-                               (count <= rp->rp_restart)) {
-                               (*linesw[tp->t_line].l_start)(tp);
-                       }
-               }
-       }
-       }
-       if (rp_num_ports_open)
-               callout_reset(&do_poll_ch, POLL_INTERVAL, rp_do_poll, NULL);
-}
-
-static const char*
-rp_pciprobe(pcici_t tag, pcidi_t type)
-{
-       int     vendor_id;
-
-       vendor_id = type & 0xffff;
-       switch(vendor_id)
-       case 0x11fe:
-               return("rp");
-       return(NULL);
-}
-
-static
-int
-rpprobe(dev)
-struct isa_device *dev;
-{
-       int controller, unit;
-       int aiop, num_aiops;
-       unsigned int aiopio[MAX_AIOPS_PER_BOARD];
-       CONTROLLER_t *ctlp;
-
-       unit = dev->id_unit;
-       if (dev->id_unit >= 4) {
-               printf("rpprobe: unit number %d invalid.\n", dev->id_unit);
-               return 1;
-       }
-       printf("probing for RocketPort(ISA) unit %d\n", unit);
-       if (rp_controller_port)
-               controller = rp_controller_port;
-       else {
-               controller = dev->id_iobase + 0x40;
-       }
-
-       for (aiop=0; aiop<MAX_AIOPS_PER_BOARD; aiop++)
-               aiopio[aiop]= dev->id_iobase + (aiop * 0x400);
-
-       ctlp = sCtlNumToCtlPtr(dev->id_unit);
-       num_aiops = sInitController(ctlp, dev->id_unit,
-                               controller + ((unit-rp_pcicount)*0x400),
-                               aiopio, MAX_AIOPS_PER_BOARD, 0,
-                               FREQ_DIS, 0);
-       if (num_aiops <= 0) {
-               printf("board%d init failed\n", unit);
-               return 0;
-       }
-
-       if (rp_controller_port) {
-               dev->id_msize = 64;
-       } else {
-               dev->id_msize = 68;
-               rp_controller_port = controller;
-       }
-
-       dev->id_irq = 0;
-
-       return 1;
-}
-
-static void
-rp_pciattach(pcici_t tag, int unit)
-{
-       int     success, oldspl;
-       u_short iobase;
-       int     num_ports, num_chan, num_aiops;
-       int     aiop, chan, port;
-       int     ChanStatus, line, i, count;
-       unsigned int    aiopio[MAX_AIOPS_PER_BOARD];
-       struct  rp_port *rp;
-       struct  tty     *tty;
-       CONTROLLER_t    *ctlp;
-
-       success = pci_map_port(tag, 0x10, &iobase);
-       if(!success)
-               printf("ioaddr mapping failed for RocketPort(PCI)\n");
-
-       for(aiop=0; aiop < MAX_AIOPS_PER_BOARD; aiop++)
-               aiopio[aiop] = iobase + (aiop * 0x40);
-
-       ctlp = sCtlNumToCtlPtr(unit);
-       num_aiops = sPCIInitController(ctlp, unit,
-                               aiopio, MAX_AIOPS_PER_BOARD, 0,
-                               FREQ_DIS, 0);
-
-       num_ports = 0;
-       for(aiop=0; aiop < num_aiops; aiop++) {
-               sResetAiopByNum(ctlp, aiop);
-               num_ports += sGetAiopNumChan(ctlp, aiop);
-       }
-       printf("RocketPort%d = %d ports\n", unit, num_ports);
-       rp_num_ports[unit] = num_ports;
-
-       rp = malloc(sizeof(struct rp_port) * num_ports,
-                       M_TTYS, M_WAITOK | M_ZERO);
-
-       count = unit * 32;      /* board times max ports per card SG */
-       for(i=count;i < (count + rp_num_ports[unit]);i++)
-               minor_to_unit[i] = unit;
-
-       tty = malloc(sizeof(struct tty) * num_ports, M_TTYS, M_WAITOK | M_ZERO);
-
-       oldspl = spltty();
-       rp_addr(unit) = rp;
-       splx(oldspl);
-
-       cdevsw_add(&rp_cdevsw, 0, 0);
-
-       port = 0;
-       for(aiop=0; aiop < num_aiops; aiop++) {
-               num_chan = sGetAiopNumChan(ctlp, aiop);
-               for(chan=0; chan < num_chan; chan++, port++, rp++, tty++) {
-                       rp->rp_tty = tty;
-                       rp->rp_port = port;
-                       rp->rp_ctlp = ctlp;
-                       rp->rp_unit = unit;
-                       rp->rp_chan = chan;
-                       rp->rp_aiop = aiop;
-
-                       tty->t_line = 0;
-       /*              tty->t_termios = deftermios;
-       */
-                       rp->dtr_wait = 3 * hz;
-                       callout_init(&rp->dtr_ch);
-                       rp->it_in.c_iflag = 0;
-                       rp->it_in.c_oflag = 0;
-                       rp->it_in.c_cflag = TTYDEF_CFLAG;
-                       rp->it_in.c_lflag = 0;
-                       termioschars(&rp->it_in);
-       /*              termioschars(&tty->t_termios);
-       */
-                       rp->it_in.c_ispeed = rp->it_in.c_ospeed = TTYDEF_SPEED;
-                       rp->it_out = rp->it_in;
-
-                       rp->rp_intmask = RXF_TRIG | TXFIFO_MT | SRC_INT |
-                               DELTA_CD | DELTA_CTS | DELTA_DSR;
-                       ChanStatus = sGetChanStatus(&rp->rp_channel);
-                       if(sInitChan(ctlp, &rp->rp_channel, aiop, chan) == 0) {
-                               printf("RocketPort sInitChan(%d, %d, %d) failed\n",
-                                      unit, aiop, chan);
-                               return;
-                       }
-                       ChanStatus = sGetChanStatus(&rp->rp_channel);
-                       rp->rp_cts = (ChanStatus & CTS_ACT) != 0;
-                       line = (unit << 5) | (aiop << 3) | chan;
-                       rp_table(line) = rp;
-               }
-       }
-}
-
-static
-int
-rpattach(dev)
-struct isa_device      *dev;
-{
-       int     iobase, unit, /*rpmajor,*/ oldspl;
-       int     num_ports, num_chan, num_aiops;
-       int     aiop, chan, port;
-       int     ChanStatus, line, i, count;
-       unsigned int    aiopio[MAX_AIOPS_PER_BOARD];
-       struct  rp_port *rp;
-       struct  tty     *tty;
-       CONTROLLER_t    *ctlp;
-
-       iobase = dev->id_iobase;
-       unit = dev->id_unit;
-       ndevs = unit;
-
-       for(aiop=0; aiop < MAX_AIOPS_PER_BOARD; aiop++)
-               aiopio[aiop] = iobase + (aiop * 0x400);
-
-       ctlp = sCtlNumToCtlPtr(unit);
-       num_aiops = sInitController(ctlp, unit,
-                               rp_controller_port + ((unit-rp_pcicount) * 0x400),
-                               aiopio, MAX_AIOPS_PER_BOARD, 0,
-                               FREQ_DIS, 0);
-
-       num_ports = 0;
-       for(aiop=0; aiop < num_aiops; aiop++) {
-               sResetAiopByNum(ctlp, aiop);
-               sEnAiop(ctlp, aiop);
-               num_ports += sGetAiopNumChan(ctlp, aiop);
-       }
-       printf("RocketPort%d = %d ports\n", unit, num_ports);
-       rp_num_ports[unit] = num_ports;
-
-       rp = malloc(sizeof(struct rp_port) * num_ports,
-                       M_TTYS, M_WAITOK | M_ZERO);
-
-       count = unit * 32;    /* board # times max ports per card  SG */
-       for(i=count;i < (count + rp_num_ports[unit]);i++)
-               minor_to_unit[i] = unit;
-
-       tty = malloc(sizeof(struct tty) * num_ports, M_TTYS, M_WAITOK | M_ZERO);
-
-       oldspl = spltty();
-       rp_addr(unit) = rp;
-       splx(oldspl);
-
-       cdevsw_add(&rp_cdevsw, 0, 0);
-
-       port = 0;
-       for(aiop=0; aiop < num_aiops; aiop++) {
-               num_chan = sGetAiopNumChan(ctlp, aiop);
-               for(chan=0; chan < num_chan; chan++, port++, rp++, tty++) {
-                       rp->rp_tty = tty;
-                       rp->rp_port = port;
-                       rp->rp_ctlp = ctlp;
-                       rp->rp_unit = unit;
-                       rp->rp_chan = chan;
-                       rp->rp_aiop = aiop;
-
-                       tty->t_line = 0;
-       /*              tty->t_termios = deftermios;
-       */
-                       rp->dtr_wait = 3 * hz;
-                       rp->it_in.c_iflag = 0;
-                       rp->it_in.c_oflag = 0;
-                       rp->it_in.c_cflag = TTYDEF_CFLAG;
-                       rp->it_in.c_lflag = 0;
-                       termioschars(&rp->it_in);
-       /*              termioschars(&tty->t_termios);
-       */
-                       rp->it_in.c_ispeed = rp->it_in.c_ospeed = TTYDEF_SPEED;
-                       rp->it_out = rp->it_in;
-
-                       rp->rp_intmask = RXF_TRIG | TXFIFO_MT | SRC_INT |
-                               DELTA_CD | DELTA_CTS | DELTA_DSR;
-                       ChanStatus = sGetChanStatus(&rp->rp_channel);
-                       if(sInitChan(ctlp, &rp->rp_channel, aiop, chan) == 0) {
-                               printf("RocketPort sInitChan(%d, %d, %d) failed\n",
-                                      unit, aiop, chan);
-                               return(0);
-                       }
-                       ChanStatus = sGetChanStatus(&rp->rp_channel);
-                       rp->rp_cts = (ChanStatus & CTS_ACT) != 0;
-                       line = (unit << 5) | (aiop << 3) | chan;
-                       rp_table(line) = rp;
-               }
-       }
-
-       return(1);
-}
-
-int
-rpopen(dev, flag, mode, td)
-       dev_t   dev;
-       int     flag, mode;
-       struct thread *td;
-{
-       struct  rp_port *rp;
-       int     unit, port, mynor, umynor, flags;  /* SG */
-       struct  tty     *tp;
-       int     oldspl, error;
-       unsigned int    IntMask, ChanStatus;
-
-
-   umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                    /* SG */
-       unit = minor_to_unit[mynor];
-       if (rp_addr(unit) == NULL)
-               return (ENXIO);
-       if(IS_CONTROL(dev))
-               return(0);
-       rp = rp_addr(unit) + port;
-/*     rp->rp_tty = &rp_tty[rp->rp_port];
-*/
-       tp = rp->rp_tty;
-       dev->si_tty = tp;
-
-       oldspl = spltty();
-
-open_top:
-       while(rp->state & ~SET_DTR) {
-               error = tsleep(&rp->dtr_wait, PCATCH, "rpdtr", 0);
-               if(error != 0)
-                       goto out;
-       }
-
-       if(tp->t_state & TS_ISOPEN) {
-               if(IS_CALLOUT(dev)) {
-                       if(!rp->active_out) {
-                               error = EBUSY;
-                               goto out;
-                       }
-               } else {
-                       if(rp->active_out) {
-                               if(flag & O_NONBLOCK) {
-                                       error = EBUSY;
-                                       goto out;
-                               }
-                               error = tsleep(&rp->active_out,
-                                           PCATCH, "rpbi", 0);
-                               if(error != 0)
-                                       goto out;
-                               goto open_top;
-                       }
-               }
-               if(tp->t_state & TS_XCLUDE &&
-                   suser(td)) {
-                       splx(oldspl);
-                       return(EBUSY);
-               }
-       }
-       else {
-               tp->t_dev = dev;
-               tp->t_param = rpparam;
-               tp->t_oproc = rpstart;
-               tp->t_stop = rpstop;
-               tp->t_line = 0;
-               tp->t_termios = IS_CALLOUT(dev) ? rp->it_out : rp->it_in;
-               flags = 0;
-               flags |= SET_RTS;
-               flags |= SET_DTR;
-               rp->rp_channel.TxControl[3] =
-                       ((rp->rp_channel.TxControl[3]
-                       & ~(SET_RTS | SET_DTR)) | flags);
-               sOutDW(rp->rp_channel.IndexAddr,
-                       *(DWord_t *) &(rp->rp_channel.TxControl[0]));
-               sSetRxTrigger(&rp->rp_channel, TRIG_1);
-               sDisRxStatusMode(&rp->rp_channel);
-               sFlushRxFIFO(&rp->rp_channel);
-               sFlushTxFIFO(&rp->rp_channel);
-
-               sEnInterrupts(&rp->rp_channel,
-                       (TXINT_EN|MCINT_EN|RXINT_EN|SRCINT_EN|CHANINT_EN));
-               sSetRxTrigger(&rp->rp_channel, TRIG_1);
-
-               sDisRxStatusMode(&rp->rp_channel);
-               sClrTxXOFF(&rp->rp_channel);
-
-/*             sDisRTSFlowCtl(&rp->rp_channel);
-               sDisCTSFlowCtl(&rp->rp_channel);
-*/
-               sDisTxSoftFlowCtl(&rp->rp_channel);
-
-               sStartRxProcessor(&rp->rp_channel);
-
-               sEnRxFIFO(&rp->rp_channel);
-               sEnTransmit(&rp->rp_channel);
-
-/*             sSetDTR(&rp->rp_channel);
-               sSetRTS(&rp->rp_channel);
-*/
-
-               ++rp->wopeners;
-               error = rpparam(tp, &tp->t_termios);
-               --rp->wopeners;
-               if(error != 0) {
-                       splx(oldspl);
-                       return(error);
-               }
-
-               rp_num_ports_open++;
-
-               IntMask = sGetChanIntID(&rp->rp_channel);
-               IntMask = IntMask & rp->rp_intmask;
-               ChanStatus = sGetChanStatus(&rp->rp_channel);
-               if((IntMask & DELTA_CD) || IS_CALLOUT(dev)) {
-                       if((ChanStatus & CD_ACT) || IS_CALLOUT(dev)) {
-                                       (void)(*linesw[tp->t_line].l_modem)(tp, 1);
-                       }
-               }
-
-       if (rp_num_ports_open == 1)
-               if ((do_poll_ch.c_flags & CALLOUT_DID_INIT) == 0)
-                       callout_init(&do_poll_ch);
-               callout_reset(&do_poll_ch, POLL_INTERVAL, rp_do_poll, NULL);
-       }
-
-       if(!(flag&O_NONBLOCK) && !(tp->t_cflag&CLOCAL) &&
-               !(tp->t_state & TS_CARR_ON) && !(IS_CALLOUT(dev))) {
-               ++rp->wopeners;
-               error = tsleep(TSA_CARR_ON(tp), PCATCH, "rpdcd", 0);
-               --rp->wopeners;
-               if(error != 0)
-                       goto out;
-               goto open_top;
-       }
-       error = (*linesw[tp->t_line].l_open)(dev, tp);
-
-       rp_disc_optim(tp, &tp->t_termios, rp);
-       if(tp->t_state & TS_ISOPEN && IS_CALLOUT(dev))
-               rp->active_out = TRUE;
-
-out:
-       splx(oldspl);
-       if(!(tp->t_state & TS_ISOPEN) && rp->wopeners == 0) {
-               rphardclose(rp);
-       }
-       return(error);
-}
-
-int
-rpclose(dev, flag, mode, td)
-       dev_t   dev;
-       int     flag, mode;
-       struct thread *td;
-{
-       int     oldspl, unit, mynor, umynor, port; /* SG */
-       struct  rp_port *rp;
-       struct  tty     *tp;
-       CHANNEL_t       *cp;
-
-   umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                    /* SG */
-   unit = minor_to_unit[mynor];                /* SG */
-
-       if(IS_CONTROL(dev))
-               return(0);
-       rp = rp_addr(unit) + port;
-       cp = &rp->rp_channel;
-       tp = rp->rp_tty;
-
-       oldspl = spltty();
-       (*linesw[tp->t_line].l_close)(tp, flag);
-       rp_disc_optim(tp, &tp->t_termios, rp);
-       rpstop(tp, FREAD | FWRITE);
-       rphardclose(rp);
-
-       tp->t_state &= ~TS_BUSY;
-       ttyclose(tp);
-
-       splx(oldspl);
-
-       return(0);
-}
-
-static void
-rphardclose(struct rp_port *rp)
-{
-       int     mynor;
-       struct  tty     *tp;
-       CHANNEL_t       *cp;
-
-       cp = &rp->rp_channel;
-       tp = rp->rp_tty;
-       mynor = MINOR_MAGIC(tp->t_dev);
-
-       sFlushRxFIFO(cp);
-       sFlushTxFIFO(cp);
-       sDisTransmit(cp);
-       sDisInterrupts(cp, TXINT_EN|MCINT_EN|RXINT_EN|SRCINT_EN|CHANINT_EN);
-       sDisRTSFlowCtl(cp);
-       sDisCTSFlowCtl(cp);
-       sDisTxSoftFlowCtl(cp);
-       sClrTxXOFF(cp);
-
-       if(tp->t_cflag&HUPCL || !(tp->t_state&TS_ISOPEN) || !rp->active_out) {
-               sClrDTR(cp);
-       }
-       if(IS_CALLOUT(tp->t_dev)) {
-               sClrDTR(cp);
-       }
-       if(rp->dtr_wait != 0) {
-               callout_reset(&rp->dtr_ch, rp->dtr_wait, rpdtrwakeup, rp);
-               rp->state |= ~SET_DTR;
-       }
-
-       rp->active_out = FALSE;
-       wakeup(&rp->active_out);
-       wakeup(TSA_CARR_ON(tp));
-}
-
-static
-int
-rpwrite(dev, uio, flag)
-       dev_t   dev;
-       struct  uio     *uio;
-       int     flag;
-{
-       struct  rp_port *rp;
-       struct  tty     *tp;
-       int     unit, mynor, port, umynor, error = 0; /* SG */
-
-   umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                    /* SG */
-   unit = minor_to_unit[mynor];                /* SG */
-
-       if(IS_CONTROL(dev))
-               return(ENODEV);
-       rp = rp_addr(unit) + port;
-       tp = rp->rp_tty;
-       while(rp->rp_disable_writes) {
-               rp->rp_waiting = 1;
-               error = ttysleep(tp, (caddr_t)rp, PCATCH, "rp_write", 0);
-               if (error)
-                       return(error);
-       }
-
-       error = (*linesw[tp->t_line].l_write)(tp, uio, flag);
-       return error;
-}
-
-static void
-rpdtrwakeup(void *chan)
-{
-       struct  rp_port *rp;
-
-       rp = (struct rp_port *)chan;
-       rp->state &= SET_DTR;
-       wakeup(&rp->dtr_wait);
-}
-
-int
-rpioctl(dev, cmd, data, flag, td)
-       dev_t   dev;
-       u_long  cmd;
-       caddr_t data;
-       int     flag;
-       struct  thread *td;
-{
-       struct rp_port  *rp;
-       CHANNEL_t       *cp;
-       struct tty      *tp;
-       int     unit, mynor, port, umynor;            /* SG */
-       int     oldspl;
-       int     error = 0;
-       int     arg, flags, result, ChanStatus;
-       int     oldcmd;
-       struct  termios term, *t;
-
-   umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                    /* SG */
-       unit = minor_to_unit[mynor];
-       rp = rp_addr(unit) + port;
-
-       if(IS_CONTROL(dev)) {
-               struct  termios *ct;
-
-               switch (IS_CONTROL(dev)) {
-               case CONTROL_INIT_STATE:
-                       ct =  IS_CALLOUT(dev) ? &rp->it_out : &rp->it_in;
-                       break;
-               case CONTROL_LOCK_STATE:
-                       ct =  IS_CALLOUT(dev) ? &rp->lt_out : &rp->lt_in;
-                       break;
-               default:
-                       return(ENODEV);         /* /dev/nodev */
-               }
-               switch (cmd) {
-               case TIOCSETA:
-                       error = suser(td);
-                       if(error != 0)
-                               return(error);
-                       *ct = *(struct termios *)data;
-                       return(0);
-               case TIOCGETA:
-                       *(struct termios *)data = *ct;
-                       return(0);
-               case TIOCGETD:
-                       *(int *)data = TTYDISC;
-                       return(0);
-               case TIOCGWINSZ:
-                       bzero(data, sizeof(struct winsize));
-                       return(0);
-               default:
-                       return(ENOTTY);
-               }
-       }
-
-       tp = rp->rp_tty;
-       cp = &rp->rp_channel;
-
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
-       term = tp->t_termios;
-       oldcmd = cmd;
-       error = ttsetcompat(tp, &cmd, data, &term);
-       if(error != 0)
-               return(error);
-       if(cmd != oldcmd) {
-               data = (caddr_t)&term;
-       }
-#endif
-       if((cmd == TIOCSETA) || (cmd == TIOCSETAW) || (cmd == TIOCSETAF)) {
-               int     cc;
-               struct  termios *dt = (struct termios *)data;
-               struct  termios *lt = IS_CALLOUT(dev)
-                                       ? &rp->lt_out : &rp->lt_in;
-
-               dt->c_iflag = (tp->t_iflag & lt->c_iflag)
-                               | (dt->c_iflag & ~lt->c_iflag);
-               dt->c_oflag = (tp->t_oflag & lt->c_oflag)
-                               | (dt->c_oflag & ~lt->c_oflag);
-               dt->c_cflag = (tp->t_cflag & lt->c_cflag)
-                               | (dt->c_cflag & ~lt->c_cflag);
-               dt->c_lflag = (tp->t_lflag & lt->c_lflag)
-                               | (dt->c_lflag & ~lt->c_lflag);
-               for(cc = 0; cc < NCCS; ++cc)
-                       if(lt->c_cc[cc] != 0)
-                               dt->c_cc[cc] = tp->t_cc[cc];
-               if(lt->c_ispeed != 0)
-                       dt->c_ispeed = tp->t_ispeed;
-               if(lt->c_ospeed != 0)
-                       dt->c_ospeed = tp->t_ospeed;
-       }
-
-       t = &tp->t_termios;
-
-       error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
-       if(error != ENOIOCTL) {
-               return(error);
-       }
-       oldspl = spltty();
-
-       flags = rp->rp_channel.TxControl[3];
-
-       error = ttioctl(tp, cmd, data, flag);
-       flags = rp->rp_channel.TxControl[3];
-       rp_disc_optim(tp, &tp->t_termios, rp);
-       if(error != ENOIOCTL) {
-               splx(oldspl);
-               return(error);
-       }
-       switch(cmd) {
-       case TIOCSBRK:
-               sSendBreak(&rp->rp_channel);
-               break;
-
-       case TIOCCBRK:
-               sClrBreak(&rp->rp_channel);
-               break;
-
-       case TIOCSDTR:
-               sSetDTR(&rp->rp_channel);
-               sSetRTS(&rp->rp_channel);
-               break;
-
-       case TIOCCDTR:
-               sClrDTR(&rp->rp_channel);
-               break;
-
-       case TIOCMSET:
-               arg = *(int *) data;
-               flags = 0;
-               if(arg & TIOCM_RTS)
-                       flags |= SET_RTS;
-               if(arg & TIOCM_DTR)
-                       flags |= SET_DTR;
-               rp->rp_channel.TxControl[3] =
-                       ((rp->rp_channel.TxControl[3]
-                       & ~(SET_RTS | SET_DTR)) | flags);
-               sOutDW(rp->rp_channel.IndexAddr,
-                       *(DWord_t *) &(rp->rp_channel.TxControl[0]));
-               break;
-       case TIOCMBIS:
-               arg = *(int *) data;
-               flags = 0;
-               if(arg & TIOCM_RTS)
-                       flags |= SET_RTS;
-               if(arg & TIOCM_DTR)
-                       flags |= SET_DTR;
-                       rp->rp_channel.TxControl[3] |= flags;
-               sOutDW(rp->rp_channel.IndexAddr,
-                       *(DWord_t *) &(rp->rp_channel.TxControl[0]));
-               break;
-       case TIOCMBIC:
-               arg = *(int *) data;
-               flags = 0;
-               if(arg & TIOCM_RTS)
-                       flags |= SET_RTS;
-               if(arg & TIOCM_DTR)
-                       flags |= SET_DTR;
-               rp->rp_channel.TxControl[3] &= ~flags;
-               sOutDW(rp->rp_channel.IndexAddr,
-                       *(DWord_t *) &(rp->rp_channel.TxControl[0]));
-               break;
-
-
-       case TIOCMGET:
-               ChanStatus = sGetChanStatusLo(&rp->rp_channel);
-               flags = rp->rp_channel.TxControl[3];
-               result = TIOCM_LE; /* always on while open for some reason */
-               result |= (((flags & SET_DTR) ? TIOCM_DTR : 0)
-                       | ((flags & SET_RTS) ? TIOCM_RTS : 0)
-                       | ((ChanStatus & CD_ACT) ? TIOCM_CAR : 0)
-                       | ((ChanStatus & DSR_ACT) ? TIOCM_DSR : 0)
-                       | ((ChanStatus & CTS_ACT) ? TIOCM_CTS : 0));
-
-               if(rp->rp_channel.RxControl[2] & RTSFC_EN)
-               {
-                       result |= TIOCM_RTS;
-               }
-
-               *(int *)data = result;
-               break;
-       case TIOCMSDTRWAIT:
-               error = suser(td);
-               if(error != 0) {
-                       splx(oldspl);
-                       return(error);
-               }
-               rp->dtr_wait = *(int *)data * hz/100;
-               break;
-       case TIOCMGDTRWAIT:
-               *(int *)data = rp->dtr_wait * 100/hz;
-               break;
-       default:
-               splx(oldspl);
-               return ENOTTY;
-       }
-       splx(oldspl);
-       return(0);
-}
-
-static struct speedtab baud_table[] = {
-       {B0,    0},             {B50,   BRD50},         {B75,   BRD75},
-       {B110,  BRD110},        {B134,  BRD134},        {B150,  BRD150},
-       {B200,  BRD200},        {B300,  BRD300},        {B600,  BRD600},
-       {B1200, BRD1200},       {B1800, BRD1800},       {B2400, BRD2400},
-       {B4800, BRD4800},       {B9600, BRD9600},       {B19200, BRD19200},
-       {B38400, BRD38400},     {B7200, BRD7200},       {B14400, BRD14400},
-                               {B57600, BRD57600},     {B76800, BRD76800},
-       {B115200, BRD115200},   {B230400, BRD230400},
-       { -1,   -1 }
-};
-
-static int
-rpparam(tp, t)
-       struct tty *tp;
-       struct termios *t;
-{
-       struct rp_port  *rp;
-       CHANNEL_t       *cp;
-       int     unit, mynor, port, umynor;               /* SG */
-       int     oldspl, cflag, iflag, oflag, lflag;
-       int     ospeed;
-
-
-   umynor = (((minor(tp->t_dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(tp->t_dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                          /* SG */
-
-       unit = minor_to_unit[mynor];
-       rp = rp_addr(unit) + port;
-       cp = &rp->rp_channel;
-       oldspl = spltty();
-
-       cflag = t->c_cflag;
-       iflag = t->c_iflag;
-       oflag = t->c_oflag;
-       lflag = t->c_lflag;
-
-       ospeed = ttspeedtab(t->c_ispeed, baud_table);
-       if(ospeed < 0 || t->c_ispeed != t->c_ospeed)
-               return(EINVAL);
-
-       tp->t_ispeed = t->c_ispeed;
-       tp->t_ospeed = t->c_ospeed;
-       tp->t_cflag = cflag;
-       tp->t_iflag = iflag;
-       tp->t_oflag = oflag;
-       tp->t_lflag = lflag;
-
-       if(t->c_ospeed == 0) {
-               sClrDTR(cp);
-               return(0);
-       }
-       rp->rp_fifo_lw = ((t->c_ospeed*2) / 1000) +1;
-
-       /* Set baud rate ----- we only pay attention to ispeed */
-       sSetDTR(cp);
-       sSetRTS(cp);
-       sSetBaud(cp, ospeed);
-
-       if(cflag & CSTOPB) {
-               sSetStop2(cp);
-       } else {
-               sSetStop1(cp);
-       }
-
-       if(cflag & PARENB) {
-               sEnParity(cp);
-               if(cflag & PARODD) {
-                       sSetOddParity(cp);
-               } else {
-                       sSetEvenParity(cp);
-               }
-       }
-       else {
-               sDisParity(cp);
-       }
-       if((cflag & CSIZE) == CS8) {
-               sSetData8(cp);
-               rp->rp_imask = 0xFF;
-       } else {
-               sSetData7(cp);
-               rp->rp_imask = 0x7F;
-       }
-
-       if(iflag & ISTRIP) {
-               rp->rp_imask &= 0x7F;
-       }
-
-       if(cflag & CLOCAL) {
-               rp->rp_intmask &= ~DELTA_CD;
-       } else {
-               rp->rp_intmask |= DELTA_CD;
-       }
-
-       /* Put flow control stuff here */
-
-       if(cflag & CCTS_OFLOW) {
-               sEnCTSFlowCtl(cp);
-       } else {
-               sDisCTSFlowCtl(cp);
-       }
-
-       if(cflag & CRTS_IFLOW) {
-               rp->rp_rts_iflow = 1;
-       } else {
-               rp->rp_rts_iflow = 0;
-       }
-
-       if(cflag & CRTS_IFLOW) {
-               sEnRTSFlowCtl(cp);
-       } else {
-               sDisRTSFlowCtl(cp);
-       }
-       rp_disc_optim(tp, t, rp);
-
-       if((cflag & CLOCAL) || (sGetChanStatusLo(cp) & CD_ACT)) {
-               tp->t_state |= TS_CARR_ON;
-               wakeup(TSA_CARR_ON(tp));
-       }
-
-/*     tp->t_state |= TS_CAN_BYPASS_L_RINT;
-       flags = rp->rp_channel.TxControl[3];
-       if(flags & SET_DTR)
-       else
-       if(flags & SET_RTS)
-       else
-*/
-       splx(oldspl);
-
-       return(0);
-}
-
-static void
-rp_disc_optim(tp, t, rp)
-struct tty     *tp;
-struct termios *t;
-struct rp_port *rp;
-{
-       if(!(t->c_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP | IXON))
-               &&(!(t->c_iflag & BRKINT) || (t->c_iflag & IGNBRK))
-               &&(!(t->c_iflag & PARMRK)
-                 ||(t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK))
-               && !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN))
-               && linesw[tp->t_line].l_rint == ttyinput)
-               tp->t_state |= TS_CAN_BYPASS_L_RINT;
-       else
-               tp->t_state &= ~TS_CAN_BYPASS_L_RINT;
-}
-
-static void
-rpstart(tp)
-       struct tty *tp;
-{
-       struct rp_port  *rp;
-       CHANNEL_t       *cp;
-       struct  clist   *qp;
-       int     unit, mynor, port, umynor;               /* SG */
-       char    ch, flags;
-       int     spl, xmit_fifo_room;
-       int     count;
-
-
-   umynor = (((minor(tp->t_dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(tp->t_dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                          /* SG */
-       unit = minor_to_unit[mynor];
-       rp = rp_addr(unit) + port;
-       cp = &rp->rp_channel;
-       flags = rp->rp_channel.TxControl[3];
-       spl = spltty();
-
-       if(tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) {
-               ttwwakeup(tp);
-               splx(spl);
-               return;
-       }
-       if(rp->rp_xmit_stopped) {
-               sEnTransmit(cp);
-               rp->rp_xmit_stopped = 0;
-       }
-       count = sGetTxCnt(cp);
-
-       if(tp->t_outq.c_cc == 0) {
-               if((tp->t_state & TS_BUSY) && (count == 0)) {
-                       tp->t_state &= ~TS_BUSY;
-               }
-               ttwwakeup(tp);
-               splx(spl);
-               return;
-       }
-       xmit_fifo_room = TXFIFO_SIZE - sGetTxCnt(cp);
-       qp = &tp->t_outq;
-       count = 0;
-       if(xmit_fifo_room > 0 && qp->c_cc > 0) {
-               tp->t_state |= TS_BUSY;
-       }
-       while(xmit_fifo_room > 0 && qp->c_cc > 0) {
-               ch = getc(qp);
-               sOutB(sGetTxRxDataIO(cp), ch);
-               xmit_fifo_room--;
-               count++;
-       }
-       rp->rp_restart = (qp->c_cc > 0) ? rp->rp_fifo_lw : 0;
-
-       ttwwakeup(tp);
-       splx(spl);
-}
-
-static
-void
-rpstop(tp, flag)
-       struct tty *tp;
-       int     flag;
-{
-       struct rp_port  *rp;
-       CHANNEL_t       *cp;
-       int     unit, mynor, port, umynor;                  /* SG */
-       int     spl;
-
-   umynor = (((minor(tp->t_dev) >> 16) -1) * 32);    /* SG */
-       port  = (minor(tp->t_dev) & 0x1f);                /* SG */
-       mynor = (port + umynor);                          /* SG */
-       unit = minor_to_unit[mynor];
-       rp = rp_addr(unit) + port;
-       cp = &rp->rp_channel;
-
-       spl = spltty();
-
-       if(tp->t_state & TS_BUSY) {
-               if((tp->t_state&TS_TTSTOP) == 0) {
-                       sFlushTxFIFO(cp);
-               } else {
-                       if(rp->rp_xmit_stopped == 0) {
-                               sDisTransmit(cp);
-                               rp->rp_xmit_stopped = 1;
-                       }
-               }
-       }
-       splx(spl);
-       rpstart(tp);
-}
diff --git a/sys/dev/serial/rp2/rpreg.h b/sys/dev/serial/rp2/rpreg.h
deleted file mode 100644 (file)
index 239bf51..0000000
+++ /dev/null
@@ -1,1046 +0,0 @@
-/* 
- * Copyright (c) Comtrol Corporation <support@comtrol.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted prodived that the follwoing conditions
- * are met.
- * 1. Redistributions of source code must retain the above copyright 
- *    notive, this list of conditions and the following disclainer.
- * 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 prodided 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 Comtrol Corporation.
- * 4. The name of Comtrol Corporation may not be used to endorse or 
- *    promote products derived from this software without specific 
- *    prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY COMTROL CORPORATION ``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 COMTROL CORPORATION 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, LIFE 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.
- *
- * $FreeBSD: src/sys/i386/isa/rpreg.h,v 1.2.6.1 2000/08/03 01:01:20 peter Exp $
- * $DragonFly: src/sys/dev/serial/rp2/Attic/rpreg.h,v 1.2 2003/06/17 04:28:37 dillon Exp $
- */
-
-/*
- * Begin OS-specific defines -  rpreg.h - for RocketPort FreeBSD
- */
-
-typedef unsigned char Byte_t;
-typedef unsigned int ByteIO_t;
-
-typedef unsigned int Word_t;
-typedef unsigned int WordIO_t;
-
-typedef unsigned long DWord_t;
-typedef unsigned int DWordIO_t;
-
-#define sOutB(a, b) outb(a, b)
-#define sOutW(a, b) outw(a, b)
-#define sOutDW(a, b) outl(a, b)
-#define sInB(a) (inb(a))
-#define sInW(a) (inw(a))
-#define sOutStrW(port, addr, count) outsw(port, addr, count)
-#define sInStrW(port, addr, count) insw(port, addr, count)
-
-/*
- * End of OS-specific defines
- */
-
-#define ROCKET_H
-
-#define CTL_SIZE 4
-#define AIOP_CTL_SIZE 4
-#define CHAN_AIOP_SIZE 8
-#define MAX_PORTS_PER_AIOP 8
-#define MAX_AIOPS_PER_BOARD 4
-#define MAX_PORTS_PER_BOARD 32
-
-/* Bus Type ID */
-#define isISA  0
-#define isPCI  1
-#define isMC   2
-
-/* Controller ID numbers */
-#define CTLID_NULL  -1             /* no controller exists */
-#define CTLID_0001  0x0001         /* controller release 1 */
-
-/* PCI IDs  */
-#define RP_VENDOR_ID           0x11FE
-#define RP_DEVICE_ID_8OCTA     0x0001
-#define RP_DEVICE_ID_8INTF     0x0002
-#define RP_DEVICE_ID_16INTF    0x0003
-#define RP_DEVICE_ID_32INTF    0x0004
-
-/* AIOP ID numbers, identifies AIOP type implementing channel */
-#define AIOPID_NULL -1             /* no AIOP or channel exists */
-#define AIOPID_0001 0x0001         /* AIOP release 1 */
-
-#define NULLDEV -1                 /* identifies non-existant device */
-#define NULLCTL -1                 /* identifies non-existant controller */
-#define NULLCTLPTR (CONTROLLER_T *)0 /* identifies non-existant controller */
-#define NULLAIOP -1                /* identifies non-existant AIOP */
-#define NULLCHAN -1                /* identifies non-existant channel */
-
-/************************************************************************
- Global Register Offsets - Direct Access - Fixed values
-************************************************************************/
-
-#define _CMD_REG   0x38   /* Command Register           8    Write */
-#define _INT_CHAN  0x39   /* Interrupt Channel Register  8    Read */
-#define _INT_MASK  0x3A   /* Interrupt Mask Register    8    Read / Write */
-#define _UNUSED    0x3B   /* Unused                     8 */
-#define _INDX_ADDR 0x3C   /* Index Register Address     16   Write */
-#define _INDX_DATA 0x3E   /* Index Register Data        8/16 Read / Write */
-
-/************************************************************************
- Channel Register Offsets for 1st channel in AIOP - Direct Access
-************************************************************************/
-#define _TD0      0x00  /* Transmit Data               16   Write */
-#define _RD0      0x00  /* Receive Data                16   Read */
-#define _CHN_STAT0 0x20  /* Channel Status             8/16 Read / Write */
-#define _FIFO_CNT0 0x10  /* Transmit/Receive FIFO Count 16   Read */
-#define _INT_ID0   0x30  /* Interrupt Identification   8    Read */
-
-/************************************************************************
- Tx Control Register Offsets - Indexed - External - Fixed
-************************************************************************/
-#define _TX_ENBLS  0x980    /* Tx Processor Enables Register 8 Read / Write */
-#define _TXCMP1    0x988    /* Transmit Compare Value #1     8 Read / Write */
-#define _TXCMP2    0x989    /* Transmit Compare Value #2     8 Read / Write */
-#define _TXREP1B1  0x98A    /* Tx Replace Value #1 - Byte 1  8 Read / Write */
-#define _TXREP1B2  0x98B    /* Tx Replace Value #1 - Byte 2  8 Read / Write */
-#define _TXREP2    0x98C    /* Transmit Replace Value #2     8 Read / Write */
-
-/************************************************************************
- Receive FIFO
-************************************************************************/
-#define RXFIFO_DATA    0x5f
-#define RXFIFO_OUT     0x5c
-#define RXFIFO_EN      0x08
-#define RXFIFO_DIS     0xa7
-
-/************************************************************************
-Memory Controller Register Offsets - Indexed - External - Fixed
-************************************************************************/
-#define _RX_FIFO    0x000    /* Rx FIFO */
-#define _TX_FIFO    0x800    /* Tx FIFO */
-#define _RXF_OUTP   0x990    /* Rx FIFO OUT pointer       16 Read / Write */
-#define _RXF_INP    0x992    /* Rx FIFO IN pointer        16 Read / Write */
-#define _TXF_OUTP   0x994    /* Tx FIFO OUT pointer       8  Read / Write */
-#define _TXF_INP    0x995    /* Tx FIFO IN pointer        8  Read / Write */
-#define _TXP_CNT    0x996    /* Tx Priority Count         8  Read / Write */
-#define _TXP_PNTR   0x997    /* Tx Priority Pointer       8  Read / Write */
-
-#define PRI_PEND    0x80     /* Priority data pending (bit7, Tx pri cnt) */
-#define TXFIFO_SIZE 255      /* size of Tx FIFO */
-#define RXFIFO_SIZE 1023     /* size of Rx FIFO */
-
-/************************************************************************
-Tx Priority Buffer - Indexed - External - Fixed
-************************************************************************/
-#define _TXP_BUF    0x9C0    /* Tx Priority Buffer  32 Bytes   Read / Write */
-#define TXP_SIZE    0x20     /* 32 bytes */
-
-/************************************************************************
-Channel Register Offsets - Indexed - Internal - Fixed
-************************************************************************/
-
-#define _TX_CTRL    0xFF0    /* Transmit Control              16  Write */
-#define _RX_CTRL    0xFF2    /* Receive Control                8  Write */
-#define _BAUD      0xFF4    /* Baud Rate                      16  Write */
-#define _CLK_PRE    0xFF6    /* Clock Prescaler                8  Write */
-
-#define CLOCK_PRESC 0x19         /* mod 9 (divide by 10) prescale */
-
-#define BRD50            4607
-#define BRD75            3071
-#define BRD110           2094
-#define BRD134           1712
-#define BRD150           1535
-#define BRD200           1151
-#define BRD300           767
-#define BRD600           383
-#define BRD1200          191
-#define BRD1800          127
-#define BRD2000          114
-#define BRD2400          95
-#define BRD3600          64
-#define BRD4800          47
-#define BRD7200          31
-#define BRD9600          23
-#define BRD14400         15
-#define BRD19200         11
-#define BRD38400         5
-#define BRD57600         3
-#define BRD76800         2
-#define BRD115200        1
-#define BRD230400        0
-
-#define STMBREAK   0x08        /* BREAK */
-#define STMFRAME   0x04        /* framing error */
-#define STMRCVROVR 0x02        /* receiver over run error */
-#define STMPARITY  0x01        /* parity error */
-#define STMERROR   (STMBREAK | STMFRAME | STMPARITY)
-#define STMBREAKH   0x800      /* BREAK */
-#define STMFRAMEH   0x400      /* framing error */
-#define STMRCVROVRH 0x200      /* receiver over run error */
-#define STMPARITYH  0x100      /* parity error */
-#define STMERRORH   (STMBREAKH | STMFRAMEH | STMPARITYH)
-
-#define CTS_ACT   0x20       /* CTS input asserted */
-#define DSR_ACT   0x10       /* DSR input asserted */
-#define CD_ACT   0x08        /* CD input asserted */
-#define TXFIFOMT  0x04       /* Tx FIFO is empty */
-#define TXSHRMT   0x02       /* Tx shift register is empty */
-#define RDA      0x01        /* Rx data available */
-#define DRAINED (TXFIFOMT | TXSHRMT)  /* indicates Tx is drained */
-
-#define STATMODE  0x8000      /* status mode enable bit */
-#define RXFOVERFL 0x2000      /* receive FIFO overflow */
-#define RX2MATCH  0x1000      /* receive compare byte 2 match */
-#define RX1MATCH  0x0800      /* receive compare byte 1 match */
-#define RXBREAK   0x0400      /* received BREAK */
-#define RXFRAME   0x0200      /* received framing error */
-#define RXPARITY  0x0100      /* received parity error */
-#define STATERROR (RXBREAK | RXFRAME | RXPARITY)
-
-#define CTSFC_EN  0x80       /* CTS flow control enable bit */
-#define RTSTOG_EN 0x40       /* RTS toggle enable bit */
-#define TXINT_EN  0x10       /* transmit interrupt enable */
-#define STOP2    0x08        /* enable 2 stop bits (0 = 1 stop) */
-#define PARITY_EN 0x04       /* enable parity (0 = no parity) */
-#define EVEN_PAR  0x02       /* even parity (0 = odd parity) */
-#define DATA8BIT  0x01       /* 8 bit data (0 = 7 bit data) */
-
-#define SETBREAK  0x10       /* send break condition (must clear) */
-#define LOCALLOOP 0x08       /* local loopback set for test */
-#define SET_DTR   0x04       /* assert DTR */
-#define SET_RTS   0x02       /* assert RTS */
-#define TX_ENABLE 0x01       /* enable transmitter */
-
-#define RTSFC_EN  0x40       /* RTS flow control enable */
-#define RXPROC_EN 0x20       /* receive processor enable */
-#define TRIG_NO   0x00       /* Rx FIFO trigger level 0 (no trigger) */
-#define TRIG_1   0x08        /* trigger level 1 char */
-#define TRIG_1_2  0x10       /* trigger level 1/2 */
-#define TRIG_7_8  0x18       /* trigger level 7/8 */
-#define TRIG_MASK 0x18       /* trigger level mask */
-#define SRCINT_EN 0x04       /* special Rx condition interrupt enable */
-#define RXINT_EN  0x02       /* Rx interrupt enable */
-#define MCINT_EN  0x01       /* modem change interrupt enable */
-
-#define RXF_TRIG  0x20       /* Rx FIFO trigger level interrupt */
-#define TXFIFO_MT 0x10       /* Tx FIFO empty interrupt */
-#define SRC_INT   0x08       /* special receive condition interrupt */
-#define DELTA_CD  0x04       /* CD change interrupt */
-#define DELTA_CTS 0x02       /* CTS change interrupt */
-#define DELTA_DSR 0x01       /* DSR change interrupt */
-
-#define REP1W2_EN 0x10       /* replace byte 1 with 2 bytes enable */
-#define IGN2_EN   0x08       /* ignore byte 2 enable */
-#define IGN1_EN   0x04       /* ignore byte 1 enable */
-#define COMP2_EN  0x02       /* compare byte 2 enable */
-#define COMP1_EN  0x01       /* compare byte 1 enable */
-
-#define RESET_ALL 0x80       /* reset AIOP (all channels) */
-#define TXOVERIDE 0x40       /* Transmit software off override */
-#define RESETUART 0x20       /* reset channel's UART */
-#define RESTXFCNT 0x10       /* reset channel's Tx FIFO count register */
-#define RESRXFCNT 0x08       /* reset channel's Rx FIFO count register */
-
-#define INTSTAT0  0x01       /* AIOP 0 interrupt status */
-#define INTSTAT1  0x02       /* AIOP 1 interrupt status */
-#define INTSTAT2  0x04       /* AIOP 2 interrupt status */
-#define INTSTAT3  0x08       /* AIOP 3 interrupt status */
-
-#define INTR_EN   0x08       /* allow interrupts to host */
-#define INT_STROB 0x04       /* strobe and clear interrupt line (EOI) */
-
-/**************************************************************************
-  MUDBAC remapped for PCI
-**************************************************************************/
-
-#define _CFG_INT_PCI   0x40
-#define _PCI_INT_FUNC  0x3A
-
-#define PCI_STROB      0x2000
-#define INTR_EN_PCI    0x0010
-
-#define CHAN3_EN  0x08       /* enable AIOP 3 */
-#define CHAN2_EN  0x04       /* enable AIOP 2 */
-#define CHAN1_EN  0x02       /* enable AIOP 1 */
-#define CHAN0_EN  0x01       /* enable AIOP 0 */
-#define FREQ_DIS  0x00
-#define FREQ_274HZ 0x60
-#define FREQ_137HZ 0x50
-#define FREQ_69HZ  0x40
-#define FREQ_34HZ  0x30
-#define FREQ_17HZ  0x20
-#define FREQ_9HZ   0x10
-#define PERIODIC_ONLY 0x80    /* only PERIODIC interrupt */
-
-#define CHANINT_EN 0x0100          /* flags to enable/disable channel ints */
-
-#define RDATASIZE 72
-#define RREGDATASIZE 52
-
-/* Controller level information structure */
-typedef struct
-{
-       int             CtlID;
-       int             CtlNum;
-       int             BusType;
-       WordIO_t        PCIIO;
-       ByteIO_t        MBaseIO;
-       ByteIO_t        MReg1IO;
-       ByteIO_t        MReg2IO;
-       ByteIO_t        MReg3IO;
-       Byte_t          MReg2;
-       Byte_t          MReg3;
-       int             NumAiop;
-       WordIO_t        AiopIO[AIOP_CTL_SIZE];
-       ByteIO_t        AiopIntChanIO[AIOP_CTL_SIZE];
-       int             AiopID[AIOP_CTL_SIZE];
-       int             AiopNumChan[AIOP_CTL_SIZE];
-} CONTROLLER_T;
-
-typedef CONTROLLER_T CONTROLLER_t;
-
-/* Channel level information structure */
-typedef struct
-{
-       CONTROLLER_T    *CtlP;
-       int             AiopNum;
-       int             ChanID;
-       int             ChanNum;
-
-       ByteIO_t        Cmd;
-       ByteIO_t        IntChan;
-       ByteIO_t        IntMask;
-       DWordIO_t       IndexAddr;
-       WordIO_t        IndexData;
-
-       WordIO_t        TxRxData;
-       WordIO_t        ChanStat;
-       WordIO_t        TxRxCount;
-       ByteIO_t        IntID;
-
-       Word_t          TxFIFO;
-       Word_t          TxFIFOPtrs;
-       Word_t          RxFIFO;
-       Word_t          RxFIFOPtrs;
-       Word_t          TxPrioCnt;
-       Word_t          TxPrioPtr;
-       Word_t          TxPrioBuf;
-
-       Byte_t          R[RREGDATASIZE];
-
-       Byte_t          BaudDiv[4];
-       Byte_t          TxControl[4];
-       Byte_t          RxControl[4];
-       Byte_t          TxEnables[4];
-       Byte_t          TxCompare[4];
-       Byte_t          TxReplace1[4];
-       Byte_t          TxReplace2[4];
-} CHANNEL_T;
-
-typedef CHANNEL_T CHANNEL_t;
-typedef CHANNEL_T * CHANPTR_T;
-
-/***************************************************************************
-Function: sClrBreak
-Purpose:  Stop sending a transmit BREAK signal
-Call:    sClrBreak(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sClrBreak(ChP) \
-{ \
-   (ChP)->TxControl[3] &= ~SETBREAK; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sClrDTR
-Purpose:  Clr the DTR output
-Call:    sClrDTR(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sClrDTR(ChP) \
-{ \
-   (ChP)->TxControl[3] &= ~SET_DTR; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sClrRTS
-Purpose:  Clr the RTS output
-Call:    sClrRTS(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sClrRTS(ChP) \
-{ \
-   (ChP)->TxControl[3] &= ~SET_RTS; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sClrTxXOFF
-Purpose:  Clear any existing transmit software flow control off condition
-Call:    sClrTxXOFF(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sClrTxXOFF(ChP) \
-{ \
-   sOutB((ChP)->Cmd,TXOVERIDE | (Byte_t)(ChP)->ChanNum); \
-   sOutB((ChP)->Cmd,(Byte_t)(ChP)->ChanNum); \
-}
-
-/***************************************************************************
-Function: sCtlNumToCtlPtr
-Purpose:  Convert a controller number to controller structure pointer
-Call:    sCtlNumToCtlPtr(CtlNum)
-         int CtlNum; Controller number
-Return:   CONTROLLER_T *: Ptr to controller structure
-*/
-#define sCtlNumToCtlPtr(CTLNUM) &sController[CTLNUM]
-
-/***************************************************************************
-Function: sControllerEOI
-Purpose:  Strobe the MUDBAC's End Of Interrupt bit.
-Call:    sControllerEOI(CtlP)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-*/
-#define sControllerEOI(CTLP) sOutB((CTLP)->MReg2IO,(CTLP)->MReg2 | INT_STROB)
-
-
-/***************************************************************************
-Function: sPCIControllerEOI
-Purpose:  Strobe the MUDBAC's End Of Interrupt bit.
-Call:    sPCIControllerEOI(CtlP)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-*/
-#define sPCIControllerEOI(CTLP) sOutW((CTLP)->PCIIO, PCI_STROB)
-
-/***************************************************************************
-Function: sDisAiop
-Purpose:  Disable I/O access to an AIOP
-Call:    sDisAiop(CltP)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-         int AiopNum; Number of AIOP on controller
-*/
-#define sDisAiop(CTLP,AIOPNUM) \
-{ \
-   (CTLP)->MReg3 &= sBitMapClrTbl[AIOPNUM]; \
-   sOutB((CTLP)->MReg3IO,(CTLP)->MReg3); \
-}
-
-/***************************************************************************
-Function: sDisCTSFlowCtl
-Purpose:  Disable output flow control using CTS
-Call:    sDisCTSFlowCtl(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sDisCTSFlowCtl(ChP) \
-{ \
-   (ChP)->TxControl[2] &= ~CTSFC_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: DisParity
-Purpose:  Disable parity
-Call:    sDisParity(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: Function sSetParity() can be used in place of functions sEnParity(),
-         sDisParity(), sSetOddParity(), and sSetEvenParity().
-*/
-#define sDisParity(ChP) \
-{ \
-   (ChP)->TxControl[2] &= ~PARITY_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sDisRxFIFO
-Purpose:  Disable Rx FIFO
-Call:    sDisRxFIFO(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sDisRxFIFO(ChP) \
-{ \
-   (ChP)->R[0x32] = 0x0a; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x30]); \
-}
-
-/***************************************************************************
-Function: sDisRxStatusMode
-Purpose:  Disable the Rx status mode
-Call:    sDisRxStatusMode(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: This takes the channel out of the receive status mode.  All
-         subsequent reads of receive data using sReadRxWord() will return
-         two data bytes.
-*/
-#define sDisRxStatusMode(ChP) sOutW((ChP)->ChanStat,0)
-
-/***************************************************************************
-Function: sDisTransmit
-Purpose:  Disable transmit
-Call:    sDisTransmit(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-         This disables movement of Tx data from the Tx FIFO into the 1 byte
-         Tx buffer.  Therefore there could be up to a 2 byte latency
-         between the time sDisTransmit() is called and the transmit buffer
-         and transmit shift register going completely empty.
-*/
-#define sDisTransmit(ChP) \
-{ \
-   (ChP)->TxControl[3] &= ~TX_ENABLE; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sDisTxSoftFlowCtl
-Purpose:  Disable Tx Software Flow Control
-Call:    sDisTxSoftFlowCtl(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sDisTxSoftFlowCtl(ChP) \
-{ \
-   (ChP)->R[0x06] = 0x8a; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x04]); \
-}
-
-/***************************************************************************
-Function: sEnAiop
-Purpose:  Enable I/O access to an AIOP
-Call:    sEnAiop(CltP)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-         int AiopNum; Number of AIOP on controller
-*/
-#define sEnAiop(CTLP,AIOPNUM) \
-{ \
-   (CTLP)->MReg3 |= sBitMapSetTbl[AIOPNUM]; \
-   sOutB((CTLP)->MReg3IO,(CTLP)->MReg3); \
-}
-
-/***************************************************************************
-Function: sEnCTSFlowCtl
-Purpose:  Enable output flow control using CTS
-Call:    sEnCTSFlowCtl(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sEnCTSFlowCtl(ChP) \
-{ \
-   (ChP)->TxControl[2] |= CTSFC_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: EnParity
-Purpose:  Enable parity
-Call:    sEnParity(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: Function sSetParity() can be used in place of functions sEnParity(),
-         sDisParity(), sSetOddParity(), and sSetEvenParity().
-
-Warnings: Before enabling parity odd or even parity should be chosen using
-         functions sSetOddParity() or sSetEvenParity().
-*/
-#define sEnParity(ChP) \
-{ \
-   (ChP)->TxControl[2] |= PARITY_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sEnRTSFlowCtl
-Return: void
-*/
-#define sEnRTSFlowCtl(ChP) \
-{ \
-       (ChP)->TxControl[2] &= ~RTSTOG_EN; \
-       (ChP)->TxControl[3] &= ~SET_RTS; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-       (ChP)->RxControl[2] |= RTSFC_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \
-}
-
-/***************************************************************************
-Function: sDisRTSFlowCtl
-Return: void
-*/
-#define sDisRTSFlowCtl(ChP) \
-{ \
-       (ChP)->RxControl[2] &= ~RTSFC_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \
-}
-
-/***************************************************************************
-Function: sEnRxFIFO
-Purpose:  Enable Rx FIFO
-Call:    sEnRxFIFO(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sEnRxFIFO(ChP) \
-{ \
-   (ChP)->R[0x32] = 0x08; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x30]); \
-}
-
-/***************************************************************************
-Function: sEnRxProcessor
-Purpose:  Enable the receive processor
-Call:    sEnRxProcessor(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: This function is used to start the receive processor.  When
-         the channel is in the reset state the receive processor is not
-         running.  This is done to prevent the receive processor from
-         executing invalid microcode instructions prior to the
-         downloading of the microcode.
-
-Warnings: This function must be called after valid microcode has been
-         downloaded to the AIOP, and it must not be called before the
-         microcode has been downloaded.
-*/
-#define sEnRxProcessor(ChP) \
-{ \
-   (ChP)->RxControl[2] |= RXPROC_EN; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \
-}
-
-/***************************************************************************
-Function: sEnRxStatusMode
-Purpose:  Enable the Rx status mode
-Call:    sEnRxStatusMode(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: This places the channel in the receive status mode.  All subsequent
-         reads of receive data using sReadRxWord() will return a data byte
-         in the low word and a status byte in the high word.
-
-*/
-#define sEnRxStatusMode(ChP) sOutW((ChP)->ChanStat,STATMODE)
-
-/***************************************************************************
-Function: sEnTransmit
-Purpose:  Enable transmit
-Call:    sEnTransmit(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sEnTransmit(ChP) \
-{ \
-   (ChP)->TxControl[3] |= TX_ENABLE; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sGetAiopIntStatus
-Purpose:  Get the AIOP interrupt status
-Call:    sGetAiopIntStatus(CtlP,AiopNum)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-         int AiopNum; AIOP number
-Return:   Byte_t: The AIOP interrupt status.  Bits 0 through 7
-                        represent channels 0 through 7 respectively.  If a
-                        bit is set that channel is interrupting.
-*/
-#define sGetAiopIntStatus(CTLP,AIOPNUM) sInB((CTLP)->AiopIntChanIO[AIOPNUM])
-
-/***************************************************************************
-Function: sGetAiopNumChan
-Purpose:  Get the number of channels supported by an AIOP
-Call:    sGetAiopNumChan(CtlP,AiopNum)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-         int AiopNum; AIOP number
-Return:   int: The number of channels supported by the AIOP
-*/
-#define sGetAiopNumChan(CTLP,AIOPNUM) (CTLP)->AiopNumChan[AIOPNUM]
-
-/***************************************************************************
-Function: sGetChanIntID
-Purpose:  Get a channel's interrupt identification byte
-Call:    sGetChanIntID(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   Byte_t: The channel interrupt ID.  Can be any
-            combination of the following flags:
-               RXF_TRIG:     Rx FIFO trigger level interrupt
-               TXFIFO_MT:    Tx FIFO empty interrupt
-               SRC_INT:      Special receive condition interrupt
-               DELTA_CD:     CD change interrupt
-               DELTA_CTS:    CTS change interrupt
-               DELTA_DSR:    DSR change interrupt
-*/
-#define sGetChanIntID(ChP) (sInB((ChP)->IntID) & (RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR))
-
-/***************************************************************************
-Function: sGetChanNum
-Purpose:  Get the number of a channel within an AIOP
-Call:    sGetChanNum(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   int: Channel number within AIOP, or NULLCHAN if channel does
-              not exist.
-*/
-#define sGetChanNum(ChP) (ChP)->ChanNum
-
-/***************************************************************************
-Function: sGetChanStatus
-Purpose:  Get the channel status
-Call:    sGetChanStatus(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   Word_t: The channel status.  Can be any combination of
-            the following flags:
-               LOW BYTE FLAGS
-               CTS_ACT:      CTS input asserted
-               DSR_ACT:      DSR input asserted
-               CD_ACT:       CD input asserted
-               TXFIFOMT:     Tx FIFO is empty
-               TXSHRMT:      Tx shift register is empty
-               RDA:          Rx data available
-
-               HIGH BYTE FLAGS
-               STATMODE:     status mode enable bit
-               RXFOVERFL:    receive FIFO overflow
-               RX2MATCH:     receive compare byte 2 match
-               RX1MATCH:     receive compare byte 1 match
-               RXBREAK:      received BREAK
-               RXFRAME:      received framing error
-               RXPARITY:     received parity error
-Warnings: This function will clear the high byte flags in the Channel
-         Status Register.
-*/
-#define sGetChanStatus(ChP) sInW((ChP)->ChanStat)
-
-/***************************************************************************
-Function: sGetChanStatusLo
-Purpose:  Get the low byte only of the channel status
-Call:    sGetChanStatusLo(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   Byte_t: The channel status low byte. Can be any combination
-            of the following flags:
-               CTS_ACT:      CTS input asserted
-               DSR_ACT:      DSR input asserted
-               CD_ACT:       CD input asserted
-               TXFIFOMT:     Tx FIFO is empty
-               TXSHRMT:      Tx shift register is empty
-               RDA:          Rx data available
-*/
-#define sGetChanStatusLo(ChP) sInB((ByteIO_t)(ChP)->ChanStat)
-
-/***************************************************************************
-Function: sGetControllerIntStatus
-Purpose:  Get the controller interrupt status
-Call:    sGetControllerIntStatus(CtlP)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-Return:   Byte_t: The controller interrupt status in the lower 4
-                        bits.  Bits 0 through 3 represent AIOP's 0
-                        through 3 respectively.  If a bit is set that
-                        AIOP is interrupting.  Bits 4 through 7 will
-                        always be cleared.
-*/
-#define sGetControllerIntStatus(CTLP) (sInB((CTLP)->MReg1IO) & 0x0f)
-
-/***************************************************************************
-Function: sPCIGetControllerIntStatus
-Purpose:  Get the controller interrupt status
-Call:    sPCIGetControllerIntStatus(CtlP)
-         CONTROLLER_T *CtlP; Ptr to controller structure
-Return:   Byte_t: The controller interrupt status in the lower 4
-                        bits.  Bits 0 through 3 represent AIOP's 0
-                        through 3 respectively.  If a bit is set that
-                        AIOP is interrupting.  Bits 4 through 7 will
-                        always be cleared.
-*/
-#define sPCIGetControllerIntStatus(CTLP) ((sInW((CTLP)->PCIIO) >> 8) & 0x1f)
-
-/***************************************************************************
-Function: sGetRxCnt
-Purpose:  Get the number of data bytes in the Rx FIFO
-Call:    sGetRxCnt(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   int: The number of data bytes in the Rx FIFO.
-Comments: Byte read of count register is required to obtain Rx count.
-
-*/
-#define sGetRxCnt(ChP) sInW((ChP)->TxRxCount)
-
-/***************************************************************************
-Function: sGetTxCnt
-Purpose:  Get the number of data bytes in the Tx FIFO
-Call:    sGetTxCnt(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   Byte_t: The number of data bytes in the Tx FIFO.
-Comments: Byte read of count register is required to obtain Tx count.
-
-*/
-#define sGetTxCnt(ChP) sInB((ByteIO_t)(ChP)->TxRxCount)
-
-/*****************************************************************************
-Function: sGetTxRxDataIO
-Purpose:  Get the I/O address of a channel's TxRx Data register
-Call:    sGetTxRxDataIO(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Return:   WordIO_t: I/O address of a channel's TxRx Data register
-*/
-#define sGetTxRxDataIO(ChP) (ChP)->TxRxData
-
-/***************************************************************************
-Function: sInitChanDefaults
-Purpose:  Initialize a channel structure to its default state.
-Call:    sInitChanDefaults(ChP)
-         CHANNEL_T *ChP; Ptr to the channel structure
-Comments: This function must be called once for every channel structure
-         that exists before any other SSCI calls can be made.
-
-*/
-#define sInitChanDefaults(ChP) \
-{ \
-   (ChP)->CtlP = NULLCTLPTR; \
-   (ChP)->AiopNum = NULLAIOP; \
-   (ChP)->ChanID = AIOPID_NULL; \
-   (ChP)->ChanNum = NULLCHAN; \
-}
-
-/***************************************************************************
-Function: sResetAiopByNum
-Purpose:  Reset the AIOP by number
-Call:    sResetAiopByNum(CTLP,AIOPNUM)
-       CONTROLLER_T CTLP; Ptr to controller structure
-       AIOPNUM; AIOP index
-*/
-#define sResetAiopByNum(CTLP,AIOPNUM) \
-{ \
-   sOutB((CTLP)->AiopIO[(AIOPNUM)]+_CMD_REG,RESET_ALL); \
-   sOutB((CTLP)->AiopIO[(AIOPNUM)]+_CMD_REG,0x0); \
-}
-
-/***************************************************************************
-Function: sSendBreak
-Purpose:  Send a transmit BREAK signal
-Call:    sSendBreak(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSendBreak(ChP) \
-{ \
-   (ChP)->TxControl[3] |= SETBREAK; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetBaud
-Purpose:  Set baud rate
-Call:    sSetBaud(ChP,Divisor)
-         CHANNEL_T *ChP; Ptr to channel structure
-         Word_t Divisor; 16 bit baud rate divisor for channel
-*/
-#define sSetBaud(ChP,DIVISOR) \
-{ \
-   (ChP)->BaudDiv[2] = (Byte_t)(DIVISOR); \
-   (ChP)->BaudDiv[3] = (Byte_t)((DIVISOR) >> 8); \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->BaudDiv[0]); \
-}
-
-/***************************************************************************
-Function: sSetData7
-Purpose:  Set data bits to 7
-Call:    sSetData7(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSetData7(ChP) \
-{ \
-   (ChP)->TxControl[2] &= ~DATA8BIT; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetData8
-Purpose:  Set data bits to 8
-Call:    sSetData8(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSetData8(ChP) \
-{ \
-   (ChP)->TxControl[2] |= DATA8BIT; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetDTR
-Purpose:  Set the DTR output
-Call:    sSetDTR(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSetDTR(ChP) \
-{ \
-   (ChP)->TxControl[3] |= SET_DTR; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetEvenParity
-Purpose:  Set even parity
-Call:    sSetEvenParity(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: Function sSetParity() can be used in place of functions sEnParity(),
-         sDisParity(), sSetOddParity(), and sSetEvenParity().
-
-Warnings: This function has no effect unless parity is enabled with function
-         sEnParity().
-*/
-#define sSetEvenParity(ChP) \
-{ \
-   (ChP)->TxControl[2] |= EVEN_PAR; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetOddParity
-Purpose:  Set odd parity
-Call:    sSetOddParity(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: Function sSetParity() can be used in place of functions sEnParity(),
-         sDisParity(), sSetOddParity(), and sSetEvenParity().
-
-Warnings: This function has no effect unless parity is enabled with function
-         sEnParity().
-*/
-#define sSetOddParity(ChP) \
-{ \
-   (ChP)->TxControl[2] &= ~EVEN_PAR; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetRTS
-Purpose:  Set the RTS output
-Call:    sSetRTS(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSetRTS(ChP) \
-{ \
-   (ChP)->TxControl[3] |= SET_RTS; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetRxTrigger
-Purpose:  Set the Rx FIFO trigger level
-Call:    sSetRxProcessor(ChP,Level)
-         CHANNEL_T *ChP; Ptr to channel structure
-         Byte_t Level; Number of characters in Rx FIFO at which the
-            interrupt will be generated.  Can be any of the following flags:
-
-            TRIG_NO:   no trigger
-            TRIG_1:    1 character in FIFO
-            TRIG_1_2:  FIFO 1/2 full
-            TRIG_7_8:  FIFO 7/8 full
-Comments: An interrupt will be generated when the trigger level is reached
-         only if function sEnInterrupt() has been called with flag
-         RXINT_EN set.  The RXF_TRIG flag in the Interrupt Idenfification
-         register will be set whenever the trigger level is reached
-         regardless of the setting of RXINT_EN.
-
-*/
-#define sSetRxTrigger(ChP,LEVEL) \
-{ \
-   (ChP)->RxControl[2] &= ~TRIG_MASK; \
-   (ChP)->RxControl[2] |= LEVEL; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetStop1
-Purpose:  Set stop bits to 1
-Call:    sSetStop1(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSetStop1(ChP) \
-{ \
-   (ChP)->TxControl[2] &= ~STOP2; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sSetStop2
-Purpose:  Set stop bits to 2
-Call:    sSetStop2(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-*/
-#define sSetStop2(ChP) \
-{ \
-   (ChP)->TxControl[2] |= STOP2; \
-   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \
-}
-
-/***************************************************************************
-Function: sStartRxProcessor
-Purpose:  Start a channel's receive processor
-Call:    sStartRxProcessor(ChP)
-         CHANNEL_T *ChP; Ptr to channel structure
-Comments: This function is used to start a Rx processor after it was
-         stopped with sStopRxProcessor() or sStopSWInFlowCtl().  It
-         will restart both the Rx processor and software input flow control.
-
-*/
-#define sStartRxProcessor(ChP) sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0])
-
-/***************************************************************************
-Function: sWriteTxByte
-Purpose:  Write a transmit data byte to a channel.
-         ByteIO_t io: Channel transmit register I/O address.  This can
-                          be obtained with sGetTxRxDataIO().
-         Byte_t Data; The transmit data byte.
-Warnings: This function writes the data byte without checking to see if
-         sMaxTxSize is exceeded in the Tx FIFO.
-*/
-#define sWriteTxByte(IO,DATA) sOutB(IO,DATA)
-
-int sInitController(   CONTROLLER_T *CtlP,
-                       int CtlNum,
-                       ByteIO_t MudbacIO,
-                       ByteIO_t *AiopIOList,
-                       int AiopIOListSize,
-                       int IRQNum,
-                       Byte_t Frequency,
-                       int PeriodicOnly);
-
-int sPCIInitController( CONTROLLER_T *CtlP,
-                       int CtlNum,
-                       ByteIO_t *AiopIOList,
-                       int AiopIOListSize,
-                       int IRQNum,
-                       Byte_t Frequency,
-                       int PeriodicOnly);
-
-int sReadAiopID(ByteIO_t io);
-int sReadAiopNumChan(WordIO_t io);
-int sInitChan( CONTROLLER_T *CtlP,
-               CHANNEL_T *ChP,
-               int AiopNum,
-               int ChanNum);
-Byte_t sGetRxErrStatus(CHANNEL_T *ChP);
-void sStopRxProcessor(CHANNEL_T *ChP);
-void sStopSWInFlowCtl(CHANNEL_T *ChP);
-void sFlushRxFIFO(CHANNEL_T *ChP);
-void sFlushTxFIFO(CHANNEL_T *ChP);
-int sWriteTxPrioByte(CHANNEL_T *ChP, Byte_t Data);
-void sEnInterrupts(CHANNEL_T *ChP,Word_t Flags);
-void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags);
-
-#ifndef ROCKET_C
-extern Byte_t R[RDATASIZE];
-extern CONTROLLER_T sController[CTL_SIZE];
-extern Byte_t sIRQMap[16];
-extern Byte_t sBitMapClrTbl[8];
-extern Byte_t sBitMapSetTbl[8];
-#endif
diff --git a/sys/dev/serial/rp2/rpvar.h b/sys/dev/serial/rp2/rpvar.h
deleted file mode 100644 (file)
index 6c252cc..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/* 
- * Copyright (c) Comtrol Corporation <support@comtrol.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted prodived that the follwoing conditions
- * are met.
- * 1. Redistributions of source code must retain the above copyright 
- *    notive, this list of conditions and the following disclainer.
- * 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 prodided 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 Comtrol Corporation.
- * 4. The name of Comtrol Corporation may not be used to endorse or 
- *    promote products derived from this software without specific 
- *    prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY COMTROL CORPORATION ``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 COMTROL CORPORATION 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, LIFE 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.
- *
- * $FreeBSD: src/sys/i386/isa/rpvar.h,v 1.1.6.1 2000/08/03 01:01:20 peter Exp $
- * $DragonFly: src/sys/dev/serial/rp2/Attic/rpvar.h,v 1.3 2004/09/19 01:55:07 dillon Exp $
- */
-
-/*
- * rpvar.h --- RocketPort data structure includes for FreeBSD
- */
-
-#define RP_UNIT(x) dv_unit(x)
-#define RP_PORT(x) (minor(x) & 0x3f)
-#define MAX_RP_PORTS   128
-
-
-struct rp_port {
-       struct tty *            rp_tty; /* cross reference */
-
-/* Initial state */
-       struct termios          it_in;
-       struct termios          it_out;
-
-/* Lock state */
-       struct termios          lt_in;
-       struct termios          lt_out;
-
-/* Nonzero if callout device is open */
-       unsigned char           active_out;
-       unsigned char           state;  /* state of dtr */
-
-/* Time to hold DTR down on close */
-       struct callout          dtr_ch;
-       int                     dtr_wait;
-       int                     wopeners;       /* processes waiting for DCD */
-
-       int                     rp_port;
-       int                     rp_flags;
-       int                     rp_unit:2;
-       int                     rp_aiop:2;
-       int                     rp_chan:3;
-       int                     rp_intmask;
-       int                     rp_imask; /* Input mask */
-       int                     rp_fifo_lw;
-       int                     rp_restart;
-       int                     rp_overflows;
-       int                     rp_rts_iflow:1;
-       int                     rp_disable_writes:1;
-       int                     rp_cts:1;
-       int                     rp_waiting:1;
-       int                     rp_xmit_stopped:1;
-       CONTROLLER_t *          rp_ctlp;
-       CHANNEL_t               rp_channel;
-};
-
-struct termios deftermios = {
-       TTYDEF_IFLAG,
-       TTYDEF_OFLAG,
-       TTYDEF_CFLAG,
-       TTYDEF_LFLAG,
-       { CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
-       _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
-       CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE },
-       TTYDEF_SPEED,
-       TTYDEF_SPEED
-};
index f355163..28fc5ad 100644 (file)
@@ -25,6 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
+ * $DragonFly: src/sys/dev/sound/isa/i386/Attic/dev_table.h,v 1.2 2005/01/31 23:44:35 joerg Exp $
  */
 
 #ifndef _DEV_TABLE_H_
@@ -356,10 +357,6 @@ struct driver_info sound_drivers[] = {
     {"SB16", 0, SNDCARD_SB16, "SoundBlaster16",
                sb16_dsp_init, sb16_dsp_detect},
 #endif
-#ifdef CONFIG_AWE32
-    {"AWE32", 0, SNDCARD_AWE32,     "AWE32 Synth",
-                attach_awe, probe_awe},
-#endif
 #ifdef CONFIG_MIDI
     {"SB16MIDI", 0, SNDCARD_SB16MIDI, "SB16 MIDI",
                attach_sb16midi, probe_sb16midi},
index 7f96317..7ef2595 100644 (file)
@@ -1,3 +1,5 @@
+/* $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_calls.h,v 1.2 2005/01/31 23:44:35 joerg Exp $ */
+
 /*
  *     DMA buffer calls
  */
@@ -130,10 +132,6 @@ void opl3_init(int ioaddr, sound_os_info *osp);
 void attach_sb_card(struct address_info *hw_config);
 int probe_sb(struct address_info *hw_config);
 
-/*  From awe_wave.c  */
-void  attach_awe(struct address_info *hw_config);
-int probe_awe(struct address_info *hw_config);
-
 /*     From adlib_card.c       */
 void attach_adlib_card(struct address_info *hw_config);
 int probe_adlib(struct address_info *hw_config);
index 7b12c5c..086f120 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/isa/sound/soundcard.c,v 1.87 1999/12/20 18:05:01 eivind Exp $
- * $DragonFly: src/sys/dev/sound/isa/i386/Attic/soundcard.c,v 1.7 2004/05/19 22:52:50 dillon Exp $
+ * $DragonFly: src/sys/dev/sound/isa/i386/Attic/soundcard.c,v 1.8 2005/01/31 23:44:35 joerg Exp $
  *
  */
 #include "use_snd.h"
@@ -129,7 +129,6 @@ struct isa_driver trixsbdriver = {sndprobe, sndattach, "trixsb"};
 struct isa_driver sbdriver = {sndprobe, sndattach, "sb"};
 struct isa_driver sbxvidriver = {sndprobe, sndattach, "sbxvi"};
 struct isa_driver sbmididriver = {sndprobe, sndattach, "sbmidi"};
-struct isa_driver awedriver    = {sndprobe, sndattach, "awe"};
 struct isa_driver pasdriver = {sndprobe, sndattach, "pas"};
 struct isa_driver mpudriver = {sndprobe, sndattach, "mpu"};
 struct isa_driver gusdriver = {sndprobe, sndattach, "gus"};
@@ -316,8 +315,6 @@ driver_to_voxunit(struct isa_driver * driver)
        return (SNDCARD_SB16);
     else if (driver == &sbmididriver)
        return (SNDCARD_SB16MIDI);
-    else if(driver == &awedriver)
-       return(SNDCARD_AWE32);
     else if (driver == &uartdriver)
        return (SNDCARD_UART6850);
     else if (driver == &gusdriver)
index 5af0c49..5c2ac52 100644 (file)
@@ -3,7 +3,7 @@
 #      as much of the source tree as it can.
 #
 # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $
-# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.45 2005/01/10 19:37:23 joerg Exp $
+# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.46 2005/01/31 23:44:35 joerg Exp $
 #
 # NB: You probably don't want to try running a kernel built from this
 # file.  Instead, you should start from GENERIC, and add options from
@@ -268,14 +268,8 @@ options    CYRIX_CACHE_REALLY_WORKS
 
 #
 # A math emulator is mandatory if you wish to run on hardware which
-# does not have a floating-point processor.  Pick either the original,
-# bogus (but freely-distributable) math emulator, or a much more
-# fully-featured but GPL-licensed emulator taken from Linux.
-#
+# does not have a floating-point processor.
 options        MATH_EMULATE            #Support for x87 emulation
-# Don't enable both of these in a real config.
-#options       GPL_MATH_EMULATE        #Support for x87 emulation via
-                                       #new math emulator
 \f
 #####################################################################
 # COMPATIBILITY OPTIONS                                             
@@ -1537,7 +1531,6 @@ options   NATM                    #native ATM
 #device sb0    at isa? port 0x220 irq 5 drq 1
 #device sbxvi0 at isa? drq 5
 #device sbmidi0        at isa? port 0x330
-#device awe0   at isa? port 0x620
 #device gus0   at isa? port 0x220 irq 12 drq 1
 ##device gus0  at isa? port 0x220 irq 12 drq 1 flags 0x3
 #device mss0   at isa? port 0x530 irq 10 drq 1
@@ -2084,15 +2077,10 @@ options         BKTR_NEW_MSP34XX_DRIVER
 # PCCARD/PCMCIA
 #
 # pccard: pccard slots
-# pcic: isa/pccard bridge (OLDCARD)
-# cardbus/cbb: cardbus bridge (NEWCARD)
+# cardbus/cbb: cardbus bridge
 device         pccard
 device         cardbus
 device         cbb
-#device                pcic
-
-# You may need to reset all pccards after resuming
-options        PCIC_RESUME_RESET       # reset after resume
 
 #
 # Laptop/Notebook options:
diff --git a/sys/i386/gnu/fpemul/Changelog b/sys/i386/gnu/fpemul/Changelog
deleted file mode 100644 (file)
index b678e15..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-$FreeBSD: src/sys/gnu/i386/fpemul/Changelog,v 1.1.20.1 2000/08/03 00:53:55 peter Exp $
-$DragonFly: src/sys/i386/gnu/fpemul/Attic/Changelog,v 1.2 2003/06/17 04:28:34 dillon Exp $
-
-This file contains the changes made to W. Metzenthem's 387 FPU
-emulator to make it work under NetBSD.
-
-a, Changes to make it compile:
-       
-       1 - Changed the #include's to get the appropriate .h files.
-       2 - Renamed .S to .s, to satisfy the kernel Makefile.
-       3 - Changed the C++ style // comments to /* */
-       4 - Changed the FPU_ORIG_EIP macro. A letter from bde included
-               in the package suggested using tf_isp for using instead
-               of the linux __orig_eip. This later turned out to interfere
-               with the user stack, so i created a separate variable, stored
-               in the i387_union.
-       5 - Changed the get_fs_.. put_fs_.. fns to fubyte,fuword,subyte,
-               suword.
-       6 - Removed the verify_area fns. I don't really know what they do,
-               i suppose they verify access to memory. The sufu routines
-               should do this.
-
-b, Changes to make it work:
-       
-       1 - Made math_emulate() to return 0 when successful, so trap() won't
-               try to generate a signal.
-       2 - Changed the size of the save87 struct in /sys/arch/i387/include/
-               npx.h to accomodate the i387_union.
-       
-d, Other changes:
-
-       1 - Removed obsolate and/or linux specific stuff.
-       2 - Changed the RE_ENTRANT_CHECK_[ON|OFF] macro to
-               REENTRANT_CHECK([ON|OFF]) so indent can grok it.
-       3 - Re-indented to Berkeley style.
-       4 - Limited max no of lookaheads. LOOKAHEAD_LIMIT in fpu_entry.c
-
-
-       Szabolcs Szigeti (pink@fsz.bme.hu)
diff --git a/sys/i386/gnu/fpemul/README b/sys/i386/gnu/fpemul/README
deleted file mode 100644 (file)
index 6233ca6..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *  wm-FPU-emu   an FPU emulator for 80386 and 80486SX microprocessors.
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/README,v 1.2.20.1 2000/08/03 00:53:55 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/README,v 1.2 2003/06/17 04:28:34 dillon Exp $
- */
-
-wm-FPU-emu is an FPU emulator for Linux. It is derived from wm-emu387
-which is my 80387 emulator for djgpp (gcc under msdos); wm-emu387 was
-in turn based upon emu387 which was written by DJ Delorie for djgpp.
-The interface to the Linux kernel is based upon the original Linux
-math emulator by Linus Torvalds.
-
-My target FPU for wm-FPU-emu is that described in the Intel486
-Programmer's Reference Manual (1992 edition). Numerous facets of the
-functioning of the FPU are not well covered in the Reference Manual;
-in the absence of clear details I have made guesses about the most
-reasonable behaviour. Recently, this situation has improved because
-I now have some access to the results produced by a real 80486 FPU.
-
-wm-FPU-emu does not implement all of the behaviour of the 80486 FPU. 
-See "Limitations" later in this file for a partial list of some
-differences.  I believe that the missing features are never used by
-normal C or FORTRAN programs. 
-
-
-Please report bugs, etc to me at:
-       apm233m@vaxc.cc.monash.edu.au
-
-
---Bill Metzenthen
-  May 1993
-
-
------------------------ Internals of wm-FPU-emu -----------------------
-
-Numeric algorithms:
-(1) Add, subtract, and multiply. Nothing remarkable in these.
-(2) Divide has been tuned to get reasonable performance. The algorithm
-    is not the obvious one which most people seem to use, but is designed
-    to take advantage of the characteristics of the 80386. I expect that
-    it has been invented many times before I discovered it, but I have not
-    seen it. It is based upon one of those ideas which one carries around
-    for years without ever bothering to check it out.
-(3) The sqrt function has been tuned to get good performance. It is based
-    upon Newton's classic method. Performance was improved by capitalizing
-    upon the properties of Newton's method, and the code is once again
-    structured taking account of the 80386 characteristics.
-(4) The trig, log, and exp functions are based in each case upon quasi-
-    "optimal" polynomial approximations. My definition of "optimal" was
-    based upon getting good accuracy with reasonable speed.
-
-The code of the emulator is complicated slightly by the need to
-account for a limited form of re-entrancy. Normally, the emulator will
-emulate each FPU instruction to completion without interruption.
-However, it may happen that when the emulator is accessing the user
-memory space, swapping may be needed. In this case the emulator may be
-temporarily suspended while disk i/o takes place. During this time
-another process may use the emulator, thereby changing some static
-variables (eg FPU_st0_ptr, etc). The code which accesses user memory
-is confined to five files:
-    fpu_entry.c
-    reg_ld_str.c
-    load_store.c
-    get_address.c
-    errors.c
-
------------------------ Limitations of wm-FPU-emu -----------------------
-
-There are a number of differences between the current wm-FPU-emu
-(version beta 1.4) and the 80486 FPU (apart from bugs). Some of the
-more important differences are listed below:
-
-All internal computations are performed at 64 bit or higher precision
-and rounded etc as required by the PC bits of the FPU control word.
-Under the crt0 version for Linux current at March 1993, the FPU PC
-bits specify 53 bits precision.
-
-The precision flag (PE of the FPU status word) and the Roundup flag
-(C1 of the status word) are now partially implemented. Does anyone
-write code which uses these features?
-
-The functions which load/store the FPU state are partially implemented,
-but the implementation should be sufficient for handling FPU errors etc
-in 32 bit protected mode.
-
-The implementation of the exception mechanism is flawed for unmasked
-interrupts.
-
-Detection of certain conditions, such as denormal operands, is not yet
-complete.
-
------------------------ Performance of wm-FPU-emu -----------------------
-
-Speed.
------
-
-The speed of floating point computation with the emulator will depend
-upon instruction mix. Relative performance is best for the instructions
-which require most computation. The simple instructions are adversely
-affected by the fpu instruction trap overhead.
-
-
-Timing: Some simple timing tests have been made on the emulator functions.
-The times include load/store instructions. All times are in microseconds
-measured on a 33MHz 386 with 64k cache. The Turbo C tests were under
-ms-dos, the next two columns are for emulators running with the djgpp
-ms-dos extender. The final column is for wm-FPU-emu in Linux 0.97,
-using libm4.0 (hard).
-
-function      Turbo C        djgpp 1.06        WM-emu387     wm-FPU-emu
-
-   +          60.5           154.8              76.5          139.4
-   -          61.1-65.5      157.3-160.8        76.2-79.5     142.9-144.7
-   *          71.0           190.8              79.6          146.6
-   /          61.2-75.0      261.4-266.9        75.3-91.6     142.2-158.1
-
- sin()        310.8          4692.0            319.0          398.5
- cos()        284.4          4855.2            308.0          388.7
- tan()        495.0          8807.1            394.9          504.7
- atan()       328.9          4866.4            601.1          419.5-491.9
-
- sqrt()       128.7          crashed           145.2          227.0
- log()        413.1-419.1    5103.4-5354.21    254.7-282.2    409.4-437.1
- exp()        479.1          6619.2            469.1          850.8
-
-
-The performance under Linux is improved by the use of look-ahead code.
-The following results show the improvement which is obtained under
-Linux due to the look-ahead code. Also given are the times for the
-original Linux emulator with the 4.1 'soft' lib.
-
- [ Linus' note: I changed look-ahead to be the default under linux, as
-   there was no reason not to use it after I had edited it to be
-   disabled during tracing ]
-
-            wm-FPU-emu w     original w
-            look-ahead       'soft' lib
-   +         106.4             190.2
-   -         108.6-111.6      192.4-216.2
-   *         113.4             193.1
-   /         108.8-124.4      700.1-706.2
-
- sin()       390.5            2642.0
- cos()       381.5            2767.4
- tan()       496.5            3153.3
- atan()      367.2-435.5     2439.4-3396.8
-
- sqrt()      195.1            4732.5
- log()       358.0-387.5     3359.2-3390.3
- exp()       619.3            4046.4
-
-
-These figures are now somewhat out-of-date. The emulator has become
-progressively slower for most functions as more of the 80486 features
-have been implemented.
-
-
------------------------ Accuracy of wm-FPU-emu -----------------------
-
-
-Accuracy: The following table gives the accuracy of the sqrt(), trig
-and log functions. Each function was tested at about 400 points. Ideal
-results would be 64 bits. The reduced accuracy of cos() and tan() for
-arguments greater than pi/4 can be thought of as being due to the
-precision of the argument x; e.g. an argument of pi/2-(1e-10) which is
-accurate to 64 bits can result in a relative accuracy in cos() of about
-64 + log2(cos(x)) = 31 bits. Results for the Turbo C emulator are given
-in the last column.
-
-
-Function      Tested x range            Worst result (bits)         Turbo C
-
-sqrt(x)       1 .. 2                    64.1                         63.2
-atan(x)       1e-10 .. 200              62.6                         62.8
-cos(x)        0 .. pi/2-(1e-10)         63.2 (x <= pi/4)             62.4
-                                        35.2 (x = pi/2-(1e-10))      31.9
-sin(x)        1e-10 .. pi/2             63.0                         62.8
-tan(x)        1e-10 .. pi/2-(1e-10)     62.4 (x <= pi/4)             62.1
-                                        35.2 (x = pi/2-(1e-10))      31.9
-exp(x)        0 .. 1                    63.1                         62.9
-log(x)        1+1e-6 .. 2               62.4                         62.1
-
-
-As of version 1.3 of the emulator, the accuracy of the basic
-arithmetic has been improved (by a small fraction of a bit). Care has
-been taken to ensure full accuracy of the rounding of the basic
-arithmetic functions (+,-,*,/,and fsqrt), and they all now produce
-results which are exact to the 64th bit (unless there are any bugs
-left). To ensure this, it was necessary to effectively get information
-of up to about 128 bits precision. The emulator now passes the
-"paranoia" tests (compiled with gcc 2.3.3) for 'float' variables (24
-bit precision numbers) when precision control is set to 24, 53 or 64
-bits, and for 'double' variables (53 bit precision numbers) when
-precision control is set to 53 bits (a properly performing FPU cannot
-pass the 'paranoia' tests for 'double' variables when precision
-control is set to 64 bits).
-
-------------------------- Contributors -------------------------------
-
-A number of people have contributed to the development of the
-emulator, often by just reporting bugs, sometimes with a suggested
-fix, and a few kind people have provided me with access in one way or
-another to an 80486 machine. Contributors include (to those people who
-I have forgotten, please excuse me):
-
-Linus Torvalds
-Tommy.Thorn@daimi.aau.dk
-Andrew.Tridgell@anu.edu.au
-Nick Holloway alfie@dcs.warwick.ac.uk
-Hermano Moura moura@dcs.gla.ac.uk
-Jon Jagger J.Jagger@scp.ac.uk
-Lennart Benschop
-Brian Gallew geek+@CMU.EDU
-Thomas Staniszewski ts3v+@andrew.cmu.edu
-Martin Howell mph@plasma.apana.org.au
-M Saggaf alsaggaf@athena.mit.edu
-Peter Barker PETER@socpsy.sci.fau.edu
-tom@vlsivie.tuwien.ac.at
-Dan Russel russed@rpi.edu
-Daniel Carosone danielce@ee.mu.oz.au
-cae@jpmorgan.com
-Hamish Coleman t933093@minyos.xx.rmit.oz.au
-
-...and numerous others who responded to my request for help with
-a real 80486.
-
diff --git a/sys/i386/gnu/fpemul/control_w.h b/sys/i386/gnu/fpemul/control_w.h
deleted file mode 100644 (file)
index 85c3bb6..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  control_w.h
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/control_w.h,v 1.7 1999/08/28 00:42:48 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/control_w.h,v 1.2 2003/06/17 04:28:34 dillon Exp $
- *
- */
-
-#ifndef _CONTROLW_H_
-#define _CONTROLW_H_
-
-#ifdef LOCORE
-#define        _Const_(x)      $/**/x
-#else
-#define        _Const_(x)      x
-#endif
-
-#define CW_RC          _Const_(0x0C00) /* rounding control */
-#define CW_PC          _Const_(0x0300) /* precision control */
-
-#define CW_Precision   Const_(0x0020)  /* loss of precision mask */
-#define CW_Underflow   Const_(0x0010)  /* underflow mask */
-#define CW_Overflow    Const_(0x0008)  /* overflow mask */
-#define CW_ZeroDiv     Const_(0x0004)  /* divide by zero mask */
-#define CW_Denormal    Const_(0x0002)  /* denormalized operand mask */
-#define CW_Invalid     Const_(0x0001)  /* invalid operation mask */
-
-#define CW_Exceptions          _Const_(0x003f) /* all masks */
-
-#define RC_RND         _Const_(0x0000)
-#define RC_DOWN                _Const_(0x0400)
-#define RC_UP          _Const_(0x0800)
-#define RC_CHOP                _Const_(0x0C00)
-
-/* p 15-5: Precision control bits affect only the following:
-   ADD, SUB(R), MUL, DIV(R), and SQRT */
-#define PR_24_BITS      _Const_(0x000)
-#define PR_53_BITS      _Const_(0x200)
-#define PR_64_BITS      _Const_(0x300)
-/* FULL_PRECISION simulates all exceptions masked */
-#define FULL_PRECISION  (PR_64_BITS | RC_RND | 0x3f)
-
-#endif                         /* _CONTROLW_H_ */
diff --git a/sys/i386/gnu/fpemul/div_small.s b/sys/i386/gnu/fpemul/div_small.s
deleted file mode 100644 (file)
index a1eff2b..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-       .file   "div_small.S"
-/*
- *  div_small.S
- *
- * Divide a 64 bit integer by a 32 bit integer & return remainder.
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- * 
- * $FreeBSD: src/sys/gnu/i386/fpemul/div_small.s,v 1.8 1999/08/28 00:42:48 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/div_small.s,v 1.3 2003/08/07 21:17:20 dillon Exp $
- *
- */
-
-/*---------------------------------------------------------------------------+
- |    unsigned long div_small(unsigned long long *x, unsigned long y)        |
- +---------------------------------------------------------------------------*/
-
-#include "fpu_asm.h"
-
-.text
-ENTRY(div_small)
-       pushl   %ebp
-       movl    %esp,%ebp
-
-       pushl   %esi
-
-       movl    PARAM1,%esi     /* pointer to num */
-       movl    PARAM2,%ecx     /* The denominator */
-
-       movl    4(%esi),%eax    /* Get the current num msw */
-       xorl    %edx,%edx
-       divl    %ecx
-
-       movl    %eax,4(%esi)
-
-       movl    (%esi),%eax     /* Get the num lsw */
-       divl    %ecx
-
-       movl    %eax,(%esi)
-
-       movl    %edx,%eax       /* Return the remainder in eax */
-
-       popl    %esi
-
-       leave
-       ret
-
diff --git a/sys/i386/gnu/fpemul/errors.c b/sys/i386/gnu/fpemul/errors.c
deleted file mode 100644 (file)
index 1c23787..0000000
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- *  errors.c
- *
- *  The error handling functions for wm-FPU-emu
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/errors.c,v 1.10 1999/08/28 00:42:49 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/errors.c,v 1.3 2003/08/07 21:17:20 dillon Exp $
- *
- */
-
-/*---------------------------------------------------------------------------+
- | Note:                                                                     |
- |    The file contains code which accesses user memory.                     |
- |    Emulator static data may change when user memory is accessed, due to   |
- |    other processes using the emulator while swapping is in progress.      |
- +---------------------------------------------------------------------------*/
-
-
-
-
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <machine/pcb.h>
-
-#include "fpu_emu.h"
-#include "fpu_system.h"
-#include "exception.h"
-#include "status_w.h"
-#include "control_w.h"
-#include "reg_constant.h"
-#include "version.h"
-
-/* */
-#undef PRINT_MESSAGES
-/* */
-
-
-void
-Un_impl(void)
-{
-       unsigned char byte1, FPU_modrm;
-
-       REENTRANT_CHECK(OFF);
-       byte1 = fubyte((unsigned char *) FPU_ORIG_EIP);
-       FPU_modrm = fubyte(1 + (unsigned char *) FPU_ORIG_EIP);
-
-       printf("Unimplemented FPU Opcode at eip=%#08x : %02x ",
-           FPU_ORIG_EIP, byte1);
-
-       if (FPU_modrm >= 0300)
-               printf("%02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7);
-       else
-               printf("/%d\n", (FPU_modrm >> 3) & 7);
-       REENTRANT_CHECK(ON);
-
-       EXCEPTION(EX_Invalid);
-
-}
-
-
-
-
-void
-emu_printall()
-{
-       int     i;
-       static char *tag_desc[] = {"Valid", "Zero", "ERROR", "ERROR",
-       "DeNorm", "Inf", "NaN", "Empty"};
-       unsigned char byte1, FPU_modrm;
-
-       REENTRANT_CHECK(OFF);
-       byte1 = fubyte((unsigned char *) FPU_ORIG_EIP);
-       FPU_modrm = fubyte(1 + (unsigned char *) FPU_ORIG_EIP);
-
-#ifdef DEBUGGING
-       if (status_word & SW_Backward)
-               printf("SW: backward compatibility\n");
-       if (status_word & SW_C3)
-               printf("SW: condition bit 3\n");
-       if (status_word & SW_C2)
-               printf("SW: condition bit 2\n");
-       if (status_word & SW_C1)
-               printf("SW: condition bit 1\n");
-       if (status_word & SW_C0)
-               printf("SW: condition bit 0\n");
-       if (status_word & SW_Summary)
-               printf("SW: exception summary\n");
-       if (status_word & SW_Stack_Fault)
-               printf("SW: stack fault\n");
-       if (status_word & SW_Precision)
-               printf("SW: loss of precision\n");
-       if (status_word & SW_Underflow)
-               printf("SW: underflow\n");
-       if (status_word & SW_Overflow)
-               printf("SW: overflow\n");
-       if (status_word & SW_Zero_Div)
-               printf("SW: divide by zero\n");
-       if (status_word & SW_Denorm_Op)
-               printf("SW: denormalized operand\n");
-       if (status_word & SW_Invalid)
-               printf("SW: invalid operation\n");
-#endif                         /* DEBUGGING */
-
-       status_word = status_word & ~SW_Top;
-       status_word |= (top & 7) << SW_Top_Shift;
-
-       printf("At %#08x: %02x ", FPU_ORIG_EIP, byte1);
-       if (FPU_modrm >= 0300)
-               printf("%02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7);
-       else
-               printf("/%d, mod=%d rm=%d\n",
-                   (FPU_modrm >> 3) & 7, (FPU_modrm >> 6) & 3, FPU_modrm & 7);
-
-       printf(" SW: b=%d st=%d es=%d sf=%d cc=%d%d%d%d ef=%d%d%d%d%d%d\n",
-           status_word & 0x8000 ? 1 : 0,       /* busy */
-           (int)((status_word & 0x3800) >> 11),        /* stack top pointer */
-           status_word & 0x80 ? 1 : 0, /* Error summary status */
-           status_word & 0x40 ? 1 : 0, /* Stack flag */
-           status_word & SW_C3 ? 1 : 0, status_word & SW_C2 ? 1 : 0,   /* cc */
-           status_word & SW_C1 ? 1 : 0, status_word & SW_C0 ? 1 : 0,   /* cc */
-           status_word & SW_Precision ? 1 : 0, status_word & SW_Underflow ? 1 : 0,
-           status_word & SW_Overflow ? 1 : 0, status_word & SW_Zero_Div ? 1 : 0,
-           status_word & SW_Denorm_Op ? 1 : 0, status_word & SW_Invalid ? 1 : 0);
-
-       printf(" CW: ic=%d rc=%d%d pc=%d%d iem=%d     ef=%d%d%d%d%d%d\n",
-           control_word & 0x1000 ? 1 : 0,
-           (int)((control_word & 0x800) >> 11),
-           (int)((control_word & 0x400) >> 10),
-           (int)((control_word & 0x200) >> 9),
-           (int)((control_word & 0x100) >> 8),
-           control_word & 0x80 ? 1 : 0,
-           control_word & SW_Precision ? 1 : 0, control_word & SW_Underflow ? 1 : 0,
-           control_word & SW_Overflow ? 1 : 0, control_word & SW_Zero_Div ? 1 : 0,
-           control_word & SW_Denorm_Op ? 1 : 0, control_word & SW_Invalid ? 1 : 0);
-
-       for (i = 0; i < 8; i++) {
-               FPU_REG *r = &st(i);
-               switch (r->tag) {
-               case TW_Empty:
-                       continue;
-                       break;
-               case TW_Zero:
-                       printf("st(%d)  %c .0000 0000 0000 0000         ",
-                           i, r->sign ? '-' : '+');
-                       break;
-               case TW_Valid:
-               case TW_NaN:
-               case TW_Denormal:
-               case TW_Infinity:
-                       printf("st(%d)  %c .%04lx %04lx %04lx %04lx e%+-6ld ",
-                           i, r->sign ? '-' : '+', r->sigh >> 16,
-                           r->sigh & 0xFFFF, r->sigl >> 16, r->sigl & 0xFFFF,
-                           r->exp - EXP_BIAS + 1);
-                       break;
-               default:
-                       printf("Whoops! Error in errors.c      ");
-                       break;
-               }
-               printf("%s\n", tag_desc[(int) (unsigned) r->tag]);
-       }
-
-       printf("[data] %c .%04lx %04lx %04lx %04lx e%+-6ld ",
-           FPU_loaded_data.sign ? '-' : '+', FPU_loaded_data.sigh >> 16,
-           FPU_loaded_data.sigh & 0xFFFF, FPU_loaded_data.sigl >> 16,
-           FPU_loaded_data.sigl & 0xFFFF, FPU_loaded_data.exp - EXP_BIAS + 1);
-       printf("%s\n", tag_desc[(int) (unsigned) FPU_loaded_data.tag]);
-       REENTRANT_CHECK(ON);
-
-}
-
-static struct {
-       int     type;
-       char   *name;
-}       exception_names[] = {
-       {
-               EX_StackOver, "stack overflow"
-       },
-       {
-               EX_StackUnder, "stack underflow"
-       },
-       {
-               EX_Precision, "loss of precision"
-       },
-       {
-               EX_Underflow, "underflow"
-       },
-       {
-               EX_Overflow, "overflow"
-       },
-       {
-               EX_ZeroDiv, "divide by zero"
-       },
-       {
-               EX_Denormal, "denormalized operand"
-       },
-       {
-               EX_Invalid, "invalid operation"
-       },
-       {
-               EX_INTERNAL, "INTERNAL BUG in " FPU_VERSION
-       },
-       {
-               0, NULL
-       }
-};
-/*
- EX_INTERNAL is always given with a code which indicates where the
- error was detected.
-
- Internal error types:
-       0x14   in e14.c
-       0x1nn  in a *.c file:
-              0x101  in reg_add_sub.c
-              0x102  in reg_mul.c
-              0x103  in poly_sin.c
-              0x104  in poly_tan.c
-              0x105  in reg_mul.c
-             0x106  in reg_mov.c
-              0x107  in fpu_trig.c
-             0x108  in reg_compare.c
-             0x109  in reg_compare.c
-             0x110  in reg_add_sub.c
-             0x111  in interface.c
-             0x112  in fpu_trig.c
-             0x113  in reg_add_sub.c
-             0x114  in reg_ld_str.c
-             0x115  in fpu_trig.c
-             0x116  in fpu_trig.c
-             0x117  in fpu_trig.c
-             0x118  in fpu_trig.c
-             0x119  in fpu_trig.c
-             0x120  in poly_atan.c
-             0x121  in reg_compare.c
-             0x122  in reg_compare.c
-             0x123  in reg_compare.c
-       0x2nn  in an *.s file:
-              0x201  in reg_u_add.S
-              0x202  in reg_u_div.S
-              0x203  in reg_u_div.S
-              0x204  in reg_u_div.S
-              0x205  in reg_u_mul.S
-              0x206  in reg_u_sub.S
-              0x207  in wm_sqrt.S
-             0x208  in reg_div.S
-              0x209  in reg_u_sub.S
-              0x210  in reg_u_sub.S
-              0x211  in reg_u_sub.S
-              0x212  in reg_u_sub.S
-             0x213  in wm_sqrt.S
-             0x214  in wm_sqrt.S
-             0x215  in wm_sqrt.S
-             0x216  in reg_round.S
-             0x217  in reg_round.S
-             0x218  in reg_round.S
- */
-
-void
-exception(int n)
-{
-       int     i, int_type;
-
-       int_type = 0;           /* Needed only to stop compiler warnings */
-       if (n & EX_INTERNAL) {
-               int_type = n - EX_INTERNAL;
-               n = EX_INTERNAL;
-               /* Set lots of exception bits! */
-               status_word |= (SW_Exc_Mask | SW_Summary | FPU_BUSY);
-       } else {
-               /* Extract only the bits which we use to set the status word */
-               n &= (SW_Exc_Mask);
-               /* Set the corresponding exception bit */
-               status_word |= n;
-               if (status_word & ~control_word & CW_Exceptions)
-                       status_word |= SW_Summary;
-               if (n & (SW_Stack_Fault | EX_Precision)) {
-                       if (!(n & SW_C1))
-                               /* This bit distinguishes over- from underflow
-                                * for a stack fault, and roundup from
-                                * round-down for precision loss. */
-                               status_word &= ~SW_C1;
-               }
-       }
-
-       REENTRANT_CHECK(OFF);
-       if ((~control_word & n & CW_Exceptions) || (n == EX_INTERNAL)) {
-#ifdef PRINT_MESSAGES
-               /* My message from the sponsor */
-               printf(FPU_VERSION " " __DATE__ " (C) W. Metzenthen.\n");
-#endif                         /* PRINT_MESSAGES */
-
-               /* Get a name string for error reporting */
-               for (i = 0; exception_names[i].type; i++)
-                       if ((exception_names[i].type & n) == exception_names[i].type)
-                               break;
-
-               if (exception_names[i].type) {
-#ifdef PRINT_MESSAGES
-                       printf("FP Exception: %s!\n", exception_names[i].name);
-#endif                         /* PRINT_MESSAGES */
-               } else
-                       printf("FP emulator: Unknown Exception: 0x%04x!\n", n);
-
-               if (n == EX_INTERNAL) {
-                       printf("FP emulator: Internal error type 0x%04x\n", int_type);
-                       emu_printall();
-               }
-#ifdef PRINT_MESSAGES
-               else
-                       emu_printall();
-#endif                         /* PRINT_MESSAGES */
-
-               /* The 80486 generates an interrupt on the next non-control
-                * FPU instruction. So we need some means of flagging it. We
-                * use the ES (Error Summary) bit for this, assuming that this
-                * is the way a real FPU does it (until I can check it out),
-                * if not, then some method such as the following kludge might
-                * be needed. */
-/*      regs[0].tag |= TW_FPU_Interrupt; */
-       }
-       REENTRANT_CHECK(ON);
-
-#ifdef __DEBUG__
-       math_abort(SIGFPE);
-#endif                         /* __DEBUG__ */
-
-}
-
-
-/* Real operation attempted on two operands, one a NaN */
-void
-real_2op_NaN(FPU_REG * a, FPU_REG * b, FPU_REG * dest)
-{
-       FPU_REG *x;
-       int     signalling;
-
-       x = a;
-       if (a->tag == TW_NaN) {
-               if (b->tag == TW_NaN) {
-                       signalling = !(a->sigh & b->sigh & 0x40000000);
-                       /* find the "larger" */
-                       if (*(long long *) &(a->sigl) < *(long long *) &(b->sigl))
-                               x = b;
-               } else {
-                       /* return the quiet version of the NaN in a */
-                       signalling = !(a->sigh & 0x40000000);
-               }
-       } else
-#ifdef PARANOID
-               if (b->tag == TW_NaN)
-#endif                         /* PARANOID */
-               {
-                       signalling = !(b->sigh & 0x40000000);
-                       x = b;
-               }
-#ifdef PARANOID
-               else {
-                       signalling = 0;
-                       EXCEPTION(EX_INTERNAL | 0x113);
-                       x = &CONST_QNaN;
-               }
-#endif                         /* PARANOID */
-
-       if (!signalling) {
-               if (!(x->sigh & 0x80000000))    /* pseudo-NaN ? */
-                       x = &CONST_QNaN;
-               reg_move(x, dest);
-               return;
-       }
-       if (control_word & CW_Invalid) {
-               /* The masked response */
-               if (!(x->sigh & 0x80000000))    /* pseudo-NaN ? */
-                       x = &CONST_QNaN;
-               reg_move(x, dest);
-               /* ensure a Quiet NaN */
-               dest->sigh |= 0x40000000;
-       }
-       EXCEPTION(EX_Invalid);
-
-       return;
-}
-/* Invalid arith operation on Valid registers */
-void
-arith_invalid(FPU_REG * dest)
-{
-
-       if (control_word & CW_Invalid) {
-               /* The masked response */
-               reg_move(&CONST_QNaN, dest);
-       }
-       EXCEPTION(EX_Invalid);
-
-       return;
-
-}
-
-
-/* Divide a finite number by zero */
-void
-divide_by_zero(int sign, FPU_REG * dest)
-{
-
-       if (control_word & CW_ZeroDiv) {
-               /* The masked response */
-               reg_move(&CONST_INF, dest);
-               dest->sign = (unsigned char) sign;
-       }
-       EXCEPTION(EX_ZeroDiv);
-
-       return;
-
-}
-
-
-/* This may be called often, so keep it lean */
-void
-set_precision_flag_up(void)
-{
-       if (control_word & CW_Precision)
-               status_word |= (SW_Precision | SW_C1);  /* The masked response */
-       else
-               exception(EX_Precision | SW_C1);
-
-}
-
-
-/* This may be called often, so keep it lean */
-void
-set_precision_flag_down(void)
-{
-       if (control_word & CW_Precision) {      /* The masked response */
-               status_word &= ~SW_C1;
-               status_word |= SW_Precision;
-       } else
-               exception(EX_Precision);
-}
-
-
-int
-denormal_operand(void)
-{
-       if (control_word & CW_Denormal) {       /* The masked response */
-               status_word |= SW_Denorm_Op;
-               return 0;
-       } else {
-               exception(EX_Denormal);
-               return 1;
-       }
-}
-
-
-void
-arith_overflow(FPU_REG * dest)
-{
-
-       if (control_word & CW_Overflow) {
-               char    sign;
-               /* The masked response */
-/* **** The response here depends upon the rounding mode */
-               sign = dest->sign;
-               reg_move(&CONST_INF, dest);
-               dest->sign = sign;
-       } else {
-               /* Subtract the magic number from the exponent */
-               dest->exp -= (3 * (1 << 13));
-       }
-
-       /* By definition, precision is lost. It appears that the roundup bit
-        * (C1) is also set by convention. */
-       EXCEPTION(EX_Overflow | EX_Precision | SW_C1);
-
-       return;
-
-}
-
-
-void
-arith_underflow(FPU_REG * dest)
-{
-
-       if (control_word & CW_Underflow) {
-               /* The masked response */
-               if (dest->exp <= EXP_UNDER - 63)
-                       reg_move(&CONST_Z, dest);
-       } else {
-               /* Add the magic number to the exponent */
-               dest->exp += (3 * (1 << 13));
-       }
-
-       EXCEPTION(EX_Underflow);
-
-       return;
-}
-
-
-void
-stack_overflow(void)
-{
-
-       if (control_word & CW_Invalid) {
-               /* The masked response */
-               top--;
-               reg_move(&CONST_QNaN, FPU_st0_ptr = &st(0));
-       }
-       EXCEPTION(EX_StackOver);
-
-       return;
-
-}
-
-
-void
-stack_underflow(void)
-{
-
-       if (control_word & CW_Invalid) {
-               /* The masked response */
-               reg_move(&CONST_QNaN, FPU_st0_ptr);
-       }
-       EXCEPTION(EX_StackUnder);
-
-       return;
-
-}
-
-
-void
-stack_underflow_i(int i)
-{
-
-       if (control_word & CW_Invalid) {
-               /* The masked response */
-               reg_move(&CONST_QNaN, &(st(i)));
-       }
-       EXCEPTION(EX_StackUnder);
-
-       return;
-
-}
-
-
-void
-stack_underflow_pop(int i)
-{
-
-       if (control_word & CW_Invalid) {
-               /* The masked response */
-               reg_move(&CONST_QNaN, &(st(i)));
-               pop();
-       }
-       EXCEPTION(EX_StackUnder);
-
-       return;
-
-}
diff --git a/sys/i386/gnu/fpemul/exception.h b/sys/i386/gnu/fpemul/exception.h
deleted file mode 100644 (file)
index dde835c..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *  exception.h
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/exception.h,v 1.9 1999/08/28 00:42:49 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/exception.h,v 1.3 2003/08/07 21:17:20 dillon Exp $
- *
- *
- */
-
-#ifndef _EXCEPTION_H_
-#define _EXCEPTION_H_
-
-
-#ifdef LOCORE
-#define        Const_(x)       $/**/x
-#else
-#define        Const_(x)       x
-#endif
-
-#ifndef SW_C1
-#include "fpu_emu.h"
-#endif                         /* SW_C1 */
-
-#define FPU_BUSY        Const_(0x8000) /* FPU busy bit (8087 compatibility) */
-#define EX_ErrorSummary Const_(0x0080) /* Error summary status */
-/* Special exceptions: */
-#define        EX_INTERNAL     Const_(0x8000)  /* Internal error in wm-FPU-emu */
-#define EX_StackOver   Const_(0x0041|SW_C1)    /* stack overflow */
-#define EX_StackUnder  Const_(0x0041)  /* stack underflow */
-/* Exception flags: */
-#define EX_Precision   Const_(0x0020)  /* loss of precision */
-#define EX_Underflow   Const_(0x0010)  /* underflow */
-#define EX_Overflow    Const_(0x0008)  /* overflow */
-#define EX_ZeroDiv     Const_(0x0004)  /* divide by zero */
-#define EX_Denormal    Const_(0x0002)  /* denormalized operand */
-#define EX_Invalid     Const_(0x0001)  /* invalid operation */
-
-
-#ifndef LOCORE
-
-#ifdef DEBUG
-#define        EXCEPTION(x)                                                        \
-       do {                                                                \
-               printf("exception in %s at line %d\n", __FILE__, __LINE__); \
-               exception(x);                                               \
-       } while (0)
-#else
-#define        EXCEPTION(x)    exception(x)
-#endif
-
-#endif                         /* LOCORE */
-
-#endif                         /* _EXCEPTION_H_ */
diff --git a/sys/i386/gnu/fpemul/fpu_arith.c b/sys/i386/gnu/fpemul/fpu_arith.c
deleted file mode 100644 (file)
index 1c6178e..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- *  fpu_arith.c
- *
- * Code to implement the FPU register/register arithmetic instructions
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/fpu_arith.c,v 1.9 1999/08/28 00:42:49 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/fpu_arith.c,v 1.3 2003/08/07 21:17:20 dillon Exp $
- *
- */
-
-
-
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <machine/pcb.h>
-
-#include "fpu_emu.h"
-#include "fpu_system.h"
-
-
-void
-fadd__()
-{
-       /* fadd st,st(i) */
-       reg_add(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
-}
-
-
-void
-fmul__()
-{
-       /* fmul st,st(i) */
-       reg_mul(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
-}
-
-
-
-void
-fsub__()
-{
-       /* fsub st,st(i) */
-       reg_sub(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
-}
-
-
-void
-fsubr_()
-{
-       /* fsubr st,st(i) */
-       reg_sub(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr, control_word);
-}
-
-
-void
-fdiv__()
-{
-       /* fdiv st,st(i) */
-       reg_div(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
-}
-
-
-void
-fdivr_()
-{
-       /* fdivr st,st(i) */
-       reg_div(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr, control_word);
-}
-
-
-
-void
-fadd_i()
-{
-       /* fadd st(i),st */
-       reg_add(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
-}
-
-
-void
-fmul_i()
-{
-       /* fmul st(i),st */
-       reg_mul(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
-}
-
-
-void
-fsubri()
-{
-       /* fsubr st(i),st */
-       /* This is the sense of the 80486 manual reg_sub(&st(FPU_rm),
-        * FPU_st0_ptr, &st(FPU_rm), control_word); */
-       reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
-}
-
-
-void
-fsub_i()
-{
-       /* fsub st(i),st */
-       /* This is the sense of the 80486 manual reg_sub(FPU_st0_ptr,
-        * &st(FPU_rm), &st(FPU_rm), control_word); */
-       reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
-}
-
-
-void
-fdivri()
-{
-       /* fdivr st(i),st */
-       reg_div(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
-}
-
-
-void
-fdiv_i()
-{
-       /* fdiv st(i),st */
-       reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
-}
-
-
-
-void
-faddp_()
-{
-       /* faddp st(i),st */
-       reg_add(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
-       pop();
-}
-
-
-void
-fmulp_()
-{
-       /* fmulp st(i),st */
-       reg_mul(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
-       pop();
-}
-
-
-
-void
-fsubrp()
-{
-       /* fsubrp st(i),st */
-       /* This is the sense of the 80486 manual reg_sub(&st(FPU_rm),
-        * FPU_st0_ptr, &st(FPU_rm), control_word); */
-       reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
-       pop();
-}
-
-
-void
-fsubp_()
-{
-       /* fsubp st(i),st */
-       /* This is the sense of the 80486 manual reg_sub(FPU_st0_ptr,
-        * &st(FPU_rm), &st(FPU_rm), control_word); */
-       reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
-       pop();
-}
-
-
-void
-fdivrp()
-{
-       /* fdivrp st(i),st */
-       reg_div(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
-       pop();
-}
-
-
-void
-fdivp_()
-{
-       /* fdivp st(i),st */
-       reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
-       pop();
-}
diff --git a/sys/i386/gnu/fpemul/fpu_asm.h b/sys/i386/gnu/fpemul/fpu_asm.h
deleted file mode 100644 (file)
index 608d733..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *  fpu_asm.h
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/fpu_asm.h,v 1.8 1999/08/28 00:42:50 peter Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/fpu_asm.h,v 1.4 2003/08/07 21:17:20 dillon Exp $
- *
- */
-
-#ifndef _FPU_ASM_H_
-#define _FPU_ASM_H_
-
-#include <machine/asmacros.h>
-#include "fpu_emu.h"
-
-#define        EXCEPTION       exception
-
-
-#define PARAM1 8(%ebp)
-#define        PARAM2  12(%ebp)
-#define        PARAM3  16(%ebp)
-#define        PARAM4  20(%ebp)
-
-#define SIGL_OFFSET 8
-#define SIGN(x)        (x)
-#define        TAG(x)  1(x)
-#define        EXP(x)  4(x)
-#define SIG(x) SIGL_OFFSET/**/(x)
-#define        SIGL(x) SIGL_OFFSET/**/(x)
-#define        SIGH(x) 12(x)
-
-#endif                         /* _FPU_ASM_H_ */
diff --git a/sys/i386/gnu/fpemul/fpu_aux.c b/sys/i386/gnu/fpemul/fpu_aux.c
deleted file mode 100644 (file)
index 86f9cec..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- *  fpu_aux.c
- *
- * Code to implement some of the FPU auxiliary instructions.
- *
- *
- * Copyright (C) 1992,1993,1994
- *                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
- *                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au
- * All rights reserved.
- *
- * This copyright notice covers the redistribution and use of the
- * FPU emulator developed by W. Metzenthen. It covers only its use
- * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
- * use is not permitted under this copyright.
- *
- * 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 include information specifying
- *    that source code for the emulator is freely available and include
- *    either:
- *      a) an offer to provide the source code for a nominal distribution
- *         fee, or
- *      b) list at least two alternative methods whereby the source
- *         can be obtained, e.g. a publically accessible bulletin board
- *         and an anonymous ftp site from which the software can be
- *         downloaded.
- * 3. All advertising materials specifically mentioning features or use of
- *    this emulator must acknowledge that it was developed by W. Metzenthen.
- * 4. The name of W. Metzenthen may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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
- * W. METZENTHEN 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.
- *
- *
- * The purpose of this copyright, based upon the Berkeley copyright, is to
- * ensure that the covered software remains freely available to everyone.
- *
- * The software (with necessary differences) is also available, but under
- * the terms of the GNU copyleft, for the Linux operating system and for
- * the djgpp ms-dos extender.
- *
- * W. Metzenthen   June 1994.
- *
- *
- * $FreeBSD: src/sys/gnu/i386/fpemul/fpu_aux.c,v 1.11 1999/10/12 02:23:14 msmith Exp $
- * $DragonFly: src/sys/i386/gnu/fpemul/Attic/fpu_aux.c,v 1.4 2005/01/06 08:33:11 asmodai Exp $
- *
- */
-
-
-#include <sys/param.h>
-#ifdef DEBUG
-#include <sys/systm.h>         /* for printf() in EXCEPTION() */
-#endif
-#include <sys/proc.h>
-#include <machine/cpu.h>
-#include <machine/pcb.h>
-
-#include "fpu_emu.h"
-#include "fpu_system.h"
-#include "exception.h"
-#include "status_w.h"
-
-
-static void
-fclex(void)
-{
-       status_word &= ~(SW_Backward | SW_Summary | SW_Stack_Fault | SW_Precision |
-           SW_Underflow | SW_Overflow | SW_Zero_Div | SW_Denorm_Op |
-           SW_Invalid);
-       FPU_entry_eip = ip_offset;      /* We want no net effect */
-}
-/* Needs to be externally visible */
-void
-finit()
-{
-       int     r;
-       control_word = 0x037f;
-       status_word = 0;
-       top = 0;                /* We don't keep top in the status word
-                                * internally. */
-       for (r = 0; r < 8; r++) {
-               regs[r].tag = TW_Empty;
-       }
-       FPU_entry_eip = ip_offset = 0;
-}
-
-static FUNC finit_table[] = {
-       Un_impl, Un_impl, fclex, finit, Un_impl, Un_impl, Un_impl, Un_impl
-};
-
-void
-finit_()
-{
-       (finit_table[FPU_rm]) ();
-}
-
-
-static void
-fstsw_ax(void)
-{
-
-       status_word &= ~SW_Top;
-       status_word |= (top & 7) << SW_Top_Shift;
-
-       *(short *) &FPU_EAX = status_word;
-
-}
-
-static FUNC fstsw_table[] = {
-       fstsw_ax, Un_impl, Un_impl, Un_impl, Un_impl, Un_impl, Un_impl, Un_impl
-};
-
-void
-fstsw_()
-{
-       (fstsw_table[FPU_rm]) ();
-}
-
-
-
-static void
-fnop(void)
-{
-}
-
-static FUNC    fp_nop_table[] = {
-       fnop, Un_impl, Un_impl, Un_impl, Un_impl, Un_impl, Un_impl, Un_impl
-};
-
-void
-fp_nop()
-{
-       (fp_nop_table[FPU_rm]) ();
-}
-
-
-void
-fld_i_()
-{
-       FPU_REG *st_new_ptr;
-
-       if (STACK_OVERFLOW) {
-               stack_overflow();
-               return;
-       }
-       /* fld st(i) */
-       if (NOT_EMPTY(FPU_rm)) {
-               reg_move(&st(FPU_rm), st_new_ptr);
-               push();
-       } else {
-               if (control_word & EX_Invalid) {
-                       /* The masked response */
-                       push();
-                       stack_underflow();
-               } else
-                       EXCEPTION(EX_StackUnder);
-       }
-
-}
-
-
-void
-fxch_i()
-{
-       /* fxch st(i) */
-       FPU_REG t;
-       FPU_REG *sti_ptr = &st(FPU_rm);
-
-       if (FPU_st0_tag == TW_Empty) {
-               if (sti_ptr->tag == TW_Empty) {
-                       stack_underflow();
-                       stack_underflow_i(FPU_rm);
-                       return;
-               }
-               reg_move(sti_ptr, FPU_st0_ptr);
-               stack_underflow_i(FPU_rm);
-               return;
-       }
-       if (sti_ptr->tag == TW_Empty) {
-               reg_move(FPU_st0_ptr, sti_ptr);
-               stack_underflow();
-               return;
-       }
-       reg_move(FPU_st0_ptr, &t);
-       reg_move(sti_ptr, FPU_st0_ptr);
-       reg_move(&t, sti_ptr);
-}
-
-
-void
-ffree_()
-{
-       /* ffree st(i) */
-       st(FPU_rm).tag = TW_Empty;
-}
-
-
-void
-ffreep()
-{
-       /* ffree st(i) + pop - unofficial code */
-       st(FPU_rm).tag = TW_Empty;
-       pop();
-}
-
-
-void
-fst_i_()
-{
-       /* fst st(i) */
-       reg_move(FPU_st0_ptr, &st(FPU_rm));
-}
-
-
-void
-fstp_i()
-{
-       /* fstp st(i) */
-       reg_move(FPU_st0_ptr, &st(FPU_rm));
-       pop();
-}
diff --git a/sys/i386/gnu/fpemul/fpu_emu.h b/sys/i386/gnu/fpem