move gic to new devtree interface
[lunaix-os.git] / lunaix-os / includes / lunaix / clock.h
1 #ifndef __LUNAIX_CLOCK_H
2 #define __LUNAIX_CLOCK_H
3
4 #include <lunaix/time.h>
5
6 #include <hal/hwrtc.h>
7 #include <hal/hwtimer.h>
8
9 extern const struct hwrtc_potens* sysrtc;
10 extern const struct hwtimer_pot* systimer;
11
12 void
13 clock_walltime(datetime_t* datetime);
14
15 /**
16  * @brief 返回当前系统时间,即自从开机到当前时刻的毫秒时。
17  *
18  * @return time_t
19  */
20 time_t
21 clock_systime();
22
23 time_t
24 clock_unixtime();
25
26 static inline void
27 clock_init()
28 {
29     hwrtc_init();
30 }
31
32 #endif /* __LUNAIX_CLOCK_H */