smp_plat.h 978 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * ARM specific SMP header, this contains our implementation
  3. * details.
  4. */
  5. #ifndef __ASMARM_SMP_PLAT_H
  6. #define __ASMARM_SMP_PLAT_H
  7. #include <asm/cputype.h>
  8. /*
  9. * Return true if we are running on a SMP platform
  10. */
  11. static inline bool is_smp(void)
  12. {
  13. #ifndef CONFIG_SMP
  14. return false;
  15. #elif defined(CONFIG_SMP_ON_UP)
  16. extern unsigned int smp_on_up;
  17. return !!smp_on_up;
  18. #else
  19. return true;
  20. #endif
  21. }
  22. /* all SMP configurations have the extended CPUID registers */
  23. static inline int tlb_ops_need_broadcast(void)
  24. {
  25. if (!is_smp())
  26. return 0;
  27. return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2;
  28. }
  29. #if !defined(CONFIG_SMP) || __LINUX_ARM_ARCH__ >= 7
  30. #define cache_ops_need_broadcast() 0
  31. #else
  32. static inline int cache_ops_need_broadcast(void)
  33. {
  34. if (!is_smp())
  35. return 0;
  36. return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1;
  37. }
  38. #endif
  39. /*
  40. * Logical CPU mapping.
  41. */
  42. extern int __cpu_logical_map[];
  43. #define cpu_logical_map(cpu) __cpu_logical_map[cpu]
  44. #endif