Skip to content

Commit 72e5525

Browse files
Paolo 'Blaisorblade' GiarrussoLinus Torvalds
authored andcommitted
[PATCH] uml: avoid "CONFIG_NR_CPUS undeclared" bogus error messages
Olaf Hering <olh@suse.de> Olaf reported UML doesn't build for him with a clear analisys of what happened - we're using NR_CPUS in files linked against glibc headers. Seems like it defines CONFIG_SMP but not CONFIG_NR_CPUS, so we get CONFIG_NR_CPUS undeclared. The fix is to move the declaration away from that header file and move it in asm-um headers, and to add that header where needed. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 42947cb commit 72e5525

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎arch/um/include/kern_util.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ extern int timer_irq_inited;
3131
extern int jail;
3232
extern int nsyscalls;
3333

34-
extern struct task_struct *idle_threads[NR_CPUS];
35-
3634
#define UML_ROUND_DOWN(addr) ((void *)(((unsigned long) addr) & PAGE_MASK))
3735
#define UML_ROUND_UP(addr) \
3836
UML_ROUND_DOWN(((unsigned long) addr) + PAGE_SIZE - 1)

‎arch/um/kernel/reboot.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "linux/module.h"
77
#include "linux/sched.h"
8+
#include "asm/smp.h"
89
#include "user_util.h"
910
#include "kern_util.h"
1011
#include "kern.h"

‎include/asm-um/smp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ extern inline void smp_cpus_done(unsigned int maxcpus)
2323
{
2424
}
2525

26+
extern struct task_struct *idle_threads[NR_CPUS];
27+
2628
#endif
2729

2830
#endif

0 commit comments

Comments
 (0)