Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_work.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
* Define global workqueues | * Define global workqueues | ||||
*/ | */ | ||||
static struct workqueue_struct *linux_system_short_wq; | static struct workqueue_struct *linux_system_short_wq; | ||||
static struct workqueue_struct *linux_system_long_wq; | static struct workqueue_struct *linux_system_long_wq; | ||||
struct workqueue_struct *system_wq; | struct workqueue_struct *system_wq; | ||||
struct workqueue_struct *system_long_wq; | struct workqueue_struct *system_long_wq; | ||||
struct workqueue_struct *system_unbound_wq; | struct workqueue_struct *system_unbound_wq; | ||||
struct workqueue_struct *system_highpri_wq; | |||||
struct workqueue_struct *system_power_efficient_wq; | struct workqueue_struct *system_power_efficient_wq; | ||||
static int linux_default_wq_cpus = 4; | static int linux_default_wq_cpus = 4; | ||||
static void linux_delayed_work_timer_fn(void *); | static void linux_delayed_work_timer_fn(void *); | ||||
/* | /* | ||||
* This function atomically updates the work state and returns the | * This function atomically updates the work state and returns the | ||||
▲ Show 20 Lines • Show All 527 Lines • ▼ Show 20 Lines | linux_work_init(void *arg) | ||||
linux_system_short_wq = alloc_workqueue("linuxkpi_short_wq", 0, max_wq_cpus); | linux_system_short_wq = alloc_workqueue("linuxkpi_short_wq", 0, max_wq_cpus); | ||||
linux_system_long_wq = alloc_workqueue("linuxkpi_long_wq", 0, max_wq_cpus); | linux_system_long_wq = alloc_workqueue("linuxkpi_long_wq", 0, max_wq_cpus); | ||||
/* populate the workqueue pointers */ | /* populate the workqueue pointers */ | ||||
system_long_wq = linux_system_long_wq; | system_long_wq = linux_system_long_wq; | ||||
system_wq = linux_system_short_wq; | system_wq = linux_system_short_wq; | ||||
system_power_efficient_wq = linux_system_short_wq; | system_power_efficient_wq = linux_system_short_wq; | ||||
system_unbound_wq = linux_system_short_wq; | system_unbound_wq = linux_system_short_wq; | ||||
system_highpri_wq = linux_system_short_wq; | |||||
} | } | ||||
SYSINIT(linux_work_init, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_init, NULL); | SYSINIT(linux_work_init, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_init, NULL); | ||||
static void | static void | ||||
linux_work_uninit(void *arg) | linux_work_uninit(void *arg) | ||||
{ | { | ||||
destroy_workqueue(linux_system_short_wq); | destroy_workqueue(linux_system_short_wq); | ||||
destroy_workqueue(linux_system_long_wq); | destroy_workqueue(linux_system_long_wq); | ||||
/* clear workqueue pointers */ | /* clear workqueue pointers */ | ||||
system_long_wq = NULL; | system_long_wq = NULL; | ||||
system_wq = NULL; | system_wq = NULL; | ||||
system_power_efficient_wq = NULL; | system_power_efficient_wq = NULL; | ||||
system_unbound_wq = NULL; | system_unbound_wq = NULL; | ||||
system_highpri_wq = NULL; | |||||
} | } | ||||
SYSUNINIT(linux_work_uninit, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_uninit, NULL); | SYSUNINIT(linux_work_uninit, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_uninit, NULL); |