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 /include/asm-i386 | |
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 'include/asm-i386')
-rw-r--r-- | include/asm-i386/smp.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 9cab1531c613..2d083cb4ca93 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -49,6 +49,59 @@ extern void cpu_exit_clear(void); | |||
49 | extern void cpu_uninit(void); | 49 | extern void cpu_uninit(void); |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | struct smp_ops | ||
53 | { | ||
54 | void (*smp_prepare_boot_cpu)(void); | ||
55 | void (*smp_prepare_cpus)(unsigned max_cpus); | ||
56 | int (*cpu_up)(unsigned cpu); | ||
57 | void (*smp_cpus_done)(unsigned max_cpus); | ||
58 | |||
59 | void (*smp_send_stop)(void); | ||
60 | void (*smp_send_reschedule)(int cpu); | ||
61 | int (*smp_call_function_mask)(cpumask_t mask, | ||
62 | void (*func)(void *info), void *info, | ||
63 | int wait); | ||
64 | }; | ||
65 | |||
66 | extern struct smp_ops smp_ops; | ||
67 | |||
68 | static inline void smp_prepare_boot_cpu(void) | ||
69 | { | ||
70 | smp_ops.smp_prepare_boot_cpu(); | ||
71 | } | ||
72 | static inline void smp_prepare_cpus(unsigned int max_cpus) | ||
73 | { | ||
74 | smp_ops.smp_prepare_cpus(max_cpus); | ||
75 | } | ||
76 | static inline int __cpu_up(unsigned int cpu) | ||
77 | { | ||
78 | return smp_ops.cpu_up(cpu); | ||
79 | } | ||
80 | static inline void smp_cpus_done(unsigned int max_cpus) | ||
81 | { | ||
82 | smp_ops.smp_cpus_done(max_cpus); | ||
83 | } | ||
84 | |||
85 | static inline void smp_send_stop(void) | ||
86 | { | ||
87 | smp_ops.smp_send_stop(); | ||
88 | } | ||
89 | static inline void smp_send_reschedule(int cpu) | ||
90 | { | ||
91 | smp_ops.smp_send_reschedule(cpu); | ||
92 | } | ||
93 | static inline int smp_call_function_mask(cpumask_t mask, | ||
94 | void (*func) (void *info), void *info, | ||
95 | int wait) | ||
96 | { | ||
97 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | ||
98 | } | ||
99 | |||
100 | void native_smp_prepare_boot_cpu(void); | ||
101 | void native_smp_prepare_cpus(unsigned int max_cpus); | ||
102 | int native_cpu_up(unsigned int cpunum); | ||
103 | void native_smp_cpus_done(unsigned int max_cpus); | ||
104 | |||
52 | #ifndef CONFIG_PARAVIRT | 105 | #ifndef CONFIG_PARAVIRT |
53 | #define startup_ipi_hook(phys_apicid, start_eip, start_esp) \ | 106 | #define startup_ipi_hook(phys_apicid, start_eip, start_esp) \ |
54 | do { } while (0) | 107 | do { } while (0) |