+
+static
+struct buf *
+getswbuf(prio)
+ int prio;
+{
+ int s;
+ struct buf *bp;
+
+ s = splbio();
+ while (bswlist.av_forw == NULL) {
+ bswlist.b_flags |= B_WANTED;
+ sleep((caddr_t)&bswlist, prio);
+ }
+ bp = bswlist.av_forw;
+ bswlist.av_forw = bp->av_forw;
+ splx(s);
+ return (bp);
+}
+
+static
+freeswbuf(bp)
+ struct buf *bp;
+{
+ int s;
+
+ s = splbio();
+ bp->av_forw = bswlist.av_forw;
+ bswlist.av_forw = bp;
+ if (bswlist.b_flags & B_WANTED) {
+ bswlist.b_flags &= ~B_WANTED;
+ wakeup((caddr_t)&bswlist);
+ wakeup((caddr_t)&proc[2]);
+ }
+ splx(s);
+}
+
+rawread(dev, uio)
+ dev_t dev;
+ struct uio *uio;
+{
+ return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL,
+ dev, B_READ, minphys, uio));
+}
+
+rawwrite(dev, uio)
+ dev_t dev;
+ struct uio *uio;
+{
+ return (physio(cdevsw[major(dev)].d_strategy, (struct buf *)NULL,
+ dev, B_WRITE, minphys, uio));
+}