Page MenuHomeFreeBSD

D28424.diff
No OneTemporary

D28424.diff

diff --git a/sys/mips/mips/exception.S b/sys/mips/mips/exception.S
--- a/sys/mips/mips/exception.S
+++ b/sys/mips/mips/exception.S
@@ -80,12 +80,6 @@
.text
#endif
-/*
- * Reasonable limit
- */
-#define INTRCNT_COUNT 256
-
-
/*
*----------------------------------------------------------------------------
*
@@ -1206,36 +1200,6 @@
.set pop
END(MipsFPTrap)
-#ifndef INTRNG
-/*
- * Interrupt counters for vmstat.
- */
- .data
- .globl intrcnt
- .globl sintrcnt
- .globl intrnames
- .globl sintrnames
-intrnames:
- .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2
-sintrnames:
-#ifdef __mips_n64
- .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2
-#else
- .int INTRCNT_COUNT * (MAXCOMLEN + 1) * 2
-#endif
-
- .align (_MIPS_SZLONG / 8)
-intrcnt:
- .space INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2
-sintrcnt:
-#ifdef __mips_n64
- .quad INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2
-#else
- .int INTRCNT_COUNT * (_MIPS_SZLONG / 8) * 2
-#endif
-#endif /* INTRNG */
-
-
/*
* Vector to real handler in KSEG1.
*/
diff --git a/sys/mips/mips/intr_machdep.c b/sys/mips/mips/intr_machdep.c
--- a/sys/mips/mips/intr_machdep.c
+++ b/sys/mips/mips/intr_machdep.c
@@ -50,6 +50,19 @@
#include <machine/md_var.h>
#include <machine/trap.h>
+#ifndef INTRNG
+#define INTRCNT_COUNT 256
+#define INTRNAME_LEN (2*MAXCOMLEN + 1)
+
+MALLOC_DECLARE(M_MIPSINTR);
+MALLOC_DEFINE(M_MIPSINTR, "mipsintr", "MIPS interrupt handling");
+
+u_long *intrcnt;
+char *intrnames;
+size_t sintrcnt;
+size_t sintrnames;
+#endif
+
static struct intr_event *hardintr_events[NHARD_IRQS];
static struct intr_event *softintr_events[NSOFT_IRQS];
static mips_intrcnt_t mips_intr_counters[NSOFT_IRQS + NHARD_IRQS];
@@ -121,6 +134,15 @@
int i;
char name[MAXCOMLEN + 1];
+#ifndef INTRNG
+ intrcnt = mallocarray(INTRCNT_COUNT, sizeof(u_long), M_MIPSINTR,
+ M_WAITOK | M_ZERO);
+ intrnames = mallocarray(INTRCNT_COUNT, INTRNAME_LEN, M_MIPSINTR,
+ M_WAITOK | M_ZERO);
+ sintrcnt = INTRCNT_COUNT * sizeof(u_long);
+ sintrnames = INTRCNT_COUNT * INTRNAME_LEN;
+#endif
+
/*
* Initialize all available vectors so spare IRQ
* would show up in systat output

File Metadata

Mime Type
text/plain
Expires
Tue, Sep 24, 6:30 PM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12687536
Default Alt Text
D28424.diff (2 KB)

Event Timeline