+ isrm_set_payload(state->rtc_iv, __ptr(state));
+
+ return 0;
+}
+
+static struct hwrtc_potens_ops ops = {
+ .get_walltime = rtc_getwalltime,
+ .set_walltime = rtc_setwalltime,
+ .set_proactive = rtc_set_proactive,
+ .chfreq = rtc_chfreq,
+ .calibrate = __rtc_calibrate
+};
+
+static int
+rtc_load(struct device_def* devdef)
+{
+ struct device* dev;
+ struct mc146818* state;
+ struct hwrtc_potens* pot;
+
+ state = valloc(sizeof(struct mc146818));
+ dev = device_allocsys(NULL, state);
+
+ pot = hwrtc_attach_potens(dev, &ops);
+ if (!pot) {
+ return 1;
+ }