Index: sys/dev/acpica/acpi_acad.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_acad.c,v retrieving revision 1.38 diff -u -r1.38 acpi_acad.c --- sys/dev/acpica/acpi_acad.c 22 Mar 2007 18:16:40 -0000 1.38 +++ sys/dev/acpica/acpi_acad.c 30 Sep 2007 19:42:09 -0000 @@ -181,7 +181,7 @@ */ AcpiInstallNotifyHandler(handle, ACPI_ALL_NOTIFY, acpi_acad_notify_handler, dev); - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_acad_init_acline, dev); + acpi_queue_task(OSL_NOTIFY_HANDLER, 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.46 diff -u -r1.46 acpi_cmbat.c --- sys/dev/acpica/acpi_cmbat.c 22 Mar 2007 18:16:40 -0000 1.46 +++ sys/dev/acpica/acpi_cmbat.c 30 Sep 2007 19:42:26 -0000 @@ -149,7 +149,7 @@ AcpiInstallNotifyHandler(handle, ACPI_ALL_NOTIFY, acpi_cmbat_notify_handler, dev); - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cmbat_init_battery, dev); + acpi_queue_task(OSL_NOTIFY_HANDLER, 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.67 diff -u -r1.67 acpi_cpu.c --- sys/dev/acpica/acpi_cpu.c 30 Aug 2007 21:18:42 -0000 1.67 +++ sys/dev/acpica/acpi_cpu.c 30 Sep 2007 19:42:31 -0000 @@ -318,7 +318,7 @@ CTLFLAG_RD, 0, "node for CPU children"); /* Queue post cpu-probing task handler */ - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); + acpi_queue_task(OSL_NOTIFY_HANDLER, 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.6 diff -u -r1.6 acpi_dock.c --- sys/dev/acpica/acpi_dock.c 31 May 2007 08:49:51 -0000 1.6 +++ sys/dev/acpica/acpi_dock.c 30 Sep 2007 19:42:34 -0000 @@ -233,7 +233,7 @@ goto out; } - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_dock_attach_later, dev); + acpi_queue_task(OSL_NOTIFY_HANDLER, 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.26 diff -u -r1.26 acpi_perf.c --- sys/dev/acpica/acpi_perf.c 22 Mar 2007 18:16:40 -0000 1.26 +++ sys/dev/acpica/acpi_perf.c 30 Sep 2007 19:42:38 -0000 @@ -221,7 +221,7 @@ sc->px_curr_state = CPUFREQ_VAL_UNKNOWN; if (acpi_perf_evaluate(dev) != 0) return (ENXIO); - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_px_startup, NULL); + acpi_queue_task(OSL_NOTIFY_HANDLER, 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.107 diff -u -r1.107 acpivar.h --- sys/dev/acpica/acpivar.h 21 Jun 2007 22:50:37 -0000 1.107 +++ sys/dev/acpica/acpivar.h 30 Sep 2007 19:43:42 -0000 @@ -417,6 +417,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(ACPI_EXECUTE_TYPE Type, + 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.39 diff -u -r1.39 OsdSchedule.c --- sys/dev/acpica/Osd/OsdSchedule.c 22 Mar 2007 18:16:41 -0000 1.39 +++ sys/dev/acpica/Osd/OsdSchedule.c 30 Sep 2007 19:40:59 -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 +AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, + void *Context) +{ + ACPI_STATUS status; + + if (!(cold || rebooting)) + status = acpi_queue_task(Type, 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 -AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, +acpi_queue_task(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, void *Context) { struct acpi_task_ctx *at;