smp.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2012 ARM Ltd.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __ASM_SMP_H
  17. #define __ASM_SMP_H
  18. #include <linux/threads.h>
  19. #include <linux/cpumask.h>
  20. #include <linux/thread_info.h>
  21. #ifndef CONFIG_SMP
  22. # error "<asm/smp.h> included in non-SMP build"
  23. #endif
  24. #define raw_smp_processor_id() (current_thread_info()->cpu)
  25. struct seq_file;
  26. /*
  27. * generate IPI list text
  28. */
  29. extern void show_ipi_list(struct seq_file *p, int prec);
  30. /*
  31. * Called from C code, this handles an IPI.
  32. */
  33. extern void handle_IPI(int ipinr, struct pt_regs *regs);
  34. /*
  35. * Discover the set of possible CPUs and determine their
  36. * SMP operations.
  37. */
  38. extern void smp_init_cpus(void);
  39. /*
  40. * Provide a function to raise an IPI cross call on CPUs in callmap.
  41. */
  42. extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
  43. extern void (*__smp_cross_call)(const struct cpumask *, unsigned int);
  44. /*
  45. * Called from the secondary holding pen, this is the secondary CPU entry point.
  46. */
  47. asmlinkage void secondary_start_kernel(void);
  48. /*
  49. * Initial data for bringing up a secondary CPU.
  50. */
  51. struct secondary_data {
  52. void *stack;
  53. };
  54. extern struct secondary_data secondary_data;
  55. extern void secondary_entry(void);
  56. extern void arch_send_call_function_single_ipi(int cpu);
  57. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  58. extern int __cpu_disable(void);
  59. extern void __cpu_die(unsigned int cpu);
  60. extern void cpu_die(void);
  61. #endif /* ifndef __ASM_SMP_H */