Add extra argument to scb_vecalloc (a struct evcnt *)
Move ivec_dsp from trap.h to scb.h Add interrupt counting to asc, le, ze, ncr, dz interrupts. add common support for counting interrupts to cnm_idisp so it can be done very efficiently.
This commit is contained in:
parent
6dcc553fae
commit
7c24069048
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bi_mainbus.c,v 1.2 2000/03/26 11:41:25 ragge Exp $ */
|
||||
/* $NetBSD: bi_mainbus.c,v 1.3 2000/06/04 02:19:24 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
@ -52,21 +52,16 @@ struct cfattach bi_mainbus_ca = {
|
||||
extern struct vax_bus_space vax_mem_bus_space;
|
||||
extern struct vax_bus_dma_tag vax_bus_dma_tag;
|
||||
|
||||
int
|
||||
bi_mainbus_match(parent, vcf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *vcf;
|
||||
void *aux;
|
||||
static int
|
||||
bi_mainbus_match(struct device *parent, struct cfdata *vcf, void *aux)
|
||||
{
|
||||
if (vax_bustype == VAX_BIBUS)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
bi_mainbus_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
static void
|
||||
bi_mainbus_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct bi_softc *sc = (void *)self;
|
||||
|
||||
@ -82,7 +77,8 @@ bi_mainbus_attach(parent, self, aux)
|
||||
}
|
||||
|
||||
void
|
||||
bi_intr_establish(void *icookie, int vec, void (*func)(void *), void *arg)
|
||||
bi_intr_establish(void *icookie, int vec, void (*func)(void *), void *arg,
|
||||
struct evcnt *ev)
|
||||
{
|
||||
scb_vecalloc(vec, func, arg, SCB_ISTACK);
|
||||
scb_vecalloc(vec, func, arg, SCB_ISTACK, ev);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_le.c,v 1.16 2000/05/31 23:55:52 matt Exp $ */
|
||||
/* $NetBSD: if_le.c,v 1.17 2000/06/04 02:19:25 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -111,6 +111,7 @@
|
||||
|
||||
struct le_softc {
|
||||
struct am7990_softc sc_am7990; /* Must be first */
|
||||
struct evcnt sc_intrcnt;
|
||||
volatile u_short *sc_rap;
|
||||
volatile u_short *sc_rdp;
|
||||
};
|
||||
@ -186,7 +187,9 @@ le_ibus_attach(parent, self, aux)
|
||||
i = scb_vecref(&vec, &br);
|
||||
if (i == 0 || vec == 0)
|
||||
return;
|
||||
scb_vecalloc(vec, (void (*)(void *))am7990_intr, sc, SCB_ISTACK);
|
||||
scb_vecalloc(vec, (void (*)(void *))am7990_intr, sc,
|
||||
SCB_ISTACK, &sc->sc_intrcnt);
|
||||
evcnt_attach(self, "intr", &sc->sc_intrcnt);
|
||||
|
||||
printf(": vec %o ipl %x\n%s", vec, br, self->dv_xname);
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_le_vsbus.c,v 1.6 2000/05/22 15:34:05 matt Exp $ */
|
||||
/* $NetBSD: if_le_vsbus.c,v 1.7 2000/06/04 02:19:25 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -110,6 +110,7 @@
|
||||
|
||||
struct le_softc {
|
||||
struct am7990_softc sc_am7990; /* Must be first */
|
||||
struct evcnt sc_intrcnt;
|
||||
bus_dmamap_t sc_dm;
|
||||
volatile u_short *sc_rap;
|
||||
volatile u_short *sc_rdp;
|
||||
@ -228,7 +229,10 @@ le_vsbus_attach(parent, self, aux)
|
||||
sc->sc_am7990.lsc.sc_wrcsr = lewrcsr;
|
||||
sc->sc_am7990.lsc.sc_nocarrier = NULL;
|
||||
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) am7990_intr, sc, SCB_ISTACK);
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) am7990_intr, sc,
|
||||
SCB_ISTACK, &sc->sc_intrcnt);
|
||||
evcnt_attach(self, "intr", &sc->sc_intrcnt);
|
||||
|
||||
/*
|
||||
* Allocate a (DMA-safe) block for all descriptors and buffers.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_ze.c,v 1.4 2000/05/08 18:51:17 ragge Exp $ */
|
||||
/* $NetBSD: if_ze.c,v 1.5 2000/06/04 02:19:25 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||
*
|
||||
@ -124,7 +124,8 @@ zeattach(parent, self, aux)
|
||||
sc->sc_enaddr[i] = (ea[i] >> 8) & 0377;
|
||||
vax_unmap_physmem((vaddr_t)ea, 1);
|
||||
|
||||
scb_vecalloc(SGECVEC, (void (*)(void *)) sgec_intr, sc, SCB_ISTACK);
|
||||
scb_vecalloc(SGECVEC, (void (*)(void *)) sgec_intr, sc,
|
||||
SCB_ISTACK, &sc->sc_intrcnt);
|
||||
|
||||
sgec_attach(sc);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scb.h,v 1.6 2000/01/24 02:40:32 matt Exp $ */
|
||||
/* $NetBSD: scb.h,v 1.7 2000/06/04 02:19:25 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
|
||||
@ -107,13 +107,30 @@ struct scb {
|
||||
#define SCB_KSTACK 0
|
||||
#define SCB_ISTACK 1
|
||||
|
||||
/*
|
||||
* This struct is used when setting up interrupt vectors dynamically.
|
||||
* It put a opaque 32 bit quanity on the stack and also has a placeholder
|
||||
* for evcnt structure.
|
||||
*/
|
||||
struct ivec_dsp {
|
||||
char pushr; /* pushr */
|
||||
char pushrarg; /* $0x3f */
|
||||
char jsb;
|
||||
char mode;
|
||||
long displacement;
|
||||
void (*hoppaddr) __P((void *));
|
||||
void *pushlarg;
|
||||
struct evcnt *ev;
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
extern const struct ivec_dsp idsptch;
|
||||
extern struct scb *scb;
|
||||
|
||||
extern paddr_t scb_init __P((paddr_t));
|
||||
extern int scb_vecref __P((int *, int *));
|
||||
extern void scb_fake __P((int, int));
|
||||
extern void scb_vecalloc __P((int, void(*)(void *), void *, int));
|
||||
extern paddr_t scb_init (paddr_t);
|
||||
extern int scb_vecref (int *, int *);
|
||||
extern void scb_fake (int, int);
|
||||
extern void scb_vecalloc (int, void(*)(void *), void *, int, struct evcnt *);
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* _VAX_SCB_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: trap.h,v 1.17 2000/01/24 02:40:32 matt Exp $ */
|
||||
/* $NetBSD: trap.h,v 1.18 2000/06/04 02:19:26 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -91,26 +91,6 @@ struct trapframe {
|
||||
long psl; /* User psl */
|
||||
};
|
||||
|
||||
/*
|
||||
* This struct is used when setting up interrupt vectors dynamically.
|
||||
* It pushes a longword between 0-63 on the stack; this number is
|
||||
* normally used as the ctlr number on devices. This use effectively
|
||||
* limits the number of interruptable ctlrs on one unibus to 64.
|
||||
*/
|
||||
struct ivec_dsp {
|
||||
char pushr; /* pushr */
|
||||
char pushrarg; /* $0x3f */
|
||||
char jsb;
|
||||
char mode;
|
||||
long displacement;
|
||||
void (*hoppaddr) __P((void *));
|
||||
void *pushlarg;
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
extern const struct ivec_dsp idsptch;
|
||||
#endif
|
||||
|
||||
#endif /* _LOCORE */
|
||||
|
||||
#endif /* _VAX_TRAP_H_ */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cfl.c,v 1.4 2000/05/27 04:52:33 thorpej Exp $ */
|
||||
/* $NetBSD: cfl.c,v 1.5 2000/06/04 02:19:26 matt Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
|
||||
* Copyright (c) 1982, 1986 The Regents of the University of California.
|
||||
@ -115,8 +115,10 @@ cflclose(dev, flag, p)
|
||||
int flag;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
int s;
|
||||
s = splbio();
|
||||
brelse(cfltab.cfl_buf);
|
||||
splx(s);
|
||||
cfltab.cfl_state = IDLE;
|
||||
return 0;
|
||||
}
|
||||
@ -135,7 +137,7 @@ cflrw(dev, uio, flag)
|
||||
|
||||
if (uio->uio_resid == 0)
|
||||
return (0);
|
||||
s = spl4();
|
||||
s = splconsfloppy();
|
||||
while (cfltab.cfl_state == BUSY)
|
||||
(void) tsleep(&cfltab, PRIBIO, "cflbusy", 0);
|
||||
cfltab.cfl_state = BUSY;
|
||||
@ -156,7 +158,7 @@ cflrw(dev, uio, flag)
|
||||
break;
|
||||
}
|
||||
bp->b_flags = uio->uio_rw == UIO_WRITE ? B_WRITE : B_READ;
|
||||
s = spl4();
|
||||
s = splconsfloppy();
|
||||
cflstart();
|
||||
while ((bp->b_flags & B_DONE) == 0)
|
||||
(void) tsleep(bp, PRIBIO, "cflrw", 0);
|
||||
@ -236,10 +238,10 @@ cfltint(arg)
|
||||
void cflrint __P((int));
|
||||
|
||||
void
|
||||
cflrint(ch)
|
||||
int ch;
|
||||
cflrint(int ch)
|
||||
{
|
||||
struct buf *bp = cfltab.cfl_buf;
|
||||
int s;
|
||||
|
||||
switch (cfltab.cfl_active) {
|
||||
case CFL_NEXT:
|
||||
@ -247,7 +249,9 @@ cflrint(ch)
|
||||
cfltab.cfl_active = CFL_GETIN;
|
||||
else {
|
||||
cfltab.cfl_active = CFL_IDLE;
|
||||
s = splbio();
|
||||
bp->b_flags |= B_DONE;
|
||||
splx(s);
|
||||
wakeup(bp);
|
||||
}
|
||||
break;
|
||||
@ -256,7 +260,9 @@ cflrint(ch)
|
||||
*cfltab.cfl_xaddr++ = ch & 0377;
|
||||
if (--bp->b_bcount==0) {
|
||||
cfltab.cfl_active = CFL_IDLE;
|
||||
s = splbio();
|
||||
bp->b_flags |= B_DONE;
|
||||
splx(s);
|
||||
wakeup(bp);
|
||||
}
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: genassym.cf,v 1.19 2000/06/02 21:51:16 matt Exp $
|
||||
# $NetBSD: genassym.cf,v 1.20 2000/06/04 02:19:26 matt Exp $
|
||||
#
|
||||
# Copyright (c) 1997 Ludd, University of Lule}, Sweden.
|
||||
# All rights reserved.
|
||||
@ -36,6 +36,7 @@ include <sys/proc.h>
|
||||
include <sys/errno.h>
|
||||
include <sys/syscall.h>
|
||||
include <sys/sched.h>
|
||||
include <sys/device.h>
|
||||
|
||||
include <net/netisr.h>
|
||||
|
||||
@ -117,19 +118,23 @@ define T_KDBTRAP T_KDBTRAP
|
||||
|
||||
# software net interrupts
|
||||
define NETISR_IP NETISR_IP
|
||||
define NETISR_ARP NETISR_ARP
|
||||
define NETISR_NS NETISR_NS
|
||||
define NETISR_ATALK NETISR_ATALK
|
||||
define NETISR_ISO NETISR_ISO
|
||||
define NETISR_CCITT NETISR_CCITT
|
||||
define NETISR_PPP NETISR_PPP
|
||||
define NETISR_ATALK NETISR_ATALK
|
||||
define NETISR_IPX NETISR_IPX
|
||||
define NETISR_IPV6 NETISR_IPV6
|
||||
define NETISR_NS NETISR_NS
|
||||
define NETISR_ISDN NETISR_ISDN
|
||||
define NETISR_ARP NETISR_ARP
|
||||
define NETISR_PPP NETISR_PPP
|
||||
|
||||
define USPACE USPACE
|
||||
|
||||
define ENAMETOOLONG ENAMETOOLONG
|
||||
define EFAULT EFAULT
|
||||
|
||||
define EV_COUNT offsetof(struct evcnt, ev_count)
|
||||
|
||||
define SYS___sigreturn14 SYS___sigreturn14
|
||||
define SYS_exit SYS_exit
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gencons.c,v 1.23 2000/05/08 17:53:24 ragge Exp $ */
|
||||
/* $NetBSD: gencons.c,v 1.24 2000/06/04 02:19:26 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Gordon W. Ross
|
||||
@ -287,19 +287,19 @@ gencninit(cndev)
|
||||
{
|
||||
|
||||
/* Allocate interrupt vectors */
|
||||
scb_vecalloc(SCB_G0R, gencnrint, &gencn_tty[0], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G0T, gencntint, &gencn_tty[0], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G0R, gencnrint, &gencn_tty[0], SCB_ISTACK, NULL);
|
||||
scb_vecalloc(SCB_G0T, gencntint, &gencn_tty[0], SCB_ISTACK, NULL);
|
||||
|
||||
if (vax_cputype == VAX_TYP_8SS) {
|
||||
maxttys = 4;
|
||||
scb_vecalloc(SCB_G1R, gencnrint, &gencn_tty[1], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G1T, gencntint, &gencn_tty[1], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G1R, gencnrint, &gencn_tty[1], SCB_ISTACK, NULL);
|
||||
scb_vecalloc(SCB_G1T, gencntint, &gencn_tty[1], SCB_ISTACK, NULL);
|
||||
|
||||
scb_vecalloc(SCB_G2R, gencnrint, &gencn_tty[2], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G2T, gencntint, &gencn_tty[2], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G2R, gencnrint, &gencn_tty[2], SCB_ISTACK, NULL);
|
||||
scb_vecalloc(SCB_G2T, gencntint, &gencn_tty[2], SCB_ISTACK, NULL);
|
||||
|
||||
scb_vecalloc(SCB_G3R, gencnrint, &gencn_tty[3], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G3T, gencntint, &gencn_tty[3], SCB_ISTACK);
|
||||
scb_vecalloc(SCB_G3R, gencnrint, &gencn_tty[3], SCB_ISTACK, NULL);
|
||||
scb_vecalloc(SCB_G3T, gencntint, &gencn_tty[3], SCB_ISTACK, NULL);
|
||||
}
|
||||
mtpr(0, PR_TBIA); /* ??? */
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: intvec.s,v 1.43 2000/06/02 21:51:15 matt Exp $ */
|
||||
/* $NetBSD: intvec.s,v 1.44 2000/06/04 02:19:27 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1997 Ludd, University of Lule}, Sweden.
|
||||
@ -219,8 +219,9 @@ L4: addl2 (sp)+,sp # remove info pushed on stack
|
||||
* put in a need for an extra check when the fault is gotten during
|
||||
* PTE reference. Handled in pmap.c.
|
||||
*/
|
||||
.align 2
|
||||
transl_v: .globl transl_v # Translation violation, 20
|
||||
.align 2
|
||||
.globl transl_v # 20: Translation violation
|
||||
transl_v:
|
||||
pushr $0x3f
|
||||
pushl 28(sp)
|
||||
pushl 28(sp)
|
||||
@ -233,8 +234,9 @@ transl_v: .globl transl_v # Translation violation, 20
|
||||
1: popr $0x3f
|
||||
brb access_v
|
||||
|
||||
.align 2
|
||||
access_v:.globl access_v # Access cntrl viol fault, 24
|
||||
.align 2
|
||||
.globl access_v # 24: Access cntrl viol fault
|
||||
access_v:
|
||||
blbs (sp), ptelen
|
||||
pushl $T_ACCFLT
|
||||
bbc $1,4(sp),1f
|
||||
@ -278,7 +280,7 @@ ENTRY(cmrerr)
|
||||
rei
|
||||
|
||||
ENTRY(sbiflt);
|
||||
movab sbifltmsg, -(sp)
|
||||
pushab sbifltmsg
|
||||
calls $1, _panic
|
||||
|
||||
TRAPCALL(astintr, T_ASTFLT)
|
||||
@ -288,14 +290,18 @@ FASTINTR(softclock,softclock)
|
||||
ENTRY(softnet)
|
||||
PUSHR
|
||||
|
||||
# tstl _netisr # any netisr's set
|
||||
# beql 2f # no, skip looking at them one by one
|
||||
#define DONETISR(bit, fn) \
|
||||
bbcc $bit,_netisr,1f; calls $0,__CONCAT(_,fn); 1:
|
||||
bbcc $bit,_netisr,1f; \
|
||||
calls $0,__CONCAT(_,fn); \
|
||||
1:
|
||||
|
||||
#include <net/netisr_dispatch.h>
|
||||
|
||||
#undef DONETISR
|
||||
|
||||
movab _softnet_head,r0
|
||||
2: movab _softnet_head,r0
|
||||
jsb softintr_dispatch
|
||||
POPR
|
||||
rei
|
||||
|
@ -218,8 +218,8 @@ ka49_steal_pages()
|
||||
/*
|
||||
* Get the soft and hard memory error vectors now.
|
||||
*/
|
||||
scb_vecalloc(0x54, ka49_softmem, 0, 0);
|
||||
scb_vecalloc(0x60, ka49_hardmem, 0, 0);
|
||||
scb_vecalloc(0x54, ka49_softmem, NULL, 0, NULL);
|
||||
scb_vecalloc(0x60, ka49_hardmem, NULL, 0, NULL);
|
||||
|
||||
/* Turn on caches (to speed up execution a bit) */
|
||||
ka49_cache_enable();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ka53.c,v 1.1 2000/05/08 18:45:26 ragge Exp $ */
|
||||
/* $NetBSD: ka53.c,v 1.2 2000/06/04 02:19:27 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2000 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
@ -211,8 +211,8 @@ ka53_steal_pages()
|
||||
* Get the soft and hard memory error vectors now.
|
||||
*/
|
||||
|
||||
scb_vecalloc(0x54, ka53_softmem, 0, 0);
|
||||
scb_vecalloc(0x60, ka53_hardmem, 0, 0);
|
||||
scb_vecalloc(0x54, ka53_softmem, NULL, 0, NULL);
|
||||
scb_vecalloc(0x60, ka53_hardmem, NULL, 0, NULL);
|
||||
|
||||
|
||||
/* Turn on caches (to speed up execution a bit) */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ka680.c,v 1.1 2000/05/08 18:45:27 ragge Exp $ */
|
||||
/* $NetBSD: ka680.c,v 1.2 2000/06/04 02:19:27 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2000 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
@ -209,8 +209,8 @@ ka680_steal_pages()
|
||||
* Get the soft and hard memory error vectors now.
|
||||
*/
|
||||
#ifdef notyet
|
||||
scb_vecalloc(0x54, ka680_softmem, 0, 0);
|
||||
scb_vecalloc(0x60, ka680_hardmem, 0, 0);
|
||||
scb_vecalloc(0x54, ka680_softmem, NULL, 0, NULL);
|
||||
scb_vecalloc(0x60, ka680_hardmem, NULL, 0, NULL);
|
||||
#endif
|
||||
|
||||
/* Turn on caches (to speed up execution a bit) */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ka820.c,v 1.21 2000/04/09 21:05:39 ragge Exp $ */
|
||||
/* $NetBSD: ka820.c,v 1.22 2000/06/04 02:19:27 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1988 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
@ -165,11 +165,11 @@ ka820_conf()
|
||||
ka820_clkpage = (void *)vax_map_physmem(KA820_CLOCKADDR, 1);
|
||||
|
||||
/* Steal the interrupt vectors that are unique for us */
|
||||
scb_vecalloc(KA820_INT_RXCD, rxcdintr, NULL, SCB_ISTACK);
|
||||
scb_vecalloc(0x50, vaxbierr, NULL, SCB_ISTACK);
|
||||
scb_vecalloc(KA820_INT_RXCD, rxcdintr, NULL, SCB_ISTACK, NULL);
|
||||
scb_vecalloc(0x50, vaxbierr, NULL, SCB_ISTACK, NULL);
|
||||
|
||||
/* XXX - should be done somewhere else */
|
||||
scb_vecalloc(SCB_RX50, crxintr, NULL, SCB_ISTACK);
|
||||
scb_vecalloc(SCB_RX50, crxintr, NULL, SCB_ISTACK, NULL);
|
||||
rx50device_ptr = (void *)vax_map_physmem(KA820_RX50ADDR, 1);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scb.c,v 1.10 2000/04/22 17:05:08 ragge Exp $ */
|
||||
/* $NetBSD: scb.c,v 1.11 2000/06/04 02:19:28 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
@ -36,6 +36,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
#include <machine/trap.h>
|
||||
#include <machine/scb.h>
|
||||
@ -46,14 +47,17 @@
|
||||
|
||||
static void scb_stray __P((void *));
|
||||
|
||||
#if 0
|
||||
static struct evcnt scb_stray_intrcnt;
|
||||
#endif
|
||||
static struct ivec_dsp *scb_vec;
|
||||
static volatile int vector, ipl, gotintr;
|
||||
|
||||
/*
|
||||
* Generates a new SCB.
|
||||
*/
|
||||
paddr_t
|
||||
scb_init(avail_start)
|
||||
paddr_t avail_start;
|
||||
scb_init(paddr_t avail_start)
|
||||
{
|
||||
struct ivec_dsp **ivec = (struct ivec_dsp **)avail_start;
|
||||
struct ivec_dsp **old = (struct ivec_dsp **)KERNBASE;
|
||||
@ -71,6 +75,7 @@ scb_init(avail_start)
|
||||
scb_vec[i] = idsptch;
|
||||
scb_vec[i].hoppaddr = scb_stray;
|
||||
scb_vec[i].pushlarg = (void *) (i * 4);
|
||||
scb_vec[i].ev = NULL;
|
||||
}
|
||||
/*
|
||||
* Copy all pre-set interrupt vectors to the new SCB.
|
||||
@ -85,7 +90,8 @@ scb_init(avail_start)
|
||||
mtpr(avail_start, PR_SCBB);
|
||||
|
||||
/* Return new avail_start. Also save space for the dispatchers. */
|
||||
return avail_start + (scb_size * 5) * VAX_NBPG;
|
||||
return avail_start + (1 + sizeof(struct ivec_dsp) / sizeof(void *))
|
||||
* scb_size * VAX_NBPG;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -93,8 +99,7 @@ scb_init(avail_start)
|
||||
* This function must _not_ save any registers (in the reg save mask).
|
||||
*/
|
||||
void
|
||||
scb_stray(arg)
|
||||
void *arg;
|
||||
scb_stray(void *arg)
|
||||
{
|
||||
struct callsframe *cf = FRAMEOFFSET(arg);
|
||||
int *a = &cf->ca_arg1;
|
||||
@ -115,8 +120,7 @@ scb_stray(arg)
|
||||
* (May I say DW780? :-)
|
||||
*/
|
||||
void
|
||||
scb_fake(vec, br)
|
||||
int vec, br;
|
||||
scb_fake(int vec, int br)
|
||||
{
|
||||
vector = vec;
|
||||
ipl = br;
|
||||
@ -127,8 +131,7 @@ scb_fake(vec, br)
|
||||
* Returns last vector/ipl referenced. Clears vector/ipl after reading.
|
||||
*/
|
||||
int
|
||||
scb_vecref(rvec, ripl)
|
||||
int *rvec, *ripl;
|
||||
scb_vecref(int *rvec, int *ripl)
|
||||
{
|
||||
int save;
|
||||
|
||||
@ -147,15 +150,12 @@ scb_vecref(rvec, ripl)
|
||||
* Arg may not be greater than 63.
|
||||
*/
|
||||
void
|
||||
scb_vecalloc(vecno, func, arg, stack)
|
||||
int vecno;
|
||||
void (*func) __P((void *));
|
||||
void *arg;
|
||||
int stack;
|
||||
scb_vecalloc(int vecno, void (*func)(void *), void *arg,
|
||||
int stack, struct evcnt *ev)
|
||||
{
|
||||
struct ivec_dsp *dsp = &scb_vec[vecno / 4];
|
||||
u_int *iscb = (u_int *)scb; /* XXX */
|
||||
dsp->hoppaddr = func;
|
||||
dsp->pushlarg = arg;
|
||||
iscb[vecno/4] = (u_int)(dsp) | stack;
|
||||
dsp->ev = ev;
|
||||
((intptr_t *) scb)[vecno/4] = (intptr_t)(dsp) | stack;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: subr.s,v 1.44 2000/06/02 21:51:16 matt Exp $ */
|
||||
/* $NetBSD: subr.s,v 1.45 2000/06/04 02:19:28 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
|
||||
@ -144,22 +144,27 @@ _ultrix_esigcode:
|
||||
|
||||
.globl _idsptch, _eidsptch
|
||||
_idsptch: pushr $0x3f
|
||||
.word 0x9f16
|
||||
.long _cmn_idsptch
|
||||
.long 0
|
||||
.long 0
|
||||
.word 0x9f16 # jsb to absolute address
|
||||
.long _cmn_idsptch # the absolute address
|
||||
.long 0 # the callback interrupt routine
|
||||
.long 0 # its argument
|
||||
.long 0 # ptr to correspond evcnt struct
|
||||
_eidsptch:
|
||||
|
||||
_cmn_idsptch:
|
||||
movl (sp)+,r0
|
||||
pushl 4(r0)
|
||||
calls $1,*(r0)
|
||||
popr $0x3f
|
||||
rei
|
||||
movl (sp)+,r0 # get pointer to idspvec
|
||||
movl 8(r0),r1 # get evcnt pointer
|
||||
beql 1f # no ptr, skip increment
|
||||
incl EV_COUNT(r1) # increment low longword
|
||||
# adwc $0,EV_COUNT+4(r1) # add any carry to hi longword
|
||||
1: pushl 4(r0) # push argument
|
||||
calls $1,*(r0) # call interrupt routine
|
||||
popr $0x3f # pop registers
|
||||
rei # return from interrut
|
||||
|
||||
ENTRY(badaddr,0) # Called with addr,b/w/l
|
||||
mfpr $0x12,r0
|
||||
mtpr $0x1f,$0x12
|
||||
mfpr $0x12,r0 # splhigh()
|
||||
mtpr $IPL_HIGH,$0x12
|
||||
movl 4(ap),r2 # First argument, the address
|
||||
movl 8(ap),r1 # Sec arg, b,w,l
|
||||
pushl r0 # Save old IPL
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: asc_vsbus.c,v 1.14 2000/05/23 23:47:29 matt Exp $ */
|
||||
/* $NetBSD: asc_vsbus.c,v 1.15 2000/06/04 02:19:28 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.14 2000/05/23 23:47:29 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.15 2000/06/04 02:19:28 matt Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -74,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.14 2000/05/23 23:47:29 matt Exp $");
|
||||
|
||||
struct asc_vsbus_softc {
|
||||
struct ncr53c9x_softc sc_ncr53c9x; /* Must be first */
|
||||
struct evcnt sc_intrcnt; /* count interrupts */
|
||||
bus_space_tag_t sc_bst; /* bus space tag */
|
||||
bus_space_handle_t sc_bsh; /* bus space handle */
|
||||
bus_space_handle_t sc_dirh; /* scsi direction handle */
|
||||
@ -273,7 +274,8 @@ asc_vsbus_attach(struct device *parent, struct device *self, void *aux)
|
||||
sc->sc_freq /= 1000000;
|
||||
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr53c9x_intr,
|
||||
&asc->sc_ncr53c9x, SCB_ISTACK);
|
||||
&asc->sc_ncr53c9x, SCB_ISTACK, &asc->sc_intrcnt);
|
||||
evcnt_attach(self, "intr", &asc->sc_intrcnt);
|
||||
|
||||
/*
|
||||
* XXX More of this should be in ncr53c9x_attach(), but
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dz_ibus.c,v 1.16 2000/01/24 02:40:35 matt Exp $ */
|
||||
/* $NetBSD: dz_ibus.c,v 1.17 2000/06/04 02:19:29 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
|
||||
* All rights reserved.
|
||||
@ -144,8 +144,8 @@ dz_vsbus_attach(parent, self, aux)
|
||||
|
||||
sc->sc_dsr = 0x0f; /* XXX check if VS has modem ctrl bits */
|
||||
|
||||
scb_vecalloc(va->va_cvec, dzxint, sc, SCB_ISTACK);
|
||||
scb_vecalloc(va->va_cvec - 4, dzrint, sc, SCB_ISTACK);
|
||||
scb_vecalloc(va->va_cvec, dzxint, sc, SCB_ISTACK, &sc->sc_tintrcnt);
|
||||
scb_vecalloc(va->va_cvec - 4, dzrint, sc, SCB_ISTACK, &sc->sc_rintrcnt);
|
||||
|
||||
printf("\n%s: 4 lines", self->dv_xname);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_ze_vsbus.c,v 1.3 2000/04/23 16:38:54 matt Exp $ */
|
||||
/* $NetBSD: if_ze_vsbus.c,v 1.4 2000/06/04 02:19:29 matt Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
|
||||
*
|
||||
@ -115,7 +115,8 @@ zeattach(parent, self, aux)
|
||||
sc->sc_dmat = &vax_bus_dma_tag;
|
||||
|
||||
sc->sc_intvec = SGECVEC;
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) sgec_intr, sc, SCB_ISTACK);
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) sgec_intr,
|
||||
sc, SCB_ISTACK, &sc->sc_intrcnt);
|
||||
|
||||
/*
|
||||
* Map in, read and release ethernet rom address.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ncr.c,v 1.27 2000/05/27 10:12:45 ragge Exp $ */
|
||||
/* $NetBSD: ncr.c,v 1.28 2000/06/04 02:19:29 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -94,6 +94,7 @@ struct si_dma_handle {
|
||||
|
||||
struct si_softc {
|
||||
struct ncr5380_softc ncr_sc;
|
||||
struct evcnt ncr_intrcnt;
|
||||
caddr_t ncr_addr;
|
||||
int ncr_off;
|
||||
int ncr_dmaaddr;
|
||||
@ -149,7 +150,8 @@ si_attach(parent, self, aux)
|
||||
struct ncr5380_softc *ncr_sc = &sc->ncr_sc;
|
||||
int tweak, target;
|
||||
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr5380_intr, sc, SCB_ISTACK);
|
||||
scb_vecalloc(va->va_cvec, (void (*)(void *)) ncr5380_intr, sc,
|
||||
SCB_ISTACK, &sc->ncr_intrcnt);
|
||||
|
||||
/*
|
||||
* DMA area mapin.
|
||||
|
Loading…
Reference in New Issue
Block a user