summaryrefslogtreecommitdiffstats
path: root/etc/rc.resume
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-08-13 20:43:19 +0000
committerjkim <jkim@FreeBSD.org>2010-08-13 20:43:19 +0000
commit0622ee44e502fcb6534c4d84f1a289fed09a363f (patch)
tree8a4b904d29030e871a1644046485cb4466226cc3 /etc/rc.resume
parentd713120364aa9a24581ed1d5780d41cdfc42339c (diff)
downloadFreeBSD-src-0622ee44e502fcb6534c4d84f1a289fed09a363f.zip
FreeBSD-src-0622ee44e502fcb6534c4d84f1a289fed09a363f.tar.gz
Enforce ACPI timer as the timecounter hardware before we change sleep state
unless it is the current timer. When we have resumed successfully, restore the previous timecounter hardware if it was changed earlier. Only the ACPI timer is guaranteed to increase monotonically between S-state changes.
Diffstat (limited to 'etc/rc.resume')
-rwxr-xr-xetc/rc.resume6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/rc.resume b/etc/rc.resume
index 84e726e..da24a54 100755
--- a/etc/rc.resume
+++ b/etc/rc.resume
@@ -43,6 +43,12 @@ if [ -r /var/run/rc.suspend.pid ]; then
echo 'rc.resume: killed rc.suspend that was still around'
fi
+if [ -r /var/run/rc.suspend.tch ]; then
+ _t=`cat /var/run/rc.suspend.tch`
+ /sbin/sysctl -n kern.timecounter.hardware=$_t > /dev/null 2>&1
+ /bin/rm -f /var/run/rc.suspend.tch
+fi
+
# Turns on a power supply of a card in the slot inactivated.
# See also contrib/pccardq.c (only for PAO users).
# pccardq | awk -F '~' '$5 == "inactive" \
OpenPOWER on IntegriCloud