[PATCH v2 1/2] ARM: arch timer: implement read_current_timer and get_cycles

Will Deacon will.deacon at arm.com
Thu Jul 5 08:59:29 EDT 2012


On Thu, Jul 05, 2012 at 01:35:51PM +0100, Shinya Kuribayashi wrote:
> On 6/30/2012 2:33 AM, Will Deacon wrote:
> > +#ifdef ARCH_HAS_READ_CURRENT_TIMER
> > +#define get_cycles()	({ cycles_t c; read_current_timer(&c) ? 0 : c; })
> > +#else
> > +#define get_cycles()	(0)
> > +#endif
> >  
> >  #endif
> 
> Except <asm/arch_timer.h> inclusion, this change is not arch_timer-
> dependent, but general parts for ARM, connecting read_current_timer()
> and get_cycles().  Should be folded into patch 2/2.

I'm not so sure. Before this patch, nobody implements read_current_timer for
ARM as far as I can tell, so with the first user it makes sense to add this
definition. It's also used on its own outside of the new delay implementation
as an entropy source.

Will



More information about the linux-arm-kernel mailing list