summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchuck <chuck@openbsd.org>1996-08-12 20:24:05 +0000
committerchuck <chuck@openbsd.org>1996-08-12 20:24:05 +0000
commit56bdcad89d50af7d758f631bc291252ad44dda3a (patch)
tree6e95234475e9bc22591c7211810b5e65381c6152
parentfixes core dump if RCSLOCALID not set--oops. (diff)
downloadwireguard-openbsd-56bdcad89d50af7d758f631bc291252ad44dda3a.tar.xz
wireguard-openbsd-56bdcad89d50af7d758f631bc291252ad44dda3a.zip
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.
-rw-r--r--sys/arch/sparc/dev/xd.c3
-rw-r--r--sys/arch/sun3/dev/xd.c3
2 files changed, 4 insertions, 2 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++; \
}
diff --git a/sys/arch/sun3/dev/xd.c b/sys/arch/sun3/dev/xd.c
index 8c1e42f9b5e..d3a8f835ecb 100644
--- a/sys/arch/sun3/dev/xd.c
+++ b/sys/arch/sun3/dev/xd.c
@@ -101,7 +101,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++; \
}