Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc/pic Brush up previous, or make things more ...



details:   https://anonhg.NetBSD.org/src/rev/2214c73e7107
branches:  trunk
changeset: 981828:2214c73e7107
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Mar 22 01:36:10 2021 +0000

description:
Brush up previous, or make things more similar to x86:

- Prevent pic_name from appearing vmstat(1) twice.
- Restore "irq" in interrupt id fields of intrctl(8).

For these purposes,

- Add is_evname member to struct intr_source.
- Bump size of is_source to INTRIDBUF, and rename it to is_intrid for clarity.

Now, outputs from vmstat(1) and intrctl(8) are like:

----
$ vmstat -ev
...
openpic irq 39                                 3967   26 intr
...
$ intrctl list
interrupt id   CPU0  device name(s)
...
openpic irq 39 3967* wdc1
...
----

diffstat:

 sys/arch/powerpc/pic/intr.c   |  14 ++++++++------
 sys/arch/powerpc/pic/picvar.h |   7 ++++---
 2 files changed, 12 insertions(+), 9 deletions(-)

diffs (79 lines):

diff -r 7474b5e86d5c -r 2214c73e7107 sys/arch/powerpc/pic/intr.c
--- a/sys/arch/powerpc/pic/intr.c       Mon Mar 22 00:09:06 2021 +0000
+++ b/sys/arch/powerpc/pic/intr.c       Mon Mar 22 01:36:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.31 2021/03/06 07:24:24 rin Exp $ */
+/*     $NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -29,7 +29,7 @@
 #define __INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.31 2021/03/06 07:24:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.32 2021/03/22 01:36:10 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_interrupt.h"
@@ -200,10 +200,12 @@
                break;
        }
        if (is->is_hand == NULL) {
-               snprintf(is->is_source, sizeof(is->is_source), "%s %d",
+               snprintf(is->is_intrid, sizeof(is->is_intrid), "%s irq %d",
                    pic->pic_name, is->is_hwirq);
+               snprintf(is->is_evname, sizeof(is->is_evname), "irq %d",
+                   is->is_hwirq);
                evcnt_attach_dynamic(&is->is_ev, EVCNT_TYPE_INTR, NULL,
-                   pic->pic_name, is->is_source);
+                   pic->pic_name, is->is_evname);
        }
 
        /*
@@ -744,7 +746,7 @@
        int irq;
 
        for (irq = 0, is = intrsources; irq < NVIRQ; irq++, is++) {
-               if (strcmp(intrid, is->is_source) == 0)
+               if (strcmp(intrid, is->is_intrid) == 0)
                        return is;
        }
        return NULL;
@@ -858,7 +860,7 @@
                if (is->is_hand == NULL)
                        continue;
 
-               strncpy(ids[i], is->is_source, sizeof(intrid_t));
+               strncpy(ids[i], is->is_intrid, sizeof(intrid_t));
                i++;
        }
 
diff -r 7474b5e86d5c -r 2214c73e7107 sys/arch/powerpc/pic/picvar.h
--- a/sys/arch/powerpc/pic/picvar.h     Mon Mar 22 00:09:06 2021 +0000
+++ b/sys/arch/powerpc/pic/picvar.h     Mon Mar 22 01:36:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: picvar.h,v 1.12 2020/04/16 23:29:52 rin Exp $ */
+/*     $NetBSD: picvar.h,v 1.13 2021/03/22 01:36:10 rin Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: picvar.h,v 1.12 2020/04/16 23:29:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: picvar.h,v 1.13 2021/03/22 01:36:10 rin Exp $");
 
 #ifndef PIC_VAR_H
 #define PIC_VAR_H
@@ -62,7 +62,8 @@
        struct intrhand *is_hand;
        struct pic_ops *is_pic;
        struct evcnt is_ev;
-       char is_source[16];
+       char is_evname[16];
+       char is_intrid[INTRIDBUF];
 };
 
 #define OPENPIC_MAX_ISUS       4



Home | Main Index | Thread Index | Old Index