[PATCH 1/6] ARM: Add inline function smp_cpu() for early init testing

Michał Nazarewicz m.nazarewicz at samsung.com
Sat Sep 4 21:53:55 EDT 2010


On Fri, 03 Sep 2010 14:12:22 +0200, Shilimkar, Santosh <santosh.shilimkar at ti.com> wrote:
> diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
> index 8db3512..82bc488 100644
> --- a/arch/arm/include/asm/smp_plat.h
> +++ b/arch/arm/include/asm/smp_plat.h
> @@ -39,4 +39,11 @@ static inline int cache_ops_need_broadcast(void)
>  #define UP(instr...)	_str(instr)
>  #endif
> +static inline int smp_cpu(void)
> +{
> +        u32 mpidr;
> +        asm volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (mpidr));
> +        return (mpidr >> 31) ? !(mpidr >> 30) : 0;

This always returns 0.  If (mpdir >> 31) is true then (mpidr >> 30) is
either 2 or 3.  Did you mean:

+	return (mpidr >> 30) == 2;

> +}
> +

-- 
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--




More information about the linux-arm-kernel mailing list