Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other codepaths
@ 2008-05-28 12:28 Manuel Lauss
  2008-06-01 17:56 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Manuel Lauss @ 2008-05-28 12:28 UTC (permalink / raw)
  To: linux-mips



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other codepaths
  2008-05-28 12:28 [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other codepaths Manuel Lauss
@ 2008-06-01 17:56 ` Sergei Shtylyov
  2008-06-03 14:12   ` Manuel Lauss
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2008-06-01 17:56 UTC (permalink / raw)
  To: Manuel Lauss; +Cc: linux-mips

Hello.

Manuel Lauss wrote:
> Make the r4k cp0 counter clocksource and clockevent modules
> library code so it may be used e.g. as a fallback in case other
> clocksources/events aren't available.
>
> Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
>   
[...]

> diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
> index d3bd5c5..01a4c93 100644
> --- a/include/asm-mips/time.h
> +++ b/include/asm-mips/time.h
> @@ -50,27 +50,35 @@ extern int (*perf_irq)(void);
>  /*
>   * Initialize the calling CPU's compare interrupt as clockevent device
>   */
> -#ifdef CONFIG_CEVT_R4K
> -extern int mips_clockevent_init(void);
> +#ifdef CONFIG_CEVT_R4K_LIB
>  extern unsigned int __weak get_c0_compare_int(void);
> -#else
> +extern int r4k_clockevent_init(void);
> +#endif
> +
>  static inline int mips_clockevent_init(void)
>  {
> +#ifdef CONFIG_CEVT_R4K
> +	return r4k_clockevent_init();
> +#else
>  	return -ENXIO;
> -}
>  #endif
> +}
>  
>  /*
>   * Initialize the count register as a clocksource
>   */
> -#ifdef CONFIG_CEVT_R4K
> -extern int init_mips_clocksource(void);
> -#else
> +#ifdef CONFIG_CSRC_R4K_LIB
> +extern int init_r4k_clocksource(void);
> +#endif
>   

   Hm, does it make sense to hedge ''extern' declaration by #ifdef's?

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other codepaths
  2008-06-01 17:56 ` Sergei Shtylyov
@ 2008-06-03 14:12   ` Manuel Lauss
  0 siblings, 0 replies; 3+ messages in thread
From: Manuel Lauss @ 2008-06-03 14:12 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mips

hi Sergei,

> Manuel Lauss wrote:
>> Make the r4k cp0 counter clocksource and clockevent modules
>> library code so it may be used e.g. as a fallback in case other
>> clocksources/events aren't available.
>>
>> Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
>>   
> [...]
>
>> diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
>> index d3bd5c5..01a4c93 100644
>> --- a/include/asm-mips/time.h
>> +++ b/include/asm-mips/time.h
>> @@ -50,27 +50,35 @@ extern int (*perf_irq)(void);
>>  /*
>>   * Initialize the calling CPU's compare interrupt as clockevent device
>>   */
>> -#ifdef CONFIG_CEVT_R4K
>> -extern int mips_clockevent_init(void);
>> +#ifdef CONFIG_CEVT_R4K_LIB
>>  extern unsigned int __weak get_c0_compare_int(void);
>> -#else
>> +extern int r4k_clockevent_init(void);
>> +#endif
>> +
>>  static inline int mips_clockevent_init(void)
>>  {
>> +#ifdef CONFIG_CEVT_R4K
>> +	return r4k_clockevent_init();
>> +#else
>>  	return -ENXIO;
>> -}
>>  #endif
>> +}
>>   /*
>>   * Initialize the count register as a clocksource
>>   */
>> -#ifdef CONFIG_CEVT_R4K
>> -extern int init_mips_clocksource(void);
>> -#else
>> +#ifdef CONFIG_CSRC_R4K_LIB
>> +extern int init_r4k_clocksource(void);
>> +#endif
>>   
>
>   Hm, does it make sense to hedge ''extern' declaration by #ifdef's?

To be honest, I didn't think about that (and I don't know the exact
semantics of 'extern' either),  I just followed the original code ;-)

MfG,
	Manuel Lauss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-03 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 12:28 [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other codepaths Manuel Lauss
2008-06-01 17:56 ` Sergei Shtylyov
2008-06-03 14:12   ` Manuel Lauss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox