diff options
author | John Stultz <john.stultz@linaro.org> | 2013-03-22 14:31:29 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2013-04-04 16:18:14 -0400 |
commit | aa6f9c595d857328e5d815e5b94c0e7cd31a6b59 (patch) | |
tree | bee031555304488a68e9f4dc76944b8924f11e7b /kernel/time/ntp.c | |
parent | ad460967a2953496ad76b1c22091ea99f21b4e86 (diff) |
ntp: Move do_adjtimex() and hardpps() functions to timekeeping.c
In preparation for changing the ntp locking rules, move
do_adjtimex and hardpps accessor functions to timekeeping.c,
but keep the code logic in ntp.c.
This patch also introduces a ntp_internal.h file so timekeeping
specific interfaces of ntp.c can be more limitedly shared with
timekeeping.c.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r-- | kernel/time/ntp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 457d2ba245fe..8b107068d7e3 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/rtc.h> | 18 | #include <linux/rtc.h> |
19 | 19 | ||
20 | #include "tick-internal.h" | 20 | #include "tick-internal.h" |
21 | #include "ntp_internal.h" | ||
21 | 22 | ||
22 | /* | 23 | /* |
23 | * NTP timekeeping variables: | 24 | * NTP timekeeping variables: |
@@ -661,7 +662,7 @@ int ntp_validate_timex(struct timex *txc) | |||
661 | * adjtimex mainly allows reading (and writing, if superuser) of | 662 | * adjtimex mainly allows reading (and writing, if superuser) of |
662 | * kernel time-keeping variables. used by xntpd. | 663 | * kernel time-keeping variables. used by xntpd. |
663 | */ | 664 | */ |
664 | int do_adjtimex(struct timex *txc) | 665 | int __do_adjtimex(struct timex *txc) |
665 | { | 666 | { |
666 | struct timespec ts; | 667 | struct timespec ts; |
667 | u32 time_tai, orig_tai; | 668 | u32 time_tai, orig_tai; |
@@ -911,7 +912,7 @@ static void hardpps_update_phase(long error) | |||
911 | } | 912 | } |
912 | 913 | ||
913 | /* | 914 | /* |
914 | * hardpps() - discipline CPU clock oscillator to external PPS signal | 915 | * __hardpps() - discipline CPU clock oscillator to external PPS signal |
915 | * | 916 | * |
916 | * This routine is called at each PPS signal arrival in order to | 917 | * This routine is called at each PPS signal arrival in order to |
917 | * discipline the CPU clock oscillator to the PPS signal. It takes two | 918 | * discipline the CPU clock oscillator to the PPS signal. It takes two |
@@ -922,7 +923,7 @@ static void hardpps_update_phase(long error) | |||
922 | * This code is based on David Mills's reference nanokernel | 923 | * This code is based on David Mills's reference nanokernel |
923 | * implementation. It was mostly rewritten but keeps the same idea. | 924 | * implementation. It was mostly rewritten but keeps the same idea. |
924 | */ | 925 | */ |
925 | void hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts) | 926 | void __hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts) |
926 | { | 927 | { |
927 | struct pps_normtime pts_norm, freq_norm; | 928 | struct pps_normtime pts_norm, freq_norm; |
928 | unsigned long flags; | 929 | unsigned long flags; |
@@ -976,8 +977,6 @@ void hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts) | |||
976 | 977 | ||
977 | raw_spin_unlock_irqrestore(&ntp_lock, flags); | 978 | raw_spin_unlock_irqrestore(&ntp_lock, flags); |
978 | } | 979 | } |
979 | EXPORT_SYMBOL(hardpps); | ||
980 | |||
981 | #endif /* CONFIG_NTP_PPS */ | 980 | #endif /* CONFIG_NTP_PPS */ |
982 | 981 | ||
983 | static int __init ntp_tick_adj_setup(char *str) | 982 | static int __init ntp_tick_adj_setup(char *str) |