From 04da103cb361ea9b303f3185a7c017a21c57856d Mon Sep 17 00:00:00 2001 From: chuck Date: Mon, 12 Aug 1996 20:24:07 +0000 Subject: 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. --- sys/arch/sparc/dev/xd.c | 3 ++- sys/arch/sun3/dev/xd.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/arch') 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++; \ } -- cgit v1.2.3