smp.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #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. #endif /* CONFIG_SMP */
  42. #define NO_PROC_ID 0xFF /* No processor magic marker */
  43. #define ANY_PROC_ID 0xFF /* Any processor magic marker */
  44. static inline int __cpu_disable (void) {
  45. return 0;
  46. }
  47. static inline void __cpu_die (unsigned int cpu) {
  48. while(1)
  49. ;
  50. }
  51. extern int __cpu_up (unsigned int cpu);
  52. #endif /* __ASM_SMP_H */