smp.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. extern cpumask_t cpu_online_map;
  15. /*
  16. * Private routines/data
  17. *
  18. * physical and logical are equivalent until we support CPU hotplug.
  19. */
  20. #define cpu_number_map(cpu) (cpu)
  21. #define cpu_logical_map(cpu) (cpu)
  22. extern void smp_send_reschedule(int cpu);
  23. extern void smp_send_all_nop(void);
  24. extern void arch_send_call_function_single_ipi(int cpu);
  25. extern void arch_send_call_function_ipi(cpumask_t mask);
  26. #endif /* !ASSEMBLY */
  27. /*
  28. * This magic constant controls our willingness to transfer
  29. * a process across CPUs. Such a transfer incurs cache and tlb
  30. * misses. The current value is inherited from i386. Still needs
  31. * to be tuned for parisc.
  32. */
  33. #define PROC_CHANGE_PENALTY 15 /* Schedule penalty */
  34. extern unsigned long cpu_present_mask;
  35. #define raw_smp_processor_id() (current_thread_info()->cpu)
  36. #else /* CONFIG_SMP */
  37. static inline void smp_send_all_nop(void) { return; }
  38. #endif
  39. #define NO_PROC_ID 0xFF /* No processor magic marker */
  40. #define ANY_PROC_ID 0xFF /* Any processor magic marker */
  41. static inline int __cpu_disable (void) {
  42. return 0;
  43. }
  44. static inline void __cpu_die (unsigned int cpu) {
  45. while(1)
  46. ;
  47. }
  48. extern int __cpu_up (unsigned int cpu);
  49. #endif /* __ASM_SMP_H */