patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / drivers / acpi / osl.c
index 77e1c62..433fdd7 100644 (file)
@@ -66,6 +66,7 @@ extern char line_buf[80];
 static unsigned int acpi_irq_irq;
 static OSD_HANDLER acpi_irq_handler;
 static void *acpi_irq_context;
+static struct workqueue_struct *kacpid_wq;
 
 acpi_status
 acpi_os_initialize(void)
@@ -80,6 +81,8 @@ acpi_os_initialize(void)
                return AE_NULL_ENTRY;
        }
 #endif
+       kacpid_wq = create_singlethread_workqueue("kacpid");
+       BUG_ON(!kacpid_wq);
 
        return AE_OK;
 }
@@ -92,6 +95,8 @@ acpi_os_terminate(void)
                                                 acpi_irq_handler);
        }
 
+       destroy_workqueue(kacpid_wq);
+
        return AE_OK;
 }
 
@@ -654,8 +659,8 @@ acpi_os_queue_for_execution(
        task = (void *)(dpc+1);
        INIT_WORK(task, acpi_os_execute_deferred, (void*)dpc);
 
-       if (!schedule_work(task)) {
-               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to schedule_work() failed.\n"));
+       if (!queue_work(kacpid_wq, task)) {
+               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Call to queue_work() failed.\n"));
                kfree(dpc);
                status = AE_ERROR;
        }
@@ -663,6 +668,13 @@ acpi_os_queue_for_execution(
        return_ACPI_STATUS (status);
 }
 
+void
+acpi_os_wait_events_complete(
+       void *context)
+{
+       flush_workqueue(kacpid_wq);
+}
+
 /*
  * Allocate the memory for a spinlock and initialize it.
  */