From 3b4b7ccbb470a5aab6c6a52606e6d3303da50485 Mon Sep 17 00:00:00 2001 From: njl Date: Sat, 26 Nov 2005 07:36:53 +0000 Subject: 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 --- sys/dev/acpica/acpi_cmbat.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/dev/acpica') 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) { -- cgit v1.1