浏览代码

clockevents: Allow build w/o run-tine usage for migration purposes

Migration aid to allow preparatory patches which introduce not yet
used parts of clock events code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Thomas Gleixner 17 年之前
父节点
当前提交
de68d9b173
共有 4 个文件被更改,包括 14 次插入4 次删除
  1. 6 2
      include/linux/clockchips.h
  2. 5 0
      kernel/time/Kconfig
  3. 1 1
      kernel/time/Makefile
  4. 2 1
      kernel/time/clockevents.c

+ 6 - 2
include/linux/clockchips.h

@@ -8,7 +8,7 @@
 #ifndef _LINUX_CLOCKCHIPS_H
 #ifndef _LINUX_CLOCKCHIPS_H
 #define _LINUX_CLOCKCHIPS_H
 #define _LINUX_CLOCKCHIPS_H
 
 
-#ifdef CONFIG_GENERIC_CLOCKEVENTS
+#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
 
 
 #include <linux/clocksource.h>
 #include <linux/clocksource.h>
 #include <linux/cpumask.h>
 #include <linux/cpumask.h>
@@ -126,9 +126,13 @@ extern int clockevents_register_notifier(struct notifier_block *nb);
 extern int clockevents_program_event(struct clock_event_device *dev,
 extern int clockevents_program_event(struct clock_event_device *dev,
 				     ktime_t expires, ktime_t now);
 				     ktime_t expires, ktime_t now);
 
 
+#ifdef CONFIG_GENERIC_CLOCKEVENTS
 extern void clockevents_notify(unsigned long reason, void *arg);
 extern void clockevents_notify(unsigned long reason, void *arg);
-
 #else
 #else
+# define clockevents_notify(reason, arg) do { } while (0)
+#endif
+
+#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
 
 
 #define clockevents_notify(reason, arg) do { } while (0)
 #define clockevents_notify(reason, arg) do { } while (0)
 
 

+ 5 - 0
kernel/time/Kconfig

@@ -23,3 +23,8 @@ config HIGH_RES_TIMERS
 	  hardware is not capable then this option only increases
 	  hardware is not capable then this option only increases
 	  the size of the kernel image.
 	  the size of the kernel image.
 
 
+config GENERIC_CLOCKEVENTS_BUILD
+	bool
+	default y
+	depends on GENERIC_CLOCKEVENTS || GENERIC_CLOCKEVENTS_MIGR
+

+ 1 - 1
kernel/time/Makefile

@@ -1,6 +1,6 @@
 obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o
 obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o
 
 
-obj-$(CONFIG_GENERIC_CLOCKEVENTS)		+= clockevents.o
+obj-$(CONFIG_GENERIC_CLOCKEVENTS_BUILD)		+= clockevents.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS)		+= tick-common.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS)		+= tick-common.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)	+= tick-broadcast.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)	+= tick-broadcast.o
 obj-$(CONFIG_TICK_ONESHOT)			+= tick-oneshot.o
 obj-$(CONFIG_TICK_ONESHOT)			+= tick-oneshot.o

+ 2 - 1
kernel/time/clockevents.c

@@ -194,6 +194,7 @@ void clockevents_exchange_device(struct clock_event_device *old,
 	local_irq_restore(flags);
 	local_irq_restore(flags);
 }
 }
 
 
+#ifdef CONFIG_GENERIC_CLOCKEVENTS
 /**
 /**
  * clockevents_notify - notification about relevant events
  * clockevents_notify - notification about relevant events
  */
  */
@@ -222,4 +223,4 @@ void clockevents_notify(unsigned long reason, void *arg)
 	spin_unlock(&clockevents_lock);
 	spin_unlock(&clockevents_lock);
 }
 }
 EXPORT_SYMBOL_GPL(clockevents_notify);
 EXPORT_SYMBOL_GPL(clockevents_notify);
-
+#endif