patch-2.4.19 linux-2.4.19/arch/m68k/atari/time.c
Next file: linux-2.4.19/arch/m68k/bvme6000/config.c
Previous file: linux-2.4.19/arch/m68k/atari/stram.c
Back to the patch index
Back to the overall index
- Lines: 148
- Date:
Fri Aug 2 17:39:43 2002
- Orig file:
linux-2.4.18/arch/m68k/atari/time.c
- Orig date:
Mon Jun 11 19:15:27 2001
diff -urN linux-2.4.18/arch/m68k/atari/time.c linux-2.4.19/arch/m68k/atari/time.c
@@ -14,6 +14,7 @@
#include <linux/mc146818rtc.h>
#include <linux/interrupt.h>
#include <linux/init.h>
+#include <linux/rtc.h>
#include <asm/rtc.h>
@@ -83,14 +84,14 @@
#define RTC_READ(reg) \
({ unsigned char __val; \
- (void) writeb(reg,&tt_rtc.regsel); \
+ (void) atari_writeb(reg,&tt_rtc.regsel); \
__val = tt_rtc.data; \
__val; \
})
#define RTC_WRITE(reg,val) \
do { \
- writeb(reg,&tt_rtc.regsel); \
+ atari_writeb(reg,&tt_rtc.regsel); \
tt_rtc.data = (val); \
} while(0)
@@ -164,7 +165,7 @@
#define HWCLK_POLL_INTERVAL 5
-int atari_mste_hwclk( int op, struct hwclk_time *t )
+int atari_mste_hwclk( int op, struct rtc_time *t )
{
int hour, year;
int hr24=0;
@@ -177,11 +178,11 @@
if (op) {
/* write: prepare values */
- val.sec_ones = t->sec % 10;
- val.sec_tens = t->sec / 10;
- val.min_ones = t->min % 10;
- val.min_tens = t->min / 10;
- hour = t->hour;
+ val.sec_ones = t->tm_sec % 10;
+ val.sec_tens = t->tm_sec / 10;
+ val.min_ones = t->tm_min % 10;
+ val.min_tens = t->tm_min / 10;
+ hour = t->tm_hour;
if (!hr24) {
if (hour > 11)
hour += 20 - 12;
@@ -190,14 +191,14 @@
}
val.hr_ones = hour % 10;
val.hr_tens = hour / 10;
- val.day_ones = t->day % 10;
- val.day_tens = t->day / 10;
- val.mon_ones = (t->mon+1) % 10;
- val.mon_tens = (t->mon+1) / 10;
- year = t->year - 80;
+ val.day_ones = t->tm_mday % 10;
+ val.day_tens = t->tm_mday / 10;
+ val.mon_ones = (t->tm_mon+1) % 10;
+ val.mon_tens = (t->tm_mon+1) / 10;
+ year = t->tm_year - 80;
val.year_ones = year % 10;
val.year_tens = year / 10;
- val.weekday = t->wday;
+ val.weekday = t->tm_wday;
mste_write(&val);
mste_rtc.mode=(mste_rtc.mode | 1);
val.year_ones = (year % 4); /* leap year register */
@@ -205,8 +206,8 @@
}
else {
mste_read(&val);
- t->sec = val.sec_ones + val.sec_tens * 10;
- t->min = val.min_ones + val.min_tens * 10;
+ t->tm_sec = val.sec_ones + val.sec_tens * 10;
+ t->tm_min = val.min_ones + val.min_tens * 10;
hour = val.hr_ones + val.hr_tens * 10;
if (!hr24) {
if (hour == 12 || hour == 12 + 20)
@@ -214,16 +215,16 @@
if (hour >= 20)
hour += 12 - 20;
}
- t->hour = hour;
- t->day = val.day_ones + val.day_tens * 10;
- t->mon = val.mon_ones + val.mon_tens * 10 - 1;
- t->year = val.year_ones + val.year_tens * 10 + 80;
- t->wday = val.weekday;
+ t->tm_hour = hour;
+ t->tm_mday = val.day_ones + val.day_tens * 10;
+ t->tm_mon = val.mon_ones + val.mon_tens * 10 - 1;
+ t->tm_year = val.year_ones + val.year_tens * 10 + 80;
+ t->tm_wday = val.weekday;
}
return 0;
}
-int atari_tt_hwclk( int op, struct hwclk_time *t )
+int atari_tt_hwclk( int op, struct rtc_time *t )
{
int sec=0, min=0, hour=0, day=0, mon=0, year=0, wday=0;
unsigned long flags;
@@ -236,13 +237,13 @@
if (op) {
/* write: prepare values */
- sec = t->sec;
- min = t->min;
- hour = t->hour;
- day = t->day;
- mon = t->mon + 1;
- year = t->year - atari_rtc_year_offset;
- wday = t->wday + (t->wday >= 0);
+ sec = t->tm_sec;
+ min = t->tm_min;
+ hour = t->tm_hour;
+ day = t->tm_mday;
+ mon = t->tm_mon + 1;
+ year = t->tm_year - atari_rtc_year_offset;
+ wday = t->tm_wday + (t->tm_wday >= 0);
if (!(ctrl & RTC_24H)) {
if (hour > 11) {
@@ -331,13 +332,13 @@
hour += 12;
}
- t->sec = sec;
- t->min = min;
- t->hour = hour;
- t->day = day;
- t->mon = mon - 1;
- t->year = year + atari_rtc_year_offset;
- t->wday = wday - 1;
+ t->tm_sec = sec;
+ t->tm_min = min;
+ t->tm_hour = hour;
+ t->tm_mday = day;
+ t->tm_mon = mon - 1;
+ t->tm_year = year + atari_rtc_year_offset;
+ t->tm_wday = wday - 1;
}
return( 0 );
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)