]>
Commit | Line | Data |
---|---|---|
87353d8a RB |
1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General | |
3 | * Public License. See the file "COPYING" in the main directory of this | |
4 | * archive for more details. | |
5 | * | |
6 | * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com) | |
7 | * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc. | |
8 | * Copyright (C) 2000, 2001, 2002 Ralf Baechle | |
9 | * Copyright (C) 2000, 2001 Broadcom Corporation | |
10 | */ | |
11 | #ifndef __ASM_SMP_OPS_H | |
12 | #define __ASM_SMP_OPS_H | |
13 | ||
4f55fd75 RB |
14 | #include <linux/errno.h> |
15 | ||
87353d8a RB |
16 | #ifdef CONFIG_SMP |
17 | ||
18 | #include <linux/cpumask.h> | |
19 | ||
f5fd02a3 RB |
20 | struct task_struct; |
21 | ||
87353d8a RB |
22 | struct plat_smp_ops { |
23 | void (*send_ipi_single)(int cpu, unsigned int action); | |
48a048fe | 24 | void (*send_ipi_mask)(const struct cpumask *mask, unsigned int action); |
87353d8a RB |
25 | void (*init_secondary)(void); |
26 | void (*smp_finish)(void); | |
27 | void (*cpus_done)(void); | |
28 | void (*boot_secondary)(int cpu, struct task_struct *idle); | |
29 | void (*smp_setup)(void); | |
30 | void (*prepare_cpus)(unsigned int max_cpus); | |
1b2bc75c RB |
31 | #ifdef CONFIG_HOTPLUG_CPU |
32 | int (*cpu_disable)(void); | |
33 | void (*cpu_die)(unsigned int cpu); | |
34 | #endif | |
87353d8a RB |
35 | }; |
36 | ||
37 | extern void register_smp_ops(struct plat_smp_ops *ops); | |
38 | ||
39 | static inline void plat_smp_setup(void) | |
40 | { | |
41 | extern struct plat_smp_ops *mp_ops; /* private */ | |
42 | ||
43 | mp_ops->smp_setup(); | |
44 | } | |
45 | ||
46 | #else /* !CONFIG_SMP */ | |
47 | ||
48 | struct plat_smp_ops; | |
49 | ||
50 | static inline void plat_smp_setup(void) | |
51 | { | |
52 | /* UP, nothing to do ... */ | |
53 | } | |
54 | ||
55 | static inline void register_smp_ops(struct plat_smp_ops *ops) | |
56 | { | |
57 | } | |
58 | ||
59 | #endif /* !CONFIG_SMP */ | |
60 | ||
72e20142 PB |
61 | extern void gic_send_ipi_single(int cpu, unsigned int action); |
62 | extern void gic_send_ipi_mask(const struct cpumask *mask, unsigned int action); | |
63 | ||
852fe310 RB |
64 | static inline int register_up_smp_ops(void) |
65 | { | |
66 | #ifdef CONFIG_SMP_UP | |
67 | extern struct plat_smp_ops up_smp_ops; | |
68 | ||
69 | register_smp_ops(&up_smp_ops); | |
70 | ||
71 | return 0; | |
72 | #else | |
73 | return -ENODEV; | |
74 | #endif | |
75 | } | |
76 | ||
77 | static inline int register_cmp_smp_ops(void) | |
78 | { | |
79 | #ifdef CONFIG_MIPS_CMP | |
80 | extern struct plat_smp_ops cmp_smp_ops; | |
81 | ||
82 | register_smp_ops(&cmp_smp_ops); | |
83 | ||
84 | return 0; | |
85 | #else | |
86 | return -ENODEV; | |
87 | #endif | |
88 | } | |
89 | ||
90 | static inline int register_vsmp_smp_ops(void) | |
91 | { | |
92 | #ifdef CONFIG_MIPS_MT_SMP | |
93 | extern struct plat_smp_ops vsmp_smp_ops; | |
94 | ||
95 | register_smp_ops(&vsmp_smp_ops); | |
96 | ||
97 | return 0; | |
98 | #else | |
99 | return -ENODEV; | |
100 | #endif | |
101 | } | |
87353d8a | 102 | |
0ee958e1 PB |
103 | #ifdef CONFIG_MIPS_CPS |
104 | extern int register_cps_smp_ops(void); | |
105 | #else | |
106 | static inline int register_cps_smp_ops(void) | |
107 | { | |
108 | return -ENODEV; | |
109 | } | |
110 | #endif | |
111 | ||
87353d8a | 112 | #endif /* __ASM_SMP_OPS_H */ |