smp.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. #include <mach/smp.h>
  16. #ifndef CONFIG_SMP
  17. # error "<asm/smp.h> included in non-SMP build"
  18. #endif
  19. #define raw_smp_processor_id() (current_thread_info()->cpu)
  20. /*
  21. * at the moment, there's not a big penalty for changing CPUs
  22. * (the >big< penalty is running SMP in the first place)
  23. */
  24. #define PROC_CHANGE_PENALTY 15
  25. struct seq_file;
  26. /*
  27. * generate IPI list text
  28. */
  29. extern void show_ipi_list(struct seq_file *p);
  30. /*
  31. * Called from assembly code, this handles an IPI.
  32. */
  33. asmlinkage void do_IPI(struct pt_regs *regs);
  34. /*
  35. * Setup the SMP cpu_possible_map
  36. */
  37. extern void smp_init_cpus(void);
  38. /*
  39. * Move global data into per-processor storage.
  40. */
  41. extern void smp_store_cpu_info(unsigned int cpuid);
  42. /*
  43. * Raise an IPI cross call on CPUs in callmap.
  44. */
  45. extern void smp_cross_call(cpumask_t callmap);
  46. /*
  47. * Broadcast a timer interrupt to the other CPUs.
  48. */
  49. extern void smp_send_timer(void);
  50. /*
  51. * Broadcast a clock event to other CPUs.
  52. */
  53. extern void smp_timer_broadcast(cpumask_t mask);
  54. /*
  55. * Boot a secondary CPU, and assign it the specified idle task.
  56. * This also gives us the initial stack to use for this CPU.
  57. */
  58. extern int boot_secondary(unsigned int cpu, struct task_struct *);
  59. /*
  60. * Called from platform specific assembly code, this is the
  61. * secondary CPU entry point.
  62. */
  63. asmlinkage void secondary_start_kernel(void);
  64. /*
  65. * Perform platform specific initialisation of the specified CPU.
  66. */
  67. extern void platform_secondary_init(unsigned int cpu);
  68. /*
  69. * Initial data for bringing up a secondary CPU.
  70. */
  71. struct secondary_data {
  72. unsigned long pgdir;
  73. void *stack;
  74. };
  75. extern struct secondary_data secondary_data;
  76. extern int __cpu_disable(void);
  77. extern int mach_cpu_disable(unsigned int cpu);
  78. extern void __cpu_die(unsigned int cpu);
  79. extern void cpu_die(void);
  80. extern void platform_cpu_die(unsigned int cpu);
  81. extern int platform_cpu_kill(unsigned int cpu);
  82. extern void platform_cpu_enable(unsigned int cpu);
  83. extern void arch_send_call_function_single_ipi(int cpu);
  84. extern void arch_send_call_function_ipi(cpumask_t mask);
  85. /*
  86. * Local timer interrupt handling function (can be IPI'ed).
  87. */
  88. extern void local_timer_interrupt(void);
  89. #ifdef CONFIG_LOCAL_TIMERS
  90. /*
  91. * Stop a local timer interrupt.
  92. */
  93. extern void local_timer_stop(unsigned int cpu);
  94. /*
  95. * Platform provides this to acknowledge a local timer IRQ
  96. */
  97. extern int local_timer_ack(void);
  98. #else
  99. static inline void local_timer_stop(unsigned int cpu)
  100. {
  101. }
  102. #endif
  103. /*
  104. * Setup a local timer interrupt for a CPU.
  105. */
  106. extern void local_timer_setup(unsigned int cpu);
  107. /*
  108. * show local interrupt info
  109. */
  110. extern void show_local_irqs(struct seq_file *);
  111. /*
  112. * Called from assembly, this is the local timer IRQ handler
  113. */
  114. asmlinkage void do_local_timer(struct pt_regs *);
  115. #endif /* ifndef __ASM_ARM_SMP_H */