mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (34 commits) time: Prevent 32 bit overflow with set_normalized_timespec() clocksource: Delay clocksource down rating to late boot clocksource: clocksource_select must be called with mutex locked clocksource: Resolve cpu hotplug dead lock with TSC unstable, fix crash timers: Drop a function prototype clocksource: Resolve cpu hotplug dead lock with TSC unstable timer.c: Fix S/390 comments timekeeping: Fix invalid getboottime() value timekeeping: Fix up read_persistent_clock() breakage on sh timekeeping: Increase granularity of read_persistent_clock(), build fix time: Introduce CLOCK_REALTIME_COARSE x86: Do not unregister PIT clocksource on PIT oneshot setup/shutdown clocksource: Avoid clocksource watchdog circular locking dependency clocksource: Protect the watchdog rating changes with clocksource_mutex clocksource: Call clocksource_change_rating() outside of watchdog_lock timekeeping: Introduce read_boot_clock timekeeping: Increase granularity of read_persistent_clock() timekeeping: Update clocksource with stop_machine timekeeping: Add timekeeper read_clock helper functions timekeeping: Move NTP adjusted clock multiplier to struct timekeeper ... Fix trivial conflict due to MIPS lemote -> loongson renaming.
This commit is contained in:
commit
a03fdb7612
32 changed files with 917 additions and 640 deletions
|
|
@ -774,11 +774,12 @@ int update_persistent_clock(struct timespec now)
|
|||
return ppc_md.set_rtc_time(&tm);
|
||||
}
|
||||
|
||||
unsigned long read_persistent_clock(void)
|
||||
void read_persistent_clock(struct timespec *ts)
|
||||
{
|
||||
struct rtc_time tm;
|
||||
static int first = 1;
|
||||
|
||||
ts->tv_nsec = 0;
|
||||
/* XXX this is a litle fragile but will work okay in the short term */
|
||||
if (first) {
|
||||
first = 0;
|
||||
|
|
@ -786,14 +787,18 @@ unsigned long read_persistent_clock(void)
|
|||
timezone_offset = ppc_md.time_init();
|
||||
|
||||
/* get_boot_time() isn't guaranteed to be safe to call late */
|
||||
if (ppc_md.get_boot_time)
|
||||
return ppc_md.get_boot_time() -timezone_offset;
|
||||
if (ppc_md.get_boot_time) {
|
||||
ts->tv_sec = ppc_md.get_boot_time() - timezone_offset;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!ppc_md.get_rtc_time) {
|
||||
ts->tv_sec = 0;
|
||||
return;
|
||||
}
|
||||
if (!ppc_md.get_rtc_time)
|
||||
return 0;
|
||||
ppc_md.get_rtc_time(&tm);
|
||||
return mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
}
|
||||
|
||||
/* clocksource code */
|
||||
|
|
|
|||
Loading…
Reference in a new issue