aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/clock.h
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2018-02-12 17:33:14 +0000
committerIan Lepore <ian@FreeBSD.org>2018-02-12 17:33:14 +0000
commit45eee6db6f361a0aafd855a197b66c9b50944823 (patch)
treecea8671aa2a37eb3f26add1f19e87c3dd881b8c4 /sys/sys/clock.h
parent48fca661579aca8494ef46178224deeb87d7b867 (diff)
downloadsrc-45eee6db6f361a0aafd855a197b66c9b50944823.tar.gz
src-45eee6db6f361a0aafd855a197b66c9b50944823.zip
Add a set of convenience routines for RTC drivers to use for debug output,
and a debug.clock_show_io sysctl to control debugging output.
Notes
Notes: svn path=/head/; revision=329172
Diffstat (limited to 'sys/sys/clock.h')
-rw-r--r--sys/sys/clock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/sys/clock.h b/sys/sys/clock.h
index a5e89746d488..bfbd6efd2ad3 100644
--- a/sys/sys/clock.h
+++ b/sys/sys/clock.h
@@ -191,6 +191,18 @@ void clock_print_bcd(const struct bcd_clocktime *bct, int nsdig);
void clock_print_ct(const struct clocktime *ct, int nsdig);
void clock_print_ts(const struct timespec *ts, int nsdig);
+/*
+ * Debugging helpers for RTC clock drivers. Print a [bcd_]clocktime or
+ * timespec, only if rtc clock debugging has been enabled. The rw argument is
+ * one of CLOCK_DBG_READ or CLOCK_DBG_WRITE.
+ */
+#define CLOCK_DBG_READ 0x01
+#define CLOCK_DBG_WRITE 0x02
+void clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct);
+void clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct);
+void clock_dbgprint_err(device_t dev, int rw, int err);
+void clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts);
+
#endif /* _KERNEL */
#endif /* !_SYS_CLOCK_H_ */