From 027d8742b866262b682a2adfa3da65ee10665009 Mon Sep 17 00:00:00 2001 From: Nisha Menon Date: Mon, 3 Aug 2020 16:59:31 -0700 Subject: [PATCH] qcacmn: Add new cpumask apis to framework Add new qdf apis to copy cpumask and check if an existing cpumask is empty. Change-Id: Ie34a9f9c097a691ac16e7f8ceca0a855ab6b26e3 CRs-Fixed: 2738317 --- qdf/inc/qdf_threads.h | 22 +++++++++++++++++++++- qdf/linux/src/qdf_threads.c | 17 ++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/qdf/inc/qdf_threads.h b/qdf/inc/qdf_threads.h index fcb28c8bea..5a89f13ada 100644 --- a/qdf/inc/qdf_threads.h +++ b/qdf/inc/qdf_threads.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -168,4 +168,24 @@ void qdf_cpumask_set_cpu(unsigned int cpu, qdf_cpu_mask *dstp); * Return: None */ void qdf_cpumask_setall(qdf_cpu_mask *dstp); + +/** + * qdf_cpumask_empty - Check if cpu_mask is empty + * @srcp: cpumask pointer + * + * Return: true or false + * + */ +bool qdf_cpumask_empty(const qdf_cpu_mask *srcp); + +/** + * qdf_cpumask_copy - Copy srcp cpumask to dstp + * @srcp: source cpumask pointer + * @dstp: destination cpumask pointer + * + * Return: None + * + */ +void qdf_cpumask_copy(qdf_cpu_mask *dstp, + const qdf_cpu_mask *srcp); #endif /* __QDF_THREADS_H */ diff --git a/qdf/linux/src/qdf_threads.c b/qdf/linux/src/qdf_threads.c index 43bfe0cba3..7f32ccd350 100644 --- a/qdf/linux/src/qdf_threads.c +++ b/qdf/linux/src/qdf_threads.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -278,3 +278,18 @@ void qdf_cpumask_setall(qdf_cpu_mask *dstp) } qdf_export_symbol(qdf_cpumask_setall); + +bool qdf_cpumask_empty(const qdf_cpu_mask *srcp) +{ + return cpumask_empty(srcp); +} + +qdf_export_symbol(qdf_cpumask_empty); + +void qdf_cpumask_copy(qdf_cpu_mask *dstp, + const qdf_cpu_mask *srcp) +{ + return cpumask_copy(dstp, srcp); +} + +qdf_export_symbol(qdf_cpumask_copy);