smp.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* smp.h: PPC specific SMP stuff.
  2. *
  3. * Original was a copy of sparc smp.h. Now heavily modified
  4. * for PPC.
  5. *
  6. * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  7. * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
  8. */
  9. #ifdef __KERNEL__
  10. #ifndef _PPC_SMP_H
  11. #define _PPC_SMP_H
  12. #include <linux/kernel.h>
  13. #include <linux/bitops.h>
  14. #include <linux/errno.h>
  15. #include <linux/cpumask.h>
  16. #include <linux/threads.h>
  17. #ifdef CONFIG_SMP
  18. #ifndef __ASSEMBLY__
  19. struct cpuinfo_PPC {
  20. unsigned long loops_per_jiffy;
  21. unsigned long pvr;
  22. unsigned long *pgd_cache;
  23. unsigned long *pte_cache;
  24. unsigned long pgtable_cache_sz;
  25. };
  26. extern struct cpuinfo_PPC cpu_data[];
  27. extern cpumask_t cpu_online_map;
  28. extern cpumask_t cpu_possible_map;
  29. extern unsigned long smp_proc_in_lock[];
  30. extern volatile unsigned long cpu_callin_map[];
  31. extern int smp_tb_synchronized;
  32. extern struct smp_ops_t *smp_ops;
  33. extern void smp_send_tlb_invalidate(int);
  34. extern void smp_send_xmon_break(int cpu);
  35. struct pt_regs;
  36. extern void smp_message_recv(int);
  37. extern int __cpu_disable(void);
  38. extern void __cpu_die(unsigned int cpu);
  39. extern void cpu_die(void) __attribute__((noreturn));
  40. #define raw_smp_processor_id() (current_thread_info()->cpu)
  41. extern int __cpu_up(unsigned int cpu);
  42. extern int smp_hw_index[];
  43. #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
  44. #define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)])
  45. #define set_hard_smp_processor_id(cpu, phys)\
  46. (smp_hw_index[(cpu)] = (phys))
  47. #endif /* __ASSEMBLY__ */
  48. #else /* !(CONFIG_SMP) */
  49. static inline void cpu_die(void) { }
  50. #define get_hard_smp_processor_id(cpu) 0
  51. #define set_hard_smp_processor_id(cpu, phys)
  52. #define hard_smp_processor_id() 0
  53. #endif /* !(CONFIG_SMP) */
  54. #ifndef __ASSEMBLY__
  55. extern int boot_cpuid;
  56. extern int boot_cpuid_phys;
  57. #endif
  58. #endif /* !(_PPC_SMP_H) */
  59. #endif /* __KERNEL__ */