xref: /wlan-driver/qca-wifi-host-cmn/qdf/linux/src/qdf_threads.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: qdf_threads
22*5113495bSYour Name  * QCA driver framework (QDF) thread APIs
23*5113495bSYour Name  */
24*5113495bSYour Name 
25*5113495bSYour Name /* Include Files */
26*5113495bSYour Name #include <qdf_threads.h>
27*5113495bSYour Name #include <qdf_types.h>
28*5113495bSYour Name #include <qdf_trace.h>
29*5113495bSYour Name #include <linux/jiffies.h>
30*5113495bSYour Name #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
31*5113495bSYour Name #include <linux/sched.h>
32*5113495bSYour Name #else
33*5113495bSYour Name #include <linux/sched/signal.h>
34*5113495bSYour Name #endif /* KERNEL_VERSION(4, 11, 0) */
35*5113495bSYour Name /* Test against msm kernel version */
36*5113495bSYour Name #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && \
37*5113495bSYour Name 	IS_ENABLED(CONFIG_SCHED_WALT)
38*5113495bSYour Name #include <linux/sched/walt.h>
39*5113495bSYour Name #endif
40*5113495bSYour Name #include <linux/delay.h>
41*5113495bSYour Name #include <linux/interrupt.h>
42*5113495bSYour Name #include <linux/kthread.h>
43*5113495bSYour Name #include <linux/stacktrace.h>
44*5113495bSYour Name #include <qdf_defer.h>
45*5113495bSYour Name #include <qdf_module.h>
46*5113495bSYour Name #include <linux/cpumask.h>
47*5113495bSYour Name /* Function declarations and documentation */
48*5113495bSYour Name 
49*5113495bSYour Name typedef int (*qdf_thread_os_func)(void *data);
50*5113495bSYour Name 
51*5113495bSYour Name /**
52*5113495bSYour Name  *  qdf_sleep() - sleep
53*5113495bSYour Name  *  @ms_interval : Number of milliseconds to suspend the current thread.
54*5113495bSYour Name  *  A value of 0 may or may not cause the current thread to yield.
55*5113495bSYour Name  *
56*5113495bSYour Name  *  This function suspends the execution of the current thread
57*5113495bSYour Name  *  until the specified time out interval elapses.
58*5113495bSYour Name  *
59*5113495bSYour Name  *  Return: none
60*5113495bSYour Name  */
qdf_sleep(uint32_t ms_interval)61*5113495bSYour Name void qdf_sleep(uint32_t ms_interval)
62*5113495bSYour Name {
63*5113495bSYour Name 	if (in_interrupt()) {
64*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
65*5113495bSYour Name 			  "%s cannot be called from interrupt context!!!",
66*5113495bSYour Name 			  __func__);
67*5113495bSYour Name 		return;
68*5113495bSYour Name 	}
69*5113495bSYour Name 	msleep_interruptible(ms_interval);
70*5113495bSYour Name }
71*5113495bSYour Name qdf_export_symbol(qdf_sleep);
72*5113495bSYour Name 
73*5113495bSYour Name /**
74*5113495bSYour Name  *  qdf_sleep_us() - sleep
75*5113495bSYour Name  *  @us_interval : Number of microseconds to suspend the current thread.
76*5113495bSYour Name  *  A value of 0 may or may not cause the current thread to yield.
77*5113495bSYour Name  *
78*5113495bSYour Name  *  This function suspends the execution of the current thread
79*5113495bSYour Name  *  until the specified time out interval elapses.
80*5113495bSYour Name  *
81*5113495bSYour Name  *  Return : none
82*5113495bSYour Name  */
qdf_sleep_us(uint32_t us_interval)83*5113495bSYour Name void qdf_sleep_us(uint32_t us_interval)
84*5113495bSYour Name {
85*5113495bSYour Name 	unsigned long timeout = usecs_to_jiffies(us_interval) + 1;
86*5113495bSYour Name 
87*5113495bSYour Name 	if (in_interrupt()) {
88*5113495bSYour Name 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
89*5113495bSYour Name 			  "%s cannot be called from interrupt context!!!",
90*5113495bSYour Name 			  __func__);
91*5113495bSYour Name 		return;
92*5113495bSYour Name 	}
93*5113495bSYour Name 
94*5113495bSYour Name 	while (timeout && !signal_pending(current))
95*5113495bSYour Name 		timeout = schedule_timeout_interruptible(timeout);
96*5113495bSYour Name }
97*5113495bSYour Name qdf_export_symbol(qdf_sleep_us);
98*5113495bSYour Name 
99*5113495bSYour Name /**
100*5113495bSYour Name  *  qdf_busy_wait() - busy wait
101*5113495bSYour Name  *  @us_interval : Number of microseconds to busy wait.
102*5113495bSYour Name  *
103*5113495bSYour Name  *  This function places the current thread in busy wait until the specified
104*5113495bSYour Name  *  time out interval elapses. If the interval is greater than 50us on WM, the
105*5113495bSYour Name  *  behaviour is undefined.
106*5113495bSYour Name  *
107*5113495bSYour Name  *  Return : none
108*5113495bSYour Name  */
qdf_busy_wait(uint32_t us_interval)109*5113495bSYour Name void qdf_busy_wait(uint32_t us_interval)
110*5113495bSYour Name {
111*5113495bSYour Name 	udelay(us_interval);
112*5113495bSYour Name }
113*5113495bSYour Name qdf_export_symbol(qdf_busy_wait);
114*5113495bSYour Name 
115*5113495bSYour Name #if defined(PF_WAKE_UP_IDLE) || IS_ENABLED(CONFIG_SCHED_WALT)
qdf_set_wake_up_idle(bool idle)116*5113495bSYour Name void qdf_set_wake_up_idle(bool idle)
117*5113495bSYour Name {
118*5113495bSYour Name 	set_wake_up_idle(idle);
119*5113495bSYour Name }
120*5113495bSYour Name #else
qdf_set_wake_up_idle(bool idle)121*5113495bSYour Name void qdf_set_wake_up_idle(bool idle)
122*5113495bSYour Name {
123*5113495bSYour Name }
124*5113495bSYour Name #endif /* PF_WAKE_UP_IDLE */
125*5113495bSYour Name 
126*5113495bSYour Name qdf_export_symbol(qdf_set_wake_up_idle);
127*5113495bSYour Name 
qdf_set_user_nice(qdf_thread_t * thread,long nice)128*5113495bSYour Name void qdf_set_user_nice(qdf_thread_t *thread, long nice)
129*5113495bSYour Name {
130*5113495bSYour Name 	set_user_nice(thread, nice);
131*5113495bSYour Name }
132*5113495bSYour Name qdf_export_symbol(qdf_set_user_nice);
133*5113495bSYour Name 
qdf_create_thread(int (* thread_handler)(void * data),void * data,const char thread_name[])134*5113495bSYour Name qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
135*5113495bSYour Name 				const char thread_name[])
136*5113495bSYour Name {
137*5113495bSYour Name 	struct task_struct *task;
138*5113495bSYour Name 
139*5113495bSYour Name 	task = kthread_create(thread_handler, data, thread_name);
140*5113495bSYour Name 
141*5113495bSYour Name 	if (IS_ERR(task))
142*5113495bSYour Name 		return NULL;
143*5113495bSYour Name 
144*5113495bSYour Name 	return task;
145*5113495bSYour Name }
146*5113495bSYour Name qdf_export_symbol(qdf_create_thread);
147*5113495bSYour Name 
148*5113495bSYour Name static uint16_t qdf_thread_id;
149*5113495bSYour Name 
qdf_thread_run(qdf_thread_func callback,void * context)150*5113495bSYour Name qdf_thread_t *qdf_thread_run(qdf_thread_func callback, void *context)
151*5113495bSYour Name {
152*5113495bSYour Name 	struct task_struct *thread;
153*5113495bSYour Name 
154*5113495bSYour Name 	thread = kthread_create((qdf_thread_os_func)callback, context,
155*5113495bSYour Name 				"qdf %u", qdf_thread_id++);
156*5113495bSYour Name 	if (IS_ERR(thread))
157*5113495bSYour Name 		return NULL;
158*5113495bSYour Name 
159*5113495bSYour Name 	get_task_struct(thread);
160*5113495bSYour Name 	wake_up_process(thread);
161*5113495bSYour Name 
162*5113495bSYour Name 	return thread;
163*5113495bSYour Name }
164*5113495bSYour Name qdf_export_symbol(qdf_thread_run);
165*5113495bSYour Name 
qdf_thread_join(qdf_thread_t * thread)166*5113495bSYour Name QDF_STATUS qdf_thread_join(qdf_thread_t *thread)
167*5113495bSYour Name {
168*5113495bSYour Name 	QDF_STATUS status;
169*5113495bSYour Name 
170*5113495bSYour Name 	QDF_BUG(thread);
171*5113495bSYour Name 
172*5113495bSYour Name 	status = (QDF_STATUS)kthread_stop(thread);
173*5113495bSYour Name 	put_task_struct(thread);
174*5113495bSYour Name 
175*5113495bSYour Name 	return status;
176*5113495bSYour Name }
177*5113495bSYour Name qdf_export_symbol(qdf_thread_join);
178*5113495bSYour Name 
qdf_thread_should_stop(void)179*5113495bSYour Name bool qdf_thread_should_stop(void)
180*5113495bSYour Name {
181*5113495bSYour Name 	return kthread_should_stop();
182*5113495bSYour Name }
183*5113495bSYour Name qdf_export_symbol(qdf_thread_should_stop);
184*5113495bSYour Name 
qdf_wake_up_process(qdf_thread_t * thread)185*5113495bSYour Name int qdf_wake_up_process(qdf_thread_t *thread)
186*5113495bSYour Name {
187*5113495bSYour Name 	return wake_up_process(thread);
188*5113495bSYour Name }
189*5113495bSYour Name qdf_export_symbol(qdf_wake_up_process);
190*5113495bSYour Name 
191*5113495bSYour Name /* save_stack_trace_tsk() is exported for:
192*5113495bSYour Name  * 1) non-arm architectures
193*5113495bSYour Name  * 2) arm architectures in kernel versions >=4.14
194*5113495bSYour Name  * 3) backported kernels defining BACKPORTED_EXPORT_SAVE_STACK_TRACE_TSK_ARM
195*5113495bSYour Name  */
196*5113495bSYour Name #if ((defined(WLAN_HOST_ARCH_ARM) && !WLAN_HOST_ARCH_ARM) || \
197*5113495bSYour Name 	LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) || \
198*5113495bSYour Name 	defined(BACKPORTED_EXPORT_SAVE_STACK_TRACE_TSK_ARM)) && \
199*5113495bSYour Name 	defined(CONFIG_STACKTRACE)
200*5113495bSYour Name #define QDF_PRINT_TRACE_COUNT 32
201*5113495bSYour Name 
202*5113495bSYour Name #ifdef CONFIG_ARCH_STACKWALK
qdf_print_thread_trace(qdf_thread_t * thread)203*5113495bSYour Name void qdf_print_thread_trace(qdf_thread_t *thread)
204*5113495bSYour Name {
205*5113495bSYour Name 	const int spaces = 4;
206*5113495bSYour Name 	struct task_struct *task = thread;
207*5113495bSYour Name 	unsigned long entries[QDF_PRINT_TRACE_COUNT] = {0};
208*5113495bSYour Name 	unsigned int nr_entries = 0;
209*5113495bSYour Name 	unsigned int max_entries = QDF_PRINT_TRACE_COUNT;
210*5113495bSYour Name 	int skip = 0;
211*5113495bSYour Name 
212*5113495bSYour Name 	nr_entries = stack_trace_save_tsk(task, entries, max_entries, skip);
213*5113495bSYour Name 	stack_trace_print(entries, nr_entries, spaces);
214*5113495bSYour Name }
215*5113495bSYour Name #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
qdf_print_thread_trace(qdf_thread_t * thread)216*5113495bSYour Name void qdf_print_thread_trace(qdf_thread_t *thread)
217*5113495bSYour Name {
218*5113495bSYour Name 	const int spaces = 4;
219*5113495bSYour Name 	struct task_struct *task = thread;
220*5113495bSYour Name 	unsigned long entries[QDF_PRINT_TRACE_COUNT] = {0};
221*5113495bSYour Name 	struct stack_trace trace = {
222*5113495bSYour Name 		.nr_entries = 0,
223*5113495bSYour Name 		.skip = 0,
224*5113495bSYour Name 		.entries = &entries[0],
225*5113495bSYour Name 		.max_entries = QDF_PRINT_TRACE_COUNT,
226*5113495bSYour Name 	};
227*5113495bSYour Name 
228*5113495bSYour Name 	save_stack_trace_tsk(task, &trace);
229*5113495bSYour Name 	stack_trace_print(entries, trace.nr_entries, spaces);
230*5113495bSYour Name }
231*5113495bSYour Name #else
qdf_print_thread_trace(qdf_thread_t * thread)232*5113495bSYour Name void qdf_print_thread_trace(qdf_thread_t *thread)
233*5113495bSYour Name {
234*5113495bSYour Name 	const int spaces = 4;
235*5113495bSYour Name 	struct task_struct *task = thread;
236*5113495bSYour Name 	unsigned long entries[QDF_PRINT_TRACE_COUNT] = {0};
237*5113495bSYour Name 	struct stack_trace trace = {
238*5113495bSYour Name 		.nr_entries = 0,
239*5113495bSYour Name 		.skip = 0,
240*5113495bSYour Name 		.entries = &entries[0],
241*5113495bSYour Name 		.max_entries = QDF_PRINT_TRACE_COUNT,
242*5113495bSYour Name 	};
243*5113495bSYour Name 
244*5113495bSYour Name 	save_stack_trace_tsk(task, &trace);
245*5113495bSYour Name 	print_stack_trace(&trace, spaces);
246*5113495bSYour Name }
247*5113495bSYour Name #endif
248*5113495bSYour Name 
249*5113495bSYour Name #else
qdf_print_thread_trace(qdf_thread_t * thread)250*5113495bSYour Name void qdf_print_thread_trace(qdf_thread_t *thread) { }
251*5113495bSYour Name #endif /* KERNEL_VERSION(4, 14, 0) */
252*5113495bSYour Name qdf_export_symbol(qdf_print_thread_trace);
253*5113495bSYour Name 
qdf_get_current_task(void)254*5113495bSYour Name qdf_thread_t *qdf_get_current_task(void)
255*5113495bSYour Name {
256*5113495bSYour Name 	return current;
257*5113495bSYour Name }
258*5113495bSYour Name qdf_export_symbol(qdf_get_current_task);
259*5113495bSYour Name 
qdf_get_current_pid(void)260*5113495bSYour Name int qdf_get_current_pid(void)
261*5113495bSYour Name {
262*5113495bSYour Name 	return current->pid;
263*5113495bSYour Name }
264*5113495bSYour Name qdf_export_symbol(qdf_get_current_pid);
265*5113495bSYour Name 
qdf_get_current_comm(void)266*5113495bSYour Name const char *qdf_get_current_comm(void)
267*5113495bSYour Name {
268*5113495bSYour Name 	return current->comm;
269*5113495bSYour Name }
270*5113495bSYour Name qdf_export_symbol(qdf_get_current_comm);
271*5113495bSYour Name 
272*5113495bSYour Name void
qdf_thread_set_cpus_allowed_mask(qdf_thread_t * thread,qdf_cpu_mask * new_mask)273*5113495bSYour Name qdf_thread_set_cpus_allowed_mask(qdf_thread_t *thread, qdf_cpu_mask *new_mask)
274*5113495bSYour Name {
275*5113495bSYour Name 	set_cpus_allowed_ptr(thread, new_mask);
276*5113495bSYour Name }
277*5113495bSYour Name 
278*5113495bSYour Name qdf_export_symbol(qdf_thread_set_cpus_allowed_mask);
279*5113495bSYour Name 
qdf_cpumask_clear(qdf_cpu_mask * dstp)280*5113495bSYour Name void qdf_cpumask_clear(qdf_cpu_mask *dstp)
281*5113495bSYour Name {
282*5113495bSYour Name 	cpumask_clear(dstp);
283*5113495bSYour Name }
284*5113495bSYour Name 
285*5113495bSYour Name qdf_export_symbol(qdf_cpumask_clear);
286*5113495bSYour Name 
qdf_cpumask_set_cpu(unsigned int cpu,qdf_cpu_mask * dstp)287*5113495bSYour Name void qdf_cpumask_set_cpu(unsigned int cpu, qdf_cpu_mask *dstp)
288*5113495bSYour Name {
289*5113495bSYour Name 	cpumask_set_cpu(cpu, dstp);
290*5113495bSYour Name }
291*5113495bSYour Name qdf_export_symbol(qdf_cpumask_set_cpu);
292*5113495bSYour Name 
qdf_cpumask_clear_cpu(unsigned int cpu,qdf_cpu_mask * dstp)293*5113495bSYour Name void qdf_cpumask_clear_cpu(unsigned int cpu, qdf_cpu_mask *dstp)
294*5113495bSYour Name {
295*5113495bSYour Name 	cpumask_clear_cpu(cpu, dstp);
296*5113495bSYour Name }
297*5113495bSYour Name 
298*5113495bSYour Name qdf_export_symbol(qdf_cpumask_clear_cpu);
299*5113495bSYour Name 
qdf_cpumask_setall(qdf_cpu_mask * dstp)300*5113495bSYour Name void qdf_cpumask_setall(qdf_cpu_mask *dstp)
301*5113495bSYour Name {
302*5113495bSYour Name 	cpumask_setall(dstp);
303*5113495bSYour Name }
304*5113495bSYour Name 
305*5113495bSYour Name qdf_export_symbol(qdf_cpumask_setall);
306*5113495bSYour Name 
qdf_cpumask_empty(const qdf_cpu_mask * srcp)307*5113495bSYour Name bool qdf_cpumask_empty(const qdf_cpu_mask *srcp)
308*5113495bSYour Name {
309*5113495bSYour Name 	return cpumask_empty(srcp);
310*5113495bSYour Name }
311*5113495bSYour Name 
312*5113495bSYour Name qdf_export_symbol(qdf_cpumask_empty);
313*5113495bSYour Name 
qdf_cpumask_copy(qdf_cpu_mask * dstp,const qdf_cpu_mask * srcp)314*5113495bSYour Name void qdf_cpumask_copy(qdf_cpu_mask *dstp,
315*5113495bSYour Name 		      const qdf_cpu_mask *srcp)
316*5113495bSYour Name {
317*5113495bSYour Name 	return cpumask_copy(dstp, srcp);
318*5113495bSYour Name }
319*5113495bSYour Name 
320*5113495bSYour Name qdf_export_symbol(qdf_cpumask_copy);
321*5113495bSYour Name 
qdf_cpumask_or(qdf_cpu_mask * dstp,qdf_cpu_mask * src1p,qdf_cpu_mask * src2p)322*5113495bSYour Name void qdf_cpumask_or(qdf_cpu_mask *dstp, qdf_cpu_mask *src1p,
323*5113495bSYour Name 		    qdf_cpu_mask *src2p)
324*5113495bSYour Name {
325*5113495bSYour Name 	cpumask_or(dstp, src1p, src2p);
326*5113495bSYour Name }
327*5113495bSYour Name 
328*5113495bSYour Name qdf_export_symbol(qdf_cpumask_or);
329*5113495bSYour Name 
330*5113495bSYour Name void
qdf_thread_cpumap_print_to_pagebuf(bool list,char * new_mask_str,qdf_cpu_mask * new_mask)331*5113495bSYour Name qdf_thread_cpumap_print_to_pagebuf(bool list, char *new_mask_str,
332*5113495bSYour Name 				   qdf_cpu_mask *new_mask)
333*5113495bSYour Name {
334*5113495bSYour Name 	cpumap_print_to_pagebuf(list, new_mask_str, new_mask);
335*5113495bSYour Name }
336*5113495bSYour Name 
337*5113495bSYour Name qdf_export_symbol(qdf_thread_cpumap_print_to_pagebuf);
338*5113495bSYour Name 
339*5113495bSYour Name bool
qdf_cpumask_and(qdf_cpu_mask * dstp,const qdf_cpu_mask * src1p,const qdf_cpu_mask * src2p)340*5113495bSYour Name qdf_cpumask_and(qdf_cpu_mask *dstp, const qdf_cpu_mask *src1p,
341*5113495bSYour Name 		const qdf_cpu_mask *src2p)
342*5113495bSYour Name {
343*5113495bSYour Name 	return cpumask_and(dstp, src1p, src2p);
344*5113495bSYour Name }
345*5113495bSYour Name 
346*5113495bSYour Name qdf_export_symbol(qdf_cpumask_and);
347*5113495bSYour Name 
348*5113495bSYour Name bool
qdf_cpumask_andnot(qdf_cpu_mask * dstp,const qdf_cpu_mask * src1p,const qdf_cpu_mask * src2p)349*5113495bSYour Name qdf_cpumask_andnot(qdf_cpu_mask *dstp, const qdf_cpu_mask *src1p,
350*5113495bSYour Name 		   const qdf_cpu_mask *src2p)
351*5113495bSYour Name {
352*5113495bSYour Name 	return cpumask_andnot(dstp, src1p, src2p);
353*5113495bSYour Name }
354*5113495bSYour Name 
355*5113495bSYour Name qdf_export_symbol(qdf_cpumask_andnot);
356*5113495bSYour Name 
357*5113495bSYour Name bool
qdf_cpumask_equal(const qdf_cpu_mask * src1p,const qdf_cpu_mask * src2p)358*5113495bSYour Name qdf_cpumask_equal(const qdf_cpu_mask *src1p, const qdf_cpu_mask *src2p)
359*5113495bSYour Name {
360*5113495bSYour Name 	return cpumask_equal(src1p, src2p);
361*5113495bSYour Name }
362*5113495bSYour Name 
363*5113495bSYour Name qdf_export_symbol(qdf_cpumask_equal);
364*5113495bSYour Name 
365*5113495bSYour Name #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))
366*5113495bSYour Name void
qdf_cpumask_complement(qdf_cpu_mask * dstp,const qdf_cpu_mask * srcp)367*5113495bSYour Name qdf_cpumask_complement(qdf_cpu_mask *dstp, const qdf_cpu_mask *srcp)
368*5113495bSYour Name {
369*5113495bSYour Name 	cpumask_andnot(dstp, cpu_possible_mask, srcp);
370*5113495bSYour Name }
371*5113495bSYour Name #else
372*5113495bSYour Name void
qdf_cpumask_complement(qdf_cpu_mask * dstp,const qdf_cpu_mask * srcp)373*5113495bSYour Name qdf_cpumask_complement(qdf_cpu_mask *dstp, const qdf_cpu_mask *srcp)
374*5113495bSYour Name {
375*5113495bSYour Name 	cpumask_complement(dstp, srcp);
376*5113495bSYour Name }
377*5113495bSYour Name #endif
378*5113495bSYour Name 
379*5113495bSYour Name qdf_export_symbol(qdf_cpumask_complement);
380*5113495bSYour Name 
381*5113495bSYour Name #if defined(WALT_GET_CPU_TAKEN_SUPPORT) && IS_ENABLED(CONFIG_SCHED_WALT)
qdf_walt_get_cpus_taken(void)382*5113495bSYour Name qdf_cpu_mask qdf_walt_get_cpus_taken(void)
383*5113495bSYour Name {
384*5113495bSYour Name 	return walt_get_cpus_taken();
385*5113495bSYour Name }
386*5113495bSYour Name 
387*5113495bSYour Name qdf_export_symbol(qdf_walt_get_cpus_taken);
388*5113495bSYour Name #endif
389