Add a polling loop (1Hz) to monitor the battery and AC status, to notify devd
like ACPI does for power monitoring. This allows /etc/rc.d/power_profile to
work on PowerPC laptops
Details
- Reviewers
nwhitehorn - Group Reviewers
PowerPC - Commits
- rS273009: Add an AC line monitor so power_profile can work
Tested on a Titanium PowerBook, configuring economy_cpu_freq and
performance_cpu_freq, disabling powerd.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Nice work! I do wonder (this is out of scope, however) whether it is worth standardizing some of these interfaces. Hopefully various ARM hardwares (Chromebooks, for example) will acquire the same features.
What happens if you remove the battery? Shouldn't the thread have some condition variable to let it terminate?
There is one enhancement I want to make, to both this and the pmac_thermal thread, and that is to suspend the thread via a sysctl, instead of, in the case of pmac_thermal, just idling every second.
If you remove the battery, you would still depend on the AC line, so this wouldn't matter. I tested just now, that if you boot with no battery, it still detects that a battery is allowed, so the thread starts up.
On systems where a battery will never be found, the thread doesn't start up. It's the same logic as adding the sysctls.