[PATCH 07/31] cpumask: changes to compile init/main.c
From: Mike Travis
Date: Mon Sep 29 2008 - 14:04:57 EST
Signed-of-by: Mike Travis <travis@xxxxxxx>
---
include/linux/sched.h | 6 +++---
include/linux/seq_file.h | 4 ++--
init/main.c | 11 ++++++-----
kernel/cpu.c | 5 +++++
4 files changed, 16 insertions(+), 10 deletions(-)
--- struct-cpumasks.orig/include/linux/sched.h
+++ struct-cpumasks/include/linux/sched.h
@@ -1583,10 +1583,10 @@ extern cputime_t task_gtime(struct task_
#ifdef CONFIG_SMP
extern int set_cpus_allowed_ptr(struct task_struct *p,
- const cpumask_t *new_mask);
+ const cpumask_t new_mask);
#else
static inline int set_cpus_allowed_ptr(struct task_struct *p,
- const cpumask_t *new_mask)
+ const cpumask_t new_mask)
{
if (!cpu_isset(0, *new_mask))
return -EINVAL;
@@ -1595,7 +1595,7 @@ static inline int set_cpus_allowed_ptr(s
#endif
static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
{
- return set_cpus_allowed_ptr(p, &new_mask);
+ return set_cpus_allowed_ptr(p, new_mask);
}
extern unsigned long long sched_clock(void);
--- struct-cpumasks.orig/include/linux/seq_file.h
+++ struct-cpumasks/include/linux/seq_file.h
@@ -50,9 +50,9 @@ int seq_dentry(struct seq_file *, struct
int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
char *esc);
int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits);
-static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask)
+static inline int seq_cpumask(struct seq_file *m, cpumask_t mask)
{
- return seq_bitmap(m, mask->bits, NR_CPUS);
+ return seq_bitmap(m, mask->bits, nr_cpu_ids);
}
static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask)
--- struct-cpumasks.orig/init/main.c
+++ struct-cpumasks/init/main.c
@@ -367,12 +367,8 @@ static inline void smp_prepare_cpus(unsi
#else
-#if NR_CPUS > BITS_PER_LONG
-cpumask_t cpu_mask_all __read_mostly = CPU_MASK_ALL;
-EXPORT_SYMBOL(cpu_mask_all);
-#endif
-
/* Setup number of possible processor ids */
+#ifndef nr_cpu_ids
int nr_cpu_ids __read_mostly = NR_CPUS;
EXPORT_SYMBOL(nr_cpu_ids);
@@ -386,6 +382,11 @@ static void __init setup_nr_cpu_ids(void
nr_cpu_ids = highest_cpu + 1;
}
+#else
+static inline void setup_nr_cpu_ids(void)
+{
+}
+#endif
#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
--- struct-cpumasks.orig/kernel/cpu.c
+++ struct-cpumasks/kernel/cpu.c
@@ -24,6 +24,11 @@
cpumask_t cpu_present_map __read_mostly;
EXPORT_SYMBOL(cpu_present_map);
+#if NR_CPUS > BITS_PER_LONG
+cpumask_map_t cpu_mask_all __read_mostly = CPU_MASK_ALL;
+EXPORT_SYMBOL(cpu_mask_all);
+#endif
+
#ifndef CONFIG_SMP
/*
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/