1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
#ifndef HWCLOCK_CLOCK_H
#define HWCLOCK_CLOCK_H
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "c.h"
struct hwclock_control {
char *date_opt;
unsigned long epoch_option;
char *adj_file_name;
#ifdef __linux__
char *rtc_dev_name;
#endif
unsigned int debug;
unsigned int
#ifdef HAVE_LIBAUDIT
hwaudit_on:1,
#endif
adjust:1,
compare:1,
show:1,
hctosys:1,
utc:1,
systohc:1,
#ifdef __alpha__
ARCconsole:1,
Jensen:1,
SRM:1,
funky_toy:1,
#endif
#ifdef __linux__
getepoch:1,
setepoch:1,
#endif
noadjfile:1,
local_opt:1,
badyear:1,
directisa:1,
testing:1,
systz:1,
predict:1,
get:1,
set:1,
update:1,
universal:1; /* will store hw_clock_is_utc() return value */
};
struct clock_ops {
char *interface_name;
int (*get_permissions) (void);
int (*read_hardware_clock) (const struct hwclock_control *ctl, struct tm * tm);
int (*set_hardware_clock) (const struct hwclock_control *ctl, const struct tm * tm);
int (*synchronize_to_clock_tick) (const struct hwclock_control *ctl);
};
extern struct clock_ops *probe_for_cmos_clock(void);
extern struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl);
typedef int bool;
/* hwclock.c */
extern int debug;
extern unsigned long epoch_option;
extern double time_diff(struct timeval subtrahend, struct timeval subtractor);
/* cmos.c */
extern void set_cmos_epoch(const struct hwclock_control *ctl);
extern void set_cmos_access(const struct hwclock_control *ctl);
/* rtc.c */
extern int get_epoch_rtc(const struct hwclock_control *ctl, unsigned long *epoch, int silent);
extern int set_epoch_rtc(const struct hwclock_control *ctl);
extern void hwclock_exit(const struct hwclock_control *ctl, int status);
#endif /* HWCLOCK_CLOCK_H */
|