]>
Commit | Line | Data |
---|---|---|
9abb2685 KZ |
1 | #ifndef HWCLOCK_CLOCK_H |
2 | #define HWCLOCK_CLOCK_H | |
3 | ||
7eda085c | 4 | #include <stdio.h> |
66ee8158 | 5 | #include <stdlib.h> |
7eda085c | 6 | #include <string.h> |
f2ff0adf | 7 | #include <sys/time.h> |
7eda085c KZ |
8 | #include <time.h> |
9 | ||
b940bae3 KZ |
10 | #include "c.h" |
11 | ||
336f7c5f SK |
12 | struct hwclock_control { |
13 | char *date_opt; | |
336f7c5f | 14 | char *adj_file_name; |
039a0cec | 15 | #if defined(__linux__) && defined(__alpha__) |
f7599b4f | 16 | char *epoch_option; |
039a0cec | 17 | #endif |
336f7c5f SK |
18 | #ifdef __linux__ |
19 | char *rtc_dev_name; | |
20 | #endif | |
de4568f7 | 21 | unsigned int verbose; |
336f7c5f | 22 | unsigned int |
336f7c5f | 23 | hwaudit_on:1, |
336f7c5f | 24 | adjust:1, |
336f7c5f SK |
25 | show:1, |
26 | hctosys:1, | |
27 | utc:1, | |
28 | systohc:1, | |
039a0cec | 29 | #if defined(__linux__) && defined(__alpha__) |
336f7c5f SK |
30 | getepoch:1, |
31 | setepoch:1, | |
32 | #endif | |
33 | noadjfile:1, | |
34 | local_opt:1, | |
336f7c5f SK |
35 | directisa:1, |
36 | testing:1, | |
37 | systz:1, | |
38 | predict:1, | |
39 | get:1, | |
40 | set:1, | |
41 | update:1, | |
42 | universal:1; /* will store hw_clock_is_utc() return value */ | |
43 | }; | |
44 | ||
7eda085c KZ |
45 | struct clock_ops { |
46 | char *interface_name; | |
ef71b8f1 | 47 | int (*get_permissions) (void); |
336f7c5f SK |
48 | int (*read_hardware_clock) (const struct hwclock_control *ctl, struct tm * tm); |
49 | int (*set_hardware_clock) (const struct hwclock_control *ctl, const struct tm * tm); | |
50 | int (*synchronize_to_clock_tick) (const struct hwclock_control *ctl); | |
7eda085c KZ |
51 | }; |
52 | ||
53 | extern struct clock_ops *probe_for_cmos_clock(void); | |
336f7c5f | 54 | extern struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl); |
7eda085c | 55 | |
7eda085c | 56 | /* hwclock.c */ |
982a4a5d | 57 | extern double time_diff(struct timeval subtrahend, struct timeval subtractor); |
7eda085c KZ |
58 | |
59 | /* rtc.c */ | |
039a0cec | 60 | #if defined(__linux__) && defined(__alpha__) |
af68bd01 | 61 | extern int get_epoch_rtc(const struct hwclock_control *ctl, unsigned long *epoch); |
336f7c5f | 62 | extern int set_epoch_rtc(const struct hwclock_control *ctl); |
039a0cec | 63 | #endif |
88058a71 | 64 | |
39ff5b34 RM |
65 | extern void __attribute__((__noreturn__)) |
66 | hwclock_exit(const struct hwclock_control *ctl, int status); | |
9abb2685 | 67 | |
ef71b8f1 | 68 | #endif /* HWCLOCK_CLOCK_H */ |