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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Tony Lindgren
> Sent: Thursday, September 02, 2010 11:13 PM
> To: Russell King - ARM Linux
> Cc: linux-omap@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx;
> Bryan Wu; Will Deacon
> Subject: Re: [PATCH 1/6] ARM: Add inline function smp_on_up() for early
> init testing
> 
> * Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx> [100902 10:00]:
> > On Thu, Sep 02, 2010 at 09:18:47AM -0700, Tony Lindgren wrote:
> >
> > > --- a/arch/arm/include/asm/smp_plat.h
> > > +++ b/arch/arm/include/asm/smp_plat.h
> > > @@ -39,4 +39,20 @@ static inline int cache_ops_need_broadcast(void)
> > >  #define UP(instr...)	_str(instr)
> > >  #endif
> > >
> > > +static inline int smp_on_up(void)
> > > +{
> > > +#ifdef CONFIG_SMP_ON_UP
> > > +	int smp_on_up;
> > > +
> > > +	asm(							\
> > > +		SMP(mov	%0, #0)					\
> > > +		UP(mov	%0, #1)					\
> > > +		: "=r" (smp_on_up));
> > > +
> > > +	return smp_on_up;
> > > +#else
> > > +	return 0;
> > > +#endif
> >
> > I think this is the wrong approach - rather than a function which tells
> us
> > just if we are a SMP kernel running on UP, why not something which
> returns
> > whether we're running on SMP and use that to eliminate some of these
> ifdefs?
> 
> Sure. Will has something like this in his patches:
> 
> static inline int cpu_is_part_of_mp_system(void)
> {
> 	u32 mpidr;
> 	asm volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (mpidr));
> 	return (mpidr >> 31) ? !(mpidr >> 30) : 0;
> }

I guess this register is only available on MP Core extensions.

Regards,
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux