diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-17 20:30:13 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-17 20:30:13 +0000 |
commit | acfed1d04aa2920ec8404d4071368b339a5bbc53 (patch) | |
tree | a22d310f022a29a9670a67088e8dc8f205811116 /sys/arch/arm | |
parent | d07f8725bf1d589c479f3d998834e287acdcbde1 (diff) |
Upon halt, invoke resettodr() on arm platforms, unless we have been sitting
in DDB; tested at least by aanriot@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/arm/arm32_machdep.c | 15 | ||||
-rw-r--r-- | sys/arch/arm/include/cpu.h | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/arch/arm/arm/arm32_machdep.c b/sys/arch/arm/arm/arm32_machdep.c index b4f1e5bef2f..26fd48655b3 100644 --- a/sys/arch/arm/arm/arm32_machdep.c +++ b/sys/arch/arm/arm/arm32_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arm32_machdep.c,v 1.18 2005/12/27 18:51:03 drahn Exp $ */ +/* $OpenBSD: arm32_machdep.c,v 1.19 2006/01/17 20:30:10 miod Exp $ */ /* $NetBSD: arm32_machdep.c,v 1.42 2003/12/30 12:33:15 pk Exp $ */ /* @@ -216,7 +216,7 @@ halt() /* Sync the discs and unmount the filesystems */ void -bootsync(void) +bootsync(int howto) { static int bootsyncdone = 0; @@ -237,6 +237,17 @@ bootsync(void) } vfs_shutdown(); + + /* + * If we've been adjusting the clock, the todr + * will be out of synch; adjust it now unless + * the system has been sitting in ddb. + */ + if ((howto & RB_TIMEBAD) == 0) { + resettodr(); + } else { + printf("WARNING: not updating battery clock\n"); + } } /* diff --git a/sys/arch/arm/include/cpu.h b/sys/arch/arm/include/cpu.h index 74626c507ed..d19b13c39e4 100644 --- a/sys/arch/arm/include/cpu.h +++ b/sys/arch/arm/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.11 2005/12/21 20:36:02 deraadt Exp $ */ +/* $OpenBSD: cpu.h,v 1.12 2006/01/17 20:30:12 miod Exp $ */ /* $NetBSD: cpu.h,v 1.34 2003/06/23 11:01:08 martin Exp $ */ /* @@ -290,7 +290,7 @@ void savectx (struct pcb *pcb); void userret (register struct proc *p, u_int32_t pc, quad_t ticks); /* machdep.h */ -void bootsync (void); +void bootsync (int); /* fault.c */ int badaddr_read (void *, size_t, void *); |