Re: [PATCH 1/1] Clocksource: Add sched_clock to Atmel TCB clocksource

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

 



On Tue, 2 Jun 2015, Carsten Emde wrote:
>  static void __iomem *tcaddr;
> +static cycle_t (*do_sched_clock_get_cycles)(struct clocksource *cs);

what's that for? Indirection for indirection sake?

>  static cycle_t tc_get_cycles(struct clocksource *cs)
>  {
> @@ -61,6 +63,13 @@ static cycle_t tc_get_cycles32(struct cl
>  	return __raw_readl(tcaddr + ATMEL_TC_REG(0, CV));
>  }
>  
> +u64 sched_clock_get_cycles(void)

Static? 

> +{
> +	struct clocksource *cs = NULL;
> +
> +	return (u64) do_sched_clock_get_cycles(cs);


What's wrong with implementing this like:

static u64 sched_clock_get_cycles(void)
{
	return tc_get_cycles(NULL); 
}

Hmm?

> @@ -273,6 +282,7 @@ static int __init tcb_clksrc_init(void)
>  	int clk32k_divisor_idx = -1;
>  	int i;
>  	int ret;
> +	unsigned long flags;
>  
>  	tc = atmel_tc_alloc(CONFIG_ATMEL_TCB_CLKSRC_BLOCK);
>  	if (!tc) {
> @@ -339,6 +349,11 @@ static int __init tcb_clksrc_init(void)
>  	if (ret)
>  		goto err_disable_t1;
>  
> +	do_sched_clock_get_cycles = clksrc.read;

Sigh.

> +	local_irq_save(flags);

What's the purpose of this?

Thanks,

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




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux