git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewrite the device subsystem interfaces (#48)
[lunaix-os.git]
/
lunaix-os
/
includes
/
hal
/
hwrtc.h
diff --git
a/lunaix-os/includes/hal/hwrtc.h
b/lunaix-os/includes/hal/hwrtc.h
index c0186ff7cd14b363ba3b0b66d36347e0937d00d3..37a1877a1738a86fe55c56543d96fca2b7a32068 100644
(file)
--- a/
lunaix-os/includes/hal/hwrtc.h
+++ b/
lunaix-os/includes/hal/hwrtc.h
@@
-8,35
+8,38
@@
#define RTC_STATE_MASKED 0x1
#define RTC_STATE_MASKED 0x1
-#define EXPORT_RTC_DEVICE(id, init_fn) \
- export_ldga_el(rtcdev, id, ptr_t, init_fn)
+struct hwrtc_potens;
+struct hwrtc_potens_ops
+{
+ void (*get_walltime)(struct hwrtc_potens*, datetime_t*);
+ void (*set_walltime)(struct hwrtc_potens*, datetime_t*);
+ void (*set_proactive)(struct hwrtc_potens*, bool);
+ int (*chfreq)(struct hwrtc_potens*, int);
+
+ int (*calibrate)(struct hwrtc_potens*);
+};
-struct hwrtc
+struct hwrtc
_potens
{
{
- struct llist_header rtc_list;
- struct device* rtc_dev;
+ POTENS_META;
+
+ struct llist_header rtc_potentes;
+ struct device* rtc_proxy;
- int id;
- char* name;
- void* data;
ticks_t base_freq;
ticks_t base_freq;
+ volatile ticks_t live;
int state;
int state;
- void (*get_walltime)(struct hwrtc*, datetime_t*);
- void (*set_walltime)(struct hwrtc*, datetime_t*);
- void (*set_mask)(struct hwrtc*);
- void (*cls_mask)(struct hwrtc*);
- int (*get_counts)(struct hwrtc*);
- int (*chfreq)(struct hwrtc*, int);
+ struct hwrtc_potens_ops* ops;
};
};
-struct hwrtc*
-hwrtc_
alloc_new(char* name
);
+void
+hwrtc_
init(
);
void
hwrtc_walltime(datetime_t* dt);
void
hwrtc_walltime(datetime_t* dt);
-void
-hwrtc_
register(struct devclass* class, struct hwrtc* rtc
);
+struct hwrtc_potens*
+hwrtc_
attach_potens(struct device* raw_rtcdev, struct hwrtc_potens_ops* ops
);
#endif /* __LUNAIX_HWRTC_H */
#endif /* __LUNAIX_HWRTC_H */