X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b26d3165c52589d1f8de37bf0df27ad96f460f47..1fe5f5eb5378a47bf0f3451762743c162e40faad:/lunaix-os/includes/hal/hwrtc.h?ds=sidebyside diff --git a/lunaix-os/includes/hal/hwrtc.h b/lunaix-os/includes/hal/hwrtc.h new file mode 100644 index 0000000..b43a2ff --- /dev/null +++ b/lunaix-os/includes/hal/hwrtc.h @@ -0,0 +1,33 @@ +#ifndef __LUNAIX_HWRTC_H +#define __LUNAIX_HWRTC_H + +#include + +struct hwrtc +{ + char* name; + void* data; + + ticks_t base_freq; + + int (*supported)(struct hwrtc*); + void (*init)(struct hwrtc*); + + void (*get_walltime)(struct hwrtc*, datetime_t*); + + void (*do_ticking)(struct hwrtc*, void (*on_tick)()); + void (*end_ticking)(struct hwrtc*); +}; + +extern const struct hwrtc* current_rtc; + +void +hwrtc_init(); + +struct hwrtc* +hwrtc_choose(); + +void +hwrtc_walltime(datetime_t* dt); + +#endif /* __LUNAIX_HWRTC_H */