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 /*
26  * This routine does raw device I/O for a user process.
27  *
28  * If the user has the proper access privileges, the process is
29  * marked 'delayed unlock' and the pages involved in the I/O are
30  * faulted and locked. After the completion of the I/O, the pages
31  * are unlocked.
32  */
33 physio(strat, bp, dev, rw, mincnt, uio)
34 	int (*strat)();
35 	register struct buf *bp;
36 	dev_t dev;
37 	int rw;
38 	u_int (*mincnt)();
39 	struct uio *uio;
40 {
41 
42 	/*
43 	 * Body deleted.
44 	 */
45 	return (EIO);
46 }
47 
48 /*
49  * Calculate the maximum size of I/O request that can be requested
50  * in a single operation. This limit is necessary to prevent a single
51  * process from being able to lock more than a fixed amount of memory
52  * in the kernel.
53  */
54 u_int
55 minphys(bp)
56 	struct buf *bp;
57 {
58 
59 	/*
60 	 * Body deleted.
61 	 */
62 	return;
63 }
64 
65 /*
66  * Do a read on a device for a user process.
67  */
68 rawread(dev, uio)
69 	dev_t dev;
70 	struct uio *uio;
71 {
72 	return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL,
73 	    dev, B_READ, minphys, uio));
74 }
75 
76 /*
77  * Do a write on a device for a user process.
78  */
79 rawwrite(dev, uio)
80 	dev_t dev;
81 	struct uio *uio;
82 {
83 	return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL,
84 	    dev, B_WRITE, minphys, uio));
85 }
86