1 #ifndef HWCLOCK_CLOCK_H
2 #define HWCLOCK_CLOCK_H
13 #define HWCLOCK_DEBUG_INIT (1 << 0)
14 #define HWCLOCK_DEBUG_RANDOM_SLEEP (1 << 1)
15 #define HWCLOCK_DEBUG_DELTA_VS_TARGET (1 << 2)
16 #define HWCLOCK_DEBUG_ALL 0xFFFF
18 UL_DEBUG_DECLARE_MASK(hwclock
);
19 #define DBG(m, x) __UL_DBG(hwclock, HWCLOCK_DEBUG_, m, x)
20 #define ON_DBG(m, x) __UL_DBG_CALL(hwclock, HWCLOCK_DEBUG_, m, x)
22 struct hwclock_control
{
25 double rtc_delay
; /* --delay <seconds> */
26 #if defined(__linux__) && defined(__alpha__)
39 #if defined(__linux__) && defined(__alpha__)
52 universal
:1, /* will store hw_clock_is_utc() return value */
58 int (*get_permissions
) (void);
59 int (*read_hardware_clock
) (const struct hwclock_control
*ctl
, struct tm
* tm
);
60 int (*set_hardware_clock
) (const struct hwclock_control
*ctl
, const struct tm
* tm
);
61 int (*synchronize_to_clock_tick
) (const struct hwclock_control
*ctl
);
62 const char *(*get_device_path
) (void);
65 extern struct clock_ops
*probe_for_cmos_clock(void);
66 extern struct clock_ops
*probe_for_rtc_clock(const struct hwclock_control
*ctl
);
69 extern double time_diff(struct timeval subtrahend
, struct timeval subtractor
);
72 #if defined(__linux__) && defined(__alpha__)
73 extern int get_epoch_rtc(const struct hwclock_control
*ctl
, unsigned long *epoch
);
74 extern int set_epoch_rtc(const struct hwclock_control
*ctl
);
77 extern void __attribute__((__noreturn__
))
78 hwclock_exit(const struct hwclock_control
*ctl
, int status
);
80 extern int parse_date(struct timespec
*, char const *, struct timespec
const *);
82 #endif /* HWCLOCK_CLOCK_H */