diff options
author | sbruno <sbruno@FreeBSD.org> | 2012-07-02 16:57:13 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2012-07-02 16:57:13 +0000 |
commit | abb8277b313e28cfe13d13b4f0a05fa4d1bd035b (patch) | |
tree | e8d114020185fcffe36f284f0d6318e33f91c259 /etc/rc.d | |
parent | 26a057bce7069299f5055f592e9331e48318f5df (diff) | |
download | FreeBSD-src-abb8277b313e28cfe13d13b4f0a05fa4d1bd035b.zip FreeBSD-src-abb8277b313e28cfe13d13b4f0a05fa4d1bd035b.tar.gz |
Cosmetic display change of Cx states via cx_supported sysctl entries.
Adjust power_profile script to handle the new world order as well.
Some vendors are opting out of a C2 state and only defining C1 & C3. This
leads the acpi_cpu display to indicate that the machine supports C1 & C2
which is caused by the (mis)use of the index of the cx_state array as the
ACPI_STATE_CX value.
e.g. the code was pretending that cx_state[i] would
always convert to i by subtracting 1.
cx_state[2] == ACPI_STATE_C3
cx_state[1] == ACPI_STATE_C2
cx_state[0] == ACPI_STATE_C1
however, on certain machines this would lead to
cx_state[1] == ACPI_STATE_C3
cx_state[0] == ACPI_STATE_C1
This didn't break anything but led to a display of:
* dev.cpu.0.cx_supported: C1/1 C2/96
Instead of
* dev.cpu.0.cx_supported: C1/1 C3/96
MFC after: 2 weeks
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-x | etc/rc.d/power_profile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/rc.d/power_profile b/etc/rc.d/power_profile index 03d36be..b7540c7 100755 --- a/etc/rc.d/power_profile +++ b/etc/rc.d/power_profile @@ -90,7 +90,7 @@ node="dev.cpu.0.freq" highest_value="`(sysctl -n dev.cpu.0.freq_levels | \ awk '{ split($0, a, "[/ ]"); print a[1] }' -) 2> /dev/null`" lowest_value="`(sysctl -n dev.cpu.0.freq_levels | \ - awk '{ split($0, a, "[/ ]"); print a[length(a) - 1] }' -) 2> /dev/null`" + awk '{ split($0, a, "[ /]"); print a[length(a) - 1] }' -) 2> /dev/null`" eval value=\$${profile}_cpu_freq sysctl_set |