smp.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __ASM_SMP_H
  2. #define __ASM_SMP_H
  3. #if defined(CONFIG_SMP)
  4. /* Page Zero Location PDC will look for the address to branch to when we poke
  5. ** slave CPUs still in "Icache loop".
  6. */
  7. #define PDC_OS_BOOT_RENDEZVOUS 0x10
  8. #define PDC_OS_BOOT_RENDEZVOUS_HI 0x28
  9. #ifndef ASSEMBLY
  10. #include <linux/bitops.h>
  11. #include <linux/threads.h> /* for NR_CPUS */
  12. #include <linux/cpumask.h>
  13. typedef unsigned long address_t;
  14. /*
  15. * Private routines/data
  16. *
  17. * physical and logical are equivalent until we support CPU hotplug.
  18. */
  19. #define cpu_number_map(cpu) (cpu)
  20. #define cpu_logical_map(cpu) (cpu)
  21. extern void smp_send_reschedule(int cpu);
  22. extern void smp_send_all_nop(void);
  23. extern void arch_send_call_function_single_ipi(int cpu);
  24. extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
  25. #endif /* !ASSEMBLY */
  26. /*
  27. * This magic constant controls our willingness to transfer
  28. * a process across CPUs. Such a transfer incurs cache and tlb
  29. * misses. The current value is inherited from i386. Still needs
  30. * to be tuned for parisc.
  31. */
  32. #define PROC_CHANGE_PENALTY 15 /* Schedule penalty */
  33. #define raw_smp_processor_id() (current_thread_info()->cpu)
  34. #else /* CONFIG_SMP */
  35. static inline void smp_send_all_nop(void) { return; }
  36. #endif
  37. #define NO_PROC_ID 0xFF /* No processor magic marker */
  38. #define ANY_PROC_ID 0xFF /* Any processor magic marker */
  39. static inline int __cpu_disable (void) {
  40. return 0;
  41. }
  42. static inline void __cpu_die (unsigned int cpu) {
  43. while(1)
  44. ;
  45. }
  46. extern int __cpu_up (unsigned int cpu);
  47. #endif /* __ASM_SMP_H */