aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-06-23 21:32:22 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 21:28:19 -0400
commite7a57273c6407bb6903fbaddec8c2119bf318617 (patch)
tree4d5b787c286e1d0ae64f757ef1f68fedd9743a3c /arch/powerpc/platforms/powermac
parentaaddd3eacaeaef3503035750b3f21ac2bfe97cbf (diff)
powerpc: Allow create_branch() to return errors
Currently create_branch() creates a branch instruction for you, and patches it into the call site. In some circumstances it would be nice to be able to create the instruction and patch it later, and also some code might want to check for errors in the branch creation before doing the patching. A future commit will change create_branch() to check for errors. For callers that don't care, replace create_branch() with patch_branch(), which just creates the branch and patches it directly. While we're touching all the callers, change to using unsigned int *, as this seems to match usage better. That allows (and requires) us to remove the volatile in the definition of vector in powermac/smp.c and mpc86xx_smp.c, that's correct because now that we're passing vector as an unsigned int * the compiler knows that it's value might change across the patch_branch() call. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r--arch/powerpc/platforms/powermac/smp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index bf202f7eadf8..4ae3d00e0bdd 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -787,8 +787,7 @@ static void __devinit smp_core99_kick_cpu(int nr)
787{ 787{
788 unsigned int save_vector; 788 unsigned int save_vector;
789 unsigned long target, flags; 789 unsigned long target, flags;
790 volatile unsigned int *vector 790 unsigned int *vector = (unsigned int *)(KERNELBASE+0x100);
791 = ((volatile unsigned int *)(KERNELBASE+0x100));
792 791
793 if (nr < 0 || nr > 3) 792 if (nr < 0 || nr > 3)
794 return; 793 return;
@@ -805,7 +804,7 @@ static void __devinit smp_core99_kick_cpu(int nr)
805 * b __secondary_start_pmac_0 + nr*8 - KERNELBASE 804 * b __secondary_start_pmac_0 + nr*8 - KERNELBASE
806 */ 805 */
807 target = (unsigned long) __secondary_start_pmac_0 + nr * 8; 806 target = (unsigned long) __secondary_start_pmac_0 + nr * 8;
808 create_branch((unsigned long)vector, target, BRANCH_SET_LINK); 807 patch_branch(vector, target, BRANCH_SET_LINK);
809 808
810 /* Put some life in our friend */ 809 /* Put some life in our friend */
811 pmac_call_feature(PMAC_FTR_RESET_CPU, NULL, nr, 0); 810 pmac_call_feature(PMAC_FTR_RESET_CPU, NULL, nr, 0);