Use IPL_ constants instead of numeric values. Get rid of sicallbacks
authorniklas <niklas@openbsd.org>
Sun, 24 Mar 1996 17:26:22 +0000 (17:26 +0000)
committerniklas <niklas@openbsd.org>
Sun, 24 Mar 1996 17:26:22 +0000 (17:26 +0000)
in favour of the remapped IPL facility.  Some argument type fixes as
well.

sys/arch/amiga/dev/clock.c
sys/arch/amiga/dev/mfc.c
sys/arch/amiga/dev/mgnsc.c
sys/arch/amiga/dev/zssc.c

index c30284c..481841c 100644 (file)
@@ -182,7 +182,7 @@ cpu_initclocks()
 #if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
        isr.isr_intr = clockintr;
        isr.isr_ipl = 6;
-       isr.isr_mapped_ipl = 4;
+       isr.isr_mapped_ipl = IPL_CLOCK;
        add_isr(&isr);
 #else
        /*
@@ -265,7 +265,7 @@ setmicspertick()
  */
 void
 delay(mic)
-       int mic;
+       u_int mic;
 {
        u_int temp;
        int s;
@@ -348,7 +348,7 @@ delay(mic)
  */
 void
 DELAY(mic)
-       int mic;
+       u_int mic;
 {
        u_long n;
        short hpos;
index f0c7280..f9f4a03 100644 (file)
@@ -47,6 +47,7 @@
 #include <sys/kernel.h>
 #include <sys/syslog.h>
 #include <sys/queue.h>
+#include <machine/psl.h>
 #include <machine/cpu.h>
 #include <amiga/amiga/device.h>
 #include <amiga/amiga/isr.h>
@@ -363,7 +364,7 @@ mfcattach(pdp, dp, auxp)
        scc->sc_isr.isr_arg = scc;
        scc->sc_isr.isr_ipl = 6;
 #if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
-       scc->sc_isr.isr_mapped_ipl = 3;
+       scc->sc_isr.isr_mapped_ipl = IPL_TTY;
 #endif
        add_isr(&scc->sc_isr);
 
@@ -994,10 +995,16 @@ mfcintr (scc)
                        tp->t_state &= ~(TS_BUSY | TS_FLUSH);
                        scc->imask &= ~0x01;
                        regs->du_imr = scc->imask;
+#if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
+                       if (tp->t_line)
+                               (*linesw[tp->t_line].l_start)(tp);
+                       else
+                               mfcsstart(tp);
+#else
                        add_sicallback (tp->t_line ?
                            (sifunc_t)linesw[tp->t_line].l_start
                            : (sifunc_t)mfcsstart, tp, NULL);
-
+#endif
                }
                else
                        regs->du_tba = *sc->ptr++;
@@ -1009,9 +1016,16 @@ mfcintr (scc)
                        tp->t_state &= ~(TS_BUSY | TS_FLUSH);
                        scc->imask &= ~0x10;
                        regs->du_imr = scc->imask;
+#if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
+                       if (tp->t_line)
+                               (*linesw[tp->t_line].l_start)(tp);
+                       else
+                               mfcsstart(tp);
+#else
                        add_sicallback (tp->t_line ?
                            (sifunc_t)linesw[tp->t_line].l_start
                            : (sifunc_t)mfcsstart, tp, NULL);
+#endif
                }
                else
                        regs->du_tbb = *sc->ptr++;
index acec614..f67148f 100644 (file)
@@ -40,6 +40,7 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/device.h>
+#include <machine/psl.h>
 #include <scsi/scsi_all.h>
 #include <scsi/scsiconf.h>
 #include <amiga/amiga/custom.h>
@@ -130,8 +131,7 @@ mgnscattach(pdp, dp, auxp)
        sc->sc_isr.isr_arg = sc;
        sc->sc_isr.isr_ipl = 6;
 #if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
-       /* XXX Don't remap it yet, the driver uses a sicallback still.  */
-       sc->sc_isr.isr_mapped_ipl = 6;
+       sc->sc_isr.isr_mapped_ipl = IPL_BIO;
 #endif
        add_isr (&sc->sc_isr);
 
@@ -189,8 +189,11 @@ mgnsc_dmaintr(sc)
        rp->siop_sien = 0;
        rp->siop_dien = 0;
        sc->sc_flags |= SIOP_INTDEFER | SIOP_INTSOFF;
+#if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
+       siopintr(sc);
+#else
        add_sicallback((sifunc_t)siopintr, sc, NULL);
-       return (1);
+#endif return (1);
 }
 
 #ifdef DEBUG
index 36510a0..16499b2 100644 (file)
  * 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.
- *
- *     @(#)dma.c
  */
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/device.h>
+#include <machine/psl.h>
 #include <scsi/scsi_all.h>
 #include <scsi/scsiconf.h>
 #include <amiga/amiga/custom.h>
@@ -131,8 +130,7 @@ zsscattach(pdp, dp, auxp)
        sc->sc_isr.isr_arg = sc;
        sc->sc_isr.isr_ipl = 6;
 #if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
-       /* XXX Don't remap it yet, the driver uses a sicallback still.  */
-       sc->sc_isr.isr_mapped_ipl = 6;
+       sc->sc_isr.isr_mapped_ipl = IPL_BIO;
 #endif
        add_isr(&sc->sc_isr);
 
@@ -191,7 +189,11 @@ zssc_dmaintr(sc)
        rp->siop_sien = 0;
        rp->siop_dien = 0;
        sc->sc_flags |= SIOP_INTDEFER | SIOP_INTSOFF;
+#if defined(IPL_REMAP_1) || defined(IPL_REMAP_2)
+       siopintr(sc);
+#else
        add_sicallback((sifunc_t)siopintr, sc, NULL);
+#endif
        return(1);
 }