lkml.org 
[lkml]   [1996]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: signed int for interrupts??
Date

> On Sun, 8 Sep 1996, Jon Lewis wrote:
>
> > 5: 1649726484 + cyclades
> > 9: 12023652 53c8xx
> > 10: 231379880 3c509
> > 11: -2104643917 + cyclades
>
> Now I'm really confused. I did some looking, and found that the interrupt
> counters _are_ or at least appear to be unsigned int.
>
> In kernel_stat.h:
> struct kernel_stat {
> ...
> unsigned int interrupts[NR_IRQS];
> ...
> };
>
> So why did my Irq 11 counter wrap at 2^31 rather than 2^32?
>

The problem is only in the function that prints the list of
interrupts, the interrupt counters are OK...

This is an untested patch to 2.0.18 that IMO should fix this

--- linux/arch/i386/kernel/irq.c.orig Mon Sep 9 01:06:30 1996
+++ linux/arch/i386/kernel/irq.c Mon Sep 9 01:10:06 1996
@@ -232,7 +232,7 @@
action = irq_action[i];
if (!action)
continue;
- len += sprintf(buf+len, "%2d: %8d %c %s",
+ len += sprintf(buf+len, "%2d: %8u %c %s",
i, kstat.interrupts[i],
(action->flags & SA_INTERRUPT) ? '+' : ' ',
action->name);

--
Johnny Stenback, programmer / University of Vaasa, Computer Centre
E-Mail jst@uwasa.fi, Phone +358 61 3248 387, +358 50 5575 094

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.059 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site