2009-09-28 03:55:43 +08:00
|
|
|
/*
|
|
|
|
* ARM specific SMP header, this contains our implementation
|
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
#ifndef __ASMARM_SMP_PLAT_H
|
|
|
|
#define __ASMARM_SMP_PLAT_H
|
|
|
|
|
|
|
|
#include <asm/cputype.h>
|
|
|
|
|
2010-09-04 17:47:48 +08:00
|
|
|
/*
|
|
|
|
* Return true if we are running on a SMP platform
|
|
|
|
*/
|
|
|
|
static inline bool is_smp(void)
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_SMP
|
|
|
|
return false;
|
|
|
|
#elif defined(CONFIG_SMP_ON_UP)
|
|
|
|
extern unsigned int smp_on_up;
|
|
|
|
return !!smp_on_up;
|
|
|
|
#else
|
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2009-09-28 03:55:43 +08:00
|
|
|
/* all SMP configurations have the extended CPUID registers */
|
|
|
|
static inline int tlb_ops_need_broadcast(void)
|
|
|
|
{
|
2010-10-05 23:40:13 +08:00
|
|
|
if (!is_smp())
|
|
|
|
return 0;
|
|
|
|
|
2009-09-28 03:55:43 +08:00
|
|
|
return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2;
|
|
|
|
}
|
|
|
|
|
2010-09-13 22:58:37 +08:00
|
|
|
#if !defined(CONFIG_SMP) || __LINUX_ARM_ARCH__ >= 7
|
|
|
|
#define cache_ops_need_broadcast() 0
|
|
|
|
#else
|
2009-11-05 21:29:36 +08:00
|
|
|
static inline int cache_ops_need_broadcast(void)
|
|
|
|
{
|
2010-10-05 23:40:13 +08:00
|
|
|
if (!is_smp())
|
|
|
|
return 0;
|
|
|
|
|
2009-11-05 21:29:36 +08:00
|
|
|
return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1;
|
|
|
|
}
|
2010-09-13 22:58:37 +08:00
|
|
|
#endif
|
2009-11-05 21:29:36 +08:00
|
|
|
|
2009-09-28 03:55:43 +08:00
|
|
|
#endif
|