Linux Audio

Check our new training course

Loading...
v6.2
  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
 14#include <linux/errno.h>
 15
 16#include <asm/mips-cps.h>
 17
 18#ifdef CONFIG_SMP
 19
 20#include <linux/cpumask.h>
 21
 22struct task_struct;
 23
 24struct 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	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);
 
 36#endif
 37#ifdef CONFIG_KEXEC
 38	void (*kexec_nonboot_cpu)(void);
 39#endif
 40};
 41
 42extern void register_smp_ops(const struct plat_smp_ops *ops);
 43
 44static inline void plat_smp_setup(void)
 45{
 46	extern const struct plat_smp_ops *mp_ops;	/* private */
 47
 48	mp_ops->smp_setup();
 49}
 50
 51extern void mips_smp_send_ipi_single(int cpu, unsigned int action);
 52extern void mips_smp_send_ipi_mask(const struct cpumask *mask,
 53				      unsigned int action);
 54
 55#else /* !CONFIG_SMP */
 56
 57struct plat_smp_ops;
 58
 59static inline void plat_smp_setup(void)
 60{
 61	/* UP, nothing to do ...  */
 62}
 63
 64static inline void register_smp_ops(const struct plat_smp_ops *ops)
 65{
 66}
 67
 68#endif /* !CONFIG_SMP */
 69
 70static inline int register_up_smp_ops(void)
 71{
 72#ifdef CONFIG_SMP_UP
 73	extern const struct plat_smp_ops up_smp_ops;
 74
 75	register_smp_ops(&up_smp_ops);
 76
 77	return 0;
 78#else
 79	return -ENODEV;
 80#endif
 81}
 82
 83static inline int register_cmp_smp_ops(void)
 84{
 85#ifdef CONFIG_MIPS_CMP
 86	extern const struct plat_smp_ops cmp_smp_ops;
 87
 88	if (!mips_cm_present())
 89		return -ENODEV;
 90
 91	register_smp_ops(&cmp_smp_ops);
 92
 93	return 0;
 94#else
 95	return -ENODEV;
 96#endif
 97}
 98
 99static inline int register_vsmp_smp_ops(void)
100{
101#ifdef CONFIG_MIPS_MT_SMP
102	extern const struct plat_smp_ops vsmp_smp_ops;
103
104	if (!cpu_has_mipsmt)
105		return -ENODEV;
106
107	register_smp_ops(&vsmp_smp_ops);
108
109	return 0;
110#else
111	return -ENODEV;
112#endif
113}
114
115#ifdef CONFIG_MIPS_CPS
116extern int register_cps_smp_ops(void);
117#else
118static inline int register_cps_smp_ops(void)
119{
120	return -ENODEV;
121}
122#endif
123
124#endif /* __ASM_SMP_OPS_H */
v6.13.7
  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
 14#include <linux/errno.h>
 15
 
 
 16#ifdef CONFIG_SMP
 17
 18#include <linux/cpumask.h>
 19
 20struct task_struct;
 21
 22struct plat_smp_ops {
 23	void (*send_ipi_single)(int cpu, unsigned int action);
 24	void (*send_ipi_mask)(const struct cpumask *mask, unsigned int action);
 25	void (*init_secondary)(void);
 26	void (*smp_finish)(void);
 27	int (*boot_secondary)(int cpu, struct task_struct *idle);
 28	void (*smp_setup)(void);
 29	void (*prepare_cpus)(unsigned int max_cpus);
 30	void (*prepare_boot_cpu)(void);
 31#ifdef CONFIG_HOTPLUG_CPU
 32	int (*cpu_disable)(void);
 33	void (*cpu_die)(unsigned int cpu);
 34	void (*cleanup_dead_cpu)(unsigned cpu);
 35#endif
 36#ifdef CONFIG_KEXEC_CORE
 37	void (*kexec_nonboot_cpu)(void);
 38#endif
 39};
 40
 41extern void register_smp_ops(const struct plat_smp_ops *ops);
 42
 43static inline void plat_smp_setup(void)
 44{
 45	extern const struct plat_smp_ops *mp_ops;	/* private */
 46
 47	mp_ops->smp_setup();
 48}
 49
 50extern void mips_smp_send_ipi_single(int cpu, unsigned int action);
 51extern void mips_smp_send_ipi_mask(const struct cpumask *mask,
 52				      unsigned int action);
 53
 54#else /* !CONFIG_SMP */
 55
 56struct plat_smp_ops;
 57
 58static inline void plat_smp_setup(void)
 59{
 60	/* UP, nothing to do ...  */
 61}
 62
 63static inline void register_smp_ops(const struct plat_smp_ops *ops)
 64{
 65}
 66
 67#endif /* !CONFIG_SMP */
 68
 69static inline int register_up_smp_ops(void)
 70{
 71#ifdef CONFIG_SMP_UP
 72	extern const struct plat_smp_ops up_smp_ops;
 73
 74	register_smp_ops(&up_smp_ops);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 75
 76	return 0;
 77#else
 78	return -ENODEV;
 79#endif
 80}
 81
 82static inline int register_vsmp_smp_ops(void)
 83{
 84#ifdef CONFIG_MIPS_MT_SMP
 85	extern const struct plat_smp_ops vsmp_smp_ops;
 86
 87	if (!cpu_has_mipsmt)
 88		return -ENODEV;
 89
 90	register_smp_ops(&vsmp_smp_ops);
 91
 92	return 0;
 93#else
 94	return -ENODEV;
 95#endif
 96}
 97
 98#ifdef CONFIG_MIPS_CPS
 99extern int register_cps_smp_ops(void);
100#else
101static inline int register_cps_smp_ops(void)
102{
103	return -ENODEV;
104}
105#endif
106
107#endif /* __ASM_SMP_OPS_H */