-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: Move GIC IPI functions out of smp-cmp.c
The GIC IPI functions aren't necessarily specific to the "CMP framework" SMP implementation, and will be used elsewhere in a subsequent commit. This patch adds cleaned up GIC IPI functions to a separate file which is compiled when a new CONFIG_MIPS_GIC_IPI Kconfig symbol is selected, and selects that symbol for CONFIG_MIPS_CMP. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6359/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
- Loading branch information
Paul Burton
authored and
Ralf Baechle
committed
Mar 6, 2014
1 parent
1d68808
commit 72e2014
Showing
5 changed files
with
63 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2013 Imagination Technologies | ||
* Author: Paul Burton <paul.burton@imgtec.com> | ||
* | ||
* Based on smp-cmp.c: | ||
* Copyright (C) 2007 MIPS Technologies, Inc. | ||
* Author: Chris Dearman (chris@mips.com) | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#include <linux/printk.h> | ||
|
||
#include <asm/gic.h> | ||
#include <asm/smp-ops.h> | ||
|
||
void gic_send_ipi_single(int cpu, unsigned int action) | ||
{ | ||
unsigned long flags; | ||
unsigned int intr; | ||
|
||
pr_debug("CPU%d: %s cpu %d action %u status %08x\n", | ||
smp_processor_id(), __func__, cpu, action, read_c0_status()); | ||
|
||
local_irq_save(flags); | ||
|
||
switch (action) { | ||
case SMP_CALL_FUNCTION: | ||
intr = plat_ipi_call_int_xlate(cpu); | ||
break; | ||
|
||
case SMP_RESCHEDULE_YOURSELF: | ||
intr = plat_ipi_resched_int_xlate(cpu); | ||
break; | ||
|
||
default: | ||
BUG(); | ||
} | ||
|
||
gic_send_ipi(intr); | ||
local_irq_restore(flags); | ||
} | ||
|
||
void gic_send_ipi_mask(const struct cpumask *mask, unsigned int action) | ||
{ | ||
unsigned int i; | ||
|
||
for_each_cpu(i, mask) | ||
gic_send_ipi_single(i, action); | ||
} |