iommu/ipmmu-vmsa: Rewrite page table management
[linux-2.6/btrfs-unstable.git] / arch / mips / include / asm / smp-ops.h
blob73d35b18fb64420aed254a316003d8282a0c5360
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.
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-cm.h>
18 #ifdef CONFIG_SMP
20 #include <linux/cpumask.h>
22 struct task_struct;
24 struct plat_smp_ops {
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 void (*cpus_done)(void);
30 void (*boot_secondary)(int cpu, struct task_struct *idle);
31 void (*smp_setup)(void);
32 void (*prepare_cpus)(unsigned int max_cpus);
33 #ifdef CONFIG_HOTPLUG_CPU
34 int (*cpu_disable)(void);
35 void (*cpu_die)(unsigned int cpu);
36 #endif
39 extern void register_smp_ops(struct plat_smp_ops *ops);
41 static inline void plat_smp_setup(void)
43 extern struct plat_smp_ops *mp_ops; /* private */
45 mp_ops->smp_setup();
48 extern void gic_send_ipi_single(int cpu, unsigned int action);
49 extern void gic_send_ipi_mask(const struct cpumask *mask, unsigned int action);
51 #else /* !CONFIG_SMP */
53 struct plat_smp_ops;
55 static inline void plat_smp_setup(void)
57 /* UP, nothing to do ... */
60 static inline void register_smp_ops(struct plat_smp_ops *ops)
64 #endif /* !CONFIG_SMP */
66 static inline int register_up_smp_ops(void)
68 #ifdef CONFIG_SMP_UP
69 extern struct plat_smp_ops up_smp_ops;
71 register_smp_ops(&up_smp_ops);
73 return 0;
74 #else
75 return -ENODEV;
76 #endif
79 static inline int register_cmp_smp_ops(void)
81 #ifdef CONFIG_MIPS_CMP
82 extern struct plat_smp_ops cmp_smp_ops;
84 if (!mips_cm_present())
85 return -ENODEV;
87 register_smp_ops(&cmp_smp_ops);
89 return 0;
90 #else
91 return -ENODEV;
92 #endif
95 static inline int register_vsmp_smp_ops(void)
97 #ifdef CONFIG_MIPS_MT_SMP
98 extern struct plat_smp_ops vsmp_smp_ops;
100 register_smp_ops(&vsmp_smp_ops);
102 return 0;
103 #else
104 return -ENODEV;
105 #endif
108 #ifdef CONFIG_MIPS_CPS
109 extern int register_cps_smp_ops(void);
110 #else
111 static inline int register_cps_smp_ops(void)
113 return -ENODEV;
115 #endif
117 #endif /* __ASM_SMP_OPS_H */