Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f7b332f authored by Russell King's avatar Russell King
Browse files

ARM: consolidate SMP cross call implementation



Rather than having each platform class provide a mach/smp.h header for
smp_cross_call(), arrange for them to register the function with the
core ARM SMP code instead.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 43b3e189
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@
#include <linux/cpumask.h>
#include <linux/thread_info.h>

#include <mach/smp.h>

#ifndef CONFIG_SMP
# error "<asm/smp.h> included in non-SMP build"
#endif
@@ -47,9 +45,9 @@ extern void smp_init_cpus(void);


/*
 * Raise an IPI cross call on CPUs in callmap.
 * Provide a function to raise an IPI cross call on CPUs in callmap.
 */
extern void smp_cross_call(const struct cpumask *mask, int ipi);
extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));

/*
 * Boot a secondary CPU, and assign it the specified idle task.
+7 −0
Original line number Diff line number Diff line
@@ -376,6 +376,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
	}
}

static void (*smp_cross_call)(const struct cpumask *, unsigned int);

void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
{
	smp_cross_call = fn;
}

void arch_send_call_function_ipi_mask(const struct cpumask *mask)
{
	smp_cross_call(mask, IPI_CALL_FUNC);
+0 −19
Original line number Diff line number Diff line
/* linux/arch/arm/mach-exynos4/include/mach/smp.h
 *
 * Cloned from arch/arm/mach-realview/include/mach/smp.h
*/

#ifndef ASM_ARCH_SMP_H
#define ASM_ARCH_SMP_H __FILE__

#include <asm/hardware/gic.h>

/*
 * We use IRQ1 as the IPI
 */
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
	gic_raise_softirq(mask, ipi);
}

#endif
+4 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/io.h>

#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
#include <asm/smp_scu.h>
#include <asm/unified.h>

@@ -104,7 +105,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
	 * the boot monitor to read the system wide flags register,
	 * and branch to the address found there.
	 */
	smp_cross_call(cpumask_of(cpu), 1);
	gic_raise_softirq(cpumask_of(cpu), 1);

	timeout = jiffies + (1 * HZ);
	while (time_before(jiffies, timeout)) {
@@ -147,6 +148,8 @@ void __init smp_init_cpus(void)

	for (i = 0; i < ncores; i++)
		set_cpu_possible(i, true);

	set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
+0 −23
Original line number Diff line number Diff line
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __ASM_ARCH_MSM_SMP_H
#define __ASM_ARCH_MSM_SMP_H

#include <asm/hardware/gic.h>

static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
	gic_raise_softirq(mask, ipi);
}

#endif
Loading