summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/xd.c
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-08-12 20:24:07 +0000
committerchuck <chuck@cvs.openbsd.org>1996-08-12 20:24:07 +0000
commit04da103cb361ea9b303f3185a7c017a21c57856d (patch)
tree05a23091e2872c388fda0d31527f5ec6c4f59731 /sys/arch/sparc/dev/xd.c
parentbdc1b2d7c445ea8597500605e3067bbc6e92ca83 (diff)
repair XDC_HWAIT macro to handle the fact that waithead is now
unsigned. should fix xdc watchdog timeouts noted in port-sparc by nathanw@mit.edu.
Diffstat (limited to 'sys/arch/sparc/dev/xd.c')
-rw-r--r--sys/arch/sparc/dev/xd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/xd.c b/sys/arch/sparc/dev/xd.c
index dd5df1fa016..70caf5e3e48 100644
--- a/sys/arch/sparc/dev/xd.c
+++ b/sys/arch/sparc/dev/xd.c
@@ -103,7 +103,8 @@
* XDC_HWAIT: add iorq "N" to head of SC's wait queue
*/
#define XDC_HWAIT(SC, N) { \
- (SC)->waithead = ((SC)->waithead - 1) % XDC_MAXIOPB; \
+ (SC)->waithead = ((SC)->waithead == 0) ? \
+ (XDC_MAXIOPB - 1) : ((SC)->waithead - 1); \
(SC)->waitq[(SC)->waithead] = (N); \
(SC)->nwait++; \
}