@@ -197,86 +197,86 @@ static int userspace_proxy_invoke(struct userspace_context *user_ctx, uint32_t c
197197#endif
198198 struct module_params * params = user_work_get_params (user_ctx );
199199 struct processing_module * mod = params -> mod ;
200- MOD_DBG (mod );
200+ DEBUG (mod );
201201 const uintptr_t ipc_req_buf = (uintptr_t )MAILBOX_HOSTBOX_BASE ;
202- MOD_DBG (mod );
202+ DEBUG (mod );
203203 struct k_mem_partition ipc_part = {
204204 .start = ipc_req_buf ,
205205 .size = MAILBOX_HOSTBOX_SIZE ,
206206 .attr = user_get_partition_attr (ipc_req_buf ) | K_MEM_PARTITION_P_RO_U_RO ,
207207 };
208- MOD_DBG (mod );
208+ DEBUG (mod );
209209 int ret = 0 , ret2 ;
210210
211211 params -> cmd = cmd ;
212- MOD_DBG (mod );
212+ DEBUG (mod );
213213
214214 if (ipc_payload_access ) {
215215 ret = k_mem_domain_add_partition (user_ctx -> comp_dom , & ipc_part );
216- MOD_DBG (mod );
216+ DEBUG (mod );
217217 if (ret < 0 ) {
218218 tr_err (& userspace_proxy_tr , "Add mailbox to domain error: %d" , ret );
219- MOD_DBG (mod );
219+ DEBUG (mod );
220220 return ret ;
221221 }
222222 }
223- MOD_DBG (mod );
223+ DEBUG (mod );
224224
225225#if !IS_ENABLED (CONFIG_SOF_USERSPACE_MOD_IPC_BY_DP_THREAD )
226226 /* Switch worker thread to module memory domain */
227227 ret = k_mem_domain_add_thread (user_ctx -> comp_dom , worker .thread_id );
228- MOD_DBG (mod );
228+ DEBUG (mod );
229229 if (ret < 0 ) {
230230 tr_err (& userspace_proxy_tr , "Failed to switch memory domain, error: %d" , ret );
231- MOD_DBG (mod );
231+ DEBUG (mod );
232232 goto done ;
233233 }
234234
235235 /* Pin worker thread to the same core as the module */
236236 ret = k_thread_cpu_pin (worker .thread_id , cpu_get_id ());
237- MOD_DBG (mod );
237+ DEBUG (mod );
238238 if (ret < 0 ) {
239239 tr_err (& userspace_proxy_tr , "Failed to pin cpu, error: %d" , ret );
240- MOD_DBG (mod );
240+ DEBUG (mod );
241241 goto done ;
242242 }
243243
244244 ret = k_work_user_submit_to_queue (& worker .work_queue , & user_ctx -> work_item -> work_item );
245- MOD_DBG (mod );
245+ DEBUG (mod );
246246 if (ret < 0 ) {
247247 tr_err (& userspace_proxy_tr , "Submit to queue error: %d" , ret );
248- MOD_DBG (mod );
248+ DEBUG (mod );
249249 goto done ;
250250 }
251251#else
252252 assert (event );
253- MOD_DBG (mod );
253+ DEBUG (mod );
254254 k_event_post (event , DP_TASK_EVENT_IPC );
255- MOD_DBG (mod );
255+ DEBUG (mod );
256256#endif
257257
258258 /* Timeout value is aligned with the ipc_wait_for_compound_msg function */
259259 if (!k_event_wait_safe (event , DP_TASK_EVENT_IPC_DONE , false,
260260 Z_TIMEOUT_US (250 * 20 ))) {
261261 tr_err (& userspace_proxy_tr , "IPC processing timedout." );
262- MOD_DBG (mod );
262+ DEBUG (mod );
263263 ret = - ETIMEDOUT ;
264264 }
265- MOD_DBG (mod );
265+ DEBUG (mod );
266266
267267done :
268268 if (ipc_payload_access ) {
269269 ret2 = k_mem_domain_remove_partition (user_ctx -> comp_dom , & ipc_part );
270- MOD_DBG (mod );
270+ DEBUG (mod );
271271 if (ret2 < 0 ) {
272272 tr_err (& userspace_proxy_tr , "Mailbox remove from domain error: %d" , ret );
273- MOD_DBG (mod );
273+ DEBUG (mod );
274274
275275 if (!ret )
276276 ret = ret2 ;
277277 }
278278 }
279- MOD_DBG (mod );
279+ DEBUG (mod );
280280
281281 return ret ;
282282}
@@ -403,7 +403,7 @@ static int userspace_proxy_start_agent(struct userspace_context *user_ctx,
403403 }
404404 return 0 ;
405405}
406-
406+ struct userspace_context * dbg_ctx ;
407407int userspace_proxy_create (struct userspace_context * * user_ctx , const struct comp_driver * drv ,
408408 const struct sof_man_module * manifest , system_agent_start_fn agent_fn ,
409409 const struct system_agent_params * agent_params ,
@@ -418,7 +418,7 @@ int userspace_proxy_create(struct userspace_context **user_ctx, const struct com
418418 context = k_heap_alloc (drv -> user_heap , sizeof (struct userspace_context ), K_FOREVER );
419419 if (!context )
420420 return - ENOMEM ;
421-
421+ dbg_ctx = context ;
422422 context -> dp_event = NULL ;
423423
424424 /* Allocate memory domain struct */
@@ -499,43 +499,43 @@ void userspace_proxy_destroy(const struct comp_driver *drv, struct userspace_con
499499static int userspace_proxy_init (struct processing_module * mod )
500500{
501501 struct module_params * params = user_work_get_params (mod -> user_ctx );
502- MOD_DBG (mod );
502+ DEBUG (mod );
503503 int ret ;
504504
505505 comp_dbg (mod -> dev , "start" );
506- MOD_DBG (mod );
506+ DEBUG (mod );
507507
508508#if IS_ENABLED (CONFIG_SOF_USERSPACE_MOD_IPC_BY_DP_THREAD )
509509 /* Start the system agent, if provided. Params is already filled by
510510 * the userspace_proxy_start_agent function.
511511 */
512512 if (params -> ext .agent .start_fn ) {
513- MOD_DBG (mod );
513+ DEBUG (mod );
514514 ret = userspace_proxy_invoke (mod -> user_ctx , USER_PROXY_MOD_CMD_AGENT_START , true);
515- MOD_DBG (mod );
515+ DEBUG (mod );
516516 if (ret )
517517 return ret ;
518518
519519 if (params -> ext .agent .start_fn == system_agent_start ) {
520520 module_set_private_data (mod , (void * )params -> ext .agent .out_interface );
521- MOD_DBG (mod );
521+ DEBUG (mod );
522522 } else {
523523 mod -> user_ctx -> interface = params -> ext .agent .out_interface ;
524- MOD_DBG (mod );
524+ DEBUG (mod );
525525 }
526526 }
527- MOD_DBG (mod );
527+ DEBUG (mod );
528528#endif
529529
530530 params -> mod = mod ;
531- MOD_DBG (mod );
531+ DEBUG (mod );
532532 ret = userspace_proxy_invoke (mod -> user_ctx , USER_PROXY_MOD_CMD_INIT , true);
533- MOD_DBG (mod );
533+ DEBUG (mod );
534534 if (ret )
535535 return ret ;
536536
537537 /* Return status from module code operation. */
538- MOD_DBG (mod );
538+ DEBUG (mod );
539539 return params -> status ;
540540}
541541
0 commit comments