smp.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * smp.h: PPC64 specific SMP code.
  3. *
  4. * Original was a copy of sparc smp.h. Now heavily modified
  5. * for PPC.
  6. *
  7. * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
  8. * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version
  13. * 2 of the License, or (at your option) any later version.
  14. */
  15. #ifdef __KERNEL__
  16. #ifndef _PPC64_SMP_H
  17. #define _PPC64_SMP_H
  18. #include <linux/config.h>
  19. #include <linux/threads.h>
  20. #include <linux/cpumask.h>
  21. #include <linux/kernel.h>
  22. #ifndef __ASSEMBLY__
  23. #include <asm/paca.h>
  24. extern int boot_cpuid;
  25. extern int boot_cpuid_phys;
  26. extern void cpu_die(void);
  27. #ifdef CONFIG_SMP
  28. extern void smp_send_debugger_break(int cpu);
  29. struct pt_regs;
  30. extern void smp_message_recv(int, struct pt_regs *);
  31. #ifdef CONFIG_HOTPLUG_CPU
  32. extern void fixup_irqs(cpumask_t map);
  33. int generic_cpu_disable(void);
  34. int generic_cpu_enable(unsigned int cpu);
  35. void generic_cpu_die(unsigned int cpu);
  36. void generic_mach_cpu_die(void);
  37. #endif
  38. #define raw_smp_processor_id() (get_paca()->paca_index)
  39. #define hard_smp_processor_id() (get_paca()->hw_cpu_id)
  40. extern cpumask_t cpu_sibling_map[NR_CPUS];
  41. /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
  42. *
  43. * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
  44. * in /proc/interrupts will be wrong!!! --Troy */
  45. #define PPC_MSG_CALL_FUNCTION 0
  46. #define PPC_MSG_RESCHEDULE 1
  47. /* This is unused now */
  48. #if 0
  49. #define PPC_MSG_MIGRATE_TASK 2
  50. #endif
  51. #define PPC_MSG_DEBUGGER_BREAK 3
  52. void smp_init_iSeries(void);
  53. void smp_init_pSeries(void);
  54. extern int __cpu_disable(void);
  55. extern void __cpu_die(unsigned int cpu);
  56. #endif /* CONFIG_SMP */
  57. #define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
  58. #define set_hard_smp_processor_id(CPU, VAL) \
  59. do { (paca[(CPU)].hw_cpu_id = (VAL)); } while (0)
  60. extern int smt_enabled_at_boot;
  61. extern int smp_mpic_probe(void);
  62. extern void smp_mpic_setup_cpu(int cpu);
  63. extern void smp_mpic_message_pass(int target, int msg);
  64. extern void smp_generic_kick_cpu(int nr);
  65. extern void smp_generic_give_timebase(void);
  66. extern void smp_generic_take_timebase(void);
  67. extern struct smp_ops_t *smp_ops;
  68. #ifdef CONFIG_PPC_PSERIES
  69. void vpa_init(int cpu);
  70. #else
  71. static inline void vpa_init(int cpu)
  72. {
  73. }
  74. #endif /* CONFIG_PPC_PSERIES */
  75. #endif /* __ASSEMBLY__ */
  76. #endif /* !(_PPC64_SMP_H) */
  77. #endif /* __KERNEL__ */