lint
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Tue, 16 Dec 1986 12:27:54 +0000 (04:27 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Tue, 16 Dec 1986 12:27:54 +0000 (04:27 -0800)
SCCS-vsn: sys/kern/subr_xxx.c 7.3
SCCS-vsn: sys/tahoe/vba/vbavar.h 1.4
SCCS-vsn: sys/tahoe/vba/cy.c 1.8
SCCS-vsn: sys/tahoe/vba/dr.c 1.6
SCCS-vsn: sys/tahoe/vba/vbaparam.h 1.3
SCCS-vsn: sys/tahoe/vba/ik.c 1.4
SCCS-vsn: sys/tahoe/if/if_ace.c 1.12
SCCS-vsn: sys/tahoe/if/if_enp.c 1.3
SCCS-vsn: sys/tahoe/if/if_enpreg.h 1.3
SCCS-vsn: sys/deprecated/kdb/defs.h 7.4
SCCS-vsn: sys/deprecated/kdb/kdb_access.c 7.3
SCCS-vsn: sys/deprecated/kdb/kdb_command.c 7.3
SCCS-vsn: sys/deprecated/kdb/kdb_ctype.c 7.2
SCCS-vsn: sys/deprecated/kdb/kdb_expr.c 7.4
SCCS-vsn: sys/deprecated/kdb/kdb_format.c 7.4
SCCS-vsn: sys/deprecated/kdb/kdb_input.c 7.3
SCCS-vsn: sys/deprecated/kdb/kdb_message.c 7.3
SCCS-vsn: sys/deprecated/kdb/kdb_output.c 7.2
SCCS-vsn: sys/deprecated/kdb/kdb_pcs.c 7.2
SCCS-vsn: sys/deprecated/kdb/kdb_print.c 7.5
SCCS-vsn: sys/deprecated/kdb/kdb_runpcs.c 7.3
SCCS-vsn: sys/deprecated/kdb/kdb_sym.c 7.2
SCCS-vsn: sys/deprecated/kdb/kdb_trap.c 7.5
SCCS-vsn: sys/tahoe/tahoe/Locore.c 1.3
SCCS-vsn: sys/tahoe/tahoe/autoconf.c 1.9
SCCS-vsn: sys/tahoe/tahoe/kdb_machdep.c 7.3
SCCS-vsn: sys/tahoe/tahoe/kdb_opset.c 7.3
SCCS-vsn: sys/tahoe/include/kdbparam.h 7.5
SCCS-vsn: sys/tahoe/tahoe/machdep.c 1.9
SCCS-vsn: sys/tahoe/tahoe/mem.c 1.4
SCCS-vsn: sys/tahoe/tahoe/trap.c 1.7
SCCS-vsn: sys/tahoe/tahoe/vm_machdep.c 1.7

32 files changed:
usr/src/sys/deprecated/kdb/defs.h
usr/src/sys/deprecated/kdb/kdb_access.c
usr/src/sys/deprecated/kdb/kdb_command.c
usr/src/sys/deprecated/kdb/kdb_ctype.c
usr/src/sys/deprecated/kdb/kdb_expr.c
usr/src/sys/deprecated/kdb/kdb_format.c
usr/src/sys/deprecated/kdb/kdb_input.c
usr/src/sys/deprecated/kdb/kdb_message.c
usr/src/sys/deprecated/kdb/kdb_output.c
usr/src/sys/deprecated/kdb/kdb_pcs.c
usr/src/sys/deprecated/kdb/kdb_print.c
usr/src/sys/deprecated/kdb/kdb_runpcs.c
usr/src/sys/deprecated/kdb/kdb_sym.c
usr/src/sys/deprecated/kdb/kdb_trap.c
usr/src/sys/kern/subr_xxx.c
usr/src/sys/tahoe/if/if_ace.c
usr/src/sys/tahoe/if/if_enp.c
usr/src/sys/tahoe/if/if_enpreg.h
usr/src/sys/tahoe/include/kdbparam.h
usr/src/sys/tahoe/tahoe/Locore.c
usr/src/sys/tahoe/tahoe/autoconf.c
usr/src/sys/tahoe/tahoe/kdb_machdep.c
usr/src/sys/tahoe/tahoe/kdb_opset.c
usr/src/sys/tahoe/tahoe/machdep.c
usr/src/sys/tahoe/tahoe/mem.c
usr/src/sys/tahoe/tahoe/trap.c
usr/src/sys/tahoe/tahoe/vm_machdep.c
usr/src/sys/tahoe/vba/cy.c
usr/src/sys/tahoe/vba/dr.c
usr/src/sys/tahoe/vba/ik.c
usr/src/sys/tahoe/vba/vbaparam.h
usr/src/sys/tahoe/vba/vbavar.h

index f42662a..c07071f 100644 (file)
@@ -1,4 +1,10 @@
-/*     defs.h  7.3     86/11/23        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)defs.h      7.4 (Berkeley) %G%
+ */
 
 /*
  * adb - string table version; common definitions
 
 /*
  * adb - string table version; common definitions
@@ -87,7 +93,6 @@ ADDR  maxoff;
 ADDR   localval;
 int    mkfault;
 long   var[36];
 ADDR   localval;
 int    mkfault;
 long   var[36];
-long   maxstor;
 char   *errflg;
 long   dot;
 int    dotinc;
 char   *errflg;
 long   dot;
 int    dotinc;
@@ -98,10 +103,10 @@ int        cntflg;
 
 /* result type declarations */
 long   inkdot();
 
 /* result type declarations */
 long   inkdot();
-POS    get();
-POS    chkget();
+u_int  get();
+u_int  chkget();
+u_int  bchkget();
 char   *exform();
 char   *exform();
-long   round();
 BKPTR  scanbkpt();
 
 struct nlist *symtab, *esymtab;
 BKPTR  scanbkpt();
 
 struct nlist *symtab, *esymtab;
index abbf3f5..de9eed0 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_access.c    7.2     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_access.c        7.3 (Berkeley) %G%
+ */
 
 /*
  * Access data in kernel address space.
 
 /*
  * Access data in kernel address space.
  * Primitives: put a value in a space, get a value from a space
  * and get a word or byte not returning if an error occurred.
  */
  * Primitives: put a value in a space, get a value from a space
  * and get a word or byte not returning if an error occurred.
  */
+/*ARGSUSED*/
 put(addr, space, value) 
 put(addr, space, value) 
-    off_t addr; { (void) kdbpoke(addr, value); }
+    off_t addr; long value; { (void) kdbpoke((caddr_t)addr, value); }
 
 
+/*ARGSUSED*/
 u_int
 get(addr, space)
 u_int
 get(addr, space)
-    off_t addr; { return (kdbpeek(addr)); };
+    off_t addr; { return (kdbpeek((caddr_t)addr)); };
 
 u_int
 chkget(addr, space)
 
 u_int
 chkget(addr, space)
index 61bea40..e921aaa 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_command.c   7.2     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_command.c       7.3 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -89,7 +95,7 @@ command(buf, defcom)
                                if (eqcom)
                                        error(BADEQ);
                                dotinc=(longpr?4:2); savdot=dot;
                                if (eqcom)
                                        error(BADEQ);
                                dotinc=(longpr?4:2); savdot=dot;
-                               expr(1); locval=expv;
+                               (void) expr(1); locval=expv;
                                if (expr(0))
                                        locmsk=expv;
                                else
                                if (expr(0))
                                        locmsk=expv;
                                else
@@ -117,11 +123,11 @@ command(buf, defcom)
                        case 'w':
                                if (eqcom)
                                        error(BADEQ);
                        case 'w':
                                if (eqcom)
                                        error(BADEQ);
-                               wformat[0]=lastc; expr(1);
+                               wformat[0]=lastc; (void) expr(1);
                                do {
                                        savdot=dot;
                                        psymoff(dot,ptype,":%16t");
                                do {
                                        savdot=dot;
                                        psymoff(dot,ptype,":%16t");
-                                       exform(1,wformat,itype,ptype);
+                                       (void) exform(1,wformat,itype,ptype);
                                        errflg=0; dot=savdot;
                                        if (longpr)
                                                put(dot,itype,expv);
                                        errflg=0; dot=savdot;
                                        if (longpr)
                                                put(dot,itype,expv);
@@ -130,7 +136,7 @@ command(buf, defcom)
                                                    itol(expv,get(dot,itype)));
                                        savdot=dot;
                                        printf("=%8t");
                                                    itol(expv,get(dot,itype)));
                                        savdot=dot;
                                        printf("=%8t");
-                                       exform(1,wformat,itype,ptype);
+                                       (void) exform(1,wformat,itype,ptype);
                                        printc(EOR);
                                } while (expr(0) && errflg==0);
                                dot=savdot;
                                        printc(EOR);
                                } while (expr(0) && errflg==0);
                                dot=savdot;
index 67f4d96..cf0862c 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_ctype.c     7.1     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_ctype.c 7.2 (Berkeley) %G%
+ */
 
 #include       <ctype.h>
 
 
 #include       <ctype.h>
 
index adfb6c9..a3860b9 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_expr.c      7.3     86/11/23        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_expr.c  7.4 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -25,31 +31,43 @@ char        lastc, peekc;
 long   ditto;
 long   expv;
 
 long   ditto;
 long   expv;
 
+static long
+round(a,b)
+       register long a, b;
+{
+       register long w;
+
+       w = (a/b)*b;
+       if (a!=w)
+               w += b;
+       return (w);
+}
+
 /* term | term dyadic expr |  */
 expr(a)
 {
        register rc;
        register long lhs;
 
 /* term | term dyadic expr |  */
 expr(a)
 {
        register rc;
        register long lhs;
 
-       rdc(); lp--; rc=term(a);
+       (void) rdc(); lp--; rc=term(a);
 
        while (rc) {
                lhs = expv;
                switch ((int)readchar()) {
                case '+':
 
        while (rc) {
                lhs = expv;
                switch ((int)readchar()) {
                case '+':
-                       term(a|1); expv += lhs; break;
+                       (void) term(a|1); expv += lhs; break;
                case '-':
                case '-':
-                       term(a|1); expv = lhs - expv; break;
+                       (void) term(a|1); expv = lhs - expv; break;
                case '#':
                case '#':
-                       term(a|1); expv = round(lhs,expv); break;
+                       (void) term(a|1); expv = round(lhs,expv); break;
                case '*':
                case '*':
-                       term(a|1); expv *= lhs; break;
+                       (void) term(a|1); expv *= lhs; break;
                case '%':
                case '%':
-                       term(a|1); expv = lhs/expv; break;
+                       (void) term(a|1); expv = lhs/expv; break;
                case '&':
                case '&':
-                       term(a|1); expv &= lhs; break;
+                       (void) term(a|1); expv &= lhs; break;
                case '|':
                case '|':
-                       term(a|1); expv |= lhs; break;
+                       (void) term(a|1); expv |= lhs; break;
                case ')':
                        if ((a&2)==0)
                                error(BADKET);
                case ')':
                        if ((a&2)==0)
                                error(BADKET);
@@ -68,22 +86,22 @@ term(a)
 
        switch ((int)readchar()) {
        case '*':
 
        switch ((int)readchar()) {
        case '*':
-               term(a|1); expv=chkget(expv,DSP);
+               (void) term(a|1); expv=chkget(expv,DSP);
                return(1);
        case '@':
                return(1);
        case '@':
-               term(a|1); expv=chkget(expv,ISP);
+               (void) term(a|1); expv=chkget(expv,ISP);
                return(1);
        case '-':
                return(1);
        case '-':
-               term(a|1); expv = -expv;
+               (void) term(a|1); expv = -expv;
                return(1);
        case '~':
                return(1);
        case '~':
-               term(a|1); expv = ~expv;
+               (void) term(a|1); expv = ~expv;
                return(1);
        case '#':
                return(1);
        case '#':
-               term(a|1); expv = !expv;
+               (void) term(a|1); expv = !expv;
                return(1);
        case '(':
                return(1);
        case '(':
-               expr(2);
+               (void) expr(2);
                if (*lp!=')')
                        error(BADSYN);
                lp++;
                if (*lp!=')')
                        error(BADSYN);
                lp++;
@@ -102,7 +120,7 @@ item(a)
        register long frame;
        register struct nlist *symp;
 
        register long frame;
        register struct nlist *symp;
 
-       readchar();
+       (void) readchar();
        if (symchar(0)) {
                readsym();
                if (lastc=='.') {
        if (symchar(0)) {
                readsym();
                if (lastc=='.') {
@@ -110,7 +128,7 @@ item(a)
                        callpc = pcb.pcb_pc;
                        while (!errflg) {
                                savpc = callpc;
                        callpc = pcb.pcb_pc;
                        while (!errflg) {
                                savpc = callpc;
-                               findsym(callpc,ISYM);
+                               (void) findsym((long)callpc,ISYM);
                                if (eqsym(cursym->n_un.n_name,isymbol,'~'))
                                        break;
                                callpc = getprevpc(frame);
                                if (eqsym(cursym->n_un.n_name,isymbol,'~'))
                                        break;
                                callpc = getprevpc(frame);
@@ -120,7 +138,7 @@ item(a)
                                        error(NOCFN);
                        }
                        savlastf = lastframe; savframe = frame;
                                        error(NOCFN);
                        }
                        savlastf = lastframe; savframe = frame;
-                       readchar();
+                       (void) readchar();
                        if (symchar(0))
                                chkloc(expv=frame);
                } else if ((symp=lookup(isymbol))==0)
                        if (symchar(0))
                                chkloc(expv=frame);
                } else if ((symp=lookup(isymbol))==0)
@@ -134,10 +152,10 @@ item(a)
                return (1);
        switch (lastc) {
        case '.':
                return (1);
        switch (lastc) {
        case '.':
-               readchar();
+               (void) readchar();
                if (symchar(0)) {
                        lastframe=savlastf; callpc=savpc;
                if (symchar(0)) {
                        lastframe=savlastf; callpc=savpc;
-                       chkloc(savframe);
+                       chkloc((long)savframe);
                } else
                        expv=dot;
                lp--;
                } else
                        expv=dot;
                lp--;
@@ -200,14 +218,14 @@ getnum()
                        expv *= base;
                if ((d=convdig(lastc))>=base || d<0)
                        error(BADSYN);
                        expv *= base;
                if ((d=convdig(lastc))>=base || d<0)
                        error(BADSYN);
-               expv += d; readchar();
+               expv += d; (void) readchar();
                if (expv==0) {
                        if (lastc=='x' || lastc=='X') {
                if (expv==0) {
                        if (lastc=='x' || lastc=='X') {
-                                base=16; readchar();
+                                base=16; (void) readchar();
                        } else if (lastc=='t' || lastc=='T') {
                        } else if (lastc=='t' || lastc=='T') {
-                                base=10; readchar();
+                                base=10; (void) readchar();
                        } else if (lastc=='o' || lastc=='O') {
                        } else if (lastc=='o' || lastc=='O') {
-                                base=8; readchar();
+                                base=8; (void) readchar();
                        }
                }
        }
                        }
                }
        }
@@ -232,9 +250,9 @@ readsym()
 
        p = isymbol;
        do {
 
        p = isymbol;
        do {
-           if (p < &isymbol[sizeof(isymbol)-1])
-                   *p++ = lastc;
-           readchar();
+               if (p < &isymbol[sizeof(isymbol)-1])
+                       *p++ = lastc;
+               (void) readchar();
        } while (symchar(1));
        *p++ = 0;
 }
        } while (symchar(1));
        *p++ = 0;
 }
@@ -255,7 +273,7 @@ symchar(dig)
 {
 
        if (lastc=='\\') {
 {
 
        if (lastc=='\\') {
-               readchar();
+               (void) readchar();
                return (1);
        }
        return (isalpha(lastc) || lastc=='_' || dig && isdigit(lastc));
                return (1);
        }
        return (isalpha(lastc) || lastc=='_' || dig && isdigit(lastc));
@@ -305,15 +323,3 @@ streq(s1, s2)
                        return (1);
        return (0);
 }
                        return (1);
        return (0);
 }
-
-static
-round(a,b)
-       register long a, b;
-{
-       register long w;
-
-       w = (a/b)*b;
-       if (a!=w)
-               w += b;
-       return (w);
-}
index 24b7a44..60a7b9e 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_format.c    7.3     86/11/23        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_format.c        7.4 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -42,12 +48,12 @@ scanform(icount,ifp,itype,ptype)
                        if (exact && dot==savdot && 
                           (cursym->n_type&N_TYPE)==N_TEXT &&
                           cursym->n_un.n_name[0]=='_' && *fp=='i') {
                        if (exact && dot==savdot && 
                           (cursym->n_type&N_TYPE)==N_TEXT &&
                           cursym->n_un.n_name[0]=='_' && *fp=='i') {
-                               exform(1,"x",itype,ptype);
+                               (void) exform(1,"x",itype,ptype);
                                fp++;
                                printc(EOR);
                        } else
 #endif
                                fp++;
                                printc(EOR);
                        } else
 #endif
-                               fp=exform(fcount,fp,itype,ptype);
+                               fp = exform(fcount,fp,itype,ptype);
                }
                dotinc=dot-savdot;
                dot=savdot;
                }
                dotinc=dot-savdot;
                dot=savdot;
@@ -62,7 +68,7 @@ scanform(icount,ifp,itype,ptype)
                if (--icount)
                        dot=inkdot(dotinc);
                if (mkfault)
                if (--icount)
                        dot=inkdot(dotinc);
                if (mkfault)
-                       error(0);
+                       error((char *)0);
        }
 }
 
        }
 }
 
@@ -97,7 +103,7 @@ exform(fcount,ifp,itype,ptype)
                if (errflg)
                        return (fp);
                if (mkfault)
                if (errflg)
                        return (fp);
                if (mkfault)
-                       error(0);
+                       error((char *)0);
                var[0] = wx;
                modifier = *fp++;
                dotinc = (longpr ? sizeof (long):sizeof (short));
                var[0] = wx;
                modifier = *fp++;
                dotinc = (longpr ? sizeof (long):sizeof (short));
@@ -129,9 +135,9 @@ exform(fcount,ifp,itype,ptype)
 
                case 'c': case 'C':
                        if (modifier == 'C')
 
                case 'c': case 'C':
                        if (modifier == 'C')
-                               printesc(byte(w));
+                               printesc((int)byte(w));
                        else
                        else
-                               printc(byte(w));
+                               printc((char)byte(w));
                        dotinc=1; break;
 
                case 'b': case 'B':
                        dotinc=1; break;
 
                case 'b': case 'B':
@@ -151,7 +157,7 @@ exform(fcount,ifp,itype,ptype)
                        while ((c=byte(get(dot,itype))) && errflg==0) {
                                dot=inkdot(1);
                                if (modifier == 'S')
                        while ((c=byte(get(dot,itype))) && errflg==0) {
                                dot=inkdot(1);
                                if (modifier == 'S')
-                                       printesc(c);
+                                       printesc((int)c);
                                else
                                        printc(c);
                                endline();
                                else
                                        printc(c);
                                endline();
@@ -226,7 +232,7 @@ exform(fcount,ifp,itype,ptype)
 
 static
 printesc(c)
 
 static
 printesc(c)
-       register c;
+       register int c;
 {
 
        c &= STRIP;
 {
 
        c &= STRIP;
index 20164a1..cd0f85d 100644 (file)
@@ -1,11 +1,16 @@
-/*     kdb_input.c     7.2     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_input.c 7.3 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 char   line[LINSIZ];
 char   *lp;
 char   peekc,lastc = EOR;
 
 #include "../kdb/defs.h"
 
 char   line[LINSIZ];
 char   *lp;
 char   peekc,lastc = EOR;
-int    eof;
 
 /* input routines */
 
 
 /* input routines */
 
@@ -18,7 +23,7 @@ eol(c)
 rdc()
 {
        do
 rdc()
 {
        do
-               readchar();
+               (void) readchar();
        while (lastc==SP || lastc==TB);
        return (lastc);
 }
        while (lastc==SP || lastc==TB);
        return (lastc);
 }
@@ -32,7 +37,7 @@ readchar()
                do {
                        (void) kdbreadc(lp);
                        if (mkfault)
                do {
                        (void) kdbreadc(lp);
                        if (mkfault)
-                               error(0);
+                               error((char *)0);
                        switch (*lp) {
                        case CTRL(h): case 0177:
                                if (lp > line)
                        switch (*lp) {
                        case CTRL(h): case 0177:
                                if (lp > line)
index 311e71d..9b2d3d3 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_message.c   7.2     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_message.c       7.3 (Berkeley) %G%
+ */
 
 #include "../kdb/redef.h"
 
 
 #include "../kdb/redef.h"
 
@@ -10,8 +16,6 @@ char  *NOMATCH =  "cannot locate value";
 char   *BADKET =  "unexpected ')'";
 char   *NOADR  =  "address expected";
 char   *BADVAR =  "bad variable";
 char   *BADKET =  "unexpected ')'";
 char   *NOADR  =  "address expected";
 char   *BADVAR =  "bad variable";
-char   *BADTXT =  "text address not found";
-char   *BADDAT =  "data address not found";
 char   *ADWRAP =  "address wrap around";
 char   *BADEQ  =  "unexpected `='";
 char   *BADSYN =  "syntax error";
 char   *ADWRAP =  "address wrap around";
 char   *BADEQ  =  "unexpected `='";
 char   *BADSYN =  "syntax error";
index 7a89334..bd5e411 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_output.c    7.1     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_output.c        7.2 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -70,7 +76,6 @@ printf(fmat,a1)
        char *fptr;
        register char *s;
        register long *dptr;
        char *fptr;
        register char *s;
        register long *dptr;
-       double *rptr;
        register width, prec;
        char c, adj;
        int x, n;
        register width, prec;
        char c, adj;
        int x, n;
@@ -93,35 +98,35 @@ printf(fmat,a1)
                } else
                        prec = -1;
                digitptr=digits;
                } else
                        prec = -1;
                digitptr=digits;
-               rptr=(double *)dptr; x = lx = *dptr++;
+               x = lx = *dptr++;
                s=0;
                switch (c = *fptr++) {
                case 'd':
                s=0;
                switch (c = *fptr++) {
                case 'd':
-                       printnum(x, -10); break;
+                       printnum((u_long)x, -10); break;
                case 'u':
                case 'u':
-                       printnum((unsigned short)x, 10); break;
+                       printnum((u_long)x, 10); break;
                case 'o':
                case 'o':
-                       printnum((unsigned short)x, 8); break;
+                       printnum((u_long)x, 8); break;
                case 'q':
                case 'q':
-                       printnum(x, -8); break;
+                       printnum((u_long)x, -8); break;
                case 'x':
                case 'x':
-                       printnum((unsigned short)x, 16); break;
+                       printnum((u_long)x, 16); break;
                case 'z':
                case 'z':
-                       printnum((unsigned short)x, -16); break;
+                       printnum((u_long)x, -16); break;
                case 'R':
                case 'R':
-                       printnum(lx, radix); break;
+                       printnum((u_long)lx, radix); break;
                case 'D':
                case 'D':
-                       printnum(lx, -10); break;
+                       printnum((u_long)lx, -10); break;
                case 'U':
                case 'U':
-                       printnum(lx, 10); break;
+                       printnum((u_long)lx, 10); break;
                case 'O':
                case 'O':
-                       printnum(lx, 8); break;
+                       printnum((u_long)lx, 8); break;
                case 'Q':
                case 'Q':
-                       printnum(lx, -8); break;
+                       printnum((u_long)lx, -8); break;
                case 'X':
                case 'X':
-                       printnum(lx, 16); break;
+                       printnum((u_long)lx, 16); break;
                case 'Z':
                case 'Z':
-                       printnum(lx, -16); break;
+                       printnum((u_long)lx, -16); break;
                case 'c':
                        printc(x); break;
                case 's':
                case 'c':
                        printc(x); break;
                case 's':
@@ -175,7 +180,7 @@ convert(cp)
 
 static
 printnum(n, base)
 
 static
 printnum(n, base)
-       register POS n;
+       register u_long n;
 {
        register char *dptr;
        char digs[15];
 {
        register char *dptr;
        char digs[15];
index 37c47d1..3d6c0cd 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_pcs.c       7.1     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_pcs.c   7.2 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -12,7 +18,7 @@ BKPTR bkpthead;
 
 char   *lp;
 char   lastc;
 
 char   *lp;
 char   lastc;
-
+extern char *kdbmalloc();
 long   loopcnt;
 
 /* sub process control */
 long   loopcnt;
 
 /* sub process control */
@@ -28,7 +34,7 @@ subpcs(modif)
 
                /* delete breakpoint */
        case 'd': case 'D':
 
                /* delete breakpoint */
        case 'd': case 'D':
-               if (bkptr=scanbkpt(dot)) {
+               if (bkptr=scanbkpt((ADDR)dot)) {
                        bkptr->flag=0;
                        return;
                }
                        bkptr->flag=0;
                        return;
                }
@@ -36,7 +42,7 @@ subpcs(modif)
 
                /* set breakpoint */
        case 'b': case 'B':
 
                /* set breakpoint */
        case 'b': case 'B':
-               if (bkptr=scanbkpt(dot))
+               if (bkptr=scanbkpt((ADDR)dot))
                        bkptr->flag=0;
                for (bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt)
                        if (bkptr->flag == 0)
                        bkptr->flag=0;
                for (bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt)
                        if (bkptr->flag == 0)
@@ -51,7 +57,7 @@ subpcs(modif)
                bkptr->loc = dot;
                bkptr->initcnt = bkptr->count = cntval;
                bkptr->flag = BKPTSET;
                bkptr->loc = dot;
                bkptr->initcnt = bkptr->count = cntval;
                bkptr->flag = BKPTSET;
-               check=MAXCOM-1; comptr=bkptr->comm; rdc(); lp--;
+               check=MAXCOM-1; comptr=bkptr->comm; (void) rdc(); lp--;
                do
                        *comptr++ = readchar();
                while (check-- && lastc!=EOR);
                do
                        *comptr++ = readchar();
                while (check-- && lastc!=EOR);
index 204cbb8..3533f8c 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_print.c     7.4     86/11/23        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_print.c 7.5 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -28,7 +34,7 @@ printtrace(modif)
        register char *comptr;
        register ADDR argp, frame;
        register struct nlist *sp;
        register char *comptr;
        register ADDR argp, frame;
        register struct nlist *sp;
-       int stack, ntramp;
+       int ntramp;
        register struct  proc *p;
        extern struct proc *allproc;
 
        register struct  proc *p;
        extern struct proc *allproc;
 
@@ -93,7 +99,7 @@ printtrace(modif)
                                ntramp++;
                        } else {
                                ntramp = 0;
                                ntramp++;
                        } else {
                                ntramp = 0;
-                               findsym(callpc, ISYM);
+                               (void) findsym((long)callpc, ISYM);
                                if (cursym)
                                        name = cursym->n_un.n_name;
                                else
                                if (cursym)
                                        name = cursym->n_un.n_name;
                                else
@@ -105,16 +111,17 @@ printtrace(modif)
                        if (ntramp != 1)
                                while (narg) {
                                        printf("%R",
                        if (ntramp != 1)
                                while (narg) {
                                        printf("%R",
-                                           get(argp = nextarg(argp), DSP));
+                                           get((off_t)(argp = nextarg(argp)),
+                                               DSP));
                                        if (--narg != 0)
                                                printc(',');
                                }
                        printf(") at ");
                                        if (--narg != 0)
                                                printc(',');
                                }
                        printf(") at ");
-                       psymoff(callpc, ISYM, "\n");
+                       psymoff((long)callpc, ISYM, "\n");
 
                        if (modif=='C') {
 
                        if (modif=='C') {
-                               while (localsym(frame, argp)) {
-                                       word = get(localval, DSP);
+                               while (localsym((long)frame)) {
+                                       word = get((off_t)localval, DSP);
                                        printf("%8t%s:%10t",
                                            cursym->n_un.n_name);
                                        if (errflg) {
                                        printf("%8t%s:%10t",
                                            cursym->n_un.n_name);
                                        if (errflg) {
@@ -141,7 +148,7 @@ printtrace(modif)
                        if (sp->n_type==(N_DATA|N_EXT) ||
                            sp->n_type==(N_BSS|N_EXT))
                                printf("%s:%12t%R\n", sp->n_un.n_name,
                        if (sp->n_type==(N_DATA|N_EXT) ||
                            sp->n_type==(N_BSS|N_EXT))
                                printf("%s:%12t%R\n", sp->n_un.n_name,
-                                       get(sp->n_value,DSP));
+                                       get((off_t)sp->n_value, DSP));
                break;
 
                /*print breakpoints*/
                break;
 
                /*print breakpoints*/
@@ -150,7 +157,7 @@ printtrace(modif)
                for (bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt)
                        if (bkptr->flag) {
                                printf("%-8.8d",bkptr->count);
                for (bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt)
                        if (bkptr->flag) {
                                printf("%-8.8d",bkptr->count);
-                               psymoff(bkptr->loc,ISYM,"%24t");
+                               psymoff((long)bkptr->loc,ISYM,"%24t");
                                comptr=bkptr->comm;
                                while (*comptr)
                                        printc(*comptr++);
                                comptr=bkptr->comm;
                                while (*comptr)
                                        printc(*comptr++);
@@ -166,7 +173,7 @@ printtrace(modif)
                                p->p_stat == SSTOP ? 'T' : '?');
                        if (p->p_wchan) {
                                printf(" wait ");
                                p->p_stat == SSTOP ? 'T' : '?');
                        if (p->p_wchan) {
                                printf(" wait ");
-                               psymoff(p->p_wchan, ISYM, "");
+                               psymoff((long)p->p_wchan, ISYM, "");
                        }
                        printc(EOR);
                }
                        }
                        printc(EOR);
                }
@@ -188,7 +195,7 @@ printregs(c)
                        continue;
                v = *p->rkern;
                printf("%s%6t%R %16t", p->rname, v);
                        continue;
                v = *p->rkern;
                printf("%s%6t%R %16t", p->rname, v);
-               valpr(v, p->rkern == &pcb.pcb_pc ? ISYM : DSYM);
+               valpr((long)v, p->rkern == &pcb.pcb_pc ? ISYM : DSYM);
                printc(EOR);
        }
        printpc();
                printc(EOR);
        }
        printpc();
@@ -222,7 +229,7 @@ getreg(regnam)
 printpc()
 {
 
 printpc()
 {
 
-       psymoff(pcb.pcb_pc, ISYM, ":%16t");
-       printins(ISP, chkget(pcb.pcb_pc, ISP));
+       psymoff((long)pcb.pcb_pc, ISYM, ":%16t");
+       printins(ISP, (long)chkget((off_t)pcb.pcb_pc, ISP));
        printc(EOR);
 }
        printc(EOR);
 }
index ed68999..9a85028 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_runpcs.c    7.2     86/11/23        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_runpcs.c        7.3 (Berkeley) %G%
+ */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -40,7 +46,7 @@ runpcs(runmode, execsig)
         * continue.
         */
        if (bkpt = scanbkpt(userpc)) {
         * continue.
         */
        if (bkpt = scanbkpt(userpc)) {
-               execbkpt(bkpt, execsig);
+               execbkpt(bkpt);
                /*NOTREACHED*/
        }
        setbp();
                /*NOTREACHED*/
        }
        setbp();
@@ -59,8 +65,8 @@ static        int execbkptf;
  * next step.  Otherwise return 1 if we stopped because
  * of a breakpoint,
  */
  * next step.  Otherwise return 1 if we stopped because
  * of a breakpoint,
  */
-nextpcs(tracetrap, execsig)
-       int tracetrap, execsig;
+nextpcs(tracetrap)
+       int tracetrap;
 {
        register BKPTR bkpt;
        short rc;
 {
        register BKPTR bkpt;
        short rc;
@@ -82,16 +88,13 @@ nextpcs(tracetrap, execsig)
                    ((bkpt->flag = BKPTEXEC) && bkpt->comm[0] != EOR &&
                    command(bkpt->comm, ':') && --bkpt->count)) {
                        loopcnt++;
                    ((bkpt->flag = BKPTEXEC) && bkpt->comm[0] != EOR &&
                    command(bkpt->comm, ':') && --bkpt->count)) {
                        loopcnt++;
-                       execbkpt(bkpt, execsig);
-                       execsig = 0;
+                       execbkpt(bkpt);
                } else {
                        bkpt->count = bkpt->initcnt;
                        rc = 1;
                }
                } else {
                        bkpt->count = bkpt->initcnt;
                        rc = 1;
                }
-       } else {
-               execsig = 0;
+       } else
                rc = 0;
                rc = 0;
-       }
        if (--loopcnt > 0)
                runpcs(rc ? CONTIN : SINGLE, 1);
        return (rc);
        if (--loopcnt > 0)
                runpcs(rc ? CONTIN : SINGLE, 1);
        return (rc);
@@ -101,7 +104,7 @@ nextpcs(tracetrap, execsig)
 #define BPIN 1
 static int bpstate = BPOUT;
 
 #define BPIN 1
 static int bpstate = BPOUT;
 
-execbkpt(bkptr,execsig)
+execbkpt(bkptr)
        BKPTR   bkptr;
 {
 
        BKPTR   bkptr;
 {
 
@@ -125,7 +128,7 @@ scanbkpt(addr)
 
 delbp()
 {
 
 delbp()
 {
-       register ADDR a;
+       register off_t a;
        register BKPTR bkptr;
 
        if (bpstate == BPOUT)
        register BKPTR bkptr;
 
        if (bpstate == BPOUT)
@@ -133,14 +136,14 @@ delbp()
        for (bkptr = bkpthead; bkptr; bkptr = bkptr->nxtbkpt)
                if (bkptr->flag) {
                        a = bkptr->loc;
        for (bkptr = bkpthead; bkptr; bkptr = bkptr->nxtbkpt)
                if (bkptr->flag) {
                        a = bkptr->loc;
-                       put(a, ISP, bkptr->ins);
+                       put((off_t)a, ISP, (long)bkptr->ins);
                }
        bpstate = BPOUT;
 }
 
 setbp()
 {
                }
        bpstate = BPOUT;
 }
 
 setbp()
 {
-       register ADDR a;
+       register off_t a;
        register BKPTR bkptr;
 
        if (bpstate == BPIN)
        register BKPTR bkptr;
 
        if (bpstate == BPIN)
@@ -149,7 +152,7 @@ setbp()
                if (bkptr->flag) {
                        a = bkptr->loc;
                        bkptr->ins = get(a, ISP);
                if (bkptr->flag) {
                        a = bkptr->loc;
                        bkptr->ins = get(a, ISP);
-                       put(a, ISP, SETBP(bkptr->ins));
+                       put(a, ISP, (long)SETBP(bkptr->ins));
                }
        bpstate = BPIN;
 }
                }
        bpstate = BPIN;
 }
index d3d5045..7bf6082 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_sym.c       7.1     86/11/20        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_sym.c   7.2 (Berkeley) %G%
+ */
 
 /*
  * adb - symbol table routines
 
 /*
  * adb - symbol table routines
  * Initialize the symbol table.
  */
 setsym(sym, esym, strtab, strsize)
  * Initialize the symbol table.
  */
 setsym(sym, esym, strtab, strsize)
-       struct nlist *sym, *esym;
-       char *strtab;
+       char *sym, *esym, *strtab;
 {
        register struct nlist *sp;
 
 {
        register struct nlist *sp;
 
-       symtab = sym, esymtab = esym;
+       symtab = (struct nlist *)sym, esymtab = (struct nlist *)esym;
        for (sp = symtab; sp < esymtab; sp++)
                if (sp->n_un.n_strx) {
                        if (sp->n_un.n_strx > strsize) {
        for (sp = symtab; sp < esymtab; sp++)
                if (sp->n_un.n_strx) {
                        if (sp->n_un.n_strx > strsize) {
@@ -52,7 +57,7 @@ lookup(symstr)
  * Leave a pointer to the symbol found as cursym.
  */
 findsym(val, type)
  * Leave a pointer to the symbol found as cursym.
  */
 findsym(val, type)
-       register val;
+       register long val;
        int type;
 {
        register diff;
        int type;
 {
        register diff;
@@ -81,7 +86,7 @@ findsym(val, type)
  * Return 0 at end of file.
  */
 localsym(cframe)
  * Return 0 at end of file.
  */
 localsym(cframe)
-       ADDR cframe;
+       long cframe;
 {
        register int type;
        register struct nlist *sp;
 {
        register int type;
        register struct nlist *sp;
@@ -130,7 +135,7 @@ localsym(cframe)
  * bytes into kernel space.
  */
 psymoff(v, type, s)
  * bytes into kernel space.
  */
 psymoff(v, type, s)
-       register v;
+       register long v;
        int type;
        char *s;
 {
        int type;
        char *s;
 {
@@ -154,6 +159,7 @@ psymoff(v, type, s)
  * Used in printing out registers $r.
  */
 valpr(v, idsp)
  * Used in printing out registers $r.
  */
 valpr(v, idsp)
+       long v;
 {
        register off_t d;
 
 {
        register off_t d;
 
index 7a6c055..dc89054 100644 (file)
@@ -1,4 +1,10 @@
-/*     kdb_trap.c      7.4     86/11/23        */
+/*
+ * Copyright (c) 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)kdb_trap.c  7.5 (Berkeley) %G%
+ */
 
 /*
  * Trap handler - command loop entry point.
 
 /*
  * Trap handler - command loop entry point.
@@ -30,7 +36,7 @@ kdb(type, code, curproc)
        var[varchk('t')] = type;
        var[varchk('c')] = code;
        var[varchk('p')] = (int)curproc;
        var[varchk('t')] = type;
        var[varchk('c')] = code;
        var[varchk('p')] = (int)curproc;
-       printtrap(type, code);
+       printtrap((long)type, (long)code);
        userpc = dot = pcb.pcb_pc;
        switch (setexit()) {
 
        userpc = dot = pcb.pcb_pc;
        switch (setexit()) {
 
@@ -40,7 +46,7 @@ kdb(type, code, curproc)
        case CONTIN:
                return (1);
        case 0:
        case CONTIN:
                return (1);
        case 0:
-               if (nextpcs(type, 0))
+               if (nextpcs(type))
                        printf("breakpoint%16t");
                else
                        printf("stopped at%16t");
                        printf("breakpoint%16t");
                else
                        printf("stopped at%16t");
@@ -62,8 +68,8 @@ kdb(type, code, curproc)
                        printf(DBNAME);
                }
                kdbwrite("kdb> ", 5);
                        printf(DBNAME);
                }
                kdbwrite("kdb> ", 5);
-               lp=0; rdc(); lp--;
-               command(0, lastcom);
+               lp=0; (void) rdc(); lp--;
+               (void) command((char *)0, lastcom);
                if (lp && lastc!='\n')
                        error(NOEOR);
        }
                if (lp && lastc!='\n')
                        error(NOEOR);
        }
index 4026c2f..7a17c6a 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)subr_xxx.c  7.2 (Berkeley) %G%
+ *     @(#)subr_xxx.c  7.3 (Berkeley) %G%
  */
 
 #include "../machine/pte.h"
  */
 
 #include "../machine/pte.h"
@@ -139,7 +139,7 @@ ffs(mask)
 #if !defined(vax)
 bcmp(s1, s2, len)
        register char *s1, *s2;
 #if !defined(vax)
 bcmp(s1, s2, len)
        register char *s1, *s2;
-       register int len;
+       register unsigned len;
 {
 
        while (len--)
 {
 
        while (len--)
index e26262b..813f0fa 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_ace.c        1.11    86/11/29        */
+/*     if_ace.c        1.12    86/12/15        */
 
 /*
  * ACC VERSAbus Ethernet controller
 
 /*
  * ACC VERSAbus Ethernet controller
@@ -88,6 +88,7 @@ aceprobe(reg, vi)
        struct ace_softc *is = &ace_softc[vi->ui_unit];
 
 #ifdef lint
        struct ace_softc *is = &ace_softc[vi->ui_unit];
 
 #ifdef lint
+       br = 0; cvec = br; br = cvec;
        acerint(0); acecint(0);
 #endif
        if (badaddr(reg, 2))
        acerint(0); acecint(0);
 #endif
        if (badaddr(reg, 2))
@@ -124,7 +125,6 @@ aceattach(ui)
        register struct ifnet *ifp = &is->is_if;
        register struct acedevice *addr = (struct acedevice *)ui->ui_addr;
        register short *wp, i;
        register struct ifnet *ifp = &is->is_if;
        register struct acedevice *addr = (struct acedevice *)ui->ui_addr;
        register short *wp, i;
-       char *cp;
 
        ifp->if_unit = unit;
        ifp->if_name = "ace";
 
        ifp->if_unit = unit;
        ifp->if_name = "ace";
@@ -808,7 +808,7 @@ aceioctl(ifp, cmd, data)
 acesetaddr(unit, addr, station)
        short unit;
        struct acedevice *addr;
 acesetaddr(unit, addr, station)
        short unit;
        struct acedevice *addr;
-       char *station;
+       u_char *station;
 {
        struct ace_softc *is = &ace_softc[unit];
        register short *wp, i;
 {
        struct ace_softc *is = &ace_softc[unit];
        register short *wp, i;
index ac042aa..89f3817 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_enp.c        1.2     86/11/29        */
+/*     if_enp.c        1.3     86/12/15        */
 
 #include "enp.h"
 #if NENP > 0
 
 #include "enp.h"
 #if NENP > 0
@@ -84,9 +84,10 @@ enpprobe(reg, vi)
        struct enp_softc *es = &enp_softc[vi->ui_unit];
 
 #ifdef lint
        struct enp_softc *es = &enp_softc[vi->ui_unit];
 
 #ifdef lint
+       br = 0; cvec = br; br = cvec;
        enpintr(0);
 #endif
        enpintr(0);
 #endif
-       if (badaddr(addr, 2) || badaddr(&addr->enp_ram[0], 2))
+       if (badaddr((caddr_t)addr, 2) || badaddr((caddr_t)&addr->enp_ram[0], 2))
                return (0);
        es->es_ivec = --vi->ui_hd->vh_lastiv;
        addr->enp_state = S_ENPRESET;           /* reset by VERSAbus reset */
                return (0);
        es->es_ivec = --vi->ui_hd->vh_lastiv;
        addr->enp_state = S_ENPRESET;           /* reset by VERSAbus reset */
@@ -112,7 +113,7 @@ enpattach(ui)
        /*
         * Get station's addresses.
         */
        /*
         * Get station's addresses.
         */
-       enpcopy(&addr->enp_addr.e_baseaddr, es->es_enaddr,
+       enpcopy((u_char *)&addr->enp_addr.e_baseaddr, es->es_enaddr,
            sizeof (es->es_enaddr));
        printf("enp%d: hardware address %s\n", ui->ui_unit,
            ether_sprintf(es->es_enaddr));
            sizeof (es->es_enaddr));
        printf("enp%d: hardware address %s\n", ui->ui_unit,
            ether_sprintf(es->es_enaddr));
@@ -179,27 +180,27 @@ enpintr(unit)
        register BCB *bcbp;
 
        addr = (struct enpdevice *)enpinfo[unit]->ui_addr;
        register BCB *bcbp;
 
        addr = (struct enpdevice *)enpinfo[unit]->ui_addr;
+#if ENP == 30
        if (!IS_ENP_INTR(addr))
                return;
        ACK_ENP_INTR(addr);
        if (!IS_ENP_INTR(addr))
                return;
        ACK_ENP_INTR(addr);
-       while ((bcbp = (BCB *)ringget(&addr->enp_tohost )) != 0) {
-               (void) enpread(&enp_softc[unit], bcbp, unit);
-               ringput(&addr->enp_enpfree, bcbp); 
+#endif
+       while ((bcbp = (BCB *)ringget((RING *)&addr->enp_tohost )) != 0) {
+               (void) enpread(&enp_softc[unit], bcbp);
+               (void) ringput((RING *)&addr->enp_enpfree, bcbp); 
        }
 }
 
 /*
  * Read input packet, examine its packet type, and enqueue it.
  */
        }
 }
 
 /*
  * Read input packet, examine its packet type, and enqueue it.
  */
-enpread(es, bcbp, unit)
+enpread(es, bcbp)
        struct enp_softc *es;
        register BCB *bcbp;
        struct enp_softc *es;
        register BCB *bcbp;
-       int unit;
 {
        register struct ether_header *enp;
        struct mbuf *m;
 {
        register struct ether_header *enp;
        struct mbuf *m;
-       long int s;
-       int len, off, resid, enptype;
+       int s, len, off, resid;
        register struct ifqueue *inq;
 
        es->es_if.if_ipackets++; 
        register struct ifqueue *inq;
 
        es->es_if.if_ipackets++; 
@@ -298,7 +299,7 @@ enpoutput(ifp, m0, dst)
        register struct enp_softc *es = &enp_softc[ifp->if_unit];
        register struct mbuf *m = m0;
        register struct ether_header *enp;
        register struct enp_softc *es = &enp_softc[ifp->if_unit];
        register struct mbuf *m = m0;
        register struct ether_header *enp;
-       register int off, i;
+       register int off;
        struct mbuf *mcopy = (struct mbuf *)0;
        int type, s, error, usetrailers;
        u_char edst[6];
        struct mbuf *mcopy = (struct mbuf *)0;
        int type, s, error, usetrailers;
        u_char edst[6];
@@ -430,9 +431,9 @@ enpput(unit, m)
        u_char *mcp;
 
        addr = (struct enpdevice *)enpinfo[unit]->ui_addr;
        u_char *mcp;
 
        addr = (struct enpdevice *)enpinfo[unit]->ui_addr;
-       if (ringempty(&addr->enp_hostfree)) 
+       if (ringempty((RING *)&addr->enp_hostfree)) 
                return (1);     
                return (1);     
-       bcbp = (BCB *)ringget(&addr->enp_hostfree);
+       bcbp = (BCB *)ringget((RING *)&addr->enp_hostfree);
        bcbp->b_len = 0;
        bp = (u_char *)bcbp->b_addr;
        for (mp = m; mp; mp = mp->m_next) {
        bcbp->b_len = 0;
        bp = (u_char *)bcbp->b_addr;
        for (mp = m; mp; mp = mp->m_next) {
@@ -444,9 +445,9 @@ enpput(unit, m)
                bp += len;
                bcbp->b_len += len;
        }
                bp += len;
                bcbp->b_len += len;
        }
-       bcbp->b_len = max(ETHERMIN, bcbp->b_len);
+       bcbp->b_len = MAX(ETHERMIN, bcbp->b_len);
        bcbp->b_reserved = 0;
        bcbp->b_reserved = 0;
-       if (ringput(&addr->enp_toenp, bcbp) == 1)
+       if (ringput((RING *)&addr->enp_toenp, bcbp) == 1)
                INTR_ENP(addr);
        m_freem(m);
        return (0);
                INTR_ENP(addr);
        m_freem(m);
        return (0);
@@ -480,8 +481,6 @@ enpget(rxbuf, totlen, off0, ifp)
                } else
                        len = totlen;
                if (len >= NBPG) {
                } else
                        len = totlen;
                if (len >= NBPG) {
-                       struct mbuf *p;
-
                        MCLGET(m);
                        if (m->m_len == CLBYTES)
                                m->m_len = len = MIN(len, CLBYTES);
                        MCLGET(m);
                        if (m->m_len == CLBYTES)
                                m->m_len = len = MIN(len, CLBYTES);
@@ -501,7 +500,7 @@ enpget(rxbuf, totlen, off0, ifp)
                        len -= sizeof (ifp);
                        ifp = (struct ifnet *)0;
                }
                        len -= sizeof (ifp);
                        ifp = (struct ifnet *)0;
                }
-               enpcopy(cp, mcp, len);
+               enpcopy(cp, mcp, (u_int)len);
                cp += len;
                *mp = m;
                mp = &m->m_next;
                cp += len;
                *mp = m;
                mp = &m->m_next;
@@ -523,8 +522,8 @@ bad:
 }
 
 enpcopy(from, to, cnt)
 }
 
 enpcopy(from, to, cnt)
-       register char *from, *to;
-       register cnt;
+       register u_char *from, *to;
+       register u_int cnt;
 {
        register c;
        register short *f, *t;
 {
        register c;
        register short *f, *t;
@@ -541,12 +540,12 @@ enpcopy(from, to, cnt)
                        *t++ = *f++;
                cnt &= 1;
                if (cnt) {                      /* odd len */
                        *t++ = *f++;
                cnt &= 1;
                if (cnt) {                      /* odd len */
-                       from = (char *)f;
-                       to = (char *)t;
+                       from = (u_char *)f;
+                       to = (u_char *)t;
                        *to = *from;
                }
        }
                        *to = *from;
                }
        }
-       while (cnt-- > 0)       /* one of the address(es) must be odd */
+       while ((int)cnt-- > 0)  /* one of the address(es) must be odd */
                *to++ = *from++;
 }
 
                *to++ = *from++;
 }
 
@@ -625,53 +624,64 @@ enpsetaddr(unit, addr, enaddr)
        cp = &addr->enp_addr.e_baseaddr.ea_addr[0];
        for (i = 0; i < 6; i++)
                *cp++ = ~*enaddr++;
        cp = &addr->enp_addr.e_baseaddr.ea_addr[0];
        for (i = 0; i < 6; i++)
                *cp++ = ~*enaddr++;
-       enpcopy(&addr->enp_addr.e_listsize, &code, sizeof (code)); 
+       enpcopy((u_char *)&addr->enp_addr.e_listsize, (u_char *)&code,
+           sizeof (code)); 
        code |= E_ADDR_SUPP;
        code |= E_ADDR_SUPP;
-       enpcopy(&code, &addr->enp_addr.e_listsize, sizeof (code)); 
+       enpcopy((u_char *)&code, (u_char *)&addr->enp_addr.e_listsize,
+           sizeof (code)); 
        enpinit(unit);
 }
 
 /* 
  * Routines to synchronize enp and host.
  */
        enpinit(unit);
 }
 
 /* 
  * Routines to synchronize enp and host.
  */
+#ifdef notdef
 static
 ringinit(rp, size)
        register RING *rp;
 {
 static
 ringinit(rp, size)
        register RING *rp;
 {
-       register int i;
-       register short *sp; 
 
        rp->r_rdidx = rp->r_wrtidx = 0;
        rp->r_size = size;
 }
 
 static
 
        rp->r_rdidx = rp->r_wrtidx = 0;
        rp->r_size = size;
 }
 
 static
-ringempty(rp)
+ringfull(rp)
        register RING *rp;
 {
        register RING *rp;
 {
+       register short idx;
 
 
-       return (rp->r_rdidx == rp->r_wrtidx);
+       idx = (rp->r_wrtidx + 1) & (rp->r_size-1);
+       return (idx == rp->r_rdidx);
 }
 
 static
 }
 
 static
-ringfull(rp)
+fir(rp)
        register RING *rp;
 {
        register RING *rp;
 {
-       register short idx;
 
 
-       idx = (rp->r_wrtidx + 1) & (rp->r_size-1);
-       return (idx == rp->r_rdidx);
+       return (rp->r_rdidx != rp->r_wrtidx ? rp->r_slot[rp->r_rdidx] : 0);
+}
+#endif
+
+static
+ringempty(rp)
+       register RING *rp;
+{
+
+       return (rp->r_rdidx == rp->r_wrtidx);
 }
 
 static
 ringput(rp, v)
        register RING *rp;
 }
 
 static
 ringput(rp, v)
        register RING *rp;
+       BCB *v;
 {
        register int idx;
 
        idx = (rp->r_wrtidx + 1) & (rp->r_size-1);
        if (idx != rp->r_rdidx) {
 {
        register int idx;
 
        idx = (rp->r_wrtidx + 1) & (rp->r_size-1);
        if (idx != rp->r_rdidx) {
-               rp->r_slot[rp->r_wrtidx] = v;
+               rp->r_slot[rp->r_wrtidx] = (int)v;
                rp->r_wrtidx = idx;
                if ((idx -= rp->r_rdidx) < 0)
                        idx += rp->r_size;
                rp->r_wrtidx = idx;
                if ((idx -= rp->r_rdidx) < 0)
                        idx += rp->r_size;
@@ -693,14 +703,6 @@ ringget(rp)
        return (i);
 }
 
        return (i);
 }
 
-static
-fir(rp)
-       register RING *rp;
-{
-
-       return (rp->r_rdidx != rp->r_wrtidx ? rp->r_slot[rp->r_rdidx] : 0);
-}
-
 /*
  * ENP Ram device.
  */
 /*
  * ENP Ram device.
  */
@@ -719,6 +721,7 @@ enpr_open(dev)
        return (0);
 }
 
        return (0);
 }
 
+/*ARGSUSED*/
 enpr_close(dev)
        dev_t dev;
 {
 enpr_close(dev)
        dev_t dev;
 {
@@ -736,14 +739,15 @@ enpr_read(dev, uio)
 
        if (uio->uio_offset > RAM_SIZE)
                return (ENODEV);
 
        if (uio->uio_offset > RAM_SIZE)
                return (ENODEV);
+       iov = uio->uio_iov;
        if (uio->uio_offset + iov->iov_len > RAM_SIZE)
                iov->iov_len = RAM_SIZE - uio->uio_offset;
        addr = (struct enpdevice *)enpinfo[ENPUNIT(dev)]->ui_addr;
        if (uio->uio_offset + iov->iov_len > RAM_SIZE)
                iov->iov_len = RAM_SIZE - uio->uio_offset;
        addr = (struct enpdevice *)enpinfo[ENPUNIT(dev)]->ui_addr;
-       iov = uio->uio_iov;
-       error = useracc(iov->iov_base, iov->iov_len, 0);
+       error = useracc(iov->iov_base, (unsigned)iov->iov_len, 0);
        if (error)
                return (error);
        if (error)
                return (error);
-       enpcopy(&addr->enp_ram[uio->uio_offset], iov->iov_base, iov->iov_len);
+       enpcopy((u_char *)&addr->enp_ram[uio->uio_offset],
+           (u_char *)iov->iov_base, (u_int)iov->iov_len);
        uio->uio_resid -= iov->iov_len;
        iov->iov_len = 0;
        return (0);
        uio->uio_resid -= iov->iov_len;
        iov->iov_len = 0;
        return (0);
@@ -763,22 +767,23 @@ enpr_write(dev, uio)
                return (ENODEV);
        if (uio->uio_offset + iov->iov_len > RAM_SIZE)
                iov->iov_len = RAM_SIZE - uio->uio_offset;
                return (ENODEV);
        if (uio->uio_offset + iov->iov_len > RAM_SIZE)
                iov->iov_len = RAM_SIZE - uio->uio_offset;
-       error =  useracc(iov->iov_base, iov->iov_len, 1);
+       error =  useracc(iov->iov_base, (unsigned)iov->iov_len, 1);
        if (error)
                return (error);
        if (error)
                return (error);
-       enpcopy(iov->iov_base, &addr->enp_ram[uio->uio_offset], iov->iov_len);
+       enpcopy((u_char *)iov->iov_base,
+           (u_char *)&addr->enp_ram[uio->uio_offset], (u_int)iov->iov_len);
        uio->uio_resid -= iov->iov_len;
        iov->iov_len = 0;
        return (0);
 }
 
        uio->uio_resid -= iov->iov_len;
        iov->iov_len = 0;
        return (0);
 }
 
+/*ARGSUSED*/
 enpr_ioctl(dev, cmd, data)
        dev_t dev;
        caddr_t data;
 {
        register struct enpdevice *addr;
        register unit = ENPUNIT(dev);
 enpr_ioctl(dev, cmd, data)
        dev_t dev;
        caddr_t data;
 {
        register struct enpdevice *addr;
        register unit = ENPUNIT(dev);
-       register struct vba_device *ui;
 
        addr = (struct enpdevice *)enpinfo[unit]->ui_addr;
        switch(cmd) {
 
        addr = (struct enpdevice *)enpinfo[unit]->ui_addr;
        switch(cmd) {
index f8234e2..e7c0040 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_enpreg.h     1.2     86/11/29        */
+/*     if_enpreg.h     1.3     86/12/15        */
 
 /*     Copyright (c) 1984 by Communication Machinery Corporation
  *
 
 /*     Copyright (c) 1984 by Communication Machinery Corporation
  *
@@ -152,10 +152,7 @@ struct enpdevice {
 #if ENP == 30
 #define ACK_ENP_INTR(addr)     (addr->enp_iow.enp2hst_clear_intr = RESETVAL)
 #define IS_ENP_INTR(addr)      (addr->enp_iow.enp2hst_clear_intr&0x80)
 #if ENP == 30
 #define ACK_ENP_INTR(addr)     (addr->enp_iow.enp2hst_clear_intr = RESETVAL)
 #define IS_ENP_INTR(addr)      (addr->enp_iow.enp2hst_clear_intr&0x80)
-#else
-#define ACK_ENP_INTR(addr)
-#define IS_ENP_INTR(addr)      (1)
-#endif ENP == 30
+#endif
 
 #ifdef notdef
 #define RESET_ENP(addr)                (addr->enp_iow.hst2enp_reset = 01)
 
 #ifdef notdef
 #define RESET_ENP(addr)                (addr->enp_iow.hst2enp_reset = 01)
@@ -166,9 +163,9 @@ struct enpdevice {
 #ifdef TAHOE
 #define ENP_GO(addr,start) { \
        int v = start; \
 #ifdef TAHOE
 #define ENP_GO(addr,start) { \
        int v = start; \
-       enpcopy(&v, &addr->enp_prog_start, sizeof(v) ); \
+       enpcopy((u_char *)&v, (u_char *)&addr->enp_prog_start, sizeof(v) ); \
        v = 0x80800000; \
        v = 0x80800000; \
-       enpcopy( &v, &addr->enp_go, sizeof(v) ); \
+       enpcopy((u_char *)&v, (u_char *)&addr->enp_go, sizeof(v) ); \
 }
 #else
 #define ENP_GO(addr,start,intvec ) { \
 }
 #else
 #define ENP_GO(addr,start,intvec ) { \
@@ -209,7 +206,7 @@ typedef struct BCB {
        struct  BCB *b_link;
        short    b_stat;
        short    b_len;
        struct  BCB *b_link;
        short    b_stat;
        short    b_len;
-       char    *b_addr;
+       u_char  *b_addr;
        short    b_msglen;
        short    b_reserved;
 } BCB;
        short    b_msglen;
        short    b_reserved;
 } BCB;
index e72eb0e..7232c86 100644 (file)
@@ -1,4 +1,4 @@
-/*     kdbparam.h      7.4     86/11/23        */
+/*     kdbparam.h      7.5     86/12/15        */
 
 #include <sys/vm.h>
 
 
 #include <sys/vm.h>
 
 
 #define        SETBP(ins)      ((BPT<<24) | ((ins) & 0xffffff))
 
 
 #define        SETBP(ins)      ((BPT<<24) | ((ins) & 0xffffff))
 
-#define        getprevpc(fp)   get((fp)-8, DSP)        /* pc of caller */
-#define        getprevframe(fp) (get((fp), DSP)&~3)    /* fp of caller */
-#define        getnargs(fp)    (((get((fp)-4, DSP)&0xffff)-4)/4)
+#define        getprevpc(fp)   get((off_t)(fp)-8, DSP) /* pc of caller */
+#define        getprevframe(fp) (get((off_t)(fp), DSP)&~3)     /* fp of caller */
+#define        getnargs(fp)    (((get((off_t)(fp)-4, DSP)&0xffff)-4)/4)
 #define        nextarg(ap)     ((ap) + 4)              /* next argument in list */
 #define        NOFRAME         0                       /* fp at top of call stack */
 
 #define        nextarg(ap)     ((ap) + 4)              /* next argument in list */
 #define        NOFRAME         0                       /* fp at top of call stack */
 
-#define        issignalpc(pc)  (MAXSTOR < (pc) && (pc) < MAXSTOR+ctob(UPAGES))
-#define        getsignalpc(fp) get((fp)+44, DSP)       /* pc of caller before signal */
+#define        issignalpc(pc)  ((unsigned)MAXSTOR < (pc) && (pc) < (unsigned)KERNBASE)
+#define        getsignalpc(fp) get((off_t)(fp)+44, DSP)/* pc of caller before signal */
 
 #define leng(a)                ((long)((unsigned)(a)))
 #define shorten(a)     (((a) >> 16) & 0xffff)
 
 #define leng(a)                ((long)((unsigned)(a)))
 #define shorten(a)     (((a) >> 16) & 0xffff)
-#define        itol(a,b)       (((a) << 16) | ((b) & 0xffff))
+#define        itol(a,b)       ((long)(((a) << 16) | ((b) & 0xffff)))
 #define        byte(a)         (((a) >> 24) & 0xff)
 #define        byte(a)         (((a) >> 24) & 0xff)
-#define        btol(a)         ((a) << 24)
+#define        btol(a)         ((long)((a) << 24))
 
 /* check for address wrap around */
 #define        addrwrap(oaddr,newaddr) \
 
 /* check for address wrap around */
 #define        addrwrap(oaddr,newaddr) \
index 9d2042a..720d9aa 100644 (file)
@@ -1,4 +1,4 @@
-/*     Locore.c        1.2     86/01/05        */
+/*     Locore.c        1.3     86/12/15        */
 
 #include "../tahoe/mtpr.h"
 #include "../tahoe/trap.h"
 
 #include "../tahoe/mtpr.h"
 #include "../tahoe/trap.h"
@@ -23,6 +23,8 @@
 #include "domain.h"
 #include "map.h"
 
 #include "domain.h"
 #include "map.h"
 
+#include "../tahoe/cpu.h"
+
 /*
  * Pseudo file for lint to show what is used/defined in locore.s.
  */
 /*
  * Pseudo file for lint to show what is used/defined in locore.s.
  */
@@ -35,12 +37,14 @@ int masterpaddr;            /* p_addr of current process on master cpu */
 struct user u;
 int    icode[8];
 int    szicode = sizeof (icode);
 struct user u;
 int    icode[8];
 int    szicode = sizeof (icode);
+long   catcher[191];
 /*
  * Variables declared for savecore, or
  * implicitly, such as by config or the loader.
  */
 char   version[] = "4.2 BSD UNIX ....";
 int    etext;
 /*
  * Variables declared for savecore, or
  * implicitly, such as by config or the loader.
  */
 char   version[] = "4.2 BSD UNIX ....";
 int    etext;
+int    end;
 
 doadump() { dumpsys(); }
 
 
 doadump() { dumpsys(); }
 
@@ -65,9 +69,6 @@ lowinit()
 #ifdef NS
        extern struct domain nsdomain;
 #endif
 #ifdef NS
        extern struct domain nsdomain;
 #endif
-       extern int nport;
-       extern short *swsize;
-       extern int *swpf;
 
        /* cpp messes these up for lint so put them here */
        unixdomain.dom_next = domains;
 
        /* cpp messes these up for lint so put them here */
        unixdomain.dom_next = domains;
@@ -102,10 +103,8 @@ lowinit()
        scb = scb;
        maxmem = physmem = freemem = 0;
        u = u;
        scb = scb;
        maxmem = physmem = freemem = 0;
        u = u;
+       fixctlrmask();
        main(0);
        main(0);
-       swsize = swsize;                /* XXX */
-       swpf = swpf;                    /* XXX */
-       nport = nport;                  /* XXX */
 
        /*
         * Routines called from interrupt vectors.
 
        /*
         * Routines called from interrupt vectors.
@@ -130,14 +129,10 @@ lowinit()
 
        if (vmemall((struct pte *)0, 0, (struct proc *)0, 0))
                return;         /* use value */
 
        if (vmemall((struct pte *)0, 0, (struct proc *)0, 0))
                return;         /* use value */
-       if (zmemall((int (*)())0, 0) == (caddr_t)0)
-               return;         /* use value */
        boothowto = 0;
        boothowto = 0;
-/* the following are not currently used but will soon */
        if (rmget((struct map *)0, 0, 0) == 0)
                return;
        cp = calloc(0); cfreemem(cp, 0);
        if (rmget((struct map *)0, 0, 0) == 0)
                return;
        cp = calloc(0); cfreemem(cp, 0);
-/* end not currently used */
        dumpflag = 0; dumpflag = dumpflag;
 #if !defined(GPROF)
        cp = (caddr_t)&etext;
        dumpflag = 0; dumpflag = dumpflag;
 #if !defined(GPROF)
        cp = (caddr_t)&etext;
@@ -147,7 +142,11 @@ lowinit()
 struct pte Sysmap[6*NPTEPG];
 caddr_t        Sysbase;
 struct pte VMEMmap[1];
 struct pte Sysmap[6*NPTEPG];
 caddr_t        Sysbase;
 struct pte VMEMmap[1];
-int    vmembeg, vmemend;
+caddr_t        vmem, vmembeg, vmemend;
+struct pte VMEMmap1[1];
+caddr_t        vmem1;
+struct pte VBmap[1];
+caddr_t        vbbase, vbend;
 struct pte Usrptmap[USRPTSIZE];
 struct pte usrpt[USRPTSIZE*NPTEPG];
 struct pte Forkmap[UPAGES];
 struct pte Usrptmap[USRPTSIZE];
 struct pte usrpt[USRPTSIZE*NPTEPG];
 struct pte Forkmap[UPAGES];
@@ -162,37 +161,6 @@ struct     pte Pushmap[UPAGES];
 struct user pushutl;
 struct pte Vfmap[UPAGES];
 struct user vfutl;
 struct user pushutl;
 struct pte Vfmap[UPAGES];
 struct user vfutl;
-#include "fsd.h"
-#if NVD > 0
-struct pte VD0map[MAXBPTE+1];
-char   vd0utl[1];
-#endif
-#if NVD > 1
-struct pte VD1map[MAXBPTE+1];
-char   vd1utl[1];
-#endif
-#if NVD > 2
-struct pte VD2map[MAXBPTE+1];
-char   vd2utl[1];
-#endif
-#if NVD > 3
-struct pte VD3map[MAXBPTE+1];
-char   vd3utl[1];
-#endif
-#include "cy.h"
-#if NCY > 0
-struct pte CY0map[TBUFSIZ+1];
-char   cy0utl[1];
-#endif
-#if NCY > 1
-struct pte CY1map[TBUFSIZ+1];
-char   cy1utl[1];
-#endif
-#include "ace.h"
-#if NACE > 0
-struct pte ACE0map[1], ACE1map[1];
-char   ace0utl[1], ace1utl[1];
-#endif
 struct pte CMAP1[1], CMAP2[1];
 caddr_t        CADDR1, CADDR2;
 struct pte mmap[1];
 struct pte CMAP1[1], CMAP2[1];
 caddr_t        CADDR1, CADDR2;
 struct pte mmap[1];
@@ -206,10 +174,6 @@ struct     mbuf mbutl[NMBCLUSTERS*CLBYTES/sizeof (struct mbuf)];
 
 /*ARGSUSED*/
 badaddr(addr, len) caddr_t addr; int len; { return (0); }
 
 /*ARGSUSED*/
 badaddr(addr, len) caddr_t addr; int len; { return (0); }
-#if NCY > 0
-/*ARGSUSED*/
-badcyaddr(addr) caddr_t addr; { return (0); }
-#endif
 /*ARGSUSED*/
 ovbcopy(from, to, len) caddr_t from, to; unsigned len; { }
 copyinstr(udaddr, kaddr, maxlength, lencopied)
 /*ARGSUSED*/
 ovbcopy(from, to, len) caddr_t from, to; unsigned len; { }
 copyinstr(udaddr, kaddr, maxlength, lencopied)
@@ -275,11 +239,11 @@ scanc(size, cp, table, mask)
 { return (0); }
 
 /*ARGSUSED*/
 { return (0); }
 
 /*ARGSUSED*/
-skpc(mask, size, cp) int mask; char *cp; unsigned size; { return (0); }
+skpc(mask, size, cp) int mask; int size; char *cp; { return (0); }
 
 #ifdef notdef
 /*ARGSUSED*/
 
 #ifdef notdef
 /*ARGSUSED*/
-locc(mask, size, cp) int mask; char *cp; unsigned size; { return (0); }
+locc(mask, size, cp) int mask; int size; char *cp; { return (0); }
 #endif
 
 /*
 #endif
 
 /*
@@ -323,5 +287,7 @@ ffs(v) long v; { return (0); }
 
 imin(a, b) int a, b; { return (a < b ? a : b); }
 imax(a, b) int a, b; { return (a > b ? a : b); }
 
 imin(a, b) int a, b; { return (a < b ? a : b); }
 imax(a, b) int a, b; { return (a > b ? a : b); }
+#ifdef notdef
 unsigned min(a, b) u_int a, b; { return (a < b ? a : b); }
 unsigned max(a, b) u_int a, b; { return (a > b ? a : b); }
 unsigned min(a, b) u_int a, b; { return (a < b ? a : b); }
 unsigned max(a, b) u_int a, b; { return (a > b ? a : b); }
+#endif
index 26cdf4b..daf1ea3 100644 (file)
@@ -1,4 +1,4 @@
-/*     autoconf.c      1.8     86/12/08        */
+/*     autoconf.c      1.9     86/12/15        */
 
 /*
  * Setup the system to run on the current machine.
 
 /*
  * Setup the system to run on the current machine.
index 50c3b37..f15c5ae 100644 (file)
@@ -1,4 +1,4 @@
-/*     kdb_machdep.c   7.2     86/11/21        */
+/*     kdb_machdep.c   7.3     86/12/15        */
 
 #include "param.h"
 #include "conf.h"
 
 #include "param.h"
 #include "conf.h"
@@ -186,7 +186,7 @@ static      char *codenames[] = {
  * Announce a trap.
  */
 kdbprinttrap(type, code)
  * Announce a trap.
  */
 kdbprinttrap(type, code)
-       int type, code;
+       long type, code;
 {
 
        extern int TRAP_TYPES;
 {
 
        extern int TRAP_TYPES;
@@ -265,7 +265,8 @@ kdbpoke(addr, v)
        long v;
 {
        register int pn, *pte, opte = 0;
        long v;
 {
        register int pn, *pte, opte = 0;
-       extern char Sysbase[], etext;
+       extern caddr_t Sysbase;
+       extern int etext;
        u_short *wp;
        u_char *cp;
 
        u_short *wp;
        u_char *cp;
 
@@ -274,7 +275,7 @@ kdbpoke(addr, v)
         * make the page writeable for the duration of
         * the access.
         */
         * make the page writeable for the duration of
         * the access.
         */
-       if ((caddr_t)Sysbase <= addr && addr <= (caddr_t)&etext) {
+       if (Sysbase <= addr && addr <= (caddr_t)&etext) {
                pn = btop((int)addr &~ 0xc0000000);
                pte = (int *)&Sysmap[pn];
                opte = *pte;
                pn = btop((int)addr &~ 0xc0000000);
                pte = (int *)&Sysmap[pn];
                opte = *pte;
index f100b18..ebd5c5d 100644 (file)
@@ -1,4 +1,4 @@
-/*     kdb_opset.c     7.2     86/11/23        */
+/*     kdb_opset.c     7.3     86/12/15        */
 
 #include "../kdb/defs.h"
 
 
 #include "../kdb/defs.h"
 
@@ -60,7 +60,7 @@ static        char *regname[] = {
        "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
        "r8", "r9", "r10", "r11", "r12", "fp", "sp", "pc"
 };
        "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
        "r8", "r9", "r10", "r11", "r12", "fp", "sp", "pc"
 };
-static POS type, space, incp;
+static int type, space, incp;
 
 /* set up ioptab */
 kdbsetup()
 
 /* set up ioptab */
 kdbsetup()
@@ -76,18 +76,18 @@ snarf(nbytes, idsp)
 {
        register long value;
 
 {
        register long value;
 
-       value = chkget(inkdot(incp), idsp);
+       value = (u_int)chkget((off_t)inkdot(incp), idsp);
        incp += nbytes;
        return(value>>(4-nbytes)*8);
 }
 
        incp += nbytes;
        return(value>>(4-nbytes)*8);
 }
 
-printins(idsp,ins)
+printins(idsp, ins)
        register long ins;
 {
        short argno;            /* argument index */
        register mode;          /* mode */
        register r;             /* register name */
        register long ins;
 {
        short argno;            /* argument index */
        register mode;          /* mode */
        register r;             /* register name */
-       register d;             /* assembled byte, word, long or float */
+       register long d;        /* assembled byte, word, long or float */
        register char *ap;
        register struct optab *ip;
 
        register char *ap;
        register struct optab *ip;
 
index 33cbe50..d00aff1 100644 (file)
@@ -1,4 +1,4 @@
-/*     machdep.c       1.8     86/11/25        */
+/*     machdep.c       1.9     86/12/15        */
 
 #include "param.h"
 #include "systm.h"
 
 #include "param.h"
 #include "systm.h"
@@ -58,7 +58,6 @@ startup(firstaddr)
        int mapaddr, j;
        register caddr_t v;
        int maxbufs, base, residual;
        int mapaddr, j;
        register caddr_t v;
        int maxbufs, base, residual;
-       extern char etext;
 
        /*
         * Initialize error message buffer (at end of core).
 
        /*
         * Initialize error message buffer (at end of core).
@@ -295,7 +294,7 @@ sendsig(p, sig, mask)
                scp = (struct sigcontext *)regs[SP] - 1;
        fp = (struct sigframe *)scp - 1;
        if ((int)fp <= USRSTACK - ctob(u.u_ssize)) 
                scp = (struct sigcontext *)regs[SP] - 1;
        fp = (struct sigframe *)scp - 1;
        if ((int)fp <= USRSTACK - ctob(u.u_ssize)) 
-               grow((unsigned)fp);
+               (void) grow((unsigned)fp);
        if (useracc((caddr_t)fp, sizeof (*fp) + sizeof (*scp), B_WRITE) == 0) {
                /*
                 * Process has trashed its stack; give it an illegal
        if (useracc((caddr_t)fp, sizeof (*fp) + sizeof (*scp), B_WRITE) == 0) {
                /*
                 * Process has trashed its stack; give it an illegal
index 4ee6caf..c32a5d1 100644 (file)
@@ -1,4 +1,4 @@
-/*     mem.c   1.3     86/07/16        */
+/*     mem.c   1.4     86/12/15        */
 
 /*
  * Memory special file
 
 /*
  * Memory special file
@@ -43,7 +43,7 @@ mmrw(dev, uio, rw)
        register u_int c, v;
        register struct iovec *iov;
        int error = 0;
        register u_int c, v;
        register struct iovec *iov;
        int error = 0;
-       extern int vmembeg, vmemend;
+       extern caddr_t vmembeg, vmemend;
 
 
        while (uio->uio_resid > 0 && error == 0) {
 
 
        while (uio->uio_resid > 0 && error == 0) {
index b50e780..e152f3f 100644 (file)
@@ -1,4 +1,4 @@
-/*     trap.c  1.6     86/11/25        */
+/*     trap.c  1.7     86/12/15        */
 
 #include "../tahoe/psl.h"
 #include "../tahoe/reg.h"
 
 #include "../tahoe/psl.h"
 #include "../tahoe/reg.h"
@@ -263,7 +263,7 @@ syscall(sp, type, hfs, accmst, acclst, dbl, code, pc, psl)
                u.u_eosys = NORMALRETURN;
 #ifdef SYSCALLTRACE
                if (syscalltrace) {
                u.u_eosys = NORMALRETURN;
 #ifdef SYSCALLTRACE
                if (syscalltrace) {
-                       register int i;
+                       register int a;
                        char *cp;
 
                        if (code >= nsysent)
                        char *cp;
 
                        if (code >= nsysent)
@@ -271,13 +271,13 @@ syscall(sp, type, hfs, accmst, acclst, dbl, code, pc, psl)
                        else
                                printf("%s", syscallnames[code]);
                        cp = "(";
                        else
                                printf("%s", syscallnames[code]);
                        cp = "(";
-                       for (i= 0; i < callp->sy_narg; i++) {
-                               printf("%s%x", cp, u.u_arg[i]);
+                       for (a = 0; a < callp->sy_narg; a++) {
+                               printf("%s%x", cp, u.u_arg[a]);
                                cp = ", ";
                        }
                                cp = ", ";
                        }
-                       if (i)
-                               putchar(')', 0);
-                       putchar('\n', 0);
+                       if (a)
+                               printf(")");
+                       printf("\n");
                }
 #endif
                (*callp->sy_call)();
                }
 #endif
                (*callp->sy_call)();
index 6f6515e..d79c91c 100644 (file)
@@ -1,4 +1,4 @@
-/*     vm_machdep.c    1.6     86/11/03        */
+/*     vm_machdep.c    1.7     86/12/15        */
 
 #include "../machine/pte.h"
 
 
 #include "../machine/pte.h"
 
@@ -67,7 +67,7 @@ mapout(pte, size)
 chksize(ts, ids, uds, ss)
        register unsigned ts, ids, uds, ss;
 {
 chksize(ts, ids, uds, ss)
        register unsigned ts, ids, uds, ss;
 {
-       extern int maxtsize;
+       extern unsigned maxtsize;
 
        if (ctob(ts) > maxtsize ||
            ctob(ids) > u.u_rlimit[RLIMIT_DATA].rlim_cur ||
 
        if (ctob(ts) > maxtsize ||
            ctob(ids) > u.u_rlimit[RLIMIT_DATA].rlim_cur ||
index b51fca4..f7c5af6 100644 (file)
@@ -1,4 +1,4 @@
-/*     cy.c    1.7     86/11/03        */
+/*     cy.c    1.8     86/12/15        */
 
 #include "yc.h"
 #if NCY > 0
 
 #include "yc.h"
 #if NCY > 0
@@ -24,6 +24,7 @@ int   cydebug = 0;
 #include "cmap.h"
 #include "kernel.h"
 #include "syslog.h"
 #include "cmap.h"
 #include "kernel.h"
 #include "syslog.h"
+#include "tty.h"
 
 #include "../tahoe/cpu.h"
 #include "../tahoe/mtpr.h"
 
 #include "../tahoe/cpu.h"
 #include "../tahoe/mtpr.h"
@@ -126,8 +127,11 @@ cyprobe(reg, vm)
        struct vba_ctlr *vm;
 {
        register br, cvec;                      /* must be r12, r11 */
        struct vba_ctlr *vm;
 {
        register br, cvec;                      /* must be r12, r11 */
-       struct cy_softc *cy;
 
 
+#ifdef lint
+       br = 0; cvec = br; br = cvec;
+       cyintr(0);
+#endif
        if (badcyaddr(reg+1))
                return (0);
        if (vm->um_ctlr > NCYSCP || cyscp[vm->um_ctlr] == 0)    /* XXX */
        if (badcyaddr(reg+1))
                return (0);
        if (vm->um_ctlr > NCYSCP || cyscp[vm->um_ctlr] == 0)    /* XXX */
@@ -336,7 +340,6 @@ cycommand(dev, com, count)
        dev_t dev;
        int com, count;
 {
        dev_t dev;
        int com, count;
 {
-       register int unit = CYUNIT(dev);
        register struct buf *bp;
        int s;
        
        register struct buf *bp;
        int s;
        
@@ -433,7 +436,6 @@ cystart(vm)
        register struct buf *bp, *dp;
        register struct yc_softc *yc;
        register struct cy_softc *cy;
        register struct buf *bp, *dp;
        register struct yc_softc *yc;
        register struct cy_softc *cy;
-       register struct vba_device *vi;
        int ycunit;
        daddr_t blkno;
 
        int ycunit;
        daddr_t blkno;
 
@@ -648,7 +650,7 @@ cyintr(cipher)
         */
        cy = &cy_softc[vm->um_ctlr];
        cy->cy_ccb.cbcw = CBCW_CLRINT;
         */
        cy = &cy_softc[vm->um_ctlr];
        cy->cy_ccb.cbcw = CBCW_CLRINT;
-       cyldmba(cy->cy_ccb.cbtpb, &cy->cy_nop);
+       cyldmba(cy->cy_ccb.cbtpb, (caddr_t)&cy->cy_nop);
        cy->cy_ccb.cbgate = GATE_CLOSED;
        CY_GO(vm->um_addr);
        if ((dp = vm->um_tab.b_actf) == NULL) {
        cy->cy_ccb.cbgate = GATE_CLOSED;
        CY_GO(vm->um_addr);
        if ((dp = vm->um_tab.b_actf) == NULL) {
@@ -659,6 +661,7 @@ cyintr(cipher)
        cyunit = CYUNIT(bp->b_dev);
        cy = &cy_softc[cyunit];
        cyuncachetpb(cy);
        cyunit = CYUNIT(bp->b_dev);
        cy = &cy_softc[cyunit];
        cyuncachetpb(cy);
+       yc = &yc_softc[YCUNIT(bp->b_dev)];
        /*
         * If last command was a rewind and tape is
         * still moving, wait for the operation to complete.
        /*
         * If last command was a rewind and tape is
         * still moving, wait for the operation to complete.
@@ -673,7 +676,6 @@ cyintr(cipher)
        /*
         * An operation completed...record status.
         */
        /*
         * An operation completed...record status.
         */
-       yc = &yc_softc[YCUNIT(bp->b_dev)];
        yc->yc_timo = INF;
        yc->yc_control = cy->cy_tpb.tpcontrol;
        yc->yc_status = cy->cy_tpb.tpstatus;
        yc->yc_timo = INF;
        yc->yc_control = cy->cy_tpb.tpcontrol;
        yc->yc_status = cy->cy_tpb.tpstatus;
@@ -776,16 +778,17 @@ ignoreerr:
                /*
                 * For forward/backward space record update current position.
                 */
                /*
                 * For forward/backward space record update current position.
                 */
-               if (bp == &ccybuf[CYUNIT(bp->b_dev)]) switch (bp->b_command) {
+               if (bp == &ccybuf[CYUNIT(bp->b_dev)])
+                       switch ((int)bp->b_command) {
 
 
-               case CY_SFORW:
-                       yc->yc_blkno -= bp->b_repcnt;
-                       break;
+                       case CY_SFORW:
+                               yc->yc_blkno -= bp->b_repcnt;
+                               break;
 
 
-               case CY_SREV:
-                       yc->yc_blkno += bp->b_repcnt;
-                       break;
-               }
+                       case CY_SREV:
+                               yc->yc_blkno += bp->b_repcnt;
+                               break;
+                       }
                goto opdone;
        
        case SSEEK:
                goto opdone;
        
        case SSEEK:
@@ -1062,7 +1065,7 @@ cydump(dev)
        register struct cy_softc *cy;
        register int bs, num, start;
        register caddr_t addr;
        register struct cy_softc *cy;
        register int bs, num, start;
        register caddr_t addr;
-       int unit = CYUNIT(dev), ctlr, error;
+       int unit = CYUNIT(dev), error;
 
        if (unit >= NCY || cyminfo[unit] == 0 ||
            (cy = &cy_softc[unit])->cy_bs == 0 || YCUNIT(dev) >= NYC)
 
        if (unit >= NCY || cyminfo[unit] == 0 ||
            (cy = &cy_softc[unit])->cy_bs == 0 || YCUNIT(dev) >= NYC)
@@ -1070,7 +1073,7 @@ cydump(dev)
        if (cywait(&cy->cy_ccb))
                return (EFAULT);
 #define        phys(a) ((caddr_t)((int)(a)&~0xc0000000))
        if (cywait(&cy->cy_ccb))
                return (EFAULT);
 #define        phys(a) ((caddr_t)((int)(a)&~0xc0000000))
-       addr = phys(cyminfo[ctlr]->um_addr);
+       addr = phys(cyminfo[unit]->um_addr);
        num = maxfree, start = NBPG*2;
        while (num > 0) {
                bs = num > btoc(CYMAXIO) ? btoc(CYMAXIO) : num;
        num = maxfree, start = NBPG*2;
        while (num > 0) {
                bs = num > btoc(CYMAXIO) ? btoc(CYMAXIO) : num;
index 5d24e64..22e34fb 100644 (file)
@@ -1,12 +1,12 @@
-/*     dr.c    1.5     86/11/29        */
+/*     dr.c    1.6     86/12/15        */
 
 #include "dr.h"
 #if NDR > 0
 
 #include "dr.h"
 #if NDR > 0
-
-/*      DRV11-W DMA interface driver.
+/*
+ * DRV11-W DMA interface driver.
+ *
  * UNTESTED WITH 4.3
  */
  * UNTESTED WITH 4.3
  */
-
 #include "../machine/mtpr.h"
 #include "../machine/pte.h"
 
 #include "../machine/mtpr.h"
 #include "../machine/pte.h"
 
@@ -20,6 +20,7 @@
 #include "buf.h"
 #include "vm.h"
 #include "uio.h"
 #include "buf.h"
 #include "vm.h"
 #include "uio.h"
+#include "kernel.h"
 
 #include "../tahoevba/vbavar.h"
 #include "../tahoevba/drreg.h"
 
 #include "../tahoevba/vbavar.h"
 #include "../tahoevba/drreg.h"
 struct  vba_device  *drinfo[NDR];
 struct  dr_aux dr_aux[NDR];
 
 struct  vba_device  *drinfo[NDR];
 struct  dr_aux dr_aux[NDR];
 
-caddr_t vtoph();
 unsigned drminphys();
 unsigned drminphys();
-int     drprobe(), drintr(), drattach(), drtime(), drrwtimo();
-int     drstrategy();
-extern struct  vba_device  *drinfo[];
-static long drstd[] = { 0 };
+int     drprobe(), drintr(), drattach(), drtimo(), drrwtimo();
+int     drstrategy();
+extern struct  vba_device  *drinfo[];
+static long drstd[] = { 0 };
 struct  vba_driver drdriver =
 struct  vba_driver drdriver =
-       { drprobe, 0, drattach, 0, drstd, "rs", drinfo };
-extern long hz;
+    { drprobe, 0, drattach, 0, drstd, "rs", drinfo };
 
 #define RSUNIT(dev) (minor(dev) & 7)
 #define SPL_UP spl5
 
 #define RSUNIT(dev) (minor(dev) & 7)
 #define SPL_UP spl5
@@ -47,121 +46,105 @@ extern long hz;
 
 extern struct dr_aux dr_aux[];
 
 
 extern struct dr_aux dr_aux[];
 
-struct rs_data {
-    struct buf  rs_buf;
-    int         rs_ubainfo;
-    short       rs_debug;
-    short       rs_busy;
-    short       rs_tout; 
-    short       rs_uid;
-    short       rs_isopen;
-    short       rs_func;
-} rs_data[NDR];
-
-
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-long DR11 = 0;
+long   DR11 = 0;
 #endif
 
 drprobe(reg, vi)
 #endif
 
 drprobe(reg, vi)
-    caddr_t reg;
-    struct vba_device *vi;
+       caddr_t reg;
+       struct vba_device *vi;
 {
 {
-    register int br, cvec;             /* must be r12, r11 */
-    register struct rsdevice *dr;
-    register ushort status;
+       register int br, cvec;          /* must be r12, r11 */
+       struct rsdevice *dr;
 
 
-    if (badaddr(reg, 2))
-       return (0);
-    dr = (struct rsdevice *)reg;
-#ifdef notdef
-    dr->dr_intvect = --vi->ui_hd->vh_lastiv;
-#else
-    dr->dr_intvect = DRINTV+vi->ui_unit;
+#ifdef lint
+       br = 0; cvec = br; br = cvec;
+       drintr(0);
 #endif
 #endif
+       if (badaddr(reg, 2))
+               return (0);
+       dr = (struct rsdevice *)reg;
+       dr->dr_intvect = --vi->ui_hd->vh_lastiv;
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    printf("dprobe: Set interrupt vector %lx and init\n",dr->dr_intvec);
+       printf("dprobe: Set interrupt vector %lx and init\n",dr->dr_intvec);
 #endif
 #endif
-    /* generate interrupt here for autoconfig */
-    dr->dr_cstat = MCLR;               /* init board and device */
-    status = dr->dr_cstat;             /* read initial status */
+       /* generate interrupt here for autoconfig */
+       dr->dr_cstat = MCLR;            /* init board and device */
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    printf("drprobe: Initial status %lx\n",status & 0xffff);
+       printf("drprobe: Initial status %lx\n", dr->dr_cstat);
 #endif
 #endif
-    br = 0x18, cvec = dr->dr_intvect;  /* XXX */
-    return (sizeof (struct rsdevice));         /* DR11 exist */
+       br = 0x18, cvec = dr->dr_intvect;       /* XXX */
+       return (sizeof (struct rsdevice));              /* DR11 exist */
 }
 
 /* ARGSUSED */
 drattach(ui)
 }
 
 /* ARGSUSED */
 drattach(ui)
-struct vba_device *ui;
+       struct vba_device *ui;
 {
 {
-    register struct dr_aux *rsd;
-
-    rsd = &dr_aux[ui->ui_unit];
-    rsd->dr_flags = DR_PRES;           /* This dr11 is present */
-    rsd->dr_addr = (struct rsdevice *)ui->ui_addr; /* Save addr of this dr11 */
-    rsd->dr_istat = 0;
-    rsd->dr_bycnt = 0;
-    rsd->dr_cmd = 0;
-    rsd->currenttimo = 0;
-    return;
+       register struct dr_aux *rsd;
+
+       rsd = &dr_aux[ui->ui_unit];
+       rsd->dr_flags = DR_PRES;                /* This dr11 is present */
+       rsd->dr_addr = (struct rsdevice *)ui->ui_addr; /* Save addr of this dr11 */
+       rsd->dr_istat = 0;
+       rsd->dr_bycnt = 0;
+       rsd->dr_cmd = 0;
+       rsd->currenttimo = 0;
 }
 
 }
 
-dropen (dev, flag)
-dev_t dev;
-int flag;
+/*ARGSUSED*/
+dropen(dev, flag)
+       dev_t dev;
+       int flag;
 {
 {
-    register int unit = RSUNIT(dev);
-    register struct rsdevice *dr;
-    register struct dr_aux *rsd;
-
-    if ((drinfo[unit] == 0) || (!drinfo[unit]->ui_alive))
-       return ENXIO;
-
-    dr = RSADDR(unit);
-    rsd = &dr_aux[unit];
-    if (rsd->dr_flags & DR_OPEN) {
+       register int unit = RSUNIT(dev);
+       register struct rsdevice *dr;
+       register struct dr_aux *rsd;
+
+       if (drinfo[unit] == 0 || !drinfo[unit]->ui_alive)
+               return (ENXIO);
+       dr = RSADDR(unit);
+       rsd = &dr_aux[unit];
+       if (rsd->dr_flags & DR_OPEN) {
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-       printf("\ndropen: dr11 unit %ld already open",unit);
+               printf("\ndropen: dr11 unit %ld already open",unit);
 #endif
 #endif
-       return ENXIO;                   /* DR11 already open */
-    }
-    rsd->dr_flags |= DR_OPEN;          /* Mark it OPEN */
-    rsd->dr_istat = 0;                 /* Clear status of previous interrupt */
-    rsd->rtimoticks = hz;              /* Set read no stall timout to 1 sec */
-    rsd->wtimoticks = hz*60;           /* Set write no stall timout to 1 min */
-    dr->dr_cstat = DR_ZERO;            /* Clear function & latches */
-    dr->dr_pulse = (RDMA | RATN);      /* clear leftover attn & e-o-r flags */
-    drtimo(dev);                       /* start the self kicker */
-    return 0;
+               return (ENXIO);                 /* DR11 already open */
+       }
+       rsd->dr_flags |= DR_OPEN;       /* Mark it OPEN */
+       rsd->dr_istat = 0;              /* Clear status of previous interrupt */
+       rsd->rtimoticks = hz;           /* Set read no stall timout to 1 sec */
+       rsd->wtimoticks = hz*60;        /* Set write no stall timout to 1 min */
+       dr->dr_cstat = DR_ZERO;         /* Clear function & latches */
+       dr->dr_pulse = (RDMA | RATN);   /* clear leftover attn & e-o-r flags */
+       drtimo(dev);                    /* start the self kicker */
+       return (0);
 }
 
 drclose (dev)
 }
 
 drclose (dev)
-dev_t dev;
+       dev_t dev;
 {
 {
-    register int unit = RSUNIT(dev);
-    register struct dr_aux *dra;
-    register struct rsdevice *rs;
-    register short s;
+       register int unit = RSUNIT(dev);
+       register struct dr_aux *dra;
+       register struct rsdevice *rs;
+       register short s;
 
 
-    dra = &dr_aux[unit];
-    if (!(dra->dr_flags & DR_OPEN)) {
+       dra = &dr_aux[unit];
+       if ((dra->dr_flags & DR_OPEN) == 0) {
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-       printf("\ndrclose: DR11 device %ld not open",unit);
+               printf("\ndrclose: DR11 device %ld not open",unit);
 #endif
 #endif
-       return;
-    }
-    dra->dr_flags &= ~(DR_OPEN|DR_ACTV);
-    rs = dra->dr_addr;
-    s=SPL_UP();
-    rs->dr_cstat = DR_ZERO;
-    if (dra->dr_buf.b_flags & B_BUSY) {
-       dra->dr_buf.b_flags &= ~B_BUSY;
-       wakeup(&dra->dr_buf.b_flags);
-    }
-    splx(s);
-    return;
+               return;
+       }
+       dra->dr_flags &= ~(DR_OPEN|DR_ACTV);
+       rs = dra->dr_addr;
+       s = SPL_UP();
+       rs->dr_cstat = DR_ZERO;
+       if (dra->dr_buf.b_flags & B_BUSY) {
+               dra->dr_buf.b_flags &= ~B_BUSY;
+               wakeup((caddr_t)&dra->dr_buf.b_flags);
+       }
+       splx(s);
 }
 
 
 }
 
 
@@ -169,467 +152,419 @@ dev_t dev;
        B_READ flag is used when physio() is called
 */
 drread (dev, uio)
        B_READ flag is used when physio() is called
 */
 drread (dev, uio)
-dev_t dev;
-struct uio *uio;
+       dev_t dev;
+       struct uio *uio;
 {      register struct dr_aux *dra;
        register struct buf *bp;
 {      register struct dr_aux *dra;
        register struct buf *bp;
-       register long spl, err;
-       register int unit = RSUNIT(dev);
-
-    if (   uio->uio_iov->iov_len <= 0          /* Negative count */
-       || uio->uio_iov->iov_len & 1            /* odd count */
-       || (int)uio->uio_iov->iov_base & 1      /* odd destination address */
-       )
-       return EINVAL;
+       register int spl, err;
+       register int unit = RSUNIT(dev);
 
 
+       if (uio->uio_iov->iov_len <= 0 ||       /* Negative count */
+           uio->uio_iov->iov_len & 1 ||        /* odd count */
+           (int)uio->uio_iov->iov_base & 1)    /* odd destination address */
+               return (EINVAL);
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    if (DR11 & 8) {
-       printf("\ndrread: (len:%ld)(base:%lx)",
-               uio->uio_iov->iov_len,(int)uio->uio_iov->iov_base); 
-    }
+       if (DR11 & 8)
+               printf("\ndrread: (len:%ld)(base:%lx)",
+                   uio->uio_iov->iov_len,(int)uio->uio_iov->iov_base); 
 #endif
 #endif
-
-    dra = &dr_aux[RSUNIT(dev)];
-    dra->dr_op = DR_READ;
-    bp =  &dra->dr_buf;
-    bp->b_resid = 0;
-    if (dra->dr_flags & DR_NORSTALL) {
-       /* We are in no stall mode, start the timer, raise IPL so nothing
-          can stop us once the timer's running */
-       spl = SPL_UP();
-       timeout(drrwtimo,(caddr_t)((dra->currenttimo<<8) | unit),
-                               dra->rtimoticks);
-       err = physio (drstrategy, bp, dev,B_READ, drminphys, uio);
-       splx(spl);
-       if (err)
-               return(err);
-       dra->currenttimo++;             /* Update current timeout number */
-       /* Did we timeout */
-       if (dra->dr_flags & DR_TMDM) {
-               dra->dr_flags &= ~DR_TMDM;      /* Clear timeout flag */
-               u.u_error = 0;          /* Made the error ourself, ignore it */
+       dra = &dr_aux[RSUNIT(dev)];
+       dra->dr_op = DR_READ;
+       bp =  &dra->dr_buf;
+       bp->b_resid = 0;
+       if (dra->dr_flags & DR_NORSTALL) {
+               /*
+                * We are in no stall mode, start the timer,
+                * raise IPL so nothing can stop us once the
+                * timer's running
+                */
+               spl = SPL_UP();
+               timeout(drrwtimo, (caddr_t)((dra->currenttimo<<8) | unit),
+                   (int)dra->rtimoticks);
+               err = physio(drstrategy, bp, dev,B_READ, drminphys, uio);
+               splx(spl);
+               if (err)
+                       return (err);
+               dra->currenttimo++;     /* Update current timeout number */
+               /* Did we timeout */
+               if (dra->dr_flags & DR_TMDM) {
+                       dra->dr_flags &= ~DR_TMDM; /* Clear timeout flag */
+                       u.u_error = 0;  /* Made the error ourself, ignore it */
+               }
+               return (err);
        }
        }
-    }
-    else {
-       return physio (drstrategy, bp, dev,B_READ, drminphys, uio);
-    }
+       return (physio(drstrategy, bp, dev,B_READ, drminphys, uio));
 }
 
 }
 
-drwrite (dev, uio)
-dev_t dev;
-struct uio *uio;
+drwrite(dev, uio)
+       dev_t dev;
+       struct uio *uio;
 {      register struct dr_aux *dra;
        register struct buf *bp;
 {      register struct dr_aux *dra;
        register struct buf *bp;
-       register int unit = RSUNIT(dev);
-       register long spl, err;
-
-    if (   uio->uio_iov->iov_len <= 0
-       || uio->uio_iov->iov_len & 1
-       || (int)uio->uio_iov->iov_base & 1
-       )
-       return EINVAL;
+       register int unit = RSUNIT(dev);
+       int spl, err;
 
 
+       if (uio->uio_iov->iov_len <= 0 || uio->uio_iov->iov_len & 1 ||
+           (int)uio->uio_iov->iov_base & 1)
+               return (EINVAL);
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    if (DR11 & 4) {
-       printf("\ndrwrite: (len:%ld)(base:%lx)",
-               uio->uio_iov->iov_len,(int)uio->uio_iov->iov_base); 
-    }
+       if (DR11 & 4)
+               printf("\ndrwrite: (len:%ld)(base:%lx)",
+                   uio->uio_iov->iov_len,(int)uio->uio_iov->iov_base); 
 #endif
 #endif
-
-    dra = &dr_aux[RSUNIT(dev)];
-    dra->dr_op = DR_WRITE;
-    bp =  &dra->dr_buf;
-    bp->b_resid = 0;
-    if (dra->dr_flags & DR_NOWSTALL) {
-       /* We are in no stall mode, start the timer, raise IPL so nothing
-          can stop us once the timer's running */
-       spl = SPL_UP();
-       timeout(drrwtimo,(caddr_t)((dra->currenttimo<<8) | unit),
-                               dra->wtimoticks);
-       err = physio (drstrategy, bp, dev,B_WRITE, drminphys, uio);
-       splx(spl);
-       if (err)
-               return(err);
-       dra->currenttimo++;             /* Update current timeout number */
-       /* Did we timeout */
-       if (dra->dr_flags & DR_TMDM) {
-               dra->dr_flags &= ~DR_TMDM;      /* Clear timeout flag */
-               u.u_error = 0;          /* Made the error ourself, ignore it */
+       dra = &dr_aux[RSUNIT(dev)];
+       dra->dr_op = DR_WRITE;
+       bp =  &dra->dr_buf;
+       bp->b_resid = 0;
+       if (dra->dr_flags & DR_NOWSTALL) {
+               /*
+                * We are in no stall mode, start the timer,
+                * raise IPL so nothing can stop us once the
+                * timer's running
+                */
+               spl = SPL_UP();
+               timeout(drrwtimo,(caddr_t)((dra->currenttimo<<8) | unit),
+                   (int)dra->wtimoticks);
+               err = physio (drstrategy, bp, dev,B_WRITE, drminphys, uio);
+               splx(spl);
+               if (err)
+                       return (err);
+               dra->currenttimo++;     /* Update current timeout number */
+               /* Did we timeout */
+               if (dra->dr_flags & DR_TMDM) {
+                       dra->dr_flags &= ~DR_TMDM;      /* Clear timeout flag */
+                       u.u_error = 0;  /* Made the error ourself, ignore it */
+               }
+               return (err);
        }
        }
-    }
-    else {
-       return physio (drstrategy, bp, dev,B_WRITE, drminphys, uio);
-    }
+       return (physio(drstrategy, bp, dev,B_WRITE, drminphys, uio));
 }
 
 }
 
-/*  Routine used by calling program to issue commands to dr11 driver and 
-    through it to the device.
-    It is also used to read status from the device and driver and to wait 
-    for attention interrupts.
-    Status is returned in an 8 elements unsigned short integer array, the 
-    first two elements of the array are also used to pass arguments to 
-    drioctl() if required.
-    The function bits to be written to the dr11 are included in the cmd
-    argument. Even if they are not being written to the dr11 in a particular
-    drioctl() call, they will update the copy of cmd that is stored in the
-    driver. When drstrategy() is called, this updated copy is used if a 
-    deferred function bit write has been specified. The "side effect" of
-    calls to the drioctl() requires that the last call prior to a read or
-    write has an appropriate copy of the function bits in cmd if they are
-    to be used in drstrategy().
-    When used as command value, the contents of data[0] is the command
-    parameter.
-*/
-
-drioctl(dev, cmd, data, flag)
-dev_t dev;
-int cmd;
-long *data;
-int flag;
+/*
+ * Routine used by calling program to issue commands to dr11 driver and 
+ * through it to the device.
+ * It is also used to read status from the device and driver and to wait 
+ * for attention interrupts.
+ * Status is returned in an 8 elements unsigned short integer array, the 
+ * first two elements of the array are also used to pass arguments to 
+ * drioctl() if required.
+ * The function bits to be written to the dr11 are included in the cmd
+ * argument. Even if they are not being written to the dr11 in a particular
+ * drioctl() call, they will update the copy of cmd that is stored in the
+ * driver. When drstrategy() is called, this updated copy is used if a 
+ * deferred function bit write has been specified. The "side effect" of
+ * calls to the drioctl() requires that the last call prior to a read or
+ * write has an appropriate copy of the function bits in cmd if they are
+ * to be used in drstrategy().
+ * When used as command value, the contents of data[0] is the command
+ * parameter.
+ */
+drioctl(dev, cmd, data)
+       dev_t dev;
+       int cmd;
+       long *data;
 {
 {
-    register int unit = RSUNIT(dev);
-    register struct dr_aux *dra;
-    register struct rsdevice *rsaddr = RSADDR(unit);
-    struct dr11io dio;
-    ushort s, errcode, status;
-    long temp;
+       register int unit = RSUNIT(dev);
+       register struct dr_aux *dra;
+       register struct rsdevice *rsaddr = RSADDR(unit);
+       int s;
+       u_short status;
+       long temp;
+
+#ifdef DR_DEBUG
+       if (DR11 & 0x10)
+               printf("\ndrioctl: (dev:%lx)(cmd:%lx)(data:%lx)(data[0]:%lx)",
+                   dev,cmd,data,data[0]);
+#endif
+       dra = &dr_aux[unit];
+       dra->dr_cmd = 0;        /* Fresh copy; clear all previous flags */
+       switch (cmd) {
 
 
+       case DRWAIT:            /* Wait for attention interrupt */
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    if (DR11 & 0x10)
-    printf("\ndrioctl: (dev:%lx)(cmd:%lx)(data:%lx)(data[0]:%lx)",
-       dev,cmd,data,data[0]);
+               printf("\ndrioctl: wait for attention interrupt");
 #endif
 #endif
+               s = SPL_UP();
+               /* 
+                * If the attention flag in dr_flags is set, it probably
+                * means that an attention has arrived by the time a
+                * previous DMA end-of-range interrupt was serviced. If
+                * ATRX is set, we will return with out sleeping, since
+                * we have received an attention since the last call to
+                * wait on attention.  This may not be appropriate for
+                * some applications.
+                */
+               if ((dra->dr_flags & DR_ATRX) == 0) {
+                       dra->dr_flags |= DR_ATWT;       /* Set waiting flag */
+                       /*
+                        * Enable interrupt; use pulse reg.
+                        * so function bits are not changed
+                        */
+                       rsaddr->dr_pulse = IENB;
+                       sleep((caddr_t)&dra->dr_cmd, DRPRI);
+               }
+               splx(s);
+               break;
+
+       case DRPIOW:                    /* Write to p-i/o register */
+               rsaddr->dr_data = data[0];
+               break;
+
+       case DRPACL:                    /* Send pulse to device */
+               rsaddr->dr_pulse = FCN2;
+               break;
+
+       case DRDACL:                    /* Defer alco pulse until go */
+               dra->dr_cmd |= DR_DACL;
+               break;
+
+       case DRPCYL:                    /* Set cycle with next go */
+               dra->dr_cmd |= DR_PCYL;
+               break;
+
+       case DRDFCN:                    /* Update function with next go */
+               dra->dr_cmd |= DR_DFCN;
+               break;
+
+       case DRRATN:                    /* Reset attention flag */
+               rsaddr->dr_pulse = RATN;
+               break;
+
+       case DRRDMA:                    /* Reset DMA e-o-r flag */
+               rsaddr->dr_pulse = RDMA;
+               break;
+
+       case DRSFCN:                    /* Set function bits */
+               temp = data[0] & DR_FMSK;
+               /*
+                * This has a very important side effect -- It clears
+                * the interrupt enable flag. That is fine for this driver,
+                * but if it is desired to leave interrupt enable at all
+                * times, it will be necessary to read the status register
+                * first to get IENB, or carry a software flag that indicates
+                * whether interrupts are set, and or this into the control
+                * register value being written.
+                */
+               rsaddr->dr_cstat = temp;
+               break;
+
+       case DRRPER:                    /* Clear parity flag */
+               rsaddr->dr_pulse = RPER;
+               break;
+
+       case DRSETRSTALL:               /* Set read stall mode. */
+               dra->dr_flags &= (~DR_NORSTALL);
+               break;
+
+       case DRSETNORSTALL:             /* Set no stall read  mode. */
+               dra->dr_flags |= DR_NORSTALL;
+               break;
+
+       case DRGETRSTALL:               /* Returns true if in read stall mode */
+               data[0]  = (dra->dr_flags & DR_NORSTALL)? 0 : 1;
+               break;
+
+       case DRSETRTIMEOUT:             /* Set read stall timeout (1/10 secs) */
+               if (data[0] < 1) {
+                       u.u_error = EINVAL;
+                       temp = 1;
+               }
+               dra->rtimoticks = (data[0] * hz )/10;
+               break;
 
 
-    dra = &dr_aux[unit];
-    dra->dr_cmd = 0;           /* Fresh copy; clear all previous flags */
+       case DRGETRTIMEOUT:             /* Return read stall timeout */
+               data[0] = ((dra->rtimoticks)*10)/hz;
+               break;
 
 
-    switch (cmd) {
+       case DRSETWSTALL:               /* Set write stall mode. */
+               dra->dr_flags &= (~DR_NOWSTALL);
+               break;
 
 
-    case DRWAIT:
-       /* Wait for attention interrupt */
-#ifdef DR_DEBUG
-       printf("\ndrioctl: wait for attention interrupt");
+       case DRSETNOWSTALL:             /* Set write stall mode. */
+               dra->dr_flags |= DR_NOWSTALL;
+               break;
+
+       case DRGETWSTALL:               /* Return true if in write stall mode */
+               data[0] = (dra->dr_flags & DR_NOWSTALL)? 0 : 1;
+               break;
+
+       case DRSETWTIMEOUT:             /* Set write stall timeout (1/10's) */
+               if (data[0] < 1) {
+                       u.u_error = EINVAL;
+                       temp = 1;
+               }
+               dra->wtimoticks = (data[0] * hz )/10;
+               break;
+
+       case DRGETWTIMEOUT:             /* Return write stall timeout */
+               data[0] = ((dra->wtimoticks)*10)/hz;
+               break;
+
+       case DRWRITEREADY:              /* Return true if can write data */
+               data[0] = (rsaddr->dr_cstat & STTA)? 1 : 0;
+               break;
+
+       case DRREADREADY:               /* Return true if data to be read */
+               data[0] = (rsaddr->dr_cstat & STTB)? 1 : 0;
+               break;
+
+       case DRBUSY:                    /* Return true if device busy */
+               /*
+                * Internally this is the DR11-W
+                * STAT C bit, but there is a bug in the Omega 500/FIFO
+                * interface board that it cannot drive this signal low
+                * for certain DR11-W ctlr such as the Ikon. We use the
+                * REDY signal of the CSR on the Ikon DR11-W instead. 
+                */
+#ifdef notdef
+               data[0] = (rsaddr->dr_cstat & STTC)? 1 : 0;
+#else
+               data[0] = ((rsaddr->dr_cstat & REDY)? 0 : 1);
 #endif
 #endif
-       s = SPL_UP();
-       /* If the attention flag in dr_flags is set, it probably means that
-          an attention has arrived by the time a previous DMA end-of-range
-          interrupt was serviced. If ATRX is set, we will return with out
-          sleeping, since we have received an attention since the last call
-          to wait on attention.
-          This may not be appropriate for some applications.
-       */
-       if (!(dra->dr_flags & DR_ATRX)) {
-               dra->dr_flags |= DR_ATWT;       /* Set waiting flag */
-               rsaddr->dr_pulse = IENB;        /* Enable interrupt; use pulse
-                                                  reg. so function bits are
-                                                  not changed */
-               sleep((caddr_t)&dra->dr_cmd,DRPRI);
-       }
-       splx(s);
-       break;
-
-    case DRPIOW:
-       /* Write to p-i/o register */
-       rsaddr->dr_data = data[0];
-       break;
-
-    case DRPACL:
-       /* Send pulse to device */
-       rsaddr->dr_pulse = FCN2;
-       break;
-
-    case DRDACL:
-       /* Defer alco pulse until go */
-       dra->dr_cmd |= DR_DACL;
-       break;
-
-    case DRPCYL:
-       /* Set cycle with next go */
-       dra->dr_cmd |= DR_PCYL;
-       break;
-
-    case DRDFCN:
-       /* Do not update function bits until next go issued */
-       dra->dr_cmd |= DR_DFCN;
-       break;
-
-    case DRRATN:
-       /* Reset attention flag -- use with extreme caution */
-       rsaddr->dr_pulse = RATN;
-       break;
-
-    case DRRDMA:
-       /* Reset DMA e-o-r flag -- should never used */
-       rsaddr->dr_pulse = RDMA;
-       break;
-
-    case DRSFCN:
-       /* Set function bits */
-       temp = data[0] & DR_FMSK;
-       rsaddr->dr_cstat = temp;        /* Write to control register */
-       /* This has a very important side effect -- It clears the interrupt
-          enable flag. That is fine for this driver, but if it is desired
-          to leave interrupt enable at all times, it will be necessary to
-          to read the status register first to get IENB, or carry a software
-          flag that indicates whether interrupts are set, and or this into 
-          the controll register value being written.
-       */
-       break;
-
-    case DRRPER:
-       /* Clear parity flag */
-       rsaddr->dr_pulse = RPER;
-       break;
-
-    case DRSETRSTALL:
-       /* Set read stall mode. */
-       dra->dr_flags &= (~DR_NORSTALL);
-       break;
-
-    case DRSETNORSTALL:
-       /* Set no stall read  mode. */
-       dra->dr_flags |= DR_NORSTALL;
-       break;
-
-    case DRGETRSTALL:
-       /* Returns true if in read stall mode. */
-       data[0]  = (dra->dr_flags & DR_NORSTALL)? 0 : 1;
-       break;
-
-    case DRSETRTIMEOUT:
-       /* Set the number of ticks before a no stall read times out.
-          The argument is given in tenths of a second. */
-       if (data[0] < 1) {
-               u.u_error = EINVAL;
-               temp = 1;
+               break;
+
+       case DRRESET:                   /* Reset device */
+               /* Reset DMA ATN RPER flag */
+               rsaddr->dr_pulse = (MCLR|RDMA|RATN|RPER);
+               DELAY(0x1f000);
+               while ((rsaddr->dr_cstat & REDY) == 0)
+                       sleep((caddr_t)dra, DRPRI);     /* Wakeup by drtimo() */
+               dra->dr_istat = 0;
+               dra->dr_cmd = 0;
+               dra->currenttimo = 0;
+               break;
+
+       case DR11STAT: {                /* Copy back dr11 status to user */
+               register struct dr11io *dr = (struct dr11io *)data;
+               dr->arg[0] = dra->dr_flags;
+               dr->arg[1] = rsaddr->dr_cstat;
+               dr->arg[2] = dra->dr_istat;     /* Status at last interrupt */
+               dr->arg[3] = rsaddr->dr_data;   /* P-i/o input data */
+               status = (u_short)((rsaddr->dr_addmod << 8) & 0xff00);
+               dr->arg[4] = status | (u_short)(rsaddr->dr_intvect & 0xff);
+               dr->arg[5] = rsaddr->dr_range;
+               dr->arg[6] = rsaddr->dr_rahi;
+               dr->arg[7] = rsaddr->dr_ralo;
+               break;
        }
        }
-       dra->rtimoticks = (data[0] * hz )/10;
-       break;
-
-    case DRGETRTIMEOUT:
-       /* Returns the number of tenths of seconds before
-          a no stall read times out. */
-       /* The argument is given in tenths of a second. */
-       data[0] = ((dra->rtimoticks)*10)/hz;
-       break;
-
-    case DRSETWSTALL:
-       /* Set write stall mode. */
-       dra->dr_flags &= (~DR_NOWSTALL);
-       break;
-
-    case DRSETNOWSTALL:
-       /* Set write stall mode. */
-       dra->dr_flags |= DR_NOWSTALL;
-       break;
-
-    case DRGETWSTALL:
-       /* Returns true if in write stall mode. */
-       data[0] = (dra->dr_flags & DR_NOWSTALL)? 0 : 1;
-       break;
-
-    case DRSETWTIMEOUT:
-       /* Set the number of ticks before a no stall write times out.
-          The argument is given in tenths of a second. */
-       if (data[0] < 1) {
-               u.u_error = EINVAL;
-               temp = 1;
+       case DR11LOOP:                  /* Perform loopback test */
+               /*
+                * NB: MUST HAVE LOOPBACK CABLE ATTACHED --
+                * Test results are printed on system console
+                */
+               if (suser())
+                       dr11loop(rsaddr, dra, unit);
+               break;
+
+       default:
+               return (EINVAL);
        }
        }
-       dra->wtimoticks = (data[0] * hz )/10;
-       break;
-
-    case DRGETWTIMEOUT:
-       /* Returns the number of tenths of seconds before
-          a no stall write times out. */
-       /* The argument is given in tenths of a second. */
-       data[0] = ((dra->wtimoticks)*10)/hz;
-       break;
-
-    case DRWRITEREADY:
-       /* Returns a value of 1 if the device can accept
-          data, 0 otherwise. Internally this is the
-          DR11-W STAT A bit. */
-
-       data[0] = (rsaddr->dr_cstat & STTA)? 1 : 0;
-       break;
-
-    case DRREADREADY:
-       /* Returns a value of 1 if the device has data
-          for host to be read, 0 otherwise. Internally
-          this is the DR11-W STAT B bit. */
-       data[0] = (rsaddr->dr_cstat & STTB)? 1 : 0;
-       break;
-
-    case DRBUSY:
-       /* Returns a value of 1 if the device is busy,
-          0 otherwise. Internally this is the DR11-W
-          STAT C bit, but there is a bug in the Omega 500/FIFO interface
-          board that it cannot drive this signal low for certain DR11-W
-          ctlr such as the Ikon. We use the REDY signal of the CSR on
-          the Ikon DR11-W instead. 
-
-       data[0] = (rsaddr->dr_cstat & STTC)? 1 : 0;
-       */
-
-       data[0] = ((rsaddr->dr_cstat & REDY)? 0 : 1);
-       break;
-
-    case DRRESET:
-       rsaddr->dr_pulse = (MCLR|RDMA|RATN|RPER);/* Reset DMA ATN RPER flag */
-       DELAY(0x1f000);
-       while (!(rsaddr->dr_cstat & REDY)) {
-               sleep((caddr_t)dra, DRPRI);     /* Wakeup by drtimo() */
-       }
-       dra->dr_istat = 0;
-       dra->dr_cmd = 0;
-       dra->currenttimo = 0;
-       break;
-
-    case DR11STAT: {
-       register struct dr11io *dr = (struct dr11io *)data;
-       /* Copy back dr11 status to user */
-       dr->arg[0] = dra->dr_flags;
-       dr->arg[1] = rsaddr->dr_cstat;
-       dr->arg[2] = dra->dr_istat;     /* Status reg. at last interrupt */
-       dr->arg[3] = rsaddr->dr_data;   /* P-i/o input data */
-       status = (ushort)((rsaddr->dr_addmod << 8) & 0xff00);
-       dr->arg[4] = status | (ushort)(rsaddr->dr_intvect & 0xff);
-       dr->arg[5] = rsaddr->dr_range;
-       dr->arg[6] = rsaddr->dr_rahi;
-       dr->arg[7] = rsaddr->dr_ralo;
-       break;
-    }
-    case DR11LOOP:
-       /* Perform loopback test -- MUST HAVE LOOPBACK CABLE ATTACHED --
-          Test results are printed on system console */
-       if (suser())
-               dr11loop(rsaddr,dra,unit);
-       break;
-
-    default:
-       printf("\ndrioctl: Invalid ioctl cmd : %lx",cmd);
-       return EINVAL;
-    }
-
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    if (DR11 & 0x10)
-       printf("**** (data[0]:%lx)",data[0]);
+       if (DR11 & 0x10)
+               printf("**** (data[0]:%lx)",data[0]);
 #endif
 #endif
-    return 0;
+       return (0);
 }
 
 }
 
-#define NPAT 2
-#define DMATBL 20
-ushort tstpat[DMATBL] = { 0xAAAA, 0x5555};
-long DMAin = 0;
+#define NPAT   2
+#define DMATBL 20
+u_short        tstpat[DMATBL] = { 0xAAAA, 0x5555};
+long   DMAin = 0;
 
 
-dr11loop(dr,dra,unit)
-struct rsdevice *dr;
-struct dr_aux *dra;
-long unit;
-{      register long result, ix;
-       long baddr, wait;
+/*
+ * Perform loopback test -- MUST HAVE LOOPBACK CABLE ATTACHED
+ * Test results are printed on system console
+ */
+dr11loop(dr, dra, unit)
+       struct rsdevice *dr;
+       struct dr_aux *dra;
+       int unit;
+{
+       register long result, ix;
+       long addr, wait;
 
        dr->dr_cstat = MCLR;            /* Clear board & device, disable intr */
 
        dr->dr_cstat = MCLR;            /* Clear board & device, disable intr */
-
-       /* Perform loopback test -- MUST HAVE LOOPBACK CABLE ATTACHED --
-          Test results are printed on system console */
-       printf("\n\t ----- DR11 unit %ld loopback test -----",unit);
-
+       printf("\n\t ----- DR11 unit %ld loopback test -----", unit);
        printf("\n\t Program I/O ...");
        for (ix=0;ix<NPAT;ix++) {
                dr->dr_data = tstpat[ix];       /* Write to Data out register */
        printf("\n\t Program I/O ...");
        for (ix=0;ix<NPAT;ix++) {
                dr->dr_data = tstpat[ix];       /* Write to Data out register */
-               result = (dr->dr_data & 0xFFFF);        /* Read it back */
+               result = dr->dr_data & 0xFFFF;  /* Read it back */
                if (result != tstpat[ix]) {
                        printf("Failed, expected : %lx --- actual : %lx",
                if (result != tstpat[ix]) {
                        printf("Failed, expected : %lx --- actual : %lx",
-                               tstpat[ix],result);
+                               tstpat[ix], result);
                        return;
                }
        }
                        return;
                }
        }
-
        printf("OK\n\t Functions & Status Bits ...");
        dr->dr_cstat = (FCN1 | FCN3);
        result = dr->dr_cstat & 0xffff;         /* Read them back */
        if ((result & (STTC | STTA)) != (STTC |STTA)) {
                printf("Failed, expected : %lx --- actual : %lx, ISR:%lx",
        printf("OK\n\t Functions & Status Bits ...");
        dr->dr_cstat = (FCN1 | FCN3);
        result = dr->dr_cstat & 0xffff;         /* Read them back */
        if ((result & (STTC | STTA)) != (STTC |STTA)) {
                printf("Failed, expected : %lx --- actual : %lx, ISR:%lx",
-                       (STTA|STTC),(result & (STTA|STTC)), result);
+                       (STTA|STTC), (result & (STTA|STTC)), result);
                return;
        }
        dr->dr_cstat = FCN2;
        result = dr->dr_cstat & 0xffff;         /* Read them back */
        if ((result & STTB) != STTB) {
                printf("Failed, expected : %lx --- actual : %lx, ISR:%lx",
                return;
        }
        dr->dr_cstat = FCN2;
        result = dr->dr_cstat & 0xffff;         /* Read them back */
        if ((result & STTB) != STTB) {
                printf("Failed, expected : %lx --- actual : %lx, ISR:%lx",
-                       STTB,(result & STTB), result);
+                       STTB, (result & STTB), result);
                return;
        }
                return;
        }
-
        printf("OK\n\t DMA output ...");
        printf("OK\n\t DMA output ...");
-
-       if (DMAin) goto dmain;
-
+       if (DMAin)
+               goto dmain;
        /* Initialize DMA data buffer */
        /* Initialize DMA data buffer */
-       for(ix=0;ix<DMATBL;ix++) tstpat[ix] = 0xCCCC + ix;
+       for (ix=0; ix<DMATBL; ix++)
+               tstpat[ix] = 0xCCCC + ix;
        tstpat[DMATBL-1] = 0xCCCC;      /* Last word output */
        tstpat[DMATBL-1] = 0xCCCC;      /* Last word output */
-
        /* Setup normal DMA */
        /* Setup normal DMA */
-       baddr = (long)vtoph(0,tstpat);          /* Virtual --> physical */
-       dr->dr_walo = (ushort)((baddr >> 1) & 0xffff);
-       dr->dr_wahi = (ushort)((baddr >> 17) & 0x7fff);
-
-       /* Set DMA range count: (number of words - 1) */
-       dr->dr_range = (ushort)(DMATBL - 1);
-
-       /* Set  address modifier code to be used for DMA access to memory */
-       dr->dr_addmod = (char)DRADDMOD;
-
-       /* Clear dmaf and attf to assure a clean dma start, also disable
-          attention interrupt
-       */
-       dr->dr_pulse = (ushort)(RDMA|RATN|RMSK);  /* Use pulse register */
-       dr->dr_cstat = (GO|CYCL);                 /* GO...... */
+       addr = (long)vtoph((struct proc *)0, (unsigned)tstpat);
+       dr->dr_walo = (addr >> 1) & 0xffff;
+       dr->dr_wahi = (addr >> 17) & 0x7fff;
+       /* Set DMA range count: (number of words - 1) */
+       dr->dr_range = DMATBL - 1;
+       /* Set address modifier code to be used for DMA access to memory */
+       dr->dr_addmod = DRADDMOD;
+
+       /*
+        * Clear dmaf and attf to assure a clean dma start, also disable
+        * attention interrupt
+        */
+       dr->dr_pulse = RDMA|RATN|RMSK;  /* Use pulse register */
+       dr->dr_cstat = GO|CYCL;           /* GO...... */
 
        /* Wait for DMA complete; REDY and DMAF are true in ISR */
        wait = 0;
 
        /* Wait for DMA complete; REDY and DMAF are true in ISR */
        wait = 0;
-       while ((result=(dr->dr_cstat & (REDY | DMAF))) != (REDY|DMAF)) {
-               printf("\n\tWait for DMA complete...ISR : %lx",result);
+       while ((result=(dr->dr_cstat & (REDY|DMAF))) != (REDY|DMAF)) {
+               printf("\n\tWait for DMA complete...ISR : %lx", result);
                if (++wait > 5) {
                        printf("\n\t DMA output fails...timeout!!, ISR:%lx",
                                result);
                        return;
                }
        }
                if (++wait > 5) {
                        printf("\n\t DMA output fails...timeout!!, ISR:%lx",
                                result);
                        return;
                }
        }
-
        result = dr->dr_data & 0xffff;          /* Read last word output */     
        if (result != 0xCCCC) {
                printf("\n\t Fails, expected : %lx --- actual : %lx",
        result = dr->dr_data & 0xffff;          /* Read last word output */     
        if (result != 0xCCCC) {
                printf("\n\t Fails, expected : %lx --- actual : %lx",
-                       0xCCCC,result);
+                       0xCCCC, result);
                return;
        }
                return;
        }
-
        printf("OK\n\t DMA input ...");
        printf("OK\n\t DMA input ...");
-
 dmain:
        dr->dr_data = 0x1111;           /* DMA input data */
        /* Setup normal DMA */
 dmain:
        dr->dr_data = 0x1111;           /* DMA input data */
        /* Setup normal DMA */
-       baddr = (long)vtoph(0,tstpat);          /* Virtual --> physical */
-       dr->dr_walo = (ushort)((baddr >> 1) & 0xffff);
-       dr->dr_wahi = (ushort)((baddr >> 17) & 0x7fff);
-
-       /* Set DMA range count: (number of words - 1) */
-       dr->dr_range = (ushort)(DMATBL - 1);
-
-       /* Set  address modifier code to be used for DMA access to memory */
-       dr->dr_addmod = (char)DRADDMOD;
-       /* Set FCN1 in ICR to DMA in*/
-       dr->dr_cstat = FCN1;
-
-       if (!(dra->dr_flags & DR_LOOPTST)) {
+       addr = (long)vtoph((struct proc *)0, (unsigned)tstpat);
+       dr->dr_walo = (addr >> 1) & 0xffff;
+       dr->dr_wahi = (addr >> 17) & 0x7fff;
+       dr->dr_range = DMATBL - 1;
+       dr->dr_addmod = (char)DRADDMOD;
+       dr->dr_cstat = FCN1;            /* Set FCN1 in ICR to DMA in*/
+       if ((dra->dr_flags & DR_LOOPTST) == 0) {
                /* Use pulse reg */  
                /* Use pulse reg */  
-               dr->dr_pulse = (ushort)(RDMA|RATN|RMSK|CYCL|GO);
+               dr->dr_pulse = RDMA|RATN|RMSK|CYCL|GO;
                /* Wait for DMA complete; REDY and DMAF are true in ISR */
                wait = 0;
                /* Wait for DMA complete; REDY and DMAF are true in ISR */
                wait = 0;
-               while ((result=(dr->dr_cstat & (REDY | DMAF))) 
-                                               != (REDY|DMAF)) {
+               while ((result=(dr->dr_cstat & (REDY|DMAF))) != (REDY|DMAF)) {
                        printf("\n\tWait for DMA to complete...ISR:%lx",result);
                        if (++wait > 5) {
                                printf("\n\t DMA input timeout!!, ISR:%lx",
                        printf("\n\tWait for DMA to complete...ISR:%lx",result);
                        if (++wait > 5) {
                                printf("\n\t DMA input timeout!!, ISR:%lx",
@@ -637,15 +572,14 @@ dmain:
                                return;
                        }
                }
                                return;
                        }
                }
-       }
-       else  {
+       } else  {
                /* Enable DMA e-o-r interrupt */
                /* Enable DMA e-o-r interrupt */
-               dr->dr_pulse = (ushort)(IENB|RDMA|RATN|CYCL|GO);
+               dr->dr_pulse = IENB|RDMA|RATN|CYCL|GO;
                /* Wait for DMA complete; DR_LOOPTST is false in dra->dr_flags*/
                wait = 0;
                while (dra->dr_flags & DR_LOOPTST) { 
                        result = dr->dr_cstat & 0xffff;
                /* Wait for DMA complete; DR_LOOPTST is false in dra->dr_flags*/
                wait = 0;
                while (dra->dr_flags & DR_LOOPTST) { 
                        result = dr->dr_cstat & 0xffff;
-                       printf("\n\tWait for DMA e-o-r intr...ISR:%lx",result);
+                       printf("\n\tWait for DMA e-o-r intr...ISR:%lx", result);
                        if (++wait > 7) {
                                printf("\n\t DMA e-o-r timeout!!, ISR:%lx",
                                        result);
                        if (++wait > 7) {
                                printf("\n\t DMA e-o-r timeout!!, ISR:%lx",
                                        result);
@@ -655,28 +589,23 @@ dmain:
                }
                dra->dr_flags |= DR_LOOPTST;
        }
                }
                dra->dr_flags |= DR_LOOPTST;
        }
-
-       mtpr(tstpat,P1DC);                      /* Purge cache */
-       mtpr((0x3ff+(long)tstpat),P1DC);
-       for(ix=0;ix<DMATBL;ix++) {
+       mtpr(P1DC, tstpat);                     /* Purge cache */
+       mtpr(P1DC, 0x3ff+tstpat);
+       for (ix=0; ix<DMATBL; ix++) {
                if (tstpat[ix] != 0x1111) {
                if (tstpat[ix] != 0x1111) {
-                       printf("\n\t Fails, ix:%ld,expected : %lx --- actual : %lx",
-                               ix,0x1111,tstpat[ix]);
+                       printf("\n\t Fails, ix:%d, expected:%x --- actual:%x",
+                               ix, 0x1111, tstpat[ix]);
                        return;
                }
        }
                        return;
                }
        }
-       if (!(dra->dr_flags & DR_LOOPTST)) {
+       if ((dra->dr_flags & DR_LOOPTST) == 0) {
                dra->dr_flags |= DR_LOOPTST;
                printf(" OK..\n\tDMA end of range interrupt...");
                goto dmain;
        }
                dra->dr_flags |= DR_LOOPTST;
                printf(" OK..\n\tDMA end of range interrupt...");
                goto dmain;
        }
-
-
        printf(" OK..\n\tAttention interrupt....");
        printf(" OK..\n\tAttention interrupt....");
-       /* Pulse FCN2 in pulse register with IENB */
-       dr->dr_pulse = (ushort)(IENB|RDMA);
-       dr->dr_pulse = (ushort)FCN2;
-
+       dr->dr_pulse = IENB|RDMA;
+       dr->dr_pulse = FCN2;
        /* Wait for ATTN interrupt; DR_LOOPTST is false in dra->dr_flags*/
        wait = 0;
        while (dra->dr_flags & DR_LOOPTST) { 
        /* Wait for ATTN interrupt; DR_LOOPTST is false in dra->dr_flags*/
        wait = 0;
        while (dra->dr_flags & DR_LOOPTST) { 
@@ -694,310 +623,280 @@ dmain:
 }
 
 /* Reset state on Unibus reset */
 }
 
 /* Reset state on Unibus reset */
+/*ARGSUSED*/
 drreset(uban)
 drreset(uban)
-int uban;
+       int uban;
 {
 {
-    register int i;
-    register struct vba_device *ui;
-    register struct dr_aux *dra;
-
-    for (i = 0; i < NDR; i++, dra++) {
-       if (   (ui = drinfo[i]) == 0
-           || !ui->ui_alive
-           || ui->ui_vbanum != uban
-          )
-           continue;
-       printf("\ndrreset: %ld",i);
-       /* Do something; reset board */
-    }
-    return;
+
 }
 
 /*
  * An interrupt is caused either by an error,
  * base address overflow, or transfer complete
  */
 }
 
 /*
  * An interrupt is caused either by an error,
  * base address overflow, or transfer complete
  */
-drintr (unit)
-register long unit;
+drintr(dr11)
+       int dr11;
 {
 {
-    register struct dr_aux *dra = &dr_aux[unit];
-    register struct rsdevice *rsaddr = RSADDR(unit);
-    register struct buf *bp;
-    register short status, csrtmp;
-
-    status = rsaddr->dr_cstat & 0xffff;                /* get board status register */
-    dra->dr_istat = status;
+       register struct dr_aux *dra = &dr_aux[dr11];
+       register struct rsdevice *rsaddr = RSADDR(dr11);
+       register struct buf *bp;
+       register short status;
 
 
+       status = rsaddr->dr_cstat & 0xffff;     /* get board status register */
+       dra->dr_istat = status;
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    if (DR11 & 2)
-       printf("\ndrintr: dr11 status : %lx",status & 0xffff);
+       if (DR11 & 2)
+               printf("\ndrintr: dr11 status : %lx",status & 0xffff);
 #endif
 #endif
-
-    if (dra->dr_flags & DR_LOOPTST) {
-       /* Controller is doing loopback test */
-       dra->dr_flags &= ~DR_LOOPTST;
-       return;
-    }
-
-    /* Make sure this is not a stray interrupt; at least one of dmaf or attf
-       must be set. Note that if the dr11 interrupt enable latch is reset 
-       during a hardware interrupt ack sequence, and by the we get to this 
-       point in the interrupt code it will be 0. This is done to give the
-       programmer some control over how the two more-or-less independent
-       interrupt sources on the board are handled.
-       If the attention flag is set when drstrategy() is called to start a
-       dma read or write an interrupt will be generated as soon as the
-       strategy routine enables interrupts for dma end-of-range. This will
-       cause execution of the interrupt routine (not necessarily bad) and
-       will cause the interrupt enable mask to be reset (very bad since the
-       dma end-of-range condition will not be able to generate an interrupt
-       when it occurs) causing the dma operation to time-out (even though
-       the dma transfer will be done successfully) or hang the process if a
-       software time-out capability is not implemented. One way to avoid 
-       this situation is to check for a pending attention interrupt (attf
-       set) by calling drioctl() before doing a read or a write. For the
-       time being this driver will solve the problem by clearing the attf
-       flag in the status register before enabling interrupts in drstrategy().
-
-       **** The IKON 10084 for which this driver is written will set both
-       attf and dmaf if dma is terminated by an attention pulse. This will
-       cause a wakeup(&dr_aux), which will be ignored since it is not being 
-       waited on, and an iodone(bp) which is the desired action. Some other
-       dr11 emulators, in particular the IKON 10077 for the Multibus, donot
-       dmaf in this case. This may require some addtional code in the inter-
-       rupt routine to ensure that en iodone(bp) is issued when dma is term-
-       inated by attention.
-    */
-
-    bp = dra->dr_actf;
-    if (!(status & (ATTF | DMAF))) {
-       printf("\ndrintr: Stray interrupt, dr11 status : %lx",status);
-       return;
-    }
-    if (status & DMAF) {
-       /* End-of-range interrupt */
-       dra->dr_flags |= DR_DMAX;
+       if (dra->dr_flags & DR_LOOPTST) {       /* doing loopback test */
+               dra->dr_flags &= ~DR_LOOPTST;
+               return;
+       }
+       /*
+        * Make sure this is not a stray interrupt; at least one of dmaf or attf
+        * must be set. Note that if the dr11 interrupt enable latch is reset 
+        * during a hardware interrupt ack sequence, and by the we get to this 
+        * point in the interrupt code it will be 0. This is done to give the
+        * programmer some control over how the two more-or-less independent
+        * interrupt sources on the board are handled.
+        * If the attention flag is set when drstrategy() is called to start a
+        * dma read or write an interrupt will be generated as soon as the
+        * strategy routine enables interrupts for dma end-of-range. This will
+        * cause execution of the interrupt routine (not necessarily bad) and
+        * will cause the interrupt enable mask to be reset (very bad since the
+        * dma end-of-range condition will not be able to generate an interrupt
+        * when it occurs) causing the dma operation to time-out (even though
+        * the dma transfer will be done successfully) or hang the process if a
+        * software time-out capability is not implemented. One way to avoid 
+        * this situation is to check for a pending attention interrupt (attf
+        * set) by calling drioctl() before doing a read or a write. For the
+        * time being this driver will solve the problem by clearing the attf
+        * flag in the status register before enabling interrupts in
+        * drstrategy().
+        *
+        * **** The IKON 10084 for which this driver is written will set both
+        * attf and dmaf if dma is terminated by an attention pulse. This will
+        * cause a wakeup(&dr_aux), which will be ignored since it is not being 
+        * waited on, and an iodone(bp) which is the desired action. Some other
+        * dr11 emulators, in particular the IKON 10077 for the Multibus, donot
+        * dmaf in this case. This may require some addtional code in the inter-
+        * rupt routine to ensure that en iodone(bp) is issued when dma is term-
+        * inated by attention.
+        */
+       bp = dra->dr_actf;
+       if ((status & (ATTF | DMAF)) == 0) {
+               printf("dr%d: stray interrupt, status=%x", dr11, status);
+               return;
+       }
+       if (status & DMAF) {            /* End-of-range interrupt */
+               dra->dr_flags |= DR_DMAX;
 
 #ifdef DR_DEBUG
 
 #ifdef DR_DEBUG
-    if (DR11 & 2)
-       printf("\ndrintr: e-o-r interrupt,cstat:%lx,dr_flags:%lx",
-               status&0xffff,dra->dr_flags & DR_ACTV);
+               if (DR11 & 2)
+               printf("\ndrintr: e-o-r interrupt,cstat:%lx,dr_flags:%lx",
+                       status&0xffff, dra->dr_flags & DR_ACTV);
 #endif
 #endif
-       if (!(dra->dr_flags & DR_ACTV)) {
-               /* We are not doing DMA !! */
-               bp->b_flags |= B_ERROR;
-       }
-       else {
-               if (dra->dr_op == DR_READ) mtpr(bp->b_un.b_addr,P1DC);
-               dra->dr_bycnt -= bp->b_bcount;
-               if (dra->dr_bycnt >0) {
-                       bp->b_un.b_addr += bp->b_bcount;
-                       bp->b_bcount = (dra->dr_bycnt > NBPG) ? NBPG:
+               if ((dra->dr_flags & DR_ACTV) == 0) {
+                       /* We are not doing DMA !! */
+                       bp->b_flags |= B_ERROR;
+               } else {
+                       if (dra->dr_op == DR_READ)
+                               mtpr(P1DC, bp->b_un.b_addr);
+                       dra->dr_bycnt -= bp->b_bcount;
+                       if (dra->dr_bycnt >0) {
+                               bp->b_un.b_addr += bp->b_bcount;
+                               bp->b_bcount = (dra->dr_bycnt > NBPG) ? NBPG:
                                        dra->dr_bycnt;
                                        dra->dr_bycnt;
-                       drstart(rsaddr,dra,bp);
-                       return;
+                               drstart(rsaddr, dra, bp);
+                               return;
+                       }
                }
                }
+               dra->dr_flags &= ~DR_ACTV;
+               wakeup((caddr_t)dra);           /* Wakeup waiting in drwait() */
+               rsaddr->dr_pulse = (RPER|RDMA|RATN); /* reset dma e-o-r flag */
+       }
+       /*
+        * Now test for attention interrupt -- It may be set in addition to 
+        * the dma e-o-r interrupt. If we get one we will issue a wakeup to
+        * the drioctl() routine which is presumable waiting for one.
+        * The program may have to monitor the attention interrupt received
+        * flag in addition to doing waits for the interrupt. Futhermore, 
+        * interrupts are not enabled unless dma is in progress or drioctl()
+        * has been called to wait for attention -- this may produce some
+        * strange results if attf is set on the dr11 when a read or a write
+        * is initiated, since that will enables interrupts.
+        * **** The appropriate code for this interrupt routine will probably
+        * be rather application dependent.
+        */
+       if (status & ATTF) {
+               dra->dr_flags |= DR_ATRX;
+               dra->dr_flags &= ~DR_ATWT;
+               rsaddr->dr_cstat = RATN;        /* reset attention flag */
+               /*
+                * Some applications which use attention to terminate
+                * dma may also want to issue an iodone() here to
+                * wakeup physio().
+                */
+               wakeup((caddr_t)&dra->dr_cmd);
        }
        }
-       dra->dr_flags &= ~DR_ACTV;
-       wakeup(dra);                    /* Wakeup proc waiting in drwait() */
-       rsaddr->dr_pulse = (RPER|RDMA|RATN);    /* reset dma e-o-r flag */
-    }
-
-    /* Now test for attention interrupt -- It may be set in addition to 
-       the dma e-o-r interrupt. If we get one we will issue a wakeup to
-       the drioctl() routine which is presumable waiting for one.
-       The program may have to monitor the attention interrupt received
-       flag in addition to doing waits for the interrupt. Futhermore, 
-       interrupts are not enabled unless dma is in progress or drioctl()
-       has been called to wait for attention -- this may produce some
-       strange results if attf is set on the dr11 when a read or a write
-       is initiated, since that will enables interrupts.
-       **** The appropriate code for this interrupt routine will probably
-       be rather application dependent.
-    */
-
-    if (status & ATTF) {
-       dra->dr_flags |= DR_ATRX;
-       dra->dr_flags &= ~DR_ATWT;
-       rsaddr->dr_cstat = RATN;        /* reset attention flag */
-       wakeup((caddr_t)&dra->dr_cmd);
-       /* Some applications which use attention to terminate dma may also
-          want to issue an iodone() here to wakeup physio().
-       */
-    }
-    return;
 }
 
 unsigned
 drminphys(bp)
 }
 
 unsigned
 drminphys(bp)
-struct buf *bp;
+       struct buf *bp;
 {
 {
-    if (bp->b_bcount > 65536)
-       bp->b_bcount = 65536;
+
+       if (bp->b_bcount > 65536)
+               bp->b_bcount = 65536;
 }
 
 /*
 }
 
 /*
- *  This routine performs the device unique operations on the DR11W
- *  it is passed as an argument to and invoked by physio
+ * This routine performs the device unique operations on the DR11W
+ * it is passed as an argument to and invoked by physio
  */
 drstrategy (bp)
  */
 drstrategy (bp)
-register struct buf *bp;
+       register struct buf *bp;
 {
 {
-    register int s;
-    int unit = RSUNIT(bp->b_dev);
-    register struct rsdevice *rsaddr = RSADDR(unit);
-    register struct dr_aux *dra = &dr_aux[unit];
-    register short go = 0;
-    register long baddr, ok;
+       register int s;
+       int unit = RSUNIT(bp->b_dev);
+       register struct rsdevice *rsaddr = RSADDR(unit);
+       register struct dr_aux *dra = &dr_aux[unit];
+       register int ok;
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    register char *caddr;
-    long drva();
+       register char *caddr;
+       long drva();
 #endif
 
 #endif
 
-
-    if (!(dra->dr_flags & DR_OPEN)) {
-       /* Device not open */
-       bp->b_error = ENXIO;
-       bp->b_flags |= B_ERROR;
-       iodone (bp);
-       return;
-    }
-
-    while (dra->dr_flags & DR_ACTV) {
-       /* Device is active; should never be in here... */
-       sleep((caddr_t)&dra->dr_flags,DRPRI);
-    }
-
-    dra->dr_actf = bp;
-
+       if ((dra->dr_flags & DR_OPEN) == 0) {   /* Device not open */
+               bp->b_error = ENXIO;
+               bp->b_flags |= B_ERROR;
+               iodone (bp);
+               return;
+       }
+       while (dra->dr_flags & DR_ACTV)
+               /* Device is active; should never be in here... */
+               sleep((caddr_t)&dra->dr_flags,DRPRI);
+       dra->dr_actf = bp;
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    drva(dra,bp->b_proc,bp->b_un.b_addr,bp->b_bcount);
+       drva(dra, bp->b_proc, bp->b_un.b_addr, bp->b_bcount);
 #endif
 #endif
-
-    dra->dr_oba = bp->b_un.b_addr;     /* Save original addr, count */
-    dra->dr_obc = bp->b_bcount;
-    dra->dr_bycnt = bp->b_bcount;      /* Save xfer count used by drintr() */
-
-    if ((((long)bp->b_un.b_addr & 0x3fffffff) >> PGSHIFT) !=
-       ((((long)bp->b_un.b_addr & 0x3fffffff) + bp->b_bcount) >> PGSHIFT)) {
-       bp->b_bcount = NBPG - (((long)bp->b_un.b_addr) & PGOFSET);
-    }
-
-    dra->dr_flags |= DR_ACTV;  /* Mark it active (use in intr handler) */
-    s = SPL_UP();
-    drstart(rsaddr,dra,bp);
-    splx(s);
-
-    ok = drwait(rsaddr,dra);
+       dra->dr_oba = bp->b_un.b_addr;  /* Save original addr, count */
+       dra->dr_obc = bp->b_bcount;
+       dra->dr_bycnt = bp->b_bcount;   /* Save xfer count used by drintr() */
+       if ((((long)bp->b_un.b_addr & 0x3fffffff) >> PGSHIFT) !=
+           ((((long)bp->b_un.b_addr & 0x3fffffff) + bp->b_bcount) >> PGSHIFT))
+               bp->b_bcount = NBPG - (((long)bp->b_un.b_addr) & PGOFSET);
+       dra->dr_flags |= DR_ACTV;       /* Mark active (use in intr handler) */
+       s = SPL_UP();
+       drstart(rsaddr,dra,bp);
+       splx(s);
+       ok = drwait(rsaddr,dra);
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-    if (DR11 & 0x40) {
-       caddr = (char *)dra->dr_oba;
-       if (dra->dr_op == DR_READ)
-               printf("\nAfter read: (%lx)(%lx)",caddr[0]&0xff,caddr[1]&0xff);
-    }
+       if (DR11 & 0x40) {
+               caddr = (char *)dra->dr_oba;
+               if (dra->dr_op == DR_READ)
+                       printf("\nAfter read: (%lx)(%lx)",
+                           caddr[0]&0xff, caddr[1]&0xff);
+       }
 #endif
 #endif
-    dra->dr_flags &= ~DR_ACTV;         /* Clear active flag */
-    bp->b_un.b_addr = dra->dr_oba;     /* Restore original addr, count */
-    bp->b_bcount = dra->dr_obc;
-
-    if (!ok) bp->b_flags |= B_ERROR;
-    iodone(bp);                                /* Mark buffer B_DONE,so physstrat()
-                                          in ml/machdep.c won't sleep */
-    wakeup((caddr_t)&dra->dr_flags);
-
-    /* Return to the calling program (physio()). Physio() will sleep
-       until awaken by a call to iodone() in the interupt handler --
-       which will be called by the dispatcher when it receives dma
-       end-of-range interrupt.
-    */
-    return;
+       dra->dr_flags &= ~DR_ACTV;              /* Clear active flag */
+       bp->b_un.b_addr = dra->dr_oba;  /* Restore original addr, count */
+       bp->b_bcount = dra->dr_obc;
+       if (!ok)
+               bp->b_flags |= B_ERROR;
+       /* Mark buffer B_DONE,so physstrat() in ml/machdep.c won't sleep */
+       iodone(bp);                     
+       wakeup((caddr_t)&dra->dr_flags);
+       /*
+        * Return to the calling program (physio()). Physio() will sleep
+        * until awaken by a call to iodone() in the interupt handler --
+        * which will be called by the dispatcher when it receives dma
+        * end-of-range interrupt.
+        */
 }
 
 }
 
-drwait(rs,dr)
-register struct rsdevice *rs;
-register struct dr_aux *dr;
+drwait(rs, dr)
+       register struct rsdevice *rs;
+       register struct dr_aux *dr;
 {
 {
-       register long status, s;
+       int s;
 
        s = SPL_UP();
 
        s = SPL_UP();
-       while (dr->dr_flags & DR_ACTV)
-               sleep((caddr_t)dr,DRPRI);
+       while (dr->dr_flags & DR_ACTV)
+               sleep((caddr_t)dr, DRPRI);
        splx(s);
        splx(s);
-
-       if (dr->dr_flags & DR_TMDM) {
-               /* DMA timed out */
+       if (dr->dr_flags & DR_TMDM) {           /* DMA timed out */
                dr->dr_flags &= ~DR_TMDM;
                dr->dr_flags &= ~DR_TMDM;
-               return(0);
+               return (0);
        }
        }
-       else {
-               if (rs->dr_cstat & (PERR|BERR|TERR)) {
-                       (dr->dr_actf)->b_flags |= B_ERROR;
-                       return(0);
-               }
+       if (rs->dr_cstat & (PERR|BERR|TERR)) {
+               dr->dr_actf->b_flags |= B_ERROR;
+               return (0);
        }
        dr->dr_flags &= ~DR_DMAX;
        }
        dr->dr_flags &= ~DR_DMAX;
-       return(1);
+       return (1);
 }
 
 }
 
-
-drrwtimo(tinfo)
-register unsigned long tinfo;
 /*
 /*
- *     The lower 8-bit of tinfo is the minor device number, the
- *     remaining higher 8-bit is the current timout number
-*/
-{      register long unit = tinfo & 0xff;
+ *
+ * The lower 8-bit of tinfo is the minor device number, the
+ * remaining higher 8-bit is the current timout number
+ */
+drrwtimo(tinfo)
+       register u_long tinfo;
+{
+       register long unit = tinfo & 0xff;
        register struct dr_aux *dr = &dr_aux[unit];
        register struct rsdevice *rs = dr->dr_addr;
 
        register struct dr_aux *dr = &dr_aux[unit];
        register struct rsdevice *rs = dr->dr_addr;
 
-       /* If this is not the timeout that drwrite/drread is waiting
-          for then we should just go away */
-       if ((tinfo & (~0xff)) != (dr->currenttimo << 8)) return;
-
+       /*
+        * If this is not the timeout that drwrite/drread is waiting
+        * for then we should just go away
+        */
+       if ((tinfo &~ 0xff) != (dr->currenttimo << 8))
+               return;
        /* Mark the device timed out */
        dr->dr_flags |= DR_TMDM;
        dr->dr_flags &= ~DR_ACTV;
        rs->dr_pulse = RMSK;                    /* Inihibit interrupt */
        rs->dr_pulse = (RPER|RDMA|RATN|IENB);   /* Clear DMA logic */
        /* Mark the device timed out */
        dr->dr_flags |= DR_TMDM;
        dr->dr_flags &= ~DR_ACTV;
        rs->dr_pulse = RMSK;                    /* Inihibit interrupt */
        rs->dr_pulse = (RPER|RDMA|RATN|IENB);   /* Clear DMA logic */
-
-       /* Some applications will not issue a master after dma timeout,
-          since doing so sends an INIT H pulse to the external device,
-          which may produce undesirable side-effects.  */
-
+       /*
+        * Some applications will not issue a master after dma timeout,
+        * since doing so sends an INIT H pulse to the external device,
+        * which may produce undesirable side-effects.
+        */
        /* Wake up process waiting in drwait() and flag the error */
        /* Wake up process waiting in drwait() and flag the error */
-       (dr->dr_actf)->b_flags |= B_ERROR;
+       dr->dr_actf->b_flags |= B_ERROR;
        wakeup((caddr_t)dr->dr_cmd);
 }
 
        wakeup((caddr_t)dr->dr_cmd);
 }
 
-
 /*
 /*
- *     Kick the driver every second
-*/
+ * Kick the driver every second
+ */
 drtimo(dev)
 drtimo(dev)
-dev_t dev;
+       dev_t dev;
 {
 {
-       register int unit = RSUNIT(dev);
+       register int unit = RSUNIT(dev);
        register struct dr_aux *dr;
 
        register struct dr_aux *dr;
 
-       dr = &dr_aux[unit];
+       dr = &dr_aux[unit];
        if (dr->dr_flags & DR_OPEN)
        if (dr->dr_flags & DR_OPEN)
-               timeout(drtimo,(caddr_t)dev,hz);
+               timeout(drtimo, (caddr_t)dev, hz);
        wakeup((caddr_t)dr);    /* Wakeup any process waiting for interrupt */
 }
 
        wakeup((caddr_t)dr);    /* Wakeup any process waiting for interrupt */
 }
 
-
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-
-drva(dra,p,va,bcnt)
-struct dr_aux *dra;
-struct proc *p;
-char *va;
-long bcnt;
-{      register long first, last , np;
+drva(dra, p, va, bcnt)
+       struct dr_aux *dra;
+       struct proc *p;
+       char *va;
+       long bcnt;
+{
+       register long first, last , np;
 
        if (DR11 & 0x20)  {
 
        if (DR11 & 0x20)  {
-               first = ((long)(vtoph(p,va))) >> 10;
-               last = ((long)(vtoph(p,va+bcnt))) >> 10;
+               first = ((long)(vtoph(p, (unsigned)va))) >> 10;
+               last = ((long)(vtoph(p, (unsigned)va+bcnt))) >> 10;
                np = bcnt / 0x3ff;
                printf("\ndrva: (op:%ld)(first:%ld)(last:%ld)(np:%ld)(cnt:%ld)",
                        dra->dr_op,first,last,np,bcnt);
                np = bcnt / 0x3ff;
                printf("\ndrva: (op:%ld)(first:%ld)(last:%ld)(np:%ld)(cnt:%ld)",
                        dra->dr_op,first,last,np,bcnt);
@@ -1005,84 +904,79 @@ long bcnt;
 }
 #endif
 
 }
 #endif
 
-
-drstart(rsaddr,dra,bp)
-register struct rsdevice *rsaddr;
-register struct dr_aux *dra;
-register struct buf *bp;
-{      register long baddr;
-       ushort go;
-       register char *caddr;
+drstart(rsaddr, dra, bp)
+       register struct rsdevice *rsaddr;
+       register struct dr_aux *dra;
+       register struct buf *bp;
+{
+       register long addr;
+       u_short go;
 
 #ifdef DR_DEBUG
 
 #ifdef DR_DEBUG
-       if ((dra->dr_op == DR_READ) && (DR11 & 8)) {
+       if (dra->dr_op == DR_READ && (DR11 & 8)) {
+               char *caddr = (char *)bp->b_un.b_addr;
                printf("\ndrstart: READ, bcnt:%ld",bp->b_bcount);
                printf("\ndrstart: READ, bcnt:%ld",bp->b_bcount);
-               caddr = (char *)bp->b_un.b_addr;
                printf(",(%lx)(%lx)",caddr[0]&0xff,caddr[1]&0xff);
        }
 #endif
                printf(",(%lx)(%lx)",caddr[0]&0xff,caddr[1]&0xff);
        }
 #endif
-    /* we are doing raw IO, bp->b_un.b_addr is user's address */
-    baddr = (long)vtoph(bp->b_proc,(caddr_t)bp->b_un.b_addr);
-
-    /* Set DMA address into DR11 interace registers: DR11 requires that
-       the address be right shifted 1 bit position before it is written
-       to the board (The board will left shift it one bit position before
-       it places the address on the bus
-    */
-    rsaddr->dr_walo = (ushort)((baddr >> 1) & 0xffff);
-    rsaddr->dr_wahi = (ushort)((baddr >> 17) & 0x7fff);
-
-    /* Set DMA range count: (number of words - 1) */
-    rsaddr->dr_range = (ushort)((bp->b_bcount >> 1) - 1);
-
-    /* Set address modifier code to be used for DMA access to memory */
-    rsaddr->dr_addmod = (char)DRADDMOD;
-
-    /* Now determine whether this is a read or a write. ***** This is
-       probably only usefull for link mode operation, since dr11 doesnot
-       controll the direction of data transfer. The C1 control input 
-       controls whether the hardware is doing a read or a write. In link
-       mode this is controlled by function 1 latch (looped back by the
-       cable) and could be set the program. In the general case, the dr11
-       doesnot know in advance what the direction of transfer is - although
-       the program and protocol logic probably is
-    */
-
+       /* we are doing raw IO, bp->b_un.b_addr is user's address */
+       addr = (long)vtoph(bp->b_proc, (unsigned)bp->b_un.b_addr);
+       /*
+        * Set DMA address into DR11 interace registers: DR11 requires that
+        * the address be right shifted 1 bit position before it is written
+        * to the board (The board will left shift it one bit position before
+        * it places the address on the bus
+        */
+       rsaddr->dr_walo = (addr >> 1) & 0xffff;
+       rsaddr->dr_wahi = (addr >> 17) & 0x7fff;
+       /* Set DMA range count: (number of words - 1) */
+       rsaddr->dr_range = (bp->b_bcount >> 1) - 1;
+       /* Set address modifier code to be used for DMA access to memory */
+       rsaddr->dr_addmod = DRADDMOD;
+       /*
+        * Now determine whether this is a read or a write. ***** This is
+        * probably only usefull for link mode operation, since dr11 doesnot
+        * controll the direction of data transfer. The C1 control input 
+        * controls whether the hardware is doing a read or a write. In link
+        * mode this is controlled by function 1 latch (looped back by the
+        * cable) and could be set the program. In the general case, the dr11
+        * doesnot know in advance what the direction of transfer is - although
+        * the program and protocol logic probably is
+        */
 #ifdef DR_DEBUG
 #ifdef DR_DEBUG
-   if (DR11 & 1)
-    printf("\ndrstrat: about to GO..,dr_cmd:%lx,drstat:%lx,drcnt:%ld,cdata:%lx,OP:%ld",
-       dra->dr_cmd,rsaddr->dr_cstat,rsaddr->dr_range,rsaddr->dr_data,dra->dr_op);
+       if (DR11 & 1)
+               printf(
+"\ndrstrat: about to GO..,dr_cmd:%lx,drstat:%lx,drcnt:%ld,cdata:%lx,OP:%ld",
+                   dra->dr_cmd, rsaddr->dr_cstat, rsaddr->dr_range,
+                   rsaddr->dr_data, dra->dr_op);
 #endif
 #endif
-
-    /* Update function latches may have been done already by drioctl() if
-       request from drioctl()
-    */
-    if (dra->dr_cmd & DR_DFCN) {
-       /* deferred function write */
-       dra->dr_cmd &= ~DR_DFCN;        /* Clear request */
-       go = dra->dr_cmd & DR_FMSK;     /* mask out fcn bits */
-       rsaddr->dr_cstat = go;          /* Write it to the board */
-    }
-
-    /* Clear dmaf and attf to assure a clean dma start */
-    rsaddr->dr_pulse = (ushort)(RATN|RDMA|RPER);
-    rsaddr->dr_cstat = (ushort)(IENB|GO|CYCL|dra->dr_op); /* GO...... */
-
-    /* Now check for software cycle request -- usually by transmitter in
-       link mode.
-    */
-    if (dra->dr_cmd & DR_PCYL) {
-       dra->dr_cmd &= ~DR_PCYL;        /* Clear request */
-       rsaddr->dr_pulse = CYCL;        /* Use pulse register again */
-    }
-
-    /* Now check for deferred ACLO FCNT2 pulse request -- usually to tell
-       the transmitter (via its attention) that we have enabled dma.
-    */
-    if (dra->dr_cmd & DR_DACL) {
-       dra->dr_cmd &= ~DR_DACL;        /* Clear request */
-       rsaddr->dr_pulse = FCN2;        /* Use pulse register again */
-    }
+       /*
+        * Update function latches may have been done already by drioctl() if
+        * request from drioctl()
+        */
+       if (dra->dr_cmd & DR_DFCN) {            /* deferred function write */
+               dra->dr_cmd &= ~DR_DFCN;        /* Clear request */
+               go = dra->dr_cmd & DR_FMSK;     /* mask out fcn bits */
+               rsaddr->dr_cstat = go;          /* Write it to the board */
+       }
+       /* Clear dmaf and attf to assure a clean dma start */
+       rsaddr->dr_pulse = RATN|RDMA|RPER;
+       rsaddr->dr_cstat = IENB|GO|CYCL|dra->dr_op; /* GO...... */
+       /*
+        * Now check for software cycle request -- usually
+        * by transmitter in link mode.
+        */
+       if (dra->dr_cmd & DR_PCYL) {
+               dra->dr_cmd &= ~DR_PCYL;        /* Clear request */
+               rsaddr->dr_pulse = CYCL;        /* Use pulse register again */
+       }
+       /*
+        * Now check for deferred ACLO FCNT2 pulse request -- usually to tell
+        * the transmitter (via its attention) that we have enabled dma.
+        */
+       if (dra->dr_cmd & DR_DACL) {
+               dra->dr_cmd &= ~DR_DACL;        /* Clear request */
+               rsaddr->dr_pulse = FCN2;        /* Use pulse register again */
+       }
 }
 }
-
 #endif  NDR
 #endif  NDR
index 72f839e..6397ccd 100644 (file)
@@ -1,4 +1,4 @@
-/*     ik.c    1.3     86/12/11        */
+/*     ik.c    1.4     86/12/15        */
 
 #include "ik.h"
 #if NIK > 0
 
 #include "ik.h"
 #if NIK > 0
@@ -73,6 +73,10 @@ ikprobe(reg, vi)
        register int br, cvec;          /* r12, r11 */
        register struct ikdevice *ik;
 
        register int br, cvec;          /* r12, r11 */
        register struct ikdevice *ik;
 
+#ifdef lint
+       br = 0; cvec = br; br = cvec;
+       ikintr(0);
+#endif
        if (badaddr(reg, 2))
                return (0);
        ik = (struct ikdevice *)reg;
        if (badaddr(reg, 2))
                return (0);
        ik = (struct ikdevice *)reg;
@@ -137,14 +141,14 @@ ikopen(dev, flag)
        if (unit >= NIK || (vi = ikinfo[unit]) == 0 || vi->ui_alive == 0)
                return (ENXIO);
        sc = &ik_softc[unit];
        if (unit >= NIK || (vi = ikinfo[unit]) == 0 || vi->ui_alive == 0)
                return (ENXIO);
        sc = &ik_softc[unit];
-       if (sc->is_uid != -1 && sc->is_uid != u.u_uid)
+       if (sc->is_uid != (uid_t)-1 && sc->is_uid != u.u_uid)
                return (EBUSY);
                return (EBUSY);
-       if (sc->is_uid == -1) {
+       if (sc->is_uid == (uid_t)-1) {
                sc->is_buf = (caddr_t)wmemall(vmemall, PS_MAXDMA);
                if (sc->is_buf == 0)
                        return (ENOMEM);
                sc->is_timeout = 0;
                sc->is_buf = (caddr_t)wmemall(vmemall, PS_MAXDMA);
                if (sc->is_buf == 0)
                        return (ENOMEM);
                sc->is_timeout = 0;
-               timeout(iktimer, unit, hz);
+               timeout(iktimer, (caddr_t)unit, hz);
                /*
                 * Perform PS300 attach for first process.
                 */
                /*
                 * Perform PS300 attach for first process.
                 */
@@ -159,7 +163,7 @@ ikopen(dev, flag)
                                ik = (struct ikdevice *)ikinfo[unit]->ui_addr;
                                if (!reset++ && psreset(ik, 0))
                                        goto again;
                                ik = (struct ikdevice *)ikinfo[unit]->ui_addr;
                                if (!reset++ && psreset(ik, 0))
                                        goto again;
-                               untimeout(iktimer, unit);
+                               untimeout(iktimer, (caddr_t)unit);
                                wmemfree(sc->is_buf, PS_MAXDMA);
                                sc->is_buf = 0;
                                return (EIO);
                                wmemfree(sc->is_buf, PS_MAXDMA);
                                sc->is_buf = 0;
                                return (EIO);
@@ -185,7 +189,7 @@ ikclose(dev, flag)
                wmemfree(sc->is_buf, PS_MAXDMA);
                sc->is_buf = 0;
        }
                wmemfree(sc->is_buf, PS_MAXDMA);
                sc->is_buf = 0;
        }
-       untimeout(iktimer, unit);
+       untimeout(iktimer, (caddr_t)unit);
 }
 
 ikread(dev, uio)
 }
 
 ikread(dev, uio)
@@ -264,7 +268,7 @@ ikrw(dev, uio, rw)
                ap->wc = (iov->iov_len + 1) >> 1;
                if (rw == B_WRITE) {
                        error = copyin(iov->iov_base, (caddr_t)&ap[1],
                ap->wc = (iov->iov_len + 1) >> 1;
                if (rw == B_WRITE) {
                        error = copyin(iov->iov_base, (caddr_t)&ap[1],
-                           iov->iov_len);
+                           (unsigned)iov->iov_len);
                        if (!error)
                                error = ikcommand(dev, wrcmd,
                                    iov->iov_len + sizeof (*ap));
                        if (!error)
                                error = ikcommand(dev, wrcmd,
                                    iov->iov_len + sizeof (*ap));
@@ -278,7 +282,7 @@ ikrw(dev, uio, rw)
                                mtpr(P1DC, cp);
                        if (!error)
                                error = copyout((caddr_t)&ap[1], iov->iov_base,
                                mtpr(P1DC, cp);
                        if (!error)
                                error = copyout((caddr_t)&ap[1], iov->iov_base,
-                                   iov->iov_len);
+                                   (unsigned)iov->iov_len);
                }
                (void) splbio();
                if (bp->b_flags&B_WANTED)
                }
                (void) splbio();
                if (bp->b_flags&B_WANTED)
@@ -355,7 +359,6 @@ ikstart(dp)
        register struct buf *bp;
        register struct ikdevice *ik;
        register struct ik_softc *sc;
        register struct buf *bp;
        register struct ikdevice *ik;
        register struct ik_softc *sc;
-       register struct psalist *ap;
        u_short bc, csr;
        u_int addr;
        int unit;
        u_short bc, csr;
        u_int addr;
        int unit;
@@ -375,7 +378,7 @@ loop:
        unit = IKUNIT(bp->b_dev);
        sc = &ik_softc[unit];
        ik = (struct ikdevice *)ikinfo[unit]->ui_addr;
        unit = IKUNIT(bp->b_dev);
        sc = &ik_softc[unit];
        ik = (struct ikdevice *)ikinfo[unit]->ui_addr;
-       switch (bp->b_command) {
+       switch ((int)bp->b_command) {
 
        case PS_ATTACH:         /* logical unit attach */
        case PS_DETACH:         /* logical unit detach */
 
        case PS_ATTACH:         /* logical unit attach */
        case PS_DETACH:         /* logical unit detach */
@@ -387,12 +390,12 @@ loop:
                 * Handshake command and, optionally,
                 * byte count and byte swap flag.
                 */
                 * Handshake command and, optionally,
                 * byte count and byte swap flag.
                 */
-               if (sc->is_error = diowrite(ik, bp->b_command))
+               if (sc->is_error = diowrite(ik, (u_short)bp->b_command))
                        goto bad;
                if (bp->b_command < PS_DETACH) {
                        goto bad;
                if (bp->b_command < PS_DETACH) {
-                       if (sc->is_error = diowrite(ik, bp->b_bcount))
+                       if (sc->is_error = diowrite(ik, (u_short)bp->b_bcount))
                                goto bad;
                                goto bad;
-                       if (sc->is_error = diowrite(ik, 0 /* !swab */))
+                       if (sc->is_error = diowrite(ik, (u_short)0 /* !swab */))
                                goto bad;
                }
                /*
                                goto bad;
                }
                /*
@@ -417,7 +420,7 @@ loop:
                goto bad;
        }
        /* initiate dma transfer */
                goto bad;
        }
        /* initiate dma transfer */
-       addr = vtoph((struct proc *)0, sc->is_buf);
+       addr = vtoph((struct proc *)0, (unsigned)sc->is_buf);
        ik->ik_bahi = addr >> 17;
        ik->ik_balo = (addr >> 1) & 0xffff;
        ik->ik_wc = ((bc + 1) >> 1) - 1;        /* round & convert */
        ik->ik_bahi = addr >> 17;
        ik->ik_balo = (addr >> 1) & 0xffff;
        ik->ik_wc = ((bc + 1) >> 1) - 1;        /* round & convert */
@@ -433,8 +436,6 @@ bad:
 }
 
 #define FETCHWORD(i) { \
 }
 
 #define FETCHWORD(i) { \
-       int v; \
-\
        v = dioread(ik); \
        if (v == -1) { \
                sc->is_error = PSERROR_NAMETIMO; \
        v = dioread(ik); \
        if (v == -1) { \
                sc->is_error = PSERROR_NAMETIMO; \
@@ -453,7 +454,7 @@ ikintr(ikon)
        register struct buf *bp, *dp;
        struct ik_softc *sc;
        register u_short data;
        register struct buf *bp, *dp;
        struct ik_softc *sc;
        register u_short data;
-       u_short i, v;
+       int v;
 
        /* should go by controller, but for now... */
        if (ikinfo[ikon] == 0)
 
        /* should go by controller, but for now... */
        if (ikinfo[ikon] == 0)
@@ -590,7 +591,7 @@ iktimer(unit)
                }
                splx(s);
        }
                }
                splx(s);
        }
-       timeout(iktimer, unit, hz);
+       timeout(iktimer, (caddr_t)unit, hz);
 }
 
 /*
 }
 
 /*
@@ -599,10 +600,10 @@ iktimer(unit)
 dioread(ik)
        register struct ikdevice *ik;
 {
 dioread(ik)
        register struct ikdevice *ik;
 {
-       register int timeout;
+       register int t;
        u_short data;
 
        u_short data;
 
-       for (timeout = ikdiotimo; timeout > 0; timeout--)
+       for (t = ikdiotimo; t > 0; t--)
                if ((ik->ik_csr&(IKCSR_ATTF|IKCSR_STATC)) == IKCSR_ATTF) {
                        data = ik->ik_data;
                        ik->ik_csr = IKCSR_RATTF|IKCSR_RDMAF|IKCSR_FNC1;
                if ((ik->ik_csr&(IKCSR_ATTF|IKCSR_STATC)) == IKCSR_ATTF) {
                        data = ik->ik_data;
                        ik->ik_csr = IKCSR_RATTF|IKCSR_RDMAF|IKCSR_FNC1;
@@ -623,7 +624,7 @@ diowrite(ik, v)
        register struct ikdevice *ik;
        u_short v;
 {
        register struct ikdevice *ik;
        u_short v;
 {
-       register int timeout;
+       register int t;
        register u_short csr;
 
 top:
        register u_short csr;
 
 top:
@@ -633,7 +634,7 @@ top:
        ik->ik_data = v;
        ik->ik_csr = IKCSR_RDMAF|IKCSR_RATTF;
        ik->ik_pulse = IKPULSE_FNC2;
        ik->ik_data = v;
        ik->ik_csr = IKCSR_RDMAF|IKCSR_RATTF;
        ik->ik_pulse = IKPULSE_FNC2;
-       for (timeout = ikdiotimo; timeout > 0; timeout--) {
+       for (t = ikdiotimo; t > 0; t--) {
                csr = ik->ik_csr;
 #define IKCSR_DONE     (IKCSR_STATA|IKCSR_STATC)
                if ((csr&IKCSR_DONE) == IKCSR_DONE) {
                csr = ik->ik_csr;
 #define IKCSR_DONE     (IKCSR_STATA|IKCSR_STATC)
                if ((csr&IKCSR_DONE) == IKCSR_DONE) {
@@ -682,7 +683,7 @@ ikioctl(dev, cmd, data, flag)
                }
                splx(s);
                bp->b_flags = B_BUSY | B_WRITE;
                }
                splx(s);
                bp->b_flags = B_BUSY | B_WRITE;
-               error = copyin(lp->pl_name, sc->is_buf, lp->pl_len);
+               error = copyin(lp->pl_name, sc->is_buf, (unsigned)lp->pl_len);
                if (error == 0) {
                        if (lp->pl_len&1)
                                sc->is_buf[lp->pl_len] = '\0';
                if (error == 0) {
                        if (lp->pl_len&1)
                                sc->is_buf[lp->pl_len] = '\0';
index bef82b5..83c0c78 100644 (file)
@@ -1,4 +1,4 @@
-/*     vbaparam.h      1.2     86/12/08        */
+/*     vbaparam.h      1.3     86/12/15        */
 
 /*
  * Parameters related to the VERSAbus i/o configuration.
 
 /*
  * Parameters related to the VERSAbus i/o configuration.
@@ -37,10 +37,10 @@ extern      caddr_t vbbase, vbend;
  * zero in the upper 2 bits; e.g. a reference to physical address fe000000
  * results in a VERSAbus address of 3e000000.
  */
  * zero in the upper 2 bits; e.g. a reference to physical address fe000000
  * results in a VERSAbus address of 3e000000.
  */
-#define        VBIO16BIT(a)    (0xfffe0000 <= ((unsigned)(a)))
-#define        VBIO24BIT(a) \
-    (0xff000000 <= ((unsigned)(a)) && ((unsigned)(a)) < 0xfffe0000)
-#define        VBIO32BIT(a)    (((unsigned)(a)) < 0xff000000)
+#define        VBIO16BIT(a)    ((unsigned)0xfffe0000 <= ((unsigned)(a)))
+#define        VBIO24BIT(a)    ((unsigned)0xff000000 <= ((unsigned)(a)) && \
+                        ((unsigned)(a)) < (unsigned)0xfffe0000)
+#define        VBIO32BIT(a)    (((unsigned)(a)) < (unsigned)0xff000000)
 
 /* 
  * The following constants define the fixed size map of the
 
 /* 
  * The following constants define the fixed size map of the
@@ -53,8 +53,8 @@ extern        caddr_t vbbase, vbend;
 /* number of entries in the system page table for i/o space */
 #define VBIOSIZE       btoc(VBIOEND-VBIOBASE)
 /* is device in mapped region */
 /* number of entries in the system page table for i/o space */
 #define VBIOSIZE       btoc(VBIOEND-VBIOBASE)
 /* is device in mapped region */
-#define        VBIOMAPPED(a) \
-    (VBIOBASE <= ((unsigned)(a)) && ((unsigned)(a)) <= VBIOEND) 
+#define        VBIOMAPPED(a)   ((unsigned)VBIOBASE <= ((unsigned)(a)) && \
+                        ((unsigned)(a)) <= (unsigned)VBIOEND) 
 #define        vboff(addr)     ((int)(((caddr_t)(addr)) - VBIOBASE))
 
 /*
 #define        vboff(addr)     ((int)(((caddr_t)(addr)) - VBIOBASE))
 
 /*
index 5cc9e45..9843a36 100644 (file)
@@ -1,4 +1,4 @@
-/*     vbavar.h        1.3     86/01/20        */
+/*     vbavar.h        1.4     86/12/15        */
 
 /*
  * This file contains definitions related to the kernel structures
 
 /*
  * This file contains definitions related to the kernel structures
@@ -118,7 +118,6 @@ extern      struct  vba_device vbdinit[];
  * into virtual address vmem[][].
  */
 extern struct pte VMEMmap[];   /* vba device addr pte's */
  * into virtual address vmem[][].
  */
 extern struct pte VMEMmap[];   /* vba device addr pte's */
-extern char vmem[];            /* vba device addr space */
-
+extern caddr_t vmem;           /* vba device addr space */
 #endif KERNEL
 #endif !LOCORE
 #endif KERNEL
 #endif !LOCORE