From 316c0fdb45042c82848a9468df9a90ba7ee53465 Mon Sep 17 00:00:00 2001 From: Saket Jha Date: Tue, 9 Jul 2019 15:13:47 -0700 Subject: [PATCH] qcacmn: Define QDF API for cpumask abstraction Defines QDF APIs for abstraction of cpumask_clear, cpumask_set_cpu, and cpumask_setall. Change-Id: I1678c600c7043b1d4a19e0479ceab9af0ce83d01 CRs-Fixed: 2478893 --- qdf/inc/qdf_threads.h | 25 +++++++++++++++++++++++++ qdf/linux/src/qdf_threads.c | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/qdf/inc/qdf_threads.h b/qdf/inc/qdf_threads.h index aa430d9fd555..fcb28c8bea0a 100644 --- a/qdf/inc/qdf_threads.h +++ b/qdf/inc/qdf_threads.h @@ -143,4 +143,29 @@ const char *qdf_get_current_comm(void); */ void qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask); + +/** + * qdf_cpumask_clear() - clear all cpus in a cpumask + * @dstp: cpumask pointer + * + * Return: None + */ +void qdf_cpumask_clear(qdf_cpu_mask *dstp); + +/** + * qdf_cpumask_set_cpu() - set a cpu in a cpumask + * @cpu: cpu number + * @dstp: cpumask pointer + * + * Return: None + */ +void qdf_cpumask_set_cpu(unsigned int cpu, qdf_cpu_mask *dstp); + +/** + * qdf_cpumask_setall - set all cpus + * @dstp: cpumask pointer + * + * Return: None + */ +void qdf_cpumask_setall(qdf_cpu_mask *dstp); #endif /* __QDF_THREADS_H */ diff --git a/qdf/linux/src/qdf_threads.c b/qdf/linux/src/qdf_threads.c index b0b22ab7c8b1..8ec0963b0036 100644 --- a/qdf/linux/src/qdf_threads.c +++ b/qdf/linux/src/qdf_threads.c @@ -236,3 +236,24 @@ qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask) } qdf_export_symbol(qdf_thread_set_cpus_allowed_mask); + +void qdf_cpumask_clear(qdf_cpu_mask *dstp) +{ + cpumask_clear(dstp); +} + +qdf_export_symbol(qdf_cpumask_clear); + +void qdf_cpumask_set_cpu(unsigned int cpu, qdf_cpu_mask *dstp) +{ + cpumask_set_cpu(cpu, dstp); +} + +qdf_export_symbol(qdf_cpumask_set_cpu); + +void qdf_cpumask_setall(qdf_cpu_mask *dstp) +{ + cpumask_setall(dstp); +} + +qdf_export_symbol(qdf_cpumask_setall);