Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips add event counters for int0 at mainbus
details: https://anonhg.NetBSD.org/src/rev/7e318246311d
branches: trunk
changeset: 433683:7e318246311d
user: macallan <macallan%NetBSD.org@localhost>
date: Thu Sep 27 17:34:28 2018 +0000
description:
add event counters for int0 at mainbus
diffstat:
sys/arch/sgimips/dev/int.c | 22 ++++++++++++++++++++--
sys/arch/sgimips/include/intr.h | 5 +++--
2 files changed, 23 insertions(+), 4 deletions(-)
diffs (104 lines):
diff -r c39f9fab5cd9 -r 7e318246311d sys/arch/sgimips/dev/int.c
--- a/sys/arch/sgimips/dev/int.c Thu Sep 27 16:34:08 2018 +0000
+++ b/sys/arch/sgimips/dev/int.c Thu Sep 27 17:34:28 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: int.c,v 1.28 2015/02/18 16:47:58 macallan Exp $ */
+/* $NetBSD: int.c,v 1.29 2018/09/27 17:34:28 macallan Exp $ */
/*
* Copyright (c) 2009 Stephen M. Rumble
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.28 2015/02/18 16:47:58 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.29 2018/09/27 17:34:28 macallan Exp $");
#define __INTR_PRIVATE
#include "opt_cputype.h"
@@ -114,6 +114,12 @@
int_attach(device_t parent, device_t self, void *aux)
{
uint32_t address;
+ int i;
+
+ for (i = 0; i < NINTR; i++) {
+ intrtab[i].ih_fun = NULL;
+ snprintf(intrtab[i].ih_evname, 7, "%d", i);
+ }
switch (mach_type) {
case MACH_SGI_IP6 | MACH_SGI_IP10:
@@ -220,9 +226,17 @@
/* Wire interrupts 7, 11 to mappable interrupt 0,1 handlers */
intrtab[7].ih_fun = int2_mappable_intr;
intrtab[7].ih_arg = (void*) 0;
+ snprintf(intrtab[7].ih_evname, 7, "map0");
intrtab[11].ih_fun = int2_mappable_intr;
intrtab[11].ih_arg = (void*) 1;
+ snprintf(intrtab[11].ih_evname, 7, "map1");
+ }
+
+ for (i = 0; i < NINTR; i++) {
+ evcnt_attach_dynamic(&intrtab[i].ih_evcnt,
+ EVCNT_TYPE_INTR, NULL,
+ "int", intrtab[i].ih_evname);
}
}
@@ -246,6 +260,7 @@
for (i = 0; i < 8; i++) {
intnum = i + 16 + (which << 3);
if (mstat & (1 << i)) {
+ intrtab[intnum].ih_evcnt.ev_count++;
for (ih = &intrtab[intnum]; ih != NULL;
ih = ih->ih_next) {
if (ih->ih_fun != NULL)
@@ -276,6 +291,7 @@
for (i = 0; stat != 0; i++, stat >>= 1) {
if (stat & 1) {
+ intrtab[i].ih_evcnt.ev_count++;
for (ih = &intrtab[i]; ih != NULL; ih = ih->ih_next) {
if (ih->ih_fun != NULL)
(ih->ih_fun)(ih->ih_arg);
@@ -302,6 +318,7 @@
for (i = 0; i < 8; i++) {
if (l0stat & (1 << i)) {
+ intrtab[i].ih_evcnt.ev_count++;
for (ih = &intrtab[i]; ih != NULL; ih = ih->ih_next) {
if (ih->ih_fun != NULL)
(ih->ih_fun)(ih->ih_arg);
@@ -328,6 +345,7 @@
for (i = 0; i < 8; i++) {
if (l1stat & (1 << i)) {
+ intrtab[i].ih_evcnt.ev_count++;
for (ih = &intrtab[8+i]; ih != NULL; ih = ih->ih_next) {
if (ih->ih_fun != NULL)
(ih->ih_fun)(ih->ih_arg);
diff -r c39f9fab5cd9 -r 7e318246311d sys/arch/sgimips/include/intr.h
--- a/sys/arch/sgimips/include/intr.h Thu Sep 27 16:34:08 2018 +0000
+++ b/sys/arch/sgimips/include/intr.h Thu Sep 27 17:34:28 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.28 2015/06/26 22:55:06 matt Exp $ */
+/* $NetBSD: intr.h,v 1.29 2018/09/27 17:34:28 macallan Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@@ -53,11 +53,12 @@
struct sgimips_intr *ih_intrhead;
struct sgimips_intrhand *ih_next;
int ih_pending;
+ struct evcnt ih_evcnt;
+ char ih_evname[8];
};
struct sgimips_intr {
LIST_HEAD(,sgimips_intrhand) intr_q;
- struct evcnt ih_evcnt;
unsigned long intr_ipl;
};
Home |
Main Index |
Thread Index |
Old Index