1,3d0
< /* $FreeBSD: head/sys/dev/mc146818/mc146818reg.h 59868 2000-05-01 19:54:26Z peter $ */
< /* $NetBSD: mc146818reg.h,v 1.2 1997/03/12 06:53:42 cgd Exp $ */
<
26a24,27
> *
> * from: NetBSD: mc146818reg.h,v 1.5 2003/11/02 11:07:45 wiz Exp
> *
> * $FreeBSD: head/sys/dev/mc146818/mc146818reg.h 137821 2004-11-17 16:37:25Z marius $
31c32
< * They also apply for the (compatible) Dallas Semicontuctor DS1287A RTC.
---
> * They also apply for the (compatible) Dallas Semiconductor DS1287A RTC.
145,187d145
<
< /*
< * A collection of TOD/Alarm registers.
< */
< typedef u_int mc_todregs[MC_NTODREGS];
<
< /*
< * Get all of the TOD/Alarm registers
< * Must be called at splhigh(), and with the RTC properly set up.
< */
< #define MC146818_GETTOD(dev, regs) \
< do { \
< int i; \
< \
< /* update in progress; spin loop */ \
< while (MCCLOCK_READ(dev, MC_REGA) & MC_REGA_UIP) \
< ; \
< \
< /* read all of the tod/alarm regs */ \
< for (i = 0; i < MC_NTODREGS; i++) \
< (*regs)[i] = MCCLOCK_READ(dev, i); \
< } while (0);
<
< /*
< * Set all of the TOD/Alarm registers
< * Must be called at splhigh(), and with the RTC properly set up.
< */
< #define MC146818_PUTTOD(dev, regs) \
< do { \
< int i; \
< \
< /* stop updates while setting */ \
< MCCLOCK_WRITE(dev, MC_REGB, \
< MCCLOCK_READ(dev, MC_REGB) | MC_REGB_SET); \
< \
< /* write all of the tod/alarm regs */ \
< for (i = 0; i < MC_NTODREGS; i++) \
< MCCLOCK_WRITE(dev, i, (*regs)[i]); \
< \
< /* reenable updates */ \
< MCCLOCK_WRITE(dev, MC_REGB, \
< MCCLOCK_READ(dev, MC_REGB) & ~MC_REGB_SET); \
< } while (0);
< /* $FreeBSD: head/sys/dev/mc146818/mc146818reg.h 59868 2000-05-01 19:54:26Z peter $ */
< /* $NetBSD: mc146818reg.h,v 1.2 1997/03/12 06:53:42 cgd Exp $ */
<
26a24,27
> *
> * from: NetBSD: mc146818reg.h,v 1.5 2003/11/02 11:07:45 wiz Exp
> *
> * $FreeBSD: head/sys/dev/mc146818/mc146818reg.h 137821 2004-11-17 16:37:25Z marius $
31c32
< * They also apply for the (compatible) Dallas Semicontuctor DS1287A RTC.
---
> * They also apply for the (compatible) Dallas Semiconductor DS1287A RTC.
145,187d145
<
< /*
< * A collection of TOD/Alarm registers.
< */
< typedef u_int mc_todregs[MC_NTODREGS];
<
< /*
< * Get all of the TOD/Alarm registers
< * Must be called at splhigh(), and with the RTC properly set up.
< */
< #define MC146818_GETTOD(dev, regs) \
< do { \
< int i; \
< \
< /* update in progress; spin loop */ \
< while (MCCLOCK_READ(dev, MC_REGA) & MC_REGA_UIP) \
< ; \
< \
< /* read all of the tod/alarm regs */ \
< for (i = 0; i < MC_NTODREGS; i++) \
< (*regs)[i] = MCCLOCK_READ(dev, i); \
< } while (0);
<
< /*
< * Set all of the TOD/Alarm registers
< * Must be called at splhigh(), and with the RTC properly set up.
< */
< #define MC146818_PUTTOD(dev, regs) \
< do { \
< int i; \
< \
< /* stop updates while setting */ \
< MCCLOCK_WRITE(dev, MC_REGB, \
< MCCLOCK_READ(dev, MC_REGB) | MC_REGB_SET); \
< \
< /* write all of the tod/alarm regs */ \
< for (i = 0; i < MC_NTODREGS; i++) \
< MCCLOCK_WRITE(dev, i, (*regs)[i]); \
< \
< /* reenable updates */ \
< MCCLOCK_WRITE(dev, MC_REGB, \
< MCCLOCK_READ(dev, MC_REGB) & ~MC_REGB_SET); \
< } while (0);