smp.h 1.8 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 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, struct pt_regs *);
  37. extern int __cpu_disable(void);
  38. extern void __cpu_die(unsigned int cpu);
  39. extern void cpu_die(void) __attribute__((noreturn));
  40. #define NO_PROC_ID 0xFF /* No processor magic marker */
  41. #define PROC_CHANGE_PENALTY 20
  42. #define raw_smp_processor_id() (current_thread_info()->cpu)
  43. extern int __cpu_up(unsigned int cpu);
  44. extern int smp_hw_index[];
  45. #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
  46. struct klock_info_struct {
  47. unsigned long kernel_flag;
  48. unsigned char akp;
  49. };
  50. extern struct klock_info_struct klock_info;
  51. #define KLOCK_HELD 0xffffffff
  52. #define KLOCK_CLEAR 0x0
  53. #endif /* __ASSEMBLY__ */
  54. #else /* !(CONFIG_SMP) */
  55. static inline void cpu_die(void) { }
  56. #endif /* !(CONFIG_SMP) */
  57. #endif /* !(_PPC_SMP_H) */
  58. #endif /* __KERNEL__ */