linux-mips
[Top] [All Lists]

Re: [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other co

To: Manuel Lauss <mano@roarinelk.homelinux.net>
Subject: Re: [PATCH 1/2] MIPS: make r4k clocksource/clockevent usable in other codepaths
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Sun, 01 Jun 2008 21:56:16 +0400
Cc: linux-mips@linux-mips.org
In-reply-to: <20080528122838.GA5976@roarinelk.homelinux.net>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20080528122838.GA5976@roarinelk.homelinux.net>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 1.5.0.14 (Windows/20071210)
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



<Prev in Thread] Current Thread [Next in Thread>