Use irq directly not as a mask

This commit is contained in:
brezak 1995-02-28 21:47:42 +00:00
parent e6371e01f3
commit 63d3904bce
6 changed files with 34 additions and 44 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pas.c,v 1.1 1995/02/21 02:27:18 brezak Exp $ */
/* $NetBSD: pas.c,v 1.2 1995/02/28 21:47:53 brezak Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: pas.c,v 1.1 1995/02/21 02:27:18 brezak Exp $
* $Id: pas.c,v 1.2 1995/02/28 21:47:53 brezak Exp $
*/
/*
* Todo:
@ -338,10 +338,10 @@ pasprobe(parent, self, aux)
printf("pas: sb emulation requires known irq\n");
return (0);
}
irq = ffs(ia->ia_irq) - 1;
irq = ia->ia_irq;
pasconf(sc->model, ia->ia_iobase, irq, 1);
} else {
DPRINTF(("sb: could not probe pas\n"));
DPRINTF(("pas: could not probe pas\n"));
return (0);
}
@ -358,7 +358,7 @@ pasprobe(parent, self, aux)
* Cannot auto-discover DMA channel.
*/
if (!SB_DRQ_VALID(ia->ia_drq)) {
printf("sb: configured dma chan %d invalid\n", ia->ia_drq);
printf("pas: configured dma chan %d invalid\n", ia->ia_drq);
return 0;
}
#ifdef NEWCONFIG
@ -375,12 +375,12 @@ pasprobe(parent, self, aux)
} else
#endif
if (!SB_IRQ_VALID(ia->ia_irq)) {
int irq = ffs(ia->ia_irq) - 1;
int irq = ia->ia_irq;
printf("pas: configured irq %d invalid\n", irq);
return 0;
}
sc->sc_sbdsp.sc_irq = ffs(ia->ia_irq) - 1;
sc->sc_sbdsp.sc_irq = ia->ia_irq;
sc->sc_sbdsp.sc_drq = ia->ia_drq;
if (sbdsp_probe(&sc->sc_sbdsp) == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb.c,v 1.17 1995/02/21 02:28:06 brezak Exp $ */
/* $NetBSD: sb.c,v 1.18 1995/02/28 21:47:42 brezak Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sb.c,v 1.17 1995/02/21 02:28:06 brezak Exp $
* $Id: sb.c,v 1.18 1995/02/28 21:47:42 brezak Exp $
*/
#include <sys/param.h>
@ -201,20 +201,18 @@ sbprobe(parent, self, aux)
#endif
if (ISSBPROCLASS(&sc->sc_sbdsp)) {
if (!SBP_IRQ_VALID(ia->ia_irq)) {
int irq = ffs(ia->ia_irq) - 1;
printf("sb: configured irq %d invalid\n", irq);
printf("sb: configured irq %d invalid\n", ia->ia_irq);
return 0;
}
}
else {
if (!SB_IRQ_VALID(ia->ia_irq)) {
int irq = ffs(ia->ia_irq) - 1;
printf("sb: configured irq %d invalid\n", irq);
printf("sb: configured irq %d invalid\n", ia->ia_irq);
return 0;
}
}
sc->sc_sbdsp.sc_irq = ffs(ia->ia_irq) - 1;
sc->sc_sbdsp.sc_irq = ia->ia_irq;
sc->sc_sbdsp.sc_drq = ia->ia_drq;
if (ISSBPROCLASS(&sc->sc_sbdsp))

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbreg.h,v 1.7 1995/02/21 02:28:10 brezak Exp $ */
/* $NetBSD: sbreg.h,v 1.8 1995/02/28 21:47:47 brezak Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* From: Header: sbreg.h,v 1.3 93/07/18 14:07:28 mccanne Exp (LBL)
* $Id: sbreg.h,v 1.7 1995/02/21 02:28:10 brezak Exp $
* $Id: sbreg.h,v 1.8 1995/02/28 21:47:47 brezak Exp $
*/
/*
@ -175,13 +175,10 @@
/*
* Macros to detect valid hardware configuration data.
*/
#define SB_IRQ_MASK 0x00ac /* IRQ 2,3,5,7 */
#define SBP_IRQ_MASK 0x04a4 /* IRQ 2,5,7,10 */
#define SBP_IRQ_VALID(irq) ((irq) == 2 || (irq) == 5 || (irq) == 7 || (irq) == 10)
#define SB_IRQ_VALID(irq) ((irq) == 2 || (irq) == 3 || (irq) == 5 || (irq) == 7)
#define SBP_IRQ_VALID(mask) ((mask) & SBP_IRQ_MASK)
#define SB_IRQ_VALID(mask) ((mask) & SB_IRQ_MASK)
#define SBP_DRQ_VALID(chan) ((chan) == 0 || (chan) == 1 || (chan) == 3)
#define SBP_DRQ_VALID(chan) ((chan) == 0 || (chan) == 1 || (chan) == 3)
#define SB_DRQ_VALID(chan) ((chan) == 1)
#define SB_BASE_VALID(base) ((base) == 0x220 || (base) == 0x240)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pas.c,v 1.1 1995/02/21 02:27:18 brezak Exp $ */
/* $NetBSD: pas.c,v 1.2 1995/02/28 21:47:53 brezak Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: pas.c,v 1.1 1995/02/21 02:27:18 brezak Exp $
* $Id: pas.c,v 1.2 1995/02/28 21:47:53 brezak Exp $
*/
/*
* Todo:
@ -338,10 +338,10 @@ pasprobe(parent, self, aux)
printf("pas: sb emulation requires known irq\n");
return (0);
}
irq = ffs(ia->ia_irq) - 1;
irq = ia->ia_irq;
pasconf(sc->model, ia->ia_iobase, irq, 1);
} else {
DPRINTF(("sb: could not probe pas\n"));
DPRINTF(("pas: could not probe pas\n"));
return (0);
}
@ -358,7 +358,7 @@ pasprobe(parent, self, aux)
* Cannot auto-discover DMA channel.
*/
if (!SB_DRQ_VALID(ia->ia_drq)) {
printf("sb: configured dma chan %d invalid\n", ia->ia_drq);
printf("pas: configured dma chan %d invalid\n", ia->ia_drq);
return 0;
}
#ifdef NEWCONFIG
@ -375,12 +375,12 @@ pasprobe(parent, self, aux)
} else
#endif
if (!SB_IRQ_VALID(ia->ia_irq)) {
int irq = ffs(ia->ia_irq) - 1;
int irq = ia->ia_irq;
printf("pas: configured irq %d invalid\n", irq);
return 0;
}
sc->sc_sbdsp.sc_irq = ffs(ia->ia_irq) - 1;
sc->sc_sbdsp.sc_irq = ia->ia_irq;
sc->sc_sbdsp.sc_drq = ia->ia_drq;
if (sbdsp_probe(&sc->sc_sbdsp) == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sb.c,v 1.17 1995/02/21 02:28:06 brezak Exp $ */
/* $NetBSD: sb.c,v 1.18 1995/02/28 21:47:42 brezak Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sb.c,v 1.17 1995/02/21 02:28:06 brezak Exp $
* $Id: sb.c,v 1.18 1995/02/28 21:47:42 brezak Exp $
*/
#include <sys/param.h>
@ -201,20 +201,18 @@ sbprobe(parent, self, aux)
#endif
if (ISSBPROCLASS(&sc->sc_sbdsp)) {
if (!SBP_IRQ_VALID(ia->ia_irq)) {
int irq = ffs(ia->ia_irq) - 1;
printf("sb: configured irq %d invalid\n", irq);
printf("sb: configured irq %d invalid\n", ia->ia_irq);
return 0;
}
}
else {
if (!SB_IRQ_VALID(ia->ia_irq)) {
int irq = ffs(ia->ia_irq) - 1;
printf("sb: configured irq %d invalid\n", irq);
printf("sb: configured irq %d invalid\n", ia->ia_irq);
return 0;
}
}
sc->sc_sbdsp.sc_irq = ffs(ia->ia_irq) - 1;
sc->sc_sbdsp.sc_irq = ia->ia_irq;
sc->sc_sbdsp.sc_drq = ia->ia_drq;
if (ISSBPROCLASS(&sc->sc_sbdsp))

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbreg.h,v 1.7 1995/02/21 02:28:10 brezak Exp $ */
/* $NetBSD: sbreg.h,v 1.8 1995/02/28 21:47:47 brezak Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* From: Header: sbreg.h,v 1.3 93/07/18 14:07:28 mccanne Exp (LBL)
* $Id: sbreg.h,v 1.7 1995/02/21 02:28:10 brezak Exp $
* $Id: sbreg.h,v 1.8 1995/02/28 21:47:47 brezak Exp $
*/
/*
@ -175,13 +175,10 @@
/*
* Macros to detect valid hardware configuration data.
*/
#define SB_IRQ_MASK 0x00ac /* IRQ 2,3,5,7 */
#define SBP_IRQ_MASK 0x04a4 /* IRQ 2,5,7,10 */
#define SBP_IRQ_VALID(irq) ((irq) == 2 || (irq) == 5 || (irq) == 7 || (irq) == 10)
#define SB_IRQ_VALID(irq) ((irq) == 2 || (irq) == 3 || (irq) == 5 || (irq) == 7)
#define SBP_IRQ_VALID(mask) ((mask) & SBP_IRQ_MASK)
#define SB_IRQ_VALID(mask) ((mask) & SB_IRQ_MASK)
#define SBP_DRQ_VALID(chan) ((chan) == 0 || (chan) == 1 || (chan) == 3)
#define SBP_DRQ_VALID(chan) ((chan) == 0 || (chan) == 1 || (chan) == 3)
#define SB_DRQ_VALID(chan) ((chan) == 1)
#define SB_BASE_VALID(base) ((base) == 0x220 || (base) == 0x240)