diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-05-02 13:27:11 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:11 -0400 |
commit | 01a2f435564b4baab61328b4018d36464468f57b (patch) | |
tree | 991f6a1604a203736131b855262d78fb75711f9b /arch/i386/kernel/smp.c | |
parent | 4fbb5968810b237e81977f131986b9efd5245368 (diff) |
[PATCH] i386: Add smp_ops interface
Add a smp_ops interface. This abstracts the API defined by
<linux/smp.h> for use within arch/i386. The primary intent is that it
be used by a paravirtualizing hypervisor to implement SMP, but it
could also be used by non-APIC-using sub-architectures.
This is related to CONFIG_PARAVIRT, but is implemented unconditionally
since it is simpler that way and not a highly performance-sensitive
interface.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'arch/i386/kernel/smp.c')
-rw-r--r-- | arch/i386/kernel/smp.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index b90bebeb1c79..fe38b49a1223 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c | |||
@@ -483,7 +483,7 @@ void flush_tlb_all(void) | |||
483 | * it goes straight through and wastes no time serializing | 483 | * it goes straight through and wastes no time serializing |
484 | * anything. Worst case is that we lose a reschedule ... | 484 | * anything. Worst case is that we lose a reschedule ... |
485 | */ | 485 | */ |
486 | void smp_send_reschedule(int cpu) | 486 | void native_smp_send_reschedule(int cpu) |
487 | { | 487 | { |
488 | WARN_ON(cpu_is_offline(cpu)); | 488 | WARN_ON(cpu_is_offline(cpu)); |
489 | send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR); | 489 | send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR); |
@@ -560,9 +560,9 @@ static void __smp_call_function(void (*func) (void *info), void *info, | |||
560 | * You must not call this function with disabled interrupts or from a | 560 | * You must not call this function with disabled interrupts or from a |
561 | * hardware interrupt handler or from a bottom half handler. | 561 | * hardware interrupt handler or from a bottom half handler. |
562 | */ | 562 | */ |
563 | int smp_call_function_mask(cpumask_t mask, | 563 | int native_smp_call_function_mask(cpumask_t mask, |
564 | void (*func)(void *), void *info, | 564 | void (*func)(void *), void *info, |
565 | int wait) | 565 | int wait) |
566 | { | 566 | { |
567 | struct call_data_struct data; | 567 | struct call_data_struct data; |
568 | cpumask_t allbutself; | 568 | cpumask_t allbutself; |
@@ -681,7 +681,7 @@ static void stop_this_cpu (void * dummy) | |||
681 | * this function calls the 'stop' function on all other CPUs in the system. | 681 | * this function calls the 'stop' function on all other CPUs in the system. |
682 | */ | 682 | */ |
683 | 683 | ||
684 | void smp_send_stop(void) | 684 | void native_smp_send_stop(void) |
685 | { | 685 | { |
686 | /* Don't deadlock on the call lock in panic */ | 686 | /* Don't deadlock on the call lock in panic */ |
687 | int nolock = !spin_trylock(&call_lock); | 687 | int nolock = !spin_trylock(&call_lock); |
@@ -757,3 +757,14 @@ int safe_smp_processor_id(void) | |||
757 | 757 | ||
758 | return cpuid >= 0 ? cpuid : 0; | 758 | return cpuid >= 0 ? cpuid : 0; |
759 | } | 759 | } |
760 | |||
761 | struct smp_ops smp_ops = { | ||
762 | .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu, | ||
763 | .smp_prepare_cpus = native_smp_prepare_cpus, | ||
764 | .cpu_up = native_cpu_up, | ||
765 | .smp_cpus_done = native_smp_cpus_done, | ||
766 | |||
767 | .smp_send_stop = native_smp_send_stop, | ||
768 | .smp_send_reschedule = native_smp_send_reschedule, | ||
769 | .smp_call_function_mask = native_smp_call_function_mask, | ||
770 | }; | ||