[PATCH] Simple change in /proc/interrupt

Etienne Lorrain (lorrain@fb.sony.DE)
Mon, 30 Mar 1998 13:06:39 +0001


--Message-Boundary-29462
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Hi,

The "file" /proc/interrupt only report the number of
interrupt for currently in-use IRQ. That means it is
not possible to know the number of IRQ of a module
which has been unloaded or a serial line which has been
closed (IRQ is released). On SMP you cannot also
know if a particular free IRQ is treated by the APIC.

Because in /proc a field is generally displayed even if
it is 0 (swap used...) I propose to display every IRQ,
like in this simple patch agains 1.2.91.

Thank,
Etienne.
----------- etienne.lorrain@ibm.net
-- hdc: irq timeout: status=0xd0 { Busy }
-- ide1: reset: success
----------> I like Linux !

--Message-Boundary-29462
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'patch_irq2'

diff -u --recursive linux-2.1.91/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- linux-2.1.91/arch/i386/kernel/irq.c Fri Mar 27 18:47:12 1998
+++ linux/arch/i386/kernel/irq.c Sun Mar 29 20:09:07 1998
@@ -70,7 +70,9 @@

static unsigned int irq_events [NR_IRQS] = { -1, };
static int disabled_irq [NR_IRQS] = { 0, };
+#ifdef __SMP__
static int ipi_pending [NR_IRQS] = { 0, };
+#endif

/*
* Not all IRQs can be routed through the IO-APIC, eg. on certain (older)
@@ -320,9 +322,6 @@
*p++ = '\n';

for (i = 0 ; i < NR_IRQS ; i++) {
- action = irq_action[i];
- if (!action)
- continue;
p += sprintf(p, "%3d: ",i);
#ifndef __SMP__
p += sprintf(p, "%10u ", kstat_irqs(i));
@@ -336,10 +335,14 @@
p += sprintf(p, " IO-APIC ");
else
p += sprintf(p, " XT PIC ");
- p += sprintf(p, " %s", action->name);

- for (action=action->next; action; action = action->next) {
- p += sprintf(p, ", %s", action->name);
+ action = irq_action[i];
+ if (action) {
+ p += sprintf(p, " %s", action->name);
+ for (action=action->next; action; action = action->next)
+ p += sprintf(p, ", %s", action->name);
+ } else {
+ p += sprintf(p, " unaffected");
}
*p++ = '\n';
}

--Message-Boundary-29462--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu