2007-03-21 09:05:58 -05:00
|
|
|
#ifndef HWCLOCK_CLOCK_H
|
|
|
|
#define HWCLOCK_CLOCK_H
|
|
|
|
|
2011-07-24 10:35:43 -05:00
|
|
|
#include <errno.h>
|
2006-12-06 17:25:39 -06:00
|
|
|
#include <stdio.h>
|
2006-12-06 17:25:44 -06:00
|
|
|
#include <stdlib.h>
|
2006-12-06 17:25:39 -06:00
|
|
|
#include <string.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2009-10-15 18:37:09 -05:00
|
|
|
#include "c.h"
|
|
|
|
|
2006-12-06 17:25:39 -06:00
|
|
|
struct clock_ops {
|
|
|
|
char *interface_name;
|
2011-07-24 10:35:43 -05:00
|
|
|
int (*get_permissions) (void);
|
|
|
|
int (*read_hardware_clock) (struct tm * tm);
|
|
|
|
int (*set_hardware_clock) (const struct tm * tm);
|
|
|
|
int (*synchronize_to_clock_tick) (void);
|
2006-12-06 17:25:39 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct clock_ops *probe_for_cmos_clock(void);
|
|
|
|
extern struct clock_ops *probe_for_rtc_clock(void);
|
|
|
|
|
|
|
|
typedef int bool;
|
|
|
|
|
|
|
|
/* hwclock.c */
|
|
|
|
extern int debug;
|
2011-07-25 17:04:34 -05:00
|
|
|
extern unsigned long epoch_option;
|
2008-08-12 06:58:51 -05:00
|
|
|
extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
|
2006-12-06 17:25:39 -06:00
|
|
|
/* cmos.c */
|
|
|
|
extern void set_cmos_epoch(int ARCconsole, int SRM);
|
|
|
|
extern void set_cmos_access(int Jensen, int funky_toy);
|
|
|
|
|
|
|
|
/* rtc.c */
|
|
|
|
extern int get_epoch_rtc(unsigned long *epoch, int silent);
|
|
|
|
extern int set_epoch_rtc(unsigned long epoch);
|
2007-03-19 04:14:13 -05:00
|
|
|
extern char *rtc_dev_name;
|
2007-03-21 08:12:05 -05:00
|
|
|
|
2016-07-16 06:57:25 -05:00
|
|
|
extern void hwclock_exit(int status);
|
2007-03-21 09:05:58 -05:00
|
|
|
|
2011-07-24 10:35:43 -05:00
|
|
|
#endif /* HWCLOCK_CLOCK_H */
|