smp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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/config.h>
  13. #include <linux/kernel.h>
  14. #include <linux/bitops.h>
  15. #include <linux/errno.h>
  16. #include <linux/cpumask.h>
  17. #include <linux/threads.h>
  18. #ifdef CONFIG_SMP
  19. #ifndef __ASSEMBLY__
  20. struct cpuinfo_PPC {
  21. unsigned long loops_per_jiffy;
  22. unsigned long pvr;
  23. unsigned long *pgd_cache;
  24. unsigned long *pte_cache;
  25. unsigned long pgtable_cache_sz;
  26. };
  27. extern struct cpuinfo_PPC cpu_data[];
  28. extern cpumask_t cpu_online_map;
  29. extern cpumask_t cpu_possible_map;
  30. extern unsigned long smp_proc_in_lock[];
  31. extern volatile unsigned long cpu_callin_map[];
  32. extern int smp_tb_synchronized;
  33. extern struct smp_ops_t *smp_ops;
  34. extern void smp_send_tlb_invalidate(int);
  35. extern void smp_send_xmon_break(int cpu);
  36. struct pt_regs;
  37. extern void smp_message_recv(int, struct pt_regs *);
  38. extern int __cpu_disable(void);
  39. extern void __cpu_die(unsigned int cpu);
  40. extern void cpu_die(void) __attribute__((noreturn));
  41. #define raw_smp_processor_id() (current_thread_info()->cpu)
  42. extern int __cpu_up(unsigned int cpu);
  43. extern int smp_hw_index[];
  44. #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
  45. #define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)])
  46. #define set_hard_smp_processor_id(cpu, phys)\
  47. (smp_hw_index[(cpu)] = (phys))
  48. #endif /* __ASSEMBLY__ */
  49. #else /* !(CONFIG_SMP) */
  50. static inline void cpu_die(void) { }
  51. #define get_hard_smp_processor_id(cpu) 0
  52. #define set_hard_smp_processor_id(cpu, phys)
  53. #define hard_smp_processor_id() 0
  54. #endif /* !(CONFIG_SMP) */
  55. #ifndef __ASSEMBLY__
  56. extern int boot_cpuid;
  57. extern int boot_cpuid_phys;
  58. #endif
  59. #endif /* !(_PPC_SMP_H) */
  60. #endif /* __KERNEL__ */