smp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General
  3. * Public License. See the file "COPYING" in the main directory of this
  4. * archive for more details.
  5. *
  6. * Copyright (C) 2000 - 2001 by Kanoj Sarcar (kanoj@sgi.com)
  7. * Copyright (C) 2000 - 2001 by Silicon Graphics, Inc.
  8. * Copyright (C) 2000, 2001, 2002 Ralf Baechle
  9. * Copyright (C) 2000, 2001 Broadcom Corporation
  10. */
  11. #ifndef __ASM_SMP_H
  12. #define __ASM_SMP_H
  13. #include <linux/bitops.h>
  14. #include <linux/linkage.h>
  15. #include <linux/smp.h>
  16. #include <linux/threads.h>
  17. #include <linux/cpumask.h>
  18. #include <asm/atomic.h>
  19. #include <asm/smp-ops.h>
  20. extern int smp_num_siblings;
  21. extern cpumask_t cpu_sibling_map[];
  22. #define raw_smp_processor_id() (current_thread_info()->cpu)
  23. /* Map from cpu id to sequential logical cpu number. This will only
  24. not be idempotent when cpus failed to come on-line. */
  25. extern int __cpu_number_map[NR_CPUS];
  26. #define cpu_number_map(cpu) __cpu_number_map[cpu]
  27. /* The reverse map from sequential logical cpu number to cpu id. */
  28. extern int __cpu_logical_map[NR_CPUS];
  29. #define cpu_logical_map(cpu) __cpu_logical_map[cpu]
  30. #define NO_PROC_ID (-1)
  31. #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
  32. #define SMP_CALL_FUNCTION 0x2
  33. /* Octeon - Tell another core to flush its icache */
  34. #define SMP_ICACHE_FLUSH 0x4
  35. extern void asmlinkage smp_bootstrap(void);
  36. /*
  37. * this function sends a 'reschedule' IPI to another CPU.
  38. * it goes straight through and wastes no time serializing
  39. * anything. Worst case is that we lose a reschedule ...
  40. */
  41. static inline void smp_send_reschedule(int cpu)
  42. {
  43. extern struct plat_smp_ops *mp_ops; /* private */
  44. mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF);
  45. }
  46. extern asmlinkage void smp_call_function_interrupt(void);
  47. extern void arch_send_call_function_single_ipi(int cpu);
  48. extern void arch_send_call_function_ipi(cpumask_t mask);
  49. #endif /* __ASM_SMP_H */