BSD 4_3_Net_2 release
[unix-history] / usr / src / sys / hp300 / dev / rd.c
index 98edcb5..5bc5810 100644 (file)
@@ -7,11 +7,37 @@
  * the Systems Programming Group of the University of Utah Computer
  * Science Department.
  *
  * the Systems Programming Group of the University of Utah Computer
  * Science Department.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- * from: Utah $Hdr: rd.c 1.3 90/10/12$
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  *
- *     @(#)rd.c        7.6 (Berkeley) %G%
+ * from: Utah $Hdr: rd.c 1.38 90/10/12$
+ *
+ *     @(#)rd.c        7.9 (Berkeley) 5/7/91
  */
 
 /*
  */
 
 /*
@@ -32,6 +58,8 @@
 #include "rdreg.h"
 
 #include "vm/vm_param.h"
 #include "rdreg.h"
 
 #include "vm/vm_param.h"
+#include "vm/lock.h"
+#include "vm/vm_statistics.h"
 #include "vm/pmap.h"
 #include "vm/vm_prot.h"
 
 #include "vm/pmap.h"
 #include "vm/vm_prot.h"
 
@@ -392,9 +420,8 @@ struct rdinfo rdinfo[] = {
 int nrdinfo = sizeof(rdinfo) / sizeof(rdinfo[0]);
 
 struct buf rdtab[NRD];
 int nrdinfo = sizeof(rdinfo) / sizeof(rdinfo[0]);
 
 struct buf rdtab[NRD];
-struct buf rdbuf[NRD];
 
 
-#define        rdunit(x)       ((minor(x) >> 3) & 0xf)
+#define        rdunit(x)       (minor(x) >> 3)
 #define rdpart(x)      (minor(x) & 0x7)
 #define        rdpunit(x)      ((x) & 7)
 #define        b_cylin         b_resid
 #define rdpart(x)      (minor(x) & 0x7)
 #define        rdpunit(x)      ((x) & 7)
 #define        b_cylin         b_resid
@@ -568,9 +595,11 @@ rdreset(rs, hd)
 #endif
 }
 
 #endif
 }
 
-/*ARGSUSED*/
-rdopen(dev, flags)
+int
+rdopen(dev, flags, mode, p)
        dev_t dev;
        dev_t dev;
+       int flags, mode;
+       struct proc *p;
 {
        register int unit = rdunit(dev);
        register struct rd_softc *rs = &rd_softc[unit];
 {
        register int unit = rdunit(dev);
        register struct rd_softc *rs = &rd_softc[unit];
@@ -986,34 +1015,40 @@ rderror(unit)
        return(1);
 }
 
        return(1);
 }
 
-rdread(dev, uio)
+int
+rdread(dev, uio, flags)
        dev_t dev;
        struct uio *uio;
        dev_t dev;
        struct uio *uio;
+       int flags;
 {
        register int unit = rdunit(dev);
 
 {
        register int unit = rdunit(dev);
 
-       return(physio(rdstrategy, &rdbuf[unit], dev, B_READ, minphys, uio));
+       return (physio(rdstrategy, NULL, dev, B_READ, minphys, uio));
 }
 
 }
 
-rdwrite(dev, uio)
+int
+rdwrite(dev, uio, flags)
        dev_t dev;
        struct uio *uio;
        dev_t dev;
        struct uio *uio;
+       int flags;
 {
        register int unit = rdunit(dev);
 
 {
        register int unit = rdunit(dev);
 
-       return(physio(rdstrategy, &rdbuf[unit], dev, B_WRITE, minphys, uio));
+       return (physio(rdstrategy, NULL, dev, B_WRITE, minphys, uio));
 }
 
 }
 
-/*ARGSUSED*/
-rdioctl(dev, cmd, data, flag)
+int
+rdioctl(dev, cmd, data, flag, p)
        dev_t dev;
        int cmd;
        caddr_t data;
        int flag;
        dev_t dev;
        int cmd;
        caddr_t data;
        int flag;
+       struct proc *p;
 {
        return(EINVAL);
 }
 
 {
        return(EINVAL);
 }
 
+int
 rdsize(dev)
        dev_t dev;
 {
 rdsize(dev)
        dev_t dev;
 {
@@ -1048,6 +1083,7 @@ rdprinterr(str, err, tab)
 /*
  * Non-interrupt driven, non-dma dump routine.
  */
 /*
  * Non-interrupt driven, non-dma dump routine.
  */
+int
 rddump(dev)
        dev_t dev;
 {
 rddump(dev)
        dev_t dev;
 {