summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/rc.resume6
-rwxr-xr-xetc/rc.suspend12
2 files changed, 18 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" \
diff --git a/etc/rc.suspend b/etc/rc.suspend
index 7b08d31..890e50a 100755
--- a/etc/rc.suspend
+++ b/etc/rc.suspend
@@ -43,6 +43,18 @@ fi
echo $$ 2> /dev/null > /var/run/rc.suspend.pid
+_t=`/sbin/sysctl -n kern.timecounter.hardware 2> /dev/null`
+case ${_t#ACPI-} in
+fast|safe)
+ /bin/rm -f /var/run/rc.suspend.tch
+ ;;
+*)
+ ( /sbin/sysctl -n kern.timecounter.hardware=ACPI-fast || \
+ /sbin/sysctl -n kern.timecounter.hardware=ACPI-safe ) \
+ > /dev/null 2>&1 && echo $_t > /var/run/rc.suspend.tch
+ ;;
+esac
+
# If you have troubles on suspending with PC-CARD modem, try this.
# See also contrib/pccardq.c (Only for PAO users).
# pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \
OpenPOWER on IntegriCloud