Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/kernel/audio/module_adapter/library/userspace_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct k_work_user *userspace_proxy_register_ipc_handler(struct processing_modul
if (user_ctx) {
tr_dbg(&userspace_proxy_tr, "Set DP event %p for module %p",
(void *)event, (void *)mod);
assert(user_ctx->work_item);
__ASSERT_NO_MSG(user_ctx->work_item);

user_ctx->dp_event = event;
user_ctx->work_item->event = event;
Expand Down Expand Up @@ -271,7 +271,7 @@ static int userspace_proxy_invoke(struct userspace_context *user_ctx, uint32_t c
goto done;
}
#else
assert(event);
__ASSERT_NO_MSG(event);
k_event_post(event, DP_TASK_EVENT_IPC);
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/kernel/debug/debug_stream/debug_stream_slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ static int debug_stream_slot_send_sized(struct debug_stream_record *rec, uint32_

ret = memcpy_s(&buf->data[record_start], buf_remain * sizeof(uint32_t),
rec, buf_remain * sizeof(uint32_t));
assert(!ret);
__ASSERT_NO_MSG(!ret);
ret = memcpy_s(&buf->data[0], desc.buf_words * sizeof(uint32_t),
((uint32_t *) rec) + buf_remain, rec_remain * sizeof(uint32_t));
assert(!ret);
__ASSERT_NO_MSG(!ret);
} else {
int ret;

ret = memcpy_s(&buf->data[record_start], buf_remain * sizeof(uint32_t),
rec, record_size * sizeof(uint32_t));
assert(!ret);
__ASSERT_NO_MSG(!ret);
}
/* Write record size again after the record */
buf->data[buf->w_ptr] = record_size + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/debug/telemetry/performance_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ __cold int io_perf_monitor_release_slot(struct io_perf_data_item *item)

/* we assign data items ourselves so neither of those should ever fail */
ret = perf_bitmap_free(&self->io_performance_data_bitmap, idx);
assert(!ret);
__ASSERT_NO_MSG(!ret);
return ret;
}

Expand Down
6 changes: 3 additions & 3 deletions src/kernel/idc/zephyr_idc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void idc_handler(struct k_p4wq_work *work)
if (msg->size == sizeof(int)) {
const int idc_handler_memcpy_err __unused =
memcpy_s(&payload, sizeof(payload), msg->payload, msg->size);
assert(!idc_handler_memcpy_err);
__ASSERT_NO_MSG(!idc_handler_memcpy_err);
}

idc->received_msg.core = msg->core;
Expand Down Expand Up @@ -153,7 +153,7 @@ static int idc_send_msg_kernel(struct idc_msg *msg, uint32_t mode)
}

idc_send_memcpy_err = memcpy_s(msg_cp, sizeof(*msg_cp), msg, sizeof(*msg));
assert(!idc_send_memcpy_err);
__ASSERT_NO_MSG(!idc_send_memcpy_err);

/* Same priority as the IPC thread which is an EDF task and under Zephyr */
work->priority = CONFIG_EDF_THREAD_PRIORITY;
Expand All @@ -164,7 +164,7 @@ static int idc_send_msg_kernel(struct idc_msg *msg, uint32_t mode)
if (msg->payload) {
idc_send_memcpy_err = memcpy_s(payload->data, sizeof(payload->data),
msg->payload, msg->size);
assert(!idc_send_memcpy_err);
__ASSERT_NO_MSG(!idc_send_memcpy_err);

/* Sending a message to another core, write back local payload cache */
sys_cache_data_flush_range(payload->data, MIN(sizeof(payload->data), msg->size));
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* initialisation functions.
*/

#include <rtos/panic.h>
#include <zephyr/kernel.h>
#include <rtos/init.h>
#include <rtos/interrupt.h>
#include <sof/init.h>
Expand Down Expand Up @@ -245,7 +245,7 @@ __cold static int primary_core_init(int argc, char *argv[], struct sof *sof)

/* init the platform */
if (platform_init(sof) < 0)
sof_panic(SOF_IPC_PANIC_PLATFORM);
k_panic();

#if CONFIG_AMS
if (ams_init())
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ __cold static void lib_manager_update_sof_ctx(void *base_addr, uint32_t lib_id)

if (!ctx) {
tr_err(&lib_manager_tr, "allocation failed");
sof_panic(SOF_IPC_PANIC_IPC);
k_panic();
}

ctx->base_addr = base_addr;
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/library_manager/lib_notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void lib_notif_msg_clean(bool leave_one_handle)
/* Free all unused elements except the last one */
list_for_item_safe(list_elem, list_tmp, &lib_notif->list) {
msg_pool_elem = container_of(list_elem, struct ipc_lib_msg, list);
assert(msg_pool_elem->msg);
__ASSERT_NO_MSG(msg_pool_elem->msg);

if (list_is_empty(&msg_pool_elem->msg->list)) {
k_spinlock_key_t key;
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/schedule/schedule-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ __cold void scheduler_init(int type, const struct scheduler_ops *ops, void *data
sch = scheduler_alloc(heap, sizeof(*sch));
if (!sch) {
tr_err(&sch_tr, "allocation failed");
sof_panic(SOF_IPC_PANIC_IPC);
k_panic();
}
memset(sch, 0, sizeof(*sch));
list_init(&sch->list);
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/schedule/zephyr_dp_schedule_application-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
int ret;

/* must be called on the same core the task will be bound to */
assert(cpu_get_id() == core);
assert(!k_is_user_context());
__ASSERT_NO_MSG(cpu_get_id() == core);
__ASSERT_NO_MSG(!k_is_user_context());

/*
* allocate memory
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/schedule/zephyr_dp_schedule_thread-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int scheduler_dp_task_init(struct task **task,
int ret;

/* must be called on the same core the task will be binded to */
assert(cpu_get_id() == core);
__ASSERT_NO_MSG(cpu_get_id() == core);

/*
* allocate memory
Expand Down Expand Up @@ -152,7 +152,7 @@ int scheduler_dp_task_init(struct task **task,

#if IS_ENABLED(CONFIG_SOF_USERSPACE_MOD_IPC_BY_DP_THREAD)
pdata->ipc_work_item = userspace_proxy_register_ipc_handler(mod, pdata->event);
assert(pdata->ipc_work_item);
__ASSERT_NO_MSG(pdata->ipc_work_item);
#endif
}
#endif /* CONFIG_USERSPACE */
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/schedule/zephyr_ll-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ struct k_thread *zephyr_ll_init_context(void *data, struct task *task)
return NULL;
}

assert(!k_is_user_context());
__ASSERT_NO_MSG(!k_is_user_context());
k_thread_access_grant(zephyr_domain_thread_tid(sch->ll_domain), sch->lock, pdata->sem_p);

tr_dbg(&ll_tr, "granting access to lock %p for thread %p", sch->lock,
Expand All @@ -215,7 +215,7 @@ struct k_thread *zephyr_ll_init_context(void *data, struct task *task)

void user_ll_grant_access(struct k_thread *thread, int core)
{
assert(core < CONFIG_CORE_COUNT && zephyr_ll_klocks[core] != NULL);
__ASSERT_NO_MSG(core < CONFIG_CORE_COUNT && zephyr_ll_klocks[core] != NULL);

k_thread_access_grant(thread, zephyr_ll_klocks[core]);
}
Expand Down Expand Up @@ -297,7 +297,7 @@ __cold int zephyr_ll_scheduler_init(struct ll_schedule_domain *domain)
zephyr_ll_free(sch);
return -ENOMEM;
}
assert(core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] == NULL);
__ASSERT_NO_MSG(core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] == NULL);
zephyr_ll_locks[core] = sch->lock;
zephyr_ll_klocks[core] = sch->lock;
k_mutex_init(sch->lock);
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/schedule/zephyr_twb_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ int scheduler_twb_task_init(struct task **task,
}

/* must be called on the same core the task will be binded to */
assert(cpu_get_id() == core);
__ASSERT_NO_MSG(cpu_get_id() == core);

if (thread_priority < 0) {
tr_err(&twb_tr, "non preemptible priority");
Expand Down
2 changes: 1 addition & 1 deletion src/schedule/zephyr_dp_schedule_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void dp_thread_fn(void *p1, void *p2, void *p3)

#if IS_ENABLED(CONFIG_SOF_USERSPACE_MOD_IPC_BY_DP_THREAD)
if (event & DP_TASK_EVENT_IPC) {
assert(task_pdata->ipc_work_item);
__ASSERT_NO_MSG(task_pdata->ipc_work_item);
userspace_proxy_worker_handler(task_pdata->ipc_work_item);
}
#endif
Expand Down
18 changes: 9 additions & 9 deletions src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ static inline void zephyr_ll_lock_acquired(int core)

static inline void zephyr_ll_lock_releasing(int core)
{
assert(zephyr_ll_lock_owner[core] == k_current_get());
__ASSERT_NO_MSG(zephyr_ll_lock_owner[core] == k_current_get());
if (--zephyr_ll_lock_depth[core] == 0)
zephyr_ll_lock_owner[core] = NULL;
}

#ifdef CONFIG_ASSERT
void user_ll_assert_locked(int core)
{
assert(core < CONFIG_CORE_COUNT &&
zephyr_ll_lock_owner[core] == k_current_get());
__ASSERT_NO_MSG(core < CONFIG_CORE_COUNT &&
zephyr_ll_lock_owner[core] == k_current_get());
}
#endif /* CONFIG_ASSERT */
#endif /* CONFIG_SOF_USERSPACE_LL */
Expand Down Expand Up @@ -550,9 +550,9 @@ struct task *zephyr_ll_task_alloc(void)
*/
void user_ll_lock_sched(int core)
{
assert(core >= 0 && core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] != NULL);
__ASSERT_NO_MSG(core >= 0 && core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] != NULL);
int __maybe_unused ret = k_mutex_lock(zephyr_ll_locks[core], K_FOREVER);
assert(!ret);
__ASSERT_NO_MSG(!ret);
zephyr_ll_lock_acquired(core);
}

Expand All @@ -561,17 +561,17 @@ void user_ll_lock_sched(int core)
*/
void user_ll_unlock_sched(int core)
{
assert(core >= 0 && core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] != NULL);
__ASSERT_NO_MSG(core >= 0 && core < CONFIG_CORE_COUNT && zephyr_ll_locks[core] != NULL);
zephyr_ll_lock_releasing(core);
int __maybe_unused ret = k_mutex_unlock(zephyr_ll_locks[core]);
assert(!ret);
__ASSERT_NO_MSG(!ret);
}

unsigned int user_ll_unlock_sched_all(int core)
{
unsigned int depth, i;

assert(core >= 0 && core < CONFIG_CORE_COUNT);
__ASSERT_NO_MSG(core >= 0 && core < CONFIG_CORE_COUNT);

if (zephyr_ll_lock_owner[core] != k_current_get())
return 0;
Expand Down Expand Up @@ -610,7 +610,7 @@ int zephyr_ll_task_init(struct task *task,
* schedule_task_init() must be run on target core, see
* sof/zephyr/schedule.c:arch_schedulers_get()
*/
assert(cpu_get_id() == core);
__ASSERT_NO_MSG(cpu_get_id() == core);

ret = schedule_task_init(task, uid, type, priority, run, data, core,
flags);
Expand Down
4 changes: 2 additions & 2 deletions zephyr/include/rtos/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static inline bool task_is_active(struct task *task)
*/
static inline enum task_state task_run(struct task *task)
{
assert(task->ops.run);
__ASSERT_NO_MSG(task->ops.run);

return task->ops.run(task->data);
}
Expand All @@ -148,7 +148,7 @@ static inline void task_complete(struct task *task)
*/
static inline uint64_t task_get_deadline(struct task *task)
{
assert(task->ops.get_deadline);
__ASSERT_NO_MSG(task->ops.get_deadline);

return task->ops.get_deadline(task->data);
}
Expand Down
2 changes: 1 addition & 1 deletion zephyr/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static void *virtual_heap_alloc(struct vmh_heap *heap, uint32_t flags, size_t by
return NULL;
}

assert(align == 0 || IS_ALIGNED(mem, align));
__ASSERT_NO_MSG(align == 0 || IS_ALIGNED(mem, align));

if (flags & SOF_MEM_FLAG_COHERENT)
mem = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)mem);
Expand Down
6 changes: 3 additions & 3 deletions zephyr/schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static struct schedulers *_ku_schedulers[CONFIG_CORE_COUNT];
struct schedulers **arch_schedulers_get(void)
{
#ifdef __ZEPHYR__
assert(!k_is_user_context());
__ASSERT_NO_MSG(!k_is_user_context());
#endif
return _k_schedulers + cpu_get_id();
}
Expand All @@ -58,7 +58,7 @@ EXPORT_SYMBOL(arch_schedulers_get);
struct schedulers **arch_user_schedulers_get(void)
{
#ifdef CONFIG_SOF_USERSPACE_LL
assert(!k_is_user_context());
__ASSERT_NO_MSG(!k_is_user_context());
return _ku_schedulers + cpu_get_id();
#else
return NULL;
Expand All @@ -76,7 +76,7 @@ void arch_user_schedulers_publish(void)
#ifdef CONFIG_SOF_USERSPACE_LL
unsigned int core = cpu_get_id();

assert(!k_is_user_context());
__ASSERT_NO_MSG(!k_is_user_context());
_u_schedulers[core] = _ku_schedulers[core];
#endif
}
Expand Down
Loading