diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-01-07 13:19:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-01-07 13:19:36 +0000 |
commit | 1d8b4eab300af38356404b265e7613bb8042a255 (patch) | |
tree | 7038095fc16808e8239ac0551052952fec50bdb4 /sys/arch/atari/dev/clock.c | |
parent | fa74a8eb679569bcb30aff39747d402a3f9a5571 (diff) |
from leo:
Add an nvram-driver. This driver makes it possible to read/write the
configuration info stored in the nvram on the mc146818
Diffstat (limited to 'sys/arch/atari/dev/clock.c')
-rw-r--r-- | sys/arch/atari/dev/clock.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/arch/atari/dev/clock.c b/sys/arch/atari/dev/clock.c index aee79a46bfd..5baf74c1dd3 100644 --- a/sys/arch/atari/dev/clock.c +++ b/sys/arch/atari/dev/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.6 1995/12/01 19:51:53 leo Exp $ */ +/* $NetBSD: clock.c,v 1.7 1996/01/06 20:11:06 leo Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -314,6 +314,26 @@ profclock(pc, ps) } #endif +/*********************************************************************** + * Real Time Clock support * + ***********************************************************************/ + +u_int mc146818_read(rtc, regno) +void *rtc; +u_int regno; +{ + ((struct rtc *)rtc)->rtc_regno = regno; + return(((struct rtc *)rtc)->rtc_data & 0377); +} + +void mc146818_write(rtc, regno, value) +void *rtc; +u_int regno, value; +{ + ((struct rtc *)rtc)->rtc_regno = regno; + ((struct rtc *)rtc)->rtc_data = value; +} + /* * Initialize the time of day register, based on the time base which is, e.g. * from a filesystem. |