Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163076
b: refs/heads/master
c: d90246c
h: refs/heads/master
v: v3
  • Loading branch information
Martin Schwidefsky authored and Ingo Molnar committed Aug 23, 2009
1 parent 4e1e8cb commit 1b382bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da15cfdae03351c689736f8d142618592e3cebc3
refs/heads/master: d90246cd8e0141332a8ab09c3c1800cc2028a686
14 changes: 9 additions & 5 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,22 +774,26 @@ 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;
if (ppc_md.time_init)
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);
ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
ts->tv_nsec = 0;
}

/* clocksource code */
Expand Down

0 comments on commit 1b382bc

Please sign in to comment.