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.
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
11 #ifndef __ASM_SMP_OPS_H
12 #define __ASM_SMP_OPS_H
14 #include <linux/errno.h>
16 #include <asm/mips-cps.h>
20 #include <linux/cpumask.h>
25 void (*send_ipi_single
)(int cpu
, unsigned int action
);
26 void (*send_ipi_mask
)(const struct cpumask
*mask
, unsigned int action
);
27 void (*init_secondary
)(void);
28 void (*smp_finish
)(void);
29 int (*boot_secondary
)(int cpu
, struct task_struct
*idle
);
30 void (*smp_setup
)(void);
31 void (*prepare_cpus
)(unsigned int max_cpus
);
32 void (*prepare_boot_cpu
)(void);
33 #ifdef CONFIG_HOTPLUG_CPU
34 int (*cpu_disable
)(void);
35 void (*cpu_die
)(unsigned int cpu
);
38 void (*kexec_nonboot_cpu
)(void);
42 extern void register_smp_ops(const struct plat_smp_ops
*ops
);
44 static inline void plat_smp_setup(void)
46 extern const struct plat_smp_ops
*mp_ops
; /* private */
51 extern void mips_smp_send_ipi_single(int cpu
, unsigned int action
);
52 extern void mips_smp_send_ipi_mask(const struct cpumask
*mask
,
55 #else /* !CONFIG_SMP */
59 static inline void plat_smp_setup(void)
61 /* UP, nothing to do ... */
64 static inline void register_smp_ops(const struct plat_smp_ops
*ops
)
68 #endif /* !CONFIG_SMP */
70 static inline int register_up_smp_ops(void)
73 extern const struct plat_smp_ops up_smp_ops
;
75 register_smp_ops(&up_smp_ops
);
83 static inline int register_cmp_smp_ops(void)
85 #ifdef CONFIG_MIPS_CMP
86 extern const struct plat_smp_ops cmp_smp_ops
;
88 if (!mips_cm_present())
91 register_smp_ops(&cmp_smp_ops
);
99 static inline int register_vsmp_smp_ops(void)
101 #ifdef CONFIG_MIPS_MT_SMP
102 extern const struct plat_smp_ops vsmp_smp_ops
;
104 register_smp_ops(&vsmp_smp_ops
);
112 #ifdef CONFIG_MIPS_CPS
113 extern int register_cps_smp_ops(void);
115 static inline int register_cps_smp_ops(void)
121 #endif /* __ASM_SMP_OPS_H */