Merge branch 'timers-for-linus-hpet' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / cris / kernel / time.c
index a05dd31f3efb5121d07cb8a826e8d6e063f88824..c72730d20ef68e03a1e836968e29f5cefd61bfdf 100644 (file)
@@ -98,6 +98,8 @@ unsigned long
 get_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
+       if(!have_rtc)
+               return 0;
 
        sec = CMOS_READ(RTC_SECONDS);
        min = CMOS_READ(RTC_MINUTES);
@@ -119,19 +121,19 @@ get_cmos_time(void)
        return mktime(year, mon, day, hour, min, sec);
 }
 
-/* update xtime from the CMOS settings. used when /dev/rtc gets a SET_TIME.
- * TODO: this doesn't reset the fancy NTP phase stuff as do_settimeofday does.
- */
 
-void
-update_xtime_from_cmos(void)
+int update_persistent_clock(struct timespec now)
 {
-       if(have_rtc) {
-               xtime.tv_sec = get_cmos_time();
-               xtime.tv_nsec = 0;
-       }
+       return set_rtc_mmss(now.tv_sec);
 }
 
+void read_persistent_clock(struct timespec *ts)
+{
+       ts->tv_sec = get_cmos_time();
+       ts->tv_nsec = 0;
+}
+
+
 extern void cris_profile_sample(struct pt_regs* regs);
 
 void