diff options
author | njl <njl@FreeBSD.org> | 2005-11-26 07:36:53 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-11-26 07:36:53 +0000 |
commit | 3b4b7ccbb470a5aab6c6a52606e6d3303da50485 (patch) | |
tree | ccdc0d55bb1da706e2972c7a9793a7399a2fdcb7 | |
parent | 69aea5c6e42da4b820c61265080973539232bcf7 (diff) | |
download | FreeBSD-src-3b4b7ccbb470a5aab6c6a52606e6d3303da50485.zip FreeBSD-src-3b4b7ccbb470a5aab6c6a52606e6d3303da50485.tar.gz |
Add a locking stub to call acpi_cmbat_get_bif() now that it is directly
run from the taskqueue. There should probably be a better way to do this
later, but this suffices for now.
Submitted by: yongari
-rw-r--r-- | sys/dev/acpica/acpi_cmbat.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index 796b49b..e27ffcb 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -80,6 +80,7 @@ static void acpi_cmbat_notify_handler(ACPI_HANDLE h, UINT32 notify, static int acpi_cmbat_info_expired(struct timespec *lastupdated); static void acpi_cmbat_info_updated(struct timespec *lastupdated); static void acpi_cmbat_get_bst(void *arg); +static void acpi_cmbat_get_bif_task(void *arg); static void acpi_cmbat_get_bif(void *arg); static int acpi_cmbat_bst(device_t dev, struct acpi_bst *bstp); static int acpi_cmbat_bif(device_t dev, struct acpi_bif *bifp); @@ -193,7 +194,7 @@ acpi_cmbat_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) * Queue a callback to get the current battery info from thread * context. It's not safe to block in a notify handler. */ - AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cmbat_get_bif, dev); + AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cmbat_get_bif_task, dev); break; } @@ -288,6 +289,16 @@ end: AcpiOsFree(bst_buffer.Pointer); } +/* XXX There should be a cleaner way to do this locking. */ +static void +acpi_cmbat_get_bif_task(void *arg) +{ + + ACPI_SERIAL_BEGIN(cmbat); + acpi_cmbat_get_bif(arg); + ACPI_SERIAL_END(cmbat); +} + static void acpi_cmbat_get_bif(void *arg) { |