smp-ops.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #ifdef CONFIG_SMP
  14. #include <linux/cpumask.h>
  15. struct plat_smp_ops {
  16. void (*send_ipi_single)(int cpu, unsigned int action);
  17. void (*send_ipi_mask)(cpumask_t mask, unsigned int action);
  18. void (*init_secondary)(void);
  19. void (*smp_finish)(void);
  20. void (*cpus_done)(void);
  21. void (*boot_secondary)(int cpu, struct task_struct *idle);
  22. void (*smp_setup)(void);
  23. void (*prepare_cpus)(unsigned int max_cpus);
  24. };
  25. extern void register_smp_ops(struct plat_smp_ops *ops);
  26. static inline void plat_smp_setup(void)
  27. {
  28. extern struct plat_smp_ops *mp_ops; /* private */
  29. mp_ops->smp_setup();
  30. }
  31. #else /* !CONFIG_SMP */
  32. struct plat_smp_ops;
  33. static inline void plat_smp_setup(void)
  34. {
  35. /* UP, nothing to do ... */
  36. }
  37. static inline void register_smp_ops(struct plat_smp_ops *ops)
  38. {
  39. }
  40. #endif /* !CONFIG_SMP */
  41. extern struct plat_smp_ops up_smp_ops;
  42. extern struct plat_smp_ops cmp_smp_ops;
  43. extern struct plat_smp_ops vsmp_smp_ops;
  44. #endif /* __ASM_SMP_OPS_H */