From 91da7c40b2ae6c86cc7d103f9925991d0e3d7f5c Mon Sep 17 00:00:00 2001 From: Mitsuru IWASAKI Date: Thu, 31 Oct 2002 17:58:39 +0000 Subject: [PATCH] Invoke 3 ACPI task threads as default if option ACPI_MAX_THREADS is not defined. To make previous default behavior (ACPI_MAX_THREADS undefined), define option ACPI_MAX_THREADS as 0. --- sys/dev/acpica/Osd/OsdSchedule.c | 4 ---- sys/dev/acpica/acpi.c | 2 +- sys/dev/acpica/acpivar.h | 9 ++++++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index 8289c5df2d0e..ac29c1ecfd40 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -95,10 +95,6 @@ TASKQUEUE_DEFINE(acpi, taskqueue_acpi_enqueue, 0, swi_add(NULL, "acpitaskq", taskqueue_acpi_run, NULL, SWI_TQ, 0, &taskqueue_acpi_ih)); -#if defined(ACPI_MAX_THREADS) && ACPI_MAX_THREADS > 0 -#define ACPI_USE_THREADS -#endif - #ifdef ACPI_USE_THREADS STAILQ_HEAD(, acpi_task_queue) acpi_task_queue; static struct mtx acpi_task_mtx; diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index f8699f9ca007..d3ebc19501a2 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -491,7 +491,7 @@ acpi_attach(device_t dev) } #endif -#if defined(ACPI_MAX_THREADS) && ACPI_MAX_THREADS > 0 +#ifdef ACPI_USE_THREADS if ((error = acpi_task_thread_init())) { goto out; } diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index edf2aa1e3ccb..0cfe4464e40e 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -385,7 +385,14 @@ extern int acpi_cmbat_get_battinfo(int, struct acpi_battinfo *); extern int acpi_acad_get_acline(int *); -#if defined(ACPI_MAX_THREADS) && ACPI_MAX_THREADS > 0 +#ifndef ACPI_MAX_THREADS +#define ACPI_MAX_THREADS 3 +#endif +#if ACPI_MAX_THREADS > 0 +#define ACPI_USE_THREADS +#endif + +#ifdef ACPI_USE_THREADS /* * ACPI task kernel thread initialization. */