use shorts to move data
[unix-history] / usr / src / sys / vax / mba / ht.c
index 7921ca8..7cd25ba 100644 (file)
@@ -1,4 +1,4 @@
-/*     ht.c    4.20    81/11/07        */
+/*     ht.c    4.22    82/05/12        */
 
 #include "tu.h"
 #if NHT > 0
 
 #include "tu.h"
 #if NHT > 0
@@ -164,9 +164,10 @@ htcommand(dev, com, count)
        int com, count;
 {
        register struct buf *bp;
        int com, count;
 {
        register struct buf *bp;
+       register int s;
 
        bp = &chtbuf[HTUNIT(dev)];
 
        bp = &chtbuf[HTUNIT(dev)];
-       (void) spl5();
+       s = spl5();
        while (bp->b_flags&B_BUSY) {
                if(bp->b_repcnt == 0 && (bp->b_flags&B_DONE))
                        break;
        while (bp->b_flags&B_BUSY) {
                if(bp->b_repcnt == 0 && (bp->b_flags&B_DONE))
                        break;
@@ -174,7 +175,7 @@ htcommand(dev, com, count)
                sleep((caddr_t)bp, PRIBIO);
        }
        bp->b_flags = B_BUSY|B_READ;
                sleep((caddr_t)bp, PRIBIO);
        }
        bp->b_flags = B_BUSY|B_READ;
-       (void) spl0();
+       splx(s);
        bp->b_dev = dev;
        bp->b_command = com;
        bp->b_repcnt = count;
        bp->b_dev = dev;
        bp->b_command = com;
        bp->b_repcnt = count;
@@ -193,10 +194,11 @@ htstrategy(bp)
 {
        register struct mba_device *mi = htinfo[HTUNIT(bp->b_dev)];
        register struct buf *dp;
 {
        register struct mba_device *mi = htinfo[HTUNIT(bp->b_dev)];
        register struct buf *dp;
+       register int s;
 
        bp->av_forw = NULL;
        dp = &mi->mi_tab;
 
        bp->av_forw = NULL;
        dp = &mi->mi_tab;
-       (void) spl5();
+       s = spl5();
        if (dp->b_actf == NULL)
                dp->b_actf = bp;
        else
        if (dp->b_actf == NULL)
                dp->b_actf = bp;
        else
@@ -204,7 +206,7 @@ htstrategy(bp)
        dp->b_actl = bp;
        if (dp->b_active == 0)
                mbustart(mi);
        dp->b_actl = bp;
        if (dp->b_active == 0)
                mbustart(mi);
-       (void) spl0();
+       splx(s);
 }
 
 htustart(mi)
 }
 
 htustart(mi)
@@ -269,6 +271,7 @@ htustart(mi)
                        }
                        if (htaddr->htds & HTDS_EOT) {
                                bp->b_resid = bp->b_bcount;
                        }
                        if (htaddr->htds & HTDS_EOT) {
                                bp->b_resid = bp->b_bcount;
+                               bp->b_flags |= B_ERROR;
                                return (MBU_NEXT);
                        }
                }
                                return (MBU_NEXT);
                        }
                }