Index: sys/dev/acpica/acpi_acad.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_acad.c,v retrieving revision 1.33.2.2 diff -u -r1.33.2.2 acpi_acad.c --- sys/dev/acpica/acpi_acad.c 5 Nov 2005 23:48:38 -0000 1.33.2.2 +++ sys/dev/acpica/acpi_acad.c 30 Sep 2007 19:24:23 -0000 @@ -181,7 +181,7 @@ */ AcpiInstallNotifyHandler(handle, ACPI_ALL_NOTIFY, acpi_acad_notify_handler, dev); - AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_acad_init_acline, dev); + acpi_queue_task(OSD_PRIORITY_LO, acpi_acad_init_acline, dev); return (0); } Index: sys/dev/acpica/acpi_cmbat.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_cmbat.c,v retrieving revision 1.39.2.5 diff -u -r1.39.2.5 acpi_cmbat.c --- sys/dev/acpica/acpi_cmbat.c 11 Jun 2006 20:50:08 -0000 1.39.2.5 +++ sys/dev/acpica/acpi_cmbat.c 30 Sep 2007 19:25:16 -0000 @@ -149,7 +149,7 @@ AcpiInstallNotifyHandler(handle, ACPI_ALL_NOTIFY, acpi_cmbat_notify_handler, dev); - AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cmbat_init_battery, dev); + acpi_queue_task(OSD_PRIORITY_LO, acpi_cmbat_init_battery, dev); return (0); } Index: sys/dev/acpica/acpi_cpu.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_cpu.c,v retrieving revision 1.57.2.3 diff -u -r1.57.2.3 acpi_cpu.c --- sys/dev/acpica/acpi_cpu.c 11 Jun 2007 18:54:09 -0000 1.57.2.3 +++ sys/dev/acpica/acpi_cpu.c 30 Sep 2007 19:25:26 -0000 @@ -313,7 +313,7 @@ CTLFLAG_RD, 0, "node for CPU children"); /* Queue post cpu-probing task handler */ - AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cpu_startup, NULL); + acpi_queue_task(OSD_PRIORITY_LO, acpi_cpu_startup, NULL); } /* Index: sys/dev/acpica/acpi_dock.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_dock.c,v retrieving revision 1.5.2.1 diff -u -r1.5.2.1 acpi_dock.c --- sys/dev/acpica/acpi_dock.c 23 Mar 2007 19:45:52 -0000 1.5.2.1 +++ sys/dev/acpica/acpi_dock.c 30 Sep 2007 19:25:31 -0000 @@ -238,7 +238,7 @@ goto out; } - AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_dock_attach_later, dev); + acpi_queue_task(OSD_PRIORITY_LO, acpi_dock_attach_later, dev); out: return (AE_OK); Index: sys/dev/acpica/acpi_perf.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_perf.c,v retrieving revision 1.21.2.4 diff -u -r1.21.2.4 acpi_perf.c --- sys/dev/acpica/acpi_perf.c 23 Jan 2007 07:21:23 -0000 1.21.2.4 +++ sys/dev/acpica/acpi_perf.c 30 Sep 2007 19:25:56 -0000 @@ -221,7 +221,7 @@ sc->px_curr_state = CPUFREQ_VAL_UNKNOWN; if (acpi_perf_evaluate(dev) != 0) return (ENXIO); - AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_px_startup, NULL); + acpi_queue_task(OSD_PRIORITY_LO, acpi_px_startup, NULL); if (!sc->info_only) cpufreq_register(dev); Index: sys/dev/acpica/acpivar.h =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpivar.h,v retrieving revision 1.95.2.6 diff -u -r1.95.2.6 acpivar.h --- sys/dev/acpica/acpivar.h 17 Jun 2007 17:28:41 -0000 1.95.2.6 +++ sys/dev/acpica/acpivar.h 30 Sep 2007 19:29:59 -0000 @@ -390,6 +415,8 @@ int acpi_sleep_machdep(struct acpi_softc *sc, int state); int acpi_table_quirks(int *quirks); int acpi_machdep_quirks(int *quirks); +ACPI_STATUS acpi_queue_task(UINT32 Priority, + ACPI_OSD_EXEC_CALLBACK Function, void *Context); /* Battery Abstraction. */ struct acpi_battinfo; Index: sys/dev/acpica/Osd/OsdSchedule.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdSchedule.c,v retrieving revision 1.32.2.6 diff -u -r1.32.2.6 OsdSchedule.c --- sys/dev/acpica/Osd/OsdSchedule.c 6 Jul 2006 08:32:49 -0000 1.32.2.6 +++ sys/dev/acpica/Osd/OsdSchedule.c 30 Sep 2007 19:23:24 -0000 @@ -83,11 +83,33 @@ } /* + * If we're up and running, queue the task for our taskq. It will run + * shortly. If we're booting and we had queued it, it would not actually run + * until interrupts are enabled later in boot. So in that case, run it + * directly instead. If a driver really wants the task delayed until boot, + * they can use acpi_queue_task() below. + */ +ACPI_STATUS +AcpiOsQueueForExecution(UINT32 Priority, ACPI_OSD_EXEC_CALLBACK Function, + void *Context) +{ + ACPI_STATUS status; + + if (!(cold || rebooting)) + status = acpi_queue_task(Priority, Function, Context); + else { + Function(Context); + status = AE_OK; + } + return (status); +} + +/* * This function may be called in interrupt context, i.e. when a GPE fires. * We allocate and queue a task for one of our taskqueue threads to process. */ ACPI_STATUS -AcpiOsQueueForExecution(UINT32 Priority, ACPI_OSD_EXEC_CALLBACK Function, +acpi_queue_task(UINT32 Priority, ACPI_OSD_EXEC_CALLBACK Function, void *Context) { struct acpi_task_ctx *at;