1 /*
2  * Copyright (c) 1982, 1986, 1990 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	from: @(#)kern_physio.c	7.20 (Berkeley) 5/11/91
8  */
9 
10 #include "param.h"
11 #include "systm.h"
12 #include "buf.h"
13 #include "conf.h"
14 #include "proc.h"
15 #include "seg.h"
16 #include "trace.h"
17 #include "map.h"
18 #include "vnode.h"
19 #include "specdev.h"
20 
21 #ifdef HPUXCOMPAT
22 #include "user.h"
23 #endif
24 
25 static	struct buf *getswbuf();
26 static	freeswbuf();
27 
28 /*
29  * This routine does device I/O for a user process.
30  *
31  * If the user has the proper access privilidges, the process is
32  * marked 'delayed unlock' and the pages involved in the I/O are
33  * faulted and locked. After the completion of the I/O, the pages
34  * are unlocked.
35  */
36 physio(strat, bp, dev, rw, mincnt, uio)
37 	int (*strat)();
38 	register struct buf *bp;
39 	dev_t dev;
40 	int rw;
41 	u_int (*mincnt)();
42 	struct uio *uio;
43 {
44 
45 	/*
46 	 * Body deleted.
47 	 */
48 	return (EIO);
49 }
50 
51 /*
52  * Calculate the maximum size of I/O request that can be requested
53  * in a single operation. This limit is necessary to prevent a single
54  * process from being able to lock more than a fixed amount of memory
55  * in the kernel.
56  */
57 u_int
58 minphys(bp)
59 	struct buf *bp;
60 {
61 
62 	/*
63 	 * Body deleted.
64 	 */
65 	return;
66 }
67 
68 /*
69  * Do a read on a device for a user process.
70  */
71 rawread(dev, uio)
72 	dev_t dev;
73 	struct uio *uio;
74 {
75 	return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL,
76 	    dev, B_READ, minphys, uio));
77 }
78 
79 /*
80  * Do a write on a device for a user process.
81  */
82 rawwrite(dev, uio)
83 	dev_t dev;
84 	struct uio *uio;
85 {
86 	return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL,
87 	    dev, B_WRITE, minphys, uio));
88 }
89