summaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/kernel/smp.c
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2008-01-25 16:15:44 +0100
committerJesper Nilsson <jesper.nilsson@axis.com>2008-02-08 11:06:35 +0100
commit538380da1a41c981c640bd22a091fdfc32d1e81e (patch)
tree69687ead9f26b59b7489e2f6d225bbbc7738414a /arch/cris/arch-v32/kernel/smp.c
parent574852a2a5cb603708133ade9896c9bc77a68c46 (diff)
downloadop-kernel-dev-538380da1a41c981c640bd22a091fdfc32d1e81e.zip
op-kernel-dev-538380da1a41c981c640bd22a091fdfc32d1e81e.tar.gz
CRIS v32: Update kernel/smp.c for CRIS v32.
- Change include paths to machine specific headers (asm/arch/hwregs -> hwregs) - Add cpu_possible_map as cpumask_t and export it. - Drop struct pt_regs parameter from crisv32_ipi_interrupt. - timer -> timer0
Diffstat (limited to 'arch/cris/arch-v32/kernel/smp.c')
-rw-r--r--arch/cris/arch-v32/kernel/smp.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 171c96e..a9c3334 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -1,11 +1,12 @@
+#include <linux/types.h>
#include <asm/delay.h>
-#include <asm/arch/irq.h>
-#include <asm/arch/hwregs/intr_vect.h>
-#include <asm/arch/hwregs/intr_vect_defs.h>
+#include <irq.h>
+#include <hwregs/intr_vect.h>
+#include <hwregs/intr_vect_defs.h>
#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
-#include <asm/arch/hwregs/mmu_defs_asm.h>
-#include <asm/arch/hwregs/supp_reg.h>
+#include <hwregs/asm/mmu_defs_asm.h>
+#include <hwregs/supp_reg.h>
#include <asm/atomic.h>
#include <linux/err.h>
@@ -20,6 +21,7 @@
#define IPI_SCHEDULE 1
#define IPI_CALL 2
#define IPI_FLUSH_TLB 4
+#define IPI_BOOT 8
#define FLUSH_ALL (void*)0xffffffff
@@ -30,6 +32,8 @@ spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED};
cpumask_t cpu_online_map = CPU_MASK_NONE;
EXPORT_SYMBOL(cpu_online_map);
cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
+cpumask_t cpu_possible_map;
+EXPORT_SYMBOL(cpu_possible_map);
EXPORT_SYMBOL(phys_cpu_present_map);
/* Variables used during SMP boot */
@@ -55,13 +59,12 @@ static unsigned long flush_addr;
extern int setup_irq(int, struct irqaction *);
/* Mode registers */
-static unsigned long irq_regs[NR_CPUS] =
-{
+static unsigned long irq_regs[NR_CPUS] = {
regi_irq,
regi_irq2
};
-static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+static irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id);
static int send_ipi(int vector, int wait, cpumask_t cpu_mask);
static struct irqaction irq_ipi = {
.handler = crisv32_ipi_interrupt,
@@ -101,6 +104,7 @@ void __devinit smp_prepare_boot_cpu(void)
cpu_set(0, cpu_online_map);
cpu_set(0, phys_cpu_present_map);
+ cpu_set(0, cpu_possible_map);
}
void __init smp_cpus_done(unsigned int max_cpus)
@@ -113,6 +117,7 @@ smp_boot_one_cpu(int cpuid)
{
unsigned timeout;
struct task_struct *idle;
+ cpumask_t cpu_mask = CPU_MASK_NONE;
idle = fork_idle(cpuid);
if (IS_ERR(idle))
@@ -124,6 +129,12 @@ smp_boot_one_cpu(int cpuid)
smp_init_current_idle_thread = task_thread_info(idle);
cpu_now_booting = cpuid;
+ /* Kick it */
+ cpu_set(cpuid, cpu_online_map);
+ cpu_set(cpuid, cpu_mask);
+ send_ipi(IPI_BOOT, 0, cpu_mask);
+ cpu_clear(cpuid, cpu_online_map);
+
/* Wait for CPU to come online */
for (timeout = 0; timeout < 10000; timeout++) {
if(cpu_online(cpuid)) {
@@ -165,7 +176,7 @@ void __init smp_callin(void)
/* Enable IRQ and idle */
REG_WR(intr_vect, irq_regs[cpu], rw_mask, vect_mask);
unmask_irq(IPI_INTR_VECT);
- unmask_irq(TIMER_INTR_VECT);
+ unmask_irq(TIMER0_INTR_VECT);
preempt_disable();
local_irq_enable();
@@ -328,7 +339,7 @@ int smp_call_function(void (*func)(void *info), void *info,
return ret;
}
-irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_id)
{
void (*func) (void *info) = call_data->func;
void *info = call_data->info;
OpenPOWER on IntegriCloud