/* * Copyright (c) 1982, 1986, 1990 Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% * * from: @(#)kern_physio.c 7.20 (Berkeley) 5/11/91 */ #include "param.h" #include "systm.h" #include "buf.h" #include "conf.h" #include "proc.h" #include "seg.h" #include "trace.h" #include "map.h" #include "vnode.h" #include "specdev.h" #ifdef HPUXCOMPAT #include "user.h" #endif /* * This routine does raw device I/O for a user process. * * If the user has the proper access privileges, the process is * marked 'delayed unlock' and the pages involved in the I/O are * faulted and locked. After the completion of the I/O, the pages * are unlocked. */ physio(strat, bp, dev, rw, mincnt, uio) int (*strat)(); register struct buf *bp; dev_t dev; int rw; u_int (*mincnt)(); struct uio *uio; { /* * Body deleted. */ return (EIO); } /* * Calculate the maximum size of I/O request that can be requested * in a single operation. This limit is necessary to prevent a single * process from being able to lock more than a fixed amount of memory * in the kernel. */ u_int minphys(bp) struct buf *bp; { /* * Body deleted. */ return; } /* * Do a read on a device for a user process. */ rawread(dev, uio) dev_t dev; struct uio *uio; { return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL, dev, B_READ, minphys, uio)); } /* * Do a write on a device for a user process. */ rawwrite(dev, uio) dev_t dev; struct uio *uio; { return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL, dev, B_WRITE, minphys, uio)); }