diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2020-05-17 13:21:22 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2020-05-17 13:21:22 +0000 |
commit | 789c39c8e28c45a43276abd64191d68d0669064d (patch) | |
tree | 5d114a45c497739bc11adf92325a21380d442488 /sys | |
parent | 8aa578901af2ee933dc5a413d464e25f23b2834d (diff) |
Add function for attaching RTC drivers, to reduce direct use
of todr_handle.
OK kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/clock_subr.h | 3 | ||||
-rw-r--r-- | sys/kern/kern_time.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/clock_subr.h b/sys/dev/clock_subr.h index fb473b581b1..3d4c4544b44 100644 --- a/sys/dev/clock_subr.h +++ b/sys/dev/clock_subr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: clock_subr.h,v 1.5 2008/06/26 05:42:14 ray Exp $ */ +/* $OpenBSD: clock_subr.h,v 1.6 2020/05/17 13:21:20 visa Exp $ */ /* $NetBSD: clock_subr.h,v 1.2 1997/03/15 18:11:17 is Exp $ */ /*- @@ -62,3 +62,4 @@ typedef struct todr_chip_handle *todr_chip_handle_t; #define todr_wenable(ct, v) if ((ct)->todr_setwen) \ ((*(ct)->todr_setwen)(ct, v)) +void todr_attach(struct todr_chip_handle *); diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index f0da7838aa2..3e5c753c3b3 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.128 2020/05/16 14:44:45 kettenis Exp $ */ +/* $OpenBSD: kern_time.c,v 1.129 2020/05/17 13:21:21 visa Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -869,6 +869,12 @@ resettodr(void) printf("WARNING: can't update clock chip time\n"); } +void +todr_attach(struct todr_chip_handle *todr) +{ + todr_handle = todr; +} + #define RESETTODR_PERIOD 1800 void periodic_resettodr(void *); |