smp.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef __ASM_SMP_H
  2. #define __ASM_SMP_H
  3. #include <linux/config.h>
  4. #if defined(CONFIG_SMP)
  5. /* Page Zero Location PDC will look for the address to branch to when we poke
  6. ** slave CPUs still in "Icache loop".
  7. */
  8. #define PDC_OS_BOOT_RENDEZVOUS 0x10
  9. #define PDC_OS_BOOT_RENDEZVOUS_HI 0x28
  10. #ifndef ASSEMBLY
  11. #include <linux/bitops.h>
  12. #include <linux/threads.h> /* for NR_CPUS */
  13. #include <linux/cpumask.h>
  14. typedef unsigned long address_t;
  15. extern cpumask_t cpu_online_map;
  16. /*
  17. * Private routines/data
  18. *
  19. * physical and logical are equivalent until we support CPU hotplug.
  20. */
  21. #define cpu_number_map(cpu) (cpu)
  22. #define cpu_logical_map(cpu) (cpu)
  23. extern void smp_send_reschedule(int cpu);
  24. extern void smp_send_all_nop(void);
  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. #undef ENTRY_SYS_CPUS
  34. #ifdef ENTRY_SYS_CPUS
  35. #define STATE_RENDEZVOUS 0
  36. #define STATE_STOPPED 1
  37. #define STATE_RUNNING 2
  38. #define STATE_HALTED 3
  39. #endif
  40. extern unsigned long cpu_present_mask;
  41. #define raw_smp_processor_id() (current_thread_info()->cpu)
  42. #else /* CONFIG_SMP */
  43. static inline void smp_send_all_nop(void) { return; }
  44. #endif
  45. #define NO_PROC_ID 0xFF /* No processor magic marker */
  46. #define ANY_PROC_ID 0xFF /* Any processor magic marker */
  47. static inline int __cpu_disable (void) {
  48. return 0;
  49. }
  50. static inline void __cpu_die (unsigned int cpu) {
  51. while(1)
  52. ;
  53. }
  54. extern int __cpu_up (unsigned int cpu);
  55. #endif /* __ASM_SMP_H */