Procházet zdrojové kódy

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
Nisha Menon před 4 roky
rodič
revize
027d8742b8
2 změnil soubory, kde provedl 37 přidání a 2 odebrání
  1. 21 1
      qdf/inc/qdf_threads.h
  2. 16 1
      qdf/linux/src/qdf_threads.c

+ 21 - 1
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 */

+ 16 - 1
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);