smp.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #endif /* !ASSEMBLY */
  25. /*
  26. * This magic constant controls our willingness to transfer
  27. * a process across CPUs. Such a transfer incurs cache and tlb
  28. * misses. The current value is inherited from i386. Still needs
  29. * to be tuned for parisc.
  30. */
  31. #define PROC_CHANGE_PENALTY 15 /* Schedule penalty */
  32. #undef ENTRY_SYS_CPUS
  33. #ifdef ENTRY_SYS_CPUS
  34. #define STATE_RENDEZVOUS 0
  35. #define STATE_STOPPED 1
  36. #define STATE_RUNNING 2
  37. #define STATE_HALTED 3
  38. #endif
  39. extern unsigned long cpu_present_mask;
  40. #define raw_smp_processor_id() (current_thread_info()->cpu)
  41. #else /* CONFIG_SMP */
  42. static inline void smp_send_all_nop(void) { return; }
  43. #endif
  44. #define NO_PROC_ID 0xFF /* No processor magic marker */
  45. #define ANY_PROC_ID 0xFF /* Any processor magic marker */
  46. static inline int __cpu_disable (void) {
  47. return 0;
  48. }
  49. static inline void __cpu_die (unsigned int cpu) {
  50. while(1)
  51. ;
  52. }
  53. extern int __cpu_up (unsigned int cpu);
  54. #endif /* __ASM_SMP_H */