smp.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _ASM_X86_SMP_H_
  2. #define _ASM_X86_SMP_H_
  3. #ifndef __ASSEMBLY__
  4. #include <linux/cpumask.h>
  5. extern cpumask_t cpu_callout_map;
  6. extern int smp_num_siblings;
  7. extern unsigned int num_processors;
  8. struct smp_ops {
  9. void (*smp_prepare_boot_cpu)(void);
  10. void (*smp_prepare_cpus)(unsigned max_cpus);
  11. int (*cpu_up)(unsigned cpu);
  12. void (*smp_cpus_done)(unsigned max_cpus);
  13. void (*smp_send_stop)(void);
  14. void (*smp_send_reschedule)(int cpu);
  15. int (*smp_call_function_mask)(cpumask_t mask,
  16. void (*func)(void *info), void *info,
  17. int wait);
  18. };
  19. #ifdef CONFIG_SMP
  20. extern struct smp_ops smp_ops;
  21. static inline void smp_send_reschedule(int cpu)
  22. {
  23. smp_ops.smp_send_reschedule(cpu);
  24. }
  25. static inline int smp_call_function_mask(cpumask_t mask,
  26. void (*func) (void *info), void *info,
  27. int wait)
  28. {
  29. return smp_ops.smp_call_function_mask(mask, func, info, wait);
  30. }
  31. #endif
  32. #ifdef CONFIG_X86_32
  33. # include "smp_32.h"
  34. #else
  35. # include "smp_64.h"
  36. #endif
  37. extern void smp_alloc_memory(void);
  38. extern void lock_ipi_call_lock(void);
  39. extern void unlock_ipi_call_lock(void);
  40. #endif /* __ASSEMBLY__ */
  41. #endif