#include <lunaix/isrm.h>
#include <lunaix/mm/valloc.h>
#include <lunaix/status.h>
+#include <lunaix/pcontext.h>
#include <hal/rtc/mc146818a.h>
#include <klibc/string.h>
-#include <sys/interrupts.h>
#include <sys/port_io.h>
#define RTC_INDEX_PORT 0x70
// Make sure the rtc timer is disabled by default
rtc_disable_timer();
- struct hwrtc* rtc = hwrtc_alloc_new(devdef, "mc146818");
+ struct hwrtc* rtc = hwrtc_alloc_new("mc146818");
struct mc146818* state = valloc(sizeof(struct mc146818));
state->rtc_context = rtc;
rtc->get_counts = rtc_getcnt;
rtc->chfreq = rtc_chfreq;
+ hwrtc_register(&devdef->class, rtc);
+
return 0;
}
.class = DEVCLASS(DEVIF_SOC, DEVFN_TIME, DEV_RTC),
.init = rtc_init
};
-EXPORT_DEVICE(mc146818, &devrtc_mc146818, load_earlystage);
\ No newline at end of file
+EXPORT_DEVICE(mc146818, &devrtc_mc146818, load_timedev);
\ No newline at end of file