projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_3_Reno release
[unix-history]
/
usr
/
src
/
sys
/
vax
/
flp.c
diff --git
a/usr/src/sys/vax/flp.c
b/usr/src/sys/vax/flp.c
index
0338eed
..
9caeac2
100644
(file)
--- a/
usr/src/sys/vax/flp.c
+++ b/
usr/src/sys/vax/flp.c
@@
-1,18
+1,22
@@
-/* flp.c 6.1 83/07/29 */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)flp.c 7.3 (Berkeley) 2/17/90
+ */
#if VAX780
#if VAX780
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-#include "../h/uio.h"
+#include "param.h"
+#include "systm.h"
+#include "conf.h"
+#include "user.h"
+#include "buf.h"
-#include "
../vax/
cons.h"
-#include "
../vax/
cpu.h"
-#include "
../vax/
flp.h"
-#include "
../vax/
mtpr.h"
+#include "cons.h"
+#include "cpu.h"
+#include "flp.h"
+#include "mtpr.h"
struct {
short fl_state; /* open and busy flags */
struct {
short fl_state; /* open and busy flags */
@@
-29,10
+33,8
@@
flopen(dev, flag)
{
struct buf *geteblk();
{
struct buf *geteblk();
-#if VAX750
if (cpu != VAX_780)
return (ENXIO);
if (cpu != VAX_780)
return (ENXIO);
-#endif
if (fltab.fl_state != 0)
return (ENXIO);
fltab.fl_state = FL_OPEN;
if (fltab.fl_state != 0)
return (ENXIO);
fltab.fl_state = FL_OPEN;
@@
-51,9
+53,11
@@
flclose(dev, flag)
fltab.fl_state = 0;
}
fltab.fl_state = 0;
}
-floperation(rw, uio)
- enum uio_rw rw;
+/*ARGSUSED*/
+flrw(dev, uio, flag)
+ dev_t dev;
struct uio *uio;
struct uio *uio;
+ int flag;
{
register struct buf *bp;
register int i;
{
register struct buf *bp;
register int i;
@@
-80,14
+84,16
@@
floperation(rw, uio)
error = 0;
while ((i = imin(RXBYSEC, uio->uio_resid)) > 0) {
bp->b_blkno = uio->uio_offset>>7;
error = 0;
while ((i = imin(RXBYSEC, uio->uio_resid)) > 0) {
bp->b_blkno = uio->uio_offset>>7;
- if (bp->b_blkno >= MAXSEC || (uio->uio_offset & 0177) != 0)
- return (ENXIO);
- if (rw == UIO_WRITE) {
- error = uiomove(bp->b_un.b_addr, i, UIO_WRITE, uio);
+ if (bp->b_blkno >= MAXSEC || (uio->uio_offset & 0177) != 0) {
+ error = ENXIO;
+ break;
+ }
+ if (uio->uio_rw == UIO_WRITE) {
+ error = uiomove(bp->b_un.b_addr, i, uio);
if (error)
break;
}
if (error)
break;
}
- bp->b_flags = rw == UIO_WRITE ? B_WRITE : B_READ;
+ bp->b_flags =
uio->uio_
rw == UIO_WRITE ? B_WRITE : B_READ;
(void) spl4();
flstart();
while ((bp->b_flags & B_DONE) == 0)
(void) spl4();
flstart();
while ((bp->b_flags & B_DONE) == 0)
@@
-97,8
+103,8
@@
floperation(rw, uio)
error = EIO;
break;
}
error = EIO;
break;
}
- if (rw == UIO_READ) {
- error = uiomove(bp->b_un.b_addr, i,
UIO_READ,
uio);
+ if (
uio->uio_
rw == UIO_READ) {
+ error = uiomove(bp->b_un.b_addr, i, uio);
if (error)
break;
}
if (error)
break;
}
@@
-108,24
+114,6
@@
floperation(rw, uio)
return (error);
}
return (error);
}
-/*ARGSUSED*/
-flread(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
-
- return (floperation(UIO_READ, uio));
-}
-
-/*ARGSUSED*/
-flwrite(dev, uio)
- dev_t dev;
- struct uio *uio;
-{
-
- return (floperation(UIO_WRITE, uio));
-}
-
flstart()
{
register struct buf *bp;
flstart()
{
register struct buf *bp;