#undef DEBUG
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
void smp_send_reschedule(int cpu)
{
- if (likely(smp_ops))
- smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE);
+ smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE);
}
#ifdef CONFIG_DEBUGGER
void smp_send_debugger_break(int cpu)
{
- if (likely(smp_ops))
- smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
+ smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
}
#endif
void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
{
crash_ipi_function_ptr = crash_ipi_callback;
- if (crash_ipi_callback && smp_ops) {
+ if (crash_ipi_callback) {
mb();
smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK);
}
/* Can deadlock when called with interrupts disabled */
WARN_ON(irqs_disabled());
- if (unlikely(smp_ops == NULL))
- return -1;
-
data.func = func;
data.info = info;
atomic_set(&data.started, 0);
smp_store_cpu_info(boot_cpuid);
cpu_callin_map[boot_cpuid] = 1;
- if (smp_ops)
- max_cpus = smp_ops->probe();
- else
- max_cpus = 1;
+ max_cpus = smp_ops->probe();
smp_space_timers(max_cpus);
static int __devinit cpu_enable(unsigned int cpu)
{
- if (smp_ops && smp_ops->cpu_enable)
+ if (smp_ops->cpu_enable)
return smp_ops->cpu_enable(cpu);
return -ENOSYS;
if (!cpu_enable(cpu))
return 0;
- if (smp_ops == NULL ||
- (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu)))
+ if (smp_ops->cpu_bootable && !smp_ops->cpu_bootable(cpu))
return -EINVAL;
/* Make sure callin-map entry is 0 (can be leftover a CPU
* -- Cort
*/
if (system_state < SYSTEM_RUNNING)
- for (c = 50000; c && !cpu_callin_map[cpu]; c--)
+ for (c = 5000; c && !cpu_callin_map[cpu]; c--)
udelay(100);
#ifdef CONFIG_HOTPLUG_CPU
else
old_mask = current->cpus_allowed;
set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
- if (smp_ops)
- smp_ops->setup_cpu(boot_cpuid);
+ smp_ops->setup_cpu(boot_cpuid);
set_cpus_allowed(current, old_mask);