do_div(tmp, FSEC_PER_NSEC);
clocksource_hpet.mult = (u32)tmp;
- return register_clocksource(&clocksource_hpet);
+ return clocksource_register(&clocksource_hpet);
}
module_init(init_hpet_clocksource);
return 0;
clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);
- return register_clocksource(&clocksource_pit);
+ return clocksource_register(&clocksource_pit);
}
module_init(init_pit_clocksource);
/* check to see if we should switch to the safe clocksource: */
if (clocksource_tsc.rating != 50 && check_tsc_unstable()) {
clocksource_tsc.rating = 50;
- reselect_clocksource();
+ clocksource_reselect();
change = 1;
}
jiffies + msecs_to_jiffies(TSC_FREQ_CHECK_INTERVAL);
add_timer(&verify_tsc_freq_timer);
- return register_clocksource(&clocksource_tsc);
+ return clocksource_register(&clocksource_tsc);
}
return 0;
return -ENODEV;
pm_good:
- return register_clocksource(&clocksource_acpi_pm);
+ return clocksource_register(&clocksource_acpi_pm);
}
module_init(init_acpi_pm_clocksource);
clocksource_cyclone.mult = clocksource_hz2mult(CYCLONE_TIMER_FREQ,
clocksource_cyclone.shift);
- return register_clocksource(&clocksource_cyclone);
+ return clocksource_register(&clocksource_cyclone);
}
module_init(init_cyclone_clocksource);
}
/**
- * read_clocksource: - Access the clocksource's current cycle value
+ * clocksource_read: - Access the clocksource's current cycle value
* @cs: pointer to clocksource being read
*
* Uses the clocksource to return the current cycle_t value
*/
-static inline cycle_t read_clocksource(struct clocksource *cs)
+static inline cycle_t clocksource_read(struct clocksource *cs)
{
return cs->read();
}
}
/**
- * calculate_clocksource_interval - Calculates a clocksource interval struct
+ * clocksource_calculate_interval - Calculates a clocksource interval struct
*
* @c: Pointer to clocksource.
* @length_nsec: Desired interval length in nanoseconds.
*
* Unless you're the timekeeping code, you should not be using this!
*/
-static inline void calculate_clocksource_interval(struct clocksource *c,
+static inline void clocksource_calculate_interval(struct clocksource *c,
unsigned long length_nsec)
{
u64 tmp;
/* used to install a new clocksource */
-int register_clocksource(struct clocksource*);
-void reselect_clocksource(void);
-struct clocksource* get_next_clocksource(void);
+int clocksource_register(struct clocksource*);
+void clocksource_reselect(void);
+struct clocksource* clocksource_get_next(void);
#endif /* _LINUX_CLOCKSOURCE_H */
late_initcall(clocksource_done_booting);
/**
- * get_next_clocksource - Returns the selected clocksource
+ * clocksource_get_next - Returns the selected clocksource
*
*/
-struct clocksource *get_next_clocksource(void)
+struct clocksource *clocksource_get_next(void)
{
unsigned long flags;
}
/**
- * register_clocksource - Used to install new clocksources
+ * clocksource_register - Used to install new clocksources
* @t: clocksource to be registered
*
* Returns -EBUSY if registration fails, zero otherwise.
*/
-int register_clocksource(struct clocksource *c)
+int clocksource_register(struct clocksource *c)
{
int ret = 0;
unsigned long flags;
spin_unlock_irqrestore(&clocksource_lock, flags);
return ret;
}
-
-EXPORT_SYMBOL(register_clocksource);
+EXPORT_SYMBOL(clocksource_register);
/**
- * reselect_clocksource - Rescan list for next clocksource
+ * clocksource_reselect - Rescan list for next clocksource
*
* A quick helper function to be used if a clocksource changes its
* rating. Forces the clocksource list to be re-scanned for the best
* clocksource.
*/
-void reselect_clocksource(void)
+void clocksource_reselect(void)
{
unsigned long flags;
next_clocksource = select_clocksource();
spin_unlock_irqrestore(&clocksource_lock, flags);
}
+EXPORT_SYMBOL(clocksource_reselect);
/**
* sysfs_show_current_clocksources - sysfs interface for current clocksource
static int __init init_jiffies_clocksource(void)
{
- return register_clocksource(&clocksource_jiffies);
+ return clocksource_register(&clocksource_jiffies);
}
module_init(init_jiffies_clocksource);
s64 ns_offset;
/* read clocksource: */
- cycle_now = read_clocksource(clock);
+ cycle_now = clocksource_read(clock);
/* calculate the delta since the last update_wall_time: */
cycle_delta = (cycle_now - last_clock_cycle) & clock->mask;
}
/**
- * get_realtime_clock_ts - Returns the time of day in a timespec
+ * getnstimeofday - Returns the time of day in a timespec
* @ts: pointer to the timespec to be set
*
* Returns the time of day in a timespec.
struct clocksource *new;
cycle_t now;
u64 nsec;
- new = get_next_clocksource();
+ new = clocksource_get_next();
if (clock != new) {
- now = read_clocksource(new);
+ now = clocksource_read(new);
nsec = __get_nsec_offset();
timespec_add_ns(&xtime, nsec);
unsigned long flags;
write_seqlock_irqsave(&xtime_lock, flags);
- clock = get_next_clocksource();
- calculate_clocksource_interval(clock, tick_nsec);
- last_clock_cycle = read_clocksource(clock);
+ clock = clocksource_get_next();
+ clocksource_calculate_interval(clock, tick_nsec);
+ last_clock_cycle = clocksource_read(clock);
ntp_clear();
write_sequnlock_irqrestore(&xtime_lock, flags);
}
write_seqlock_irqsave(&xtime_lock, flags);
/* restart the last cycle value */
- last_clock_cycle = read_clocksource(clock);
+ last_clock_cycle = clocksource_read(clock);
write_sequnlock_irqrestore(&xtime_lock, flags);
return 0;
}
snsecs_per_sec = (s64)NSEC_PER_SEC << clock->shift;
remainder_snsecs += (s64)xtime.tv_nsec << clock->shift;
- now = read_clocksource(clock);
+ now = clocksource_read(clock);
offset = (now - last_clock_cycle)&clock->mask;
/* normally this loop will run just once, however in the
if (change_clocksource()) {
error = 0;
remainder_snsecs = 0;
- calculate_clocksource_interval(clock, tick_nsec);
+ clocksource_calculate_interval(clock, tick_nsec);
}
}