feat: kprintf now goes into dedicated pseudo-dev rather than flooding the framebuffer
[lunaix-os.git] / lunaix-os / kernel / time / clock.c
index 2dc4e8153359fc91c3137db86021b1bd86b457ee..3770dd00ce3088aa4dfff566768aa2615ff69a04 100644 (file)
@@ -51,12 +51,6 @@ clock_build_mapping()
 }
 EXPORT_TWIFS_PLUGIN(sys_clock, clock_build_mapping);
 
-void
-clock_init()
-{
-    hwrtc_init();
-}
-
 time_t
 clock_unixtime()
 {
@@ -68,6 +62,10 @@ clock_unixtime()
 time_t
 clock_systime()
 {
+    if (!current_timer) {
+        return 0;
+    }
+
     ticks_t t = hwtimer_current_systicks();
     return t / current_timer->running_freq;
 }
@@ -75,5 +73,5 @@ clock_systime()
 void
 clock_walltime(datetime_t* datetime)
 {
-    current_rtc->get_walltime(current_rtc, datetime);
+    primary_rtc->get_walltime(primary_rtc, datetime);
 }
\ No newline at end of file