1 #ifndef __READCLOCK_H
2 #define __READCLOCK_H
3 
4 #include <time.h>
5 
6 /* implementations provided by arch/${MACHINE_ARCH}/arch_readclock.c */
7 struct rtc {
8 	int (*init)(void);
9 	int (*get_time)(struct tm *t, int flags);
10 	int (*set_time)(struct tm *t, int flags);
11 	int (*pwr_off)(void);
12 	void (*exit)(void);
13 };
14 
15 int arch_setup(struct rtc *r);
16 
17 /* utility functions provided by readclock.c */
18 int bcd_to_dec(int n);
19 int dec_to_bcd(int n);
20 
21 #endif /* __READCLOCK_H */
22