x86: track memtype for RAM in page struct
[linux-2.6/verdex.git] / kernel / time / tick-internal.h
blob0ffc2918ea6fb8365523ad0a63266cd68628b65f
1 /*
2 * tick internal variable and functions used by low/high res code
3 */
4 DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
5 extern spinlock_t tick_device_lock;
6 extern ktime_t tick_next_period;
7 extern ktime_t tick_period;
8 extern int tick_do_timer_cpu __read_mostly;
10 extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast);
11 extern void tick_handle_periodic(struct clock_event_device *dev);
14 * NO_HZ / high resolution timer shared code
16 #ifdef CONFIG_TICK_ONESHOT
17 extern void tick_setup_oneshot(struct clock_event_device *newdev,
18 void (*handler)(struct clock_event_device *),
19 ktime_t nextevt);
20 extern int tick_dev_program_event(struct clock_event_device *dev,
21 ktime_t expires, int force);
22 extern int tick_program_event(ktime_t expires, int force);
23 extern void tick_oneshot_notify(void);
24 extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *));
25 extern void tick_resume_oneshot(void);
26 # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
27 extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
28 extern void tick_broadcast_oneshot_control(unsigned long reason);
29 extern void tick_broadcast_switch_to_oneshot(void);
30 extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup);
31 extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc);
32 # else /* BROADCAST */
33 static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
35 BUG();
37 static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
38 static inline void tick_broadcast_switch_to_oneshot(void) { }
39 static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
40 # endif /* !BROADCAST */
42 #else /* !ONESHOT */
43 static inline
44 void tick_setup_oneshot(struct clock_event_device *newdev,
45 void (*handler)(struct clock_event_device *),
46 ktime_t nextevt)
48 BUG();
50 static inline void tick_resume_oneshot(void)
52 BUG();
54 static inline int tick_program_event(ktime_t expires, int force)
56 return 0;
58 static inline void tick_oneshot_notify(void) { }
59 static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
61 BUG();
63 static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
64 static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
65 static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
67 return 0;
69 #endif /* !TICK_ONESHOT */
72 * Broadcasting support
74 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
75 extern int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu);
76 extern int tick_check_broadcast_device(struct clock_event_device *dev);
77 extern int tick_is_broadcast_device(struct clock_event_device *dev);
78 extern void tick_broadcast_on_off(unsigned long reason, int *oncpu);
79 extern void tick_shutdown_broadcast(unsigned int *cpup);
80 extern void tick_suspend_broadcast(void);
81 extern int tick_resume_broadcast(void);
83 extern void
84 tick_set_periodic_handler(struct clock_event_device *dev, int broadcast);
86 #else /* !BROADCAST */
88 static inline int tick_check_broadcast_device(struct clock_event_device *dev)
90 return 0;
93 static inline int tick_is_broadcast_device(struct clock_event_device *dev)
95 return 0;
97 static inline int tick_device_uses_broadcast(struct clock_event_device *dev,
98 int cpu)
100 return 0;
102 static inline void tick_do_periodic_broadcast(struct clock_event_device *d) { }
103 static inline void tick_broadcast_on_off(unsigned long reason, int *oncpu) { }
104 static inline void tick_shutdown_broadcast(unsigned int *cpup) { }
105 static inline void tick_suspend_broadcast(void) { }
106 static inline int tick_resume_broadcast(void) { return 0; }
109 * Set the periodic handler in non broadcast mode
111 static inline void tick_set_periodic_handler(struct clock_event_device *dev,
112 int broadcast)
114 dev->event_handler = tick_handle_periodic;
116 #endif /* !BROADCAST */
119 * Check, if the device is functional or a dummy for broadcast
121 static inline int tick_device_is_functional(struct clock_event_device *dev)
123 return !(dev->features & CLOCK_EVT_FEAT_DUMMY);