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
This commit is contained in:
Nate Lawson 2005-11-26 07:36:53 +00:00
parent da7851e1e6
commit c02106f3cc

View File

@ -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)
{