linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.4.20-pre7 i486
@ 2002-09-23 14:47 bonganilinux
  0 siblings, 0 replies; 2+ messages in thread
From: bonganilinux @ 2002-09-23 14:47 UTC (permalink / raw)
  To: Ian Carr-de Avelon; +Cc: linux-kernel

<snip>
> /usr/src/linux/include/linux/kernel_stat.h: In function `kstat_irqs':
> /usr/src/linux/include/linux/kernel_stat.h:57: `smp_num_cpus' undeclared (first
> use in this function)
> /usr/src/linux/include/linux/kernel_stat.h:57: (Each undeclared identifier is reported
only once
> /usr/src/linux/include/linux/kernel_stat.h:57: for each function it appears in.)make[2]:
*** [ksyms.o] Error 1
> make[2]: Leaving directory `/usr/src/linux/kernel'
> make[1]: *** [first_rule] Error 2
> make[1]: Leaving directory `/usr/src/linux/kernel'
> make: *** [_dir_kernel] Error 2

Strange that this has not being noticed before 2.4 define kstat_irqs as

#if defined (__hppa__) 
/*
 * Number of interrupts per specific IRQ source, since bootup
 */
static inline int kstat_irqs (int irq)
{
        return kstat.irqs[IRQ_REGION(irq)][IRQ_OFFSET(irq)];
}
#elif !defined(CONFIG_ARCH_S390)
/*
 * Number of interrupts per specific IRQ source, since bootup
 */
extern inline int kstat_irqs (int irq)
{
        int i, sum=0;

        for (i = 0 ; i < smp_num_cpus ; i++)
                sum += kstat.irqs[cpu_logical_map(i)][irq];

        return sum;
}
#endif

But smp_num_cpus is only defined for SMP kernels

on the other hand 2.5 defines it as

#if !defined(CONFIG_ARCH_S390)
/*
 * Number of interrupts per specific IRQ source, since bootup
 */
static inline int kstat_irqs (int irq)
{
        int i, sum=0;

        for (i = 0 ; i < NR_CPUS ; i++)
                sum += kstat.irqs[i][irq];

        return sum;
}
#endif

which seems correct cause NR_CPUS is defined as 1 for UP

is this a correct patch?

diff -uNr include/linux/kernel_stat.h~ include/linux/kernel_stat.h 
--- include/linux/kernel_stat.h~	2002-09-23 16:16:45.000000000 +0200
+++ include/linux/kernel_stat.h	2002-09-23 16:42:42.000000000 +0200
@@ -54,7 +54,7 @@
 {
 	int i, sum=0;
 
-	for (i = 0 ; i < smp_num_cpus ; i++)
+	for (i = 0 ; i < NR_CPUS ; i++)
 		sum += kstat.irqs[cpu_logical_map(i)][irq];
 
 	return sum;


---------------------------------------------
This message was sent using M-Web Airmail.
JUST LIKE THAT
Are you ready for 10-digit dialling?
To find out how this will affect your Internet connection go to www.mweb.co.za/ten
http://airmail.mweb.co.za/



^ permalink raw reply	[flat|nested] 2+ messages in thread

* 2.4.20-pre7 i486
@ 2002-09-23 13:18 Ian Carr-de Avelon
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Carr-de Avelon @ 2002-09-23 13:18 UTC (permalink / raw)


Compiling 2.4.20-pre7 fails for i486 (still a fer of them around) without 
Symmetric multi-processing support. With SMP support, the kernel compiles,
but resets immediately after boot.
This is with gcc 2.95.3
Yours
Ian
 
/usr/src/linux/include/linux/modules/ksyms.ver:548: warning: `del_timer_sync' redefined
/usr/src/linux/include/linux/timer.h:30: warning: this is the location of the previous definition
In file included from /usr/src/linux/include/linux/interrupt.h:45,
                 from ksyms.c:21:
/usr/src/linux/include/asm/hardirq.h:37: warning: `synchronize_irq' redefined
/usr/src/linux/include/linux/modules/i386_ksyms.ver:90: warning: this is the location of the previous definition
In file included from ksyms.c:17:
/usr/src/linux/include/linux/kernel_stat.h: In function `kstat_irqs':
/usr/src/linux/include/linux/kernel_stat.h:57: `smp_num_cpus' undeclared (first
use in this function)
/usr/src/linux/include/linux/kernel_stat.h:57: (Each undeclared identifier is reported only once
/usr/src/linux/include/linux/kernel_stat.h:57: for each function it appears in.)make[2]: *** [ksyms.o] Error 1
make[2]: Leaving directory `/usr/src/linux/kernel'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux/kernel'
make: *** [_dir_kernel] Error 2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-23 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-23 14:47 2.4.20-pre7 i486 bonganilinux
  -- strict thread matches above, loose matches on Subject: below --
2002-09-23 13:18 Ian Carr-de Avelon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).