aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-04 01:52:41 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-04 16:51:37 -0400
commit5e0797e5b84408a13260a107e2f7a49ee6342ae4 (patch)
tree7f44ab72a2c79a44d0efee14ddb7b2a985c1e77d /arch/sparc64
parentabd9e6982815ad7bd2c70dbf4cc0c08b48229d6e (diff)
sparc64: Use function pointer for cross-call sending.
Initialize it using the smp_setup_processor_id() hook. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/smp.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 340842e51ce1..3c6970ad774f 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -756,6 +756,8 @@ dump_cpu_list_and_out:
756 printk("]\n"); 756 printk("]\n");
757} 757}
758 758
759static void (*xcall_deliver)(u64, u64, u64, cpumask_t);
760
759/* Send cross call to all processors mentioned in MASK 761/* Send cross call to all processors mentioned in MASK
760 * except self. 762 * except self.
761 */ 763 */
@@ -767,12 +769,7 @@ static void smp_cross_call_masked(unsigned long *func, u32 ctx, u64 data1, u64 d
767 cpus_and(mask, mask, cpu_online_map); 769 cpus_and(mask, mask, cpu_online_map);
768 cpu_clear(this_cpu, mask); 770 cpu_clear(this_cpu, mask);
769 771
770 if (tlb_type == spitfire) 772 xcall_deliver(data0, data1, data2, mask);
771 spitfire_xcall_deliver(data0, data1, data2, mask);
772 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
773 cheetah_xcall_deliver(data0, data1, data2, mask);
774 else
775 hypervisor_xcall_deliver(data0, data1, data2, mask);
776 /* NOTE: Caller runs local copy on master. */ 773 /* NOTE: Caller runs local copy on master. */
777 774
778 put_cpu(); 775 put_cpu();
@@ -1202,6 +1199,16 @@ void __devinit smp_prepare_boot_cpu(void)
1202{ 1199{
1203} 1200}
1204 1201
1202void __init smp_setup_processor_id(void)
1203{
1204 if (tlb_type == spitfire)
1205 xcall_deliver = spitfire_xcall_deliver;
1206 else if (tlb_type == cheetah || tlb_type == cheetah_plus)
1207 xcall_deliver = cheetah_xcall_deliver;
1208 else
1209 xcall_deliver = hypervisor_xcall_deliver;
1210}
1211
1205void __devinit smp_fill_in_sib_core_maps(void) 1212void __devinit smp_fill_in_sib_core_maps(void)
1206{ 1213{
1207 unsigned int i; 1214 unsigned int i;