Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168271
b: refs/heads/master
c: 978d7eb
h: refs/heads/master
i:
  168269: bf19ccb
  168267: 8c1d5f2
  168263: cfae1b1
  168255: c7a8ffa
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Nov 5, 2009
1 parent 60e39e4 commit 5d65cde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 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: f1167fb318f0ff0bcb9cbb57bb6d16ad450f0cfb
refs/heads/master: 978d7eb31d44de34a7f71e04ed4158f3f854688d
15 changes: 14 additions & 1 deletion trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ int update_persistent_clock(struct timespec now)
return ppc_md.set_rtc_time(&tm);
}

void read_persistent_clock(struct timespec *ts)
static void __read_persistent_clock(struct timespec *ts)
{
struct rtc_time tm;
static int first = 1;
Expand All @@ -800,10 +800,23 @@ void read_persistent_clock(struct timespec *ts)
return;
}
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);
}

void read_persistent_clock(struct timespec *ts)
{
__read_persistent_clock(ts);

/* Sanitize it in case real time clock is set below EPOCH */
if (ts->tv_sec < 0) {
ts->tv_sec = 0;
ts->tv_nsec = 0;
}

}

/* clocksource code */
static cycle_t rtc_read(struct clocksource *cs)
{
Expand Down

0 comments on commit 5d65cde

Please sign in to comment.