LINT build test. Aggregated source code adjustments to bring most of the
[dragonfly.git] / sys / dev / serial / rc / rc.c
index a2c5541..e2d5bd1 100644 (file)
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/isa/rc.c,v 1.53.2.1 2001/02/26 04:23:10 jlemon Exp $
- * $DragonFly: src/sys/dev/serial/rc/rc.c,v 1.5 2003/07/21 05:50:40 dillon Exp $
+ * $DragonFly: src/sys/dev/serial/rc/rc.c,v 1.6 2003/07/21 07:57:44 dillon Exp $
  *
  */
 
@@ -181,7 +181,7 @@ static int  rc_modctl           __P((struct rc_chans *, int, int));
 static void rc_start            __P((struct tty *));
 static void rc_stop              __P((struct tty *, int rw));
 static int  rc_param            __P((struct tty *, struct termios *));
-static swihand_t rcpoll;
+static inthand2_t rcpoll;
 static void rc_reinit           __P((struct rc_softc *));
 #ifdef RCDEBUG
 static void printrcflags();
@@ -267,7 +267,7 @@ rcattach(dvp)
        rcb->rcb_probed = RC_ATTACHED;
        if (!rc_started) {
                cdevsw_add(&rc_cdevsw);
-               register_swi(SWI_TTY, rcpoll);
+               register_swi(SWI_TTY, rcpoll, NULL, "rcpoll");
                rc_wakeup((void *)NULL);
                rc_started = 1;
        }
@@ -502,7 +502,7 @@ register struct tty *tp;
                return;
        s = spltty();
        rc->rc_flags |= RC_OSBUSY;
-       disable_intr();
+       cpu_disable_intr();
        if (tp->t_state & TS_TTSTOP)
                rc->rc_flags |= RC_OSUSP;
        else
@@ -518,7 +518,7 @@ register struct tty *tp;
                rcout(CD180_CAR, rc->rc_chan);
                rcout(CD180_MSVR, rc->rc_msvr |= MSVR_RTS);
        }
-       enable_intr();
+       cpu_enable_intr();
        if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP))
                goto out;
 #ifdef RCDEBUG
@@ -537,10 +537,10 @@ register struct tty *tp;
 
                tp->t_state |= TS_BUSY;
                ocnt = q_to_b(&tp->t_outq, rc->rc_obuf, sizeof rc->rc_obuf);
-               disable_intr();
+               cpu_disable_intr();
                rc->rc_optr = rc->rc_obuf;
                rc->rc_obufend = rc->rc_optr + ocnt;
-               enable_intr();
+               cpu_enable_intr();
                if (!(rc->rc_ier & IER_TxRdy)) {
 #ifdef RCDEBUG
                        printf("rc%d/%d: rcstart enable txint\n", rc->rc_rcb->rcb_unit, rc->rc_chan);
@@ -555,7 +555,8 @@ out:
 }
 
 /* Handle delayed events. */
-void rcpoll()
+void 
+rcpoll(void *dummy)
 {
        register struct rc_chans *rc;
        register struct rc_softc *rcb;
@@ -578,30 +579,30 @@ repeat:
                                printrcflags(rc, "rcevent");
 #endif
                        if (rc->rc_flags & RC_WAS_BUFOVFL) {
-                               disable_intr();
+                               cpu_disable_intr();
                                rc->rc_flags &= ~RC_WAS_BUFOVFL;
                                rc_scheduled_event--;
-                               enable_intr();
+                               cpu_enable_intr();
                                printf("rc%d/%d: interrupt-level buffer overflow\n",
                                        unit, chan);
                        }
                        if (rc->rc_flags & RC_WAS_SILOVFL) {
-                               disable_intr();
+                               cpu_disable_intr();
                                rc->rc_flags &= ~RC_WAS_SILOVFL;
                                rc_scheduled_event--;
-                               enable_intr();
+                               cpu_enable_intr();
                                printf("rc%d/%d: silo overflow\n",
                                        unit, chan);
                        }
                        if (rc->rc_flags & RC_MODCHG) {
-                               disable_intr();
+                               cpu_disable_intr();
                                rc->rc_flags &= ~RC_MODCHG;
                                rc_scheduled_event -= LOTS_OF_EVENTS;
-                               enable_intr();
+                               cpu_enable_intr();
                                (*linesw[tp->t_line].l_modem)(tp, !!(rc->rc_msvr & MSVR_CD));
                        }
                        if (rc->rc_flags & RC_DORXFER) {
-                               disable_intr();
+                               cpu_disable_intr();
                                rc->rc_flags &= ~RC_DORXFER;
                                eptr = rc->rc_iptr;
                                if (rc->rc_bufend == &rc->rc_ibuf[2 * RC_IBUFSIZE])
@@ -631,7 +632,7 @@ repeat:
                                        }
                                        rc_scheduled_event -= icnt;
                                }
-                               enable_intr();
+                               cpu_enable_intr();
 
                                if (icnt <= 0 || !(tp->t_state & TS_ISOPEN))
                                        goto done1;
@@ -664,11 +665,11 @@ repeat:
 done1: ;
                        }
                        if (rc->rc_flags & RC_DOXXFER) {
-                               disable_intr();
+                               cpu_disable_intr();
                                rc_scheduled_event -= LOTS_OF_EVENTS;
                                rc->rc_flags &= ~RC_DOXXFER;
                                rc->rc_tp->t_state &= ~TS_BUSY;
-                               enable_intr();
+                               cpu_enable_intr();
                                (*linesw[tp->t_line].l_start)(tp);
                        }
                }
@@ -693,7 +694,7 @@ rc_stop(tp, rw)
 #endif
        if (rw & FWRITE)
                rc_discard_output(rc);
-       disable_intr();
+       cpu_disable_intr();
        if (rw & FREAD) {
                rc->rc_flags &= ~RC_DORXFER;
                eptr = rc->rc_iptr;
@@ -710,14 +711,14 @@ rc_stop(tp, rw)
                rc->rc_flags |= RC_OSUSP;
        else
                rc->rc_flags &= ~RC_OSUSP;
-       enable_intr();
+       cpu_enable_intr();
 }
 
 static int
-rcopen(dev, flag, mode, p)
+rcopen(dev, flag, mode, td)
        dev_t           dev;
        int             flag, mode;
-       struct proc    *p;
+       struct thread *td;
 {
        register struct rc_chans *rc;
        register struct tty      *tp;
@@ -808,10 +809,10 @@ out:
 }
 
 static int
-rcclose(dev, flag, mode, p)
+rcclose(dev, flag, mode, td)
        dev_t           dev;
        int             flag, mode;
-       struct proc    *p;
+       struct thread *td;
 {
        register struct rc_chans *rc;
        register struct tty      *tp;
@@ -1062,18 +1063,18 @@ struct rc_softc         *rcb;
 }
 
 static int
-rcioctl(dev, cmd, data, flag, p)
+rcioctl(dev, cmd, data, flag, td)
 dev_t           dev;
 u_long          cmd;
 int            flag;
 caddr_t         data;
-struct proc     *p;
+struct thread *td;
 {
        register struct rc_chans       *rc = &rc_chans[GET_UNIT(dev)];
        register int                    s, error;
        struct tty                     *tp = rc->rc_tp;
 
-       error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+       error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
        if (error != ENOIOCTL)
                return (error);
        error = ttioctl(tp, cmd, data, flag);
@@ -1397,14 +1398,14 @@ static void
 rc_discard_output(rc)
        struct rc_chans  *rc;
 {
-       disable_intr();
+       cpu_disable_intr();
        if (rc->rc_flags & RC_DOXXFER) {
                rc_scheduled_event -= LOTS_OF_EVENTS;
                rc->rc_flags &= ~RC_DOXXFER;
        }
        rc->rc_optr = rc->rc_obufend;
        rc->rc_tp->t_state &= ~TS_BUSY;
-       enable_intr();
+       cpu_enable_intr();
        ttwwakeup(rc->rc_tp);
 }
 
@@ -1418,7 +1419,7 @@ rc_wakeup(chan)
                int     s;
 
                s = splsofttty();
-               rcpoll();
+               rcpoll(NULL);
                splx(s);
        }
 }