blob: 9e09af34c8a87cbfc03b65c429fc99844edcd69d [file] [log] [blame]
Ralf Baechle87353d82007-11-19 12:23:51 +00001/*
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
14#ifdef CONFIG_SMP
15
16#include <linux/cpumask.h>
17
Ralf Baechlef5fd02a2009-03-25 14:41:09 +010018struct task_struct;
19
Ralf Baechle87353d82007-11-19 12:23:51 +000020struct plat_smp_ops {
21 void (*send_ipi_single)(int cpu, unsigned int action);
Rusty Russell48a048f2009-09-24 09:34:44 -060022 void (*send_ipi_mask)(const struct cpumask *mask, unsigned int action);
Ralf Baechle87353d82007-11-19 12:23:51 +000023 void (*init_secondary)(void);
24 void (*smp_finish)(void);
25 void (*cpus_done)(void);
26 void (*boot_secondary)(int cpu, struct task_struct *idle);
27 void (*smp_setup)(void);
28 void (*prepare_cpus)(unsigned int max_cpus);
Ralf Baechle1b2bc752009-06-23 10:00:31 +010029#ifdef CONFIG_HOTPLUG_CPU
30 int (*cpu_disable)(void);
31 void (*cpu_die)(unsigned int cpu);
32#endif
Ralf Baechle87353d82007-11-19 12:23:51 +000033};
34
35extern void register_smp_ops(struct plat_smp_ops *ops);
36
37static inline void plat_smp_setup(void)
38{
39 extern struct plat_smp_ops *mp_ops; /* private */
40
41 mp_ops->smp_setup();
42}
43
44#else /* !CONFIG_SMP */
45
46struct plat_smp_ops;
47
48static inline void plat_smp_setup(void)
49{
50 /* UP, nothing to do ... */
51}
52
53static inline void register_smp_ops(struct plat_smp_ops *ops)
54{
55}
56
57#endif /* !CONFIG_SMP */
58
59extern struct plat_smp_ops up_smp_ops;
Ralf Baechle39b8d522008-04-28 17:14:26 +010060extern struct plat_smp_ops cmp_smp_ops;
Ralf Baechle87353d82007-11-19 12:23:51 +000061extern struct plat_smp_ops vsmp_smp_ops;
62
63#endif /* __ASM_SMP_OPS_H */