Skip to contentSkip to conversation

2.6.0-test3-bk1 -- include/asm/smp.h:61: error: `NR_CPUS' undeclared (first use in this function)

DISCUSSION Miles Lane 2 participants 3 messages Aug 10, 2003

lore
Share & tools
lore

Miles Lane

author
#0 lore raw

CC kernel/timer.o
In file included from include/linux/smp.h:17,

                 from include/linux/kernel_stat.h:6,
                 from kernel/timer.c:22:

include/asm/smp.h: In function `any_online_cpu':
include/asm/smp.h:61: error: `NR_CPUS' undeclared (first use in this function) include/asm/smp.h:61: error: (Each undeclared identifier is reported only once include/asm/smp.h:61: error: for each function it appears in.) make[1]: *** [kernel/timer.o] Error 1

CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_6xx=y

CONFIG_PM=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_PPC_STD_MMU=y
CONFIG_PPC_MULTIPLATFORM=y

CONFIG_PPC_CHRP=y
CONFIG_PPC_PMAC=y
CONFIG_PPC_PREP=y
CONFIG_PPC_OF=y
CONFIG_SMP=y
CONFIG_NR_CPUS=2
CONFIG_ALTIVEC=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_PROC_INTF=y
CONFIG_CPU_FREQ_24_API=y
CONFIG_CPU_FREQ_PMAC=y

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 10 lines · Miles Lane

CC kernel/timer.o
In file included from include/linux/smp.h:17,

                 from include/linux/kernel_stat.h:6,
                 from kernel/timer.c:22:

include/asm/smp.h: In function `any_online_cpu':
include/asm/smp.h:61: error: `NR_CPUS' undeclared (first use in this function) include/asm/smp.h:61: error: (Each undeclared identifier is reported only once include/asm/smp.h:61: error: for each function it appears in.) make[1]: *** [kernel/timer.o] Error 1

I had that for a while now. Including <linux/threads.h> in <asm/smp.h> fixes it.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

author
#2 lore raw

PATCH -- Re: 2.6.0-test3-bk1 -- include/asm/smp.h:61: error: `NR_CPUS' undeclared (first use in this function)

For Linus:

asm-ppc/smp.h 2003-08-10 12:30:14.000000000 -0700 renamed from asm-ppc/smp.h~ 2003-07-27 09:57:50.000000000 -0700 +1 -0
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/bitops.h>
 #include <linux/errno.h>
+#include <linux/threads.h>
 
 #ifdef CONFIG_SMP
 

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/