Add evcnt_attach().

This commit is contained in:
pk 1995-04-07 19:46:13 +00:00
parent ce01c21e6d
commit 8161907540
4 changed files with 18 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.2 1995/02/22 21:37:15 pk Exp $ */
/* $NetBSD: fd.c,v 1.3 1995/04/07 19:46:13 pk Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
@ -115,6 +115,7 @@ struct fdc_softc {
#define sc_tc sc_io.fdcio_tc
#define sc_nstat sc_io.fdcio_nstat
#define sc_status sc_io.fdcio_status
#define sc_intrcnt sc_io.fdcio_intrcnt
};
#ifndef FDC_C_HANDLER
@ -365,6 +366,8 @@ fdcattach(parent, self, aux)
printf(" CFGLOCK: unexpected response");
}
evcnt_attach(&fdc->sc_dk.dk_dev, "intr", &fdc->sc_intrcnt);
printf(" pri %d, softpri %d: chip %s\n", pri, PIL_FDSOFT,
(fdc->sc_flags & FDC_82077)?"82077":"82072");

View File

@ -1,5 +1,5 @@
/*
* $NetBSD: fdvar.h,v 1.2 1995/03/08 20:58:05 pk Exp $
* $NetBSD: fdvar.h,v 1.3 1995/04/07 19:46:15 pk Exp $
*
* Copyright (c) 1995 Paul Kranenburg
* All rights reserved.
@ -58,6 +58,11 @@ struct fdcio {
int fdcio_tc; /* pseudo-dma Terminal Count */
u_char fdcio_status[FDC_NSTATUS]; /* copy of registers */
int fdcio_nstat; /* # of valid status bytes */
/*
* Statictics.
*/
struct evcnt fdcio_intrcnt;
};
#endif /* LOCORE */

View File

@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: bsd_fdintr.s,v 1.2 1995/03/02 20:47:11 pk Exp $
* $NetBSD: bsd_fdintr.s,v 1.3 1995/04/07 19:49:30 pk Exp $
*/
#ifndef FDC_C_HANDLER
@ -91,6 +91,11 @@ _fdchwintr:
sethi %hi(_fdciop), %l7
ld [%l7 + %lo(_fdciop)], R_fdc
! tally interrupt
ld [R_fdc + FDC_EVCNT], %l6
inc %l6
st %l6, [R_fdc + FDC_EVCNT]
! load chips register addresses
ld [R_fdc + FDC_REG_MSR], R_msr ! get chip MSR reg addr
ld [R_fdc + FDC_REG_FIFO], R_fifo ! get chip FIFO reg addr

View File

@ -1,4 +1,4 @@
/* $NetBSD: genassym.c,v 1.11 1995/02/22 21:17:53 pk Exp $ */
/* $NetBSD: genassym.c,v 1.12 1995/04/07 19:49:29 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@ -218,6 +218,7 @@ main()
off("FDC_NSTAT", struct fdcio, fdcio_nstat);
off("FDC_DATA", struct fdcio, fdcio_data);
off("FDC_TC", struct fdcio, fdcio_tc);
off("FDC_EVCNT", struct fdcio, fdcio_intrcnt.ev_count);
flush();