summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-10-11 06:18:07 +0000
committernjl <njl@FreeBSD.org>2004-10-11 06:18:07 +0000
commitbc141ad4081279948d87eb3892a0647170b771c6 (patch)
tree22597d1179e5c97b68bb44411cbce68ae2dfe122 /sys/dev/acpica
parent46eb5d68144e7fa25d3740a018a87ede3e5816f7 (diff)
downloadFreeBSD-src-bc141ad4081279948d87eb3892a0647170b771c6.zip
FreeBSD-src-bc141ad4081279948d87eb3892a0647170b771c6.tar.gz
Notify the user when the battery is critically low. In the future, we
may want to shut down here but the chance of BIOS vendors getting this wrong is high. They're only supposed to announce this when all batteries hit their critical level but past experience indicates we should be conservative about this for now.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_cmbat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c
index 90f46a4..6bcd4a0 100644
--- a/sys/dev/acpica/acpi_cmbat.c
+++ b/sys/dev/acpica/acpi_cmbat.c
@@ -189,6 +189,10 @@ acpi_cmbat_get_bst(void *context)
goto end;
acpi_cmbat_info_updated(&sc->bst_lastupdated);
+ /* XXX Should we shut down here? */
+ if (sc->bst.state & ACPI_BATT_STAT_CRITICAL)
+ device_printf(dev, "critically low charge!\n");
+
end:
if (bst_buffer.Pointer != NULL)
AcpiOsFree(bst_buffer.Pointer);
OpenPOWER on IntegriCloud