smp.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * arch/arm/include/asm/smp.h
  3. *
  4. * Copyright (C) 2004-2005 ARM Ltd.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARM_SMP_H
  11. #define __ASM_ARM_SMP_H
  12. #include <linux/threads.h>
  13. #include <linux/cpumask.h>
  14. #include <linux/thread_info.h>
  15. #ifndef CONFIG_SMP
  16. # error "<asm/smp.h> included in non-SMP build"
  17. #endif
  18. #define raw_smp_processor_id() (current_thread_info()->cpu)
  19. /*
  20. * at the moment, there's not a big penalty for changing CPUs
  21. * (the >big< penalty is running SMP in the first place)
  22. */
  23. #define PROC_CHANGE_PENALTY 15
  24. struct seq_file;
  25. /*
  26. * generate IPI list text
  27. */
  28. extern void show_ipi_list(struct seq_file *, int);
  29. /*
  30. * Called from assembly code, this handles an IPI.
  31. */
  32. asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);
  33. /*
  34. * Setup the set of possible CPUs (via set_cpu_possible)
  35. */
  36. extern void smp_init_cpus(void);
  37. /*
  38. * Provide a function to raise an IPI cross call on CPUs in callmap.
  39. */
  40. extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
  41. /*
  42. * Boot a secondary CPU, and assign it the specified idle task.
  43. * This also gives us the initial stack to use for this CPU.
  44. */
  45. extern int boot_secondary(unsigned int cpu, struct task_struct *);
  46. /*
  47. * Called from platform specific assembly code, this is the
  48. * secondary CPU entry point.
  49. */
  50. asmlinkage void secondary_start_kernel(void);
  51. /*
  52. * Perform platform specific initialisation of the specified CPU.
  53. */
  54. extern void platform_secondary_init(unsigned int cpu);
  55. /*
  56. * Initialize cpu_possible map, and enable coherency
  57. */
  58. extern void platform_smp_prepare_cpus(unsigned int);
  59. /*
  60. * Initial data for bringing up a secondary CPU.
  61. */
  62. struct secondary_data {
  63. unsigned long pgdir;
  64. void *stack;
  65. };
  66. extern struct secondary_data secondary_data;
  67. extern int __cpu_disable(void);
  68. extern int platform_cpu_disable(unsigned int cpu);
  69. extern void __cpu_die(unsigned int cpu);
  70. extern void cpu_die(void);
  71. extern void platform_cpu_die(unsigned int cpu);
  72. extern int platform_cpu_kill(unsigned int cpu);
  73. extern void platform_cpu_enable(unsigned int cpu);
  74. extern void arch_send_call_function_single_ipi(int cpu);
  75. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  76. /*
  77. * show local interrupt info
  78. */
  79. extern void show_local_irqs(struct seq_file *, int);
  80. #endif /* ifndef __ASM_ARM_SMP_H */