smp_boot_cpus();
}
+void __devinit
+smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_present_mask);
+}
+
int __devinit
__cpu_up(unsigned int cpu)
{
printk("CPU%d: ", 0);
print_cpu_info(&cpu_data[0]);
- /*
- * We have the boot CPU online for sure.
- */
- set_bit(0, &cpu_online_map);
- set_bit(0, &cpu_callout_map);
boot_cpu_logical_apicid = logical_smp_processor_id();
map_cpu_to_boot_apicid(0, boot_cpu_apicid);
smp_boot_cpus(max_cpus);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_callout_map);
+}
+
int __devinit __cpu_up(unsigned int cpu)
{
/* This only works at boot for x86. See "rewrite" above. */
smp_boot_cpus();
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_callout_map);
+}
+
int __devinit
__cpu_up(unsigned int cpu)
{
}
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_callin_map);
+}
+
void
smp_cpus_done (unsigned int dummy)
{
smp_boot_cpus();
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_present_mask);
+}
+
int __devinit __cpu_up(unsigned int cpu)
{
return cpu_online(cpu) ? 0 : -ENOSYS;
smp_ops->space_timers(num_cpus);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_possible_map);
+}
+
int __init setup_profiling_timer(unsigned int multiplier)
{
return 0;
smp_space_timers(max_cpus);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ /* FIXME: what about cpu_possible()? */
+}
+
int __devinit __cpu_up(unsigned int cpu)
{
struct pt_regs regs;
set_prefix((u32) lowcore_ptr[smp_processor_id()]);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_possible_map);
+}
+
void smp_cpus_done(unsigned int max_cpus)
{
}
set_prefix((u32)(u64) lowcore_ptr[smp_processor_id()]);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_possible_map);
+}
+
void smp_cpus_done(unsigned int max_cpis)
{
}
smp_store_cpu_info(boot_cpu_id);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &phys_cpu_present_map);
+}
+
int __devinit __cpu_up(unsigned int cpu)
{
int ret = smp_boot_one_cpu(cpu);
}
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+}
+
int __cpu_up(unsigned int cpu)
{
set_bit(cpu, &smp_commenced_mask);
smp_boot_cpus(max_cpus);
}
+void __devinit smp_prepare_boot_cpu(void)
+{
+ set_bit(smp_processor_id(), &cpu_online_map);
+ set_bit(smp_processor_id(), &cpu_callout_map);
+}
+
int __devinit __cpu_up(unsigned int cpu)
{
/* This only works at boot for x86. See "rewrite" above. */
#ifdef CONFIG_SMP
-/* Return true if this CPU can call the console drivers in printk() */
-#define arch_consoles_callable() (cpu_online_map & (1UL << smp_processor_id()))
-
/*
* In the SMP case, we save the fph state when context-switching
* away from a thread that modified fph. This way, when the thread
extern void unregister_cpu_notifier(struct notifier_block *nb);
int cpu_up(unsigned int cpu);
+
+/*
+ * Mark the boot cpu "online" so that it can call console drivers in
+ * printk() and can access its per-cpu storage.
+ */
+void smp_prepare_boot_cpu(void);
+
#else /* !SMP */
/*
#define cpu_online(cpu) ({ BUG_ON((cpu) != 0); 1; })
#define num_online_cpus() 1
#define num_booting_cpus() 1
-#define cpu_possible(cpu) ({ BUG_ON((cpu) != 0); 1; })
+#define cpu_possible(cpu) ({ BUG_ON((cpu) != 0); 1; })
+#define smp_prepare_boot_cpu() do {} while (0)
struct notifier_block;
printk(linux_banner);
setup_arch(&command_line);
setup_per_cpu_areas();
+
+ /*
+ * Mark the boot cpu "online" so that it can call console drivers in
+ * printk() and can access its per-cpu storage.
+ */
+ smp_prepare_boot_cpu();
+
build_all_zonelists();
page_alloc_init();
printk("Kernel command line: %s\n", saved_command_line);
#include <linux/interrupt.h> /* For in_interrupt() */
#include <linux/config.h>
#include <linux/delay.h>
+#include <linux/smp.h>
#include <asm/uaccess.h>
#define LOG_BUF_MASK (LOG_BUF_LEN-1)
-#ifndef arch_consoles_callable
-#define arch_consoles_callable() (1)
-#endif
-
/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
log_level_unknown = 1;
}
- if (!arch_consoles_callable()) {
+ if (!cpu_online(smp_processor_id())) {
/*
- * On some architectures, the consoles are not usable
- * on secondary CPUs early in the boot process.
+ * Some console drivers may assume that per-cpu resources have
+ * been allocated. So don't allow them to be called by this
+ * CPU until it is officially up. We shouldn't be calling into
+ * random console drivers on a CPU which doesn't exist yet..
*/
spin_unlock_irqrestore(&logbuf_lock, flags);
goto out;
}
if (console->flags & CON_PRINTBUFFER) {
/*
- * release_console_sem() will print out the buffered messages for us.
+ * release_console_sem() will print out the buffered messages
+ * for us.
*/
spin_lock_irqsave(&logbuf_lock, flags);
con_start = log_start;