fix bug to fix bug in compiler bug in dh bug
[unix-history] / usr / src / sys / vax / uba / dh.c
index b21425d..77bd7d6 100644 (file)
@@ -1,4 +1,4 @@
-/*     dh.c    4.30    81/03/09        */
+/*     dh.c    4.32    81/04/22        */
 
 #include "dh.h"
 #if NDH > 0
 
 #include "dh.h"
 #if NDH > 0
@@ -75,7 +75,11 @@ struct dhdevice
 #define        OPAR    040
 #define        HDUPLX  040000
 
 #define        OPAR    040
 #define        HDUPLX  040000
 
+#if NBK == 0
+#define        DH_IE   (DH_TIE|DH_RIE)
+#else
 #define        DH_IE   (DH_TIE|DH_SIE|DH_RIE)
 #define        DH_IE   (DH_TIE|DH_SIE|DH_RIE)
+#endif
 
 /* Bits in dhrcr */
 #define        DH_PE           0010000         /* parity error */
 
 /* Bits in dhrcr */
 #define        DH_PE           0010000         /* parity error */
@@ -152,7 +156,7 @@ dhprobe(reg)
 #endif
 #ifndef notdef
        dhaddr->un.dhcsr = DH_RIE|DH_MM|DH_RI;
 #endif
 #ifndef notdef
        dhaddr->un.dhcsr = DH_RIE|DH_MM|DH_RI;
-       DELAY(5);
+       DELAY(25);
        dhaddr->un.dhcsr = 0;
 #else
        dhaddr->un.dhcsr = DH_TIE;
        dhaddr->un.dhcsr = 0;
 #else
        dhaddr->un.dhcsr = DH_TIE;
@@ -555,11 +559,17 @@ dhstart(tp)
        if (nch) {
                car = UBACVT(tp->t_outq.c_cf, dhinfo[dh]->ui_ubanum);
                addr->un.dhcsrl = unit|((car>>12)&0x30)|DH_IE;
        if (nch) {
                car = UBACVT(tp->t_outq.c_cf, dhinfo[dh]->ui_ubanum);
                addr->un.dhcsrl = unit|((car>>12)&0x30)|DH_IE;
-               unit = 1 << unit;
-               dhsar[dh] |= unit;
+               /*
+                * The following nonsense with short word
+                * is to make sure the dhbar |= word below
+                * is done with an interlocking bisw2 instruction.
+                */
+               { short word = 1 << unit;
+               dhsar[dh] |= word;
                addr->dhcar = car;
                addr->dhbcr = -nch;
                addr->dhcar = car;
                addr->dhbcr = -nch;
-               addr->dhbar |= unit;
+               addr->dhbar |= word;
+               }
                tp->t_state |= BUSY;
        }
 out:
                tp->t_state |= BUSY;
        }
 out: