1 #ifndef __LUNAIX_HWRTC_H
2 #define __LUNAIX_HWRTC_H
4 #include <lunaix/device.h>
5 #include <lunaix/ds/ldga.h>
6 #include <lunaix/ds/llist.h>
7 #include <lunaix/time.h>
9 #define RTC_STATE_MASKED 0x1
11 #define EXPORT_RTC_DEVICE(id, init_fn) \
12 export_ldga_el(rtcdev, id, ptr_t, init_fn)
16 struct llist_header rtc_list;
17 struct device* rtc_dev;
24 void (*get_walltime)(struct hwrtc*, datetime_t*);
25 void (*set_walltime)(struct hwrtc*, datetime_t*);
26 void (*set_mask)(struct hwrtc*);
27 void (*cls_mask)(struct hwrtc*);
28 int (*get_counts)(struct hwrtc*);
29 int (*chfreq)(struct hwrtc*, int);
32 extern const struct hwrtc* primary_rtc;
38 hwrtc_alloc_new(struct device_def* def, char* name);
41 hwrtc_walltime(datetime_t* dt);
43 #endif /* __LUNAIX_HWRTC_H */