Skip to content
Draft
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
6 changes: 6 additions & 0 deletions posix/include/rtos/panic.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ void __panic(uint32_t p, const char *filename, uint32_t linenum) SOF_NORETURN;
#define assert(cond) (void)((cond) || (sof_panic(SOF_IPC_PANIC_ASSERT), 0))
#endif

/*
* The Zephyr assert macros. On Zephyr, rtos/panic.h provides them through
* <zephyr/kernel.h>.
*/
#include <zephyr/sys/__assert.h>

#endif /* __POSIX_RTOS_PANIC_H__ */
2 changes: 1 addition & 1 deletion src/kernel/drivers/generic/dummy-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static ssize_t dummy_dma_copy_crt_elem(struct dma_chan_pdata *pdata,

/* Perform the copy, being careful if we overflow the elem */
ret = memcpy_s((void *)wptr, remaining_size, (void *)rptr, copy_size);
assert(!ret);
__ASSERT_NO_MSG(!ret);

/* On capture, writeback the host buffer (it may lie in a cached area).
* On playback, also writeback because host.c does an invalidate to
Expand Down
4 changes: 2 additions & 2 deletions src/kernel/ipc/ipc-common-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ __cold void ipc_msg_send_direct(struct ipc_msg *msg, void *data)
if (data && msg->tx_size > 0 && msg->tx_size <= SOF_IPC_MSG_MAX_SIZE &&
msg->tx_data != data) {
ret = memcpy_s(msg->tx_data, msg->tx_size, data, msg->tx_size);
assert(!ret);
__ASSERT_NO_MSG(!ret);
}

ipc_platform_send_msg_direct(msg);
Expand All @@ -214,7 +214,7 @@ void z_impl_ipc_msg_send(struct ipc_msg *msg, void *data, bool high_priority)
if (data && (msg->tx_size > 0 && msg->tx_size <= SOF_IPC_MSG_MAX_SIZE) &&
msg->tx_data != data) {
ret = memcpy_s(msg->tx_data, msg->tx_size, data, msg->tx_size);
assert(!ret);
__ASSERT_NO_MSG(!ret);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/ipc/ipc3/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int dai_config_dma_channel(struct dai_data *dd, struct comp_dev *dev, const void
int channel;
int handshake;

assert(config);
__ASSERT_NO_MSG(config);

switch (config->type) {
case SOF_DAI_INTEL_SSP:
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/ipc/ipc3/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ LOG_MODULE_DECLARE(ipc, CONFIG_SOF_LOG_LEVEL);
int ___ret; \
if (rx_size > tx->size) { \
___ret = memcpy_s(rx, rx_size, tx, tx->size); \
assert(!___ret); \
__ASSERT_NO_MSG(!___ret); \
bzero((char *)rx + tx->size, rx_size - tx->size);\
tr_dbg(&ipc_tr, "ipc: hdr 0x%x rx (%zu) > tx (%d)",\
rx->cmd, rx_size, tx->size); \
} else if (tx->size > rx_size) { \
___ret = memcpy_s(rx, rx_size, tx, rx_size); \
assert(!___ret); \
__ASSERT_NO_MSG(!___ret); \
tr_warn(&ipc_tr, "ipc: hdr 0x%x tx (%d) > rx (%zu)",\
rx->cmd, tx->size, rx_size); \
} else { \
___ret = memcpy_s(rx, rx_size, tx, rx_size); \
assert(!___ret); \
__ASSERT_NO_MSG(!___ret); \
} \
} while (0)

Expand Down
4 changes: 2 additions & 2 deletions src/kernel/ipc/ipc4/handler-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static inline void ipc4_send_reply(struct ipc4_message_reply *reply)
/* copy the extension from the message reply */
reply->extension.dat = msg_reply.extension;
ret = memcpy_s(ipc->comp_data, sizeof(*reply), reply, sizeof(*reply));
assert(!ret);
__ASSERT_NO_MSG(!ret);
}
#else /* CONFIG_LIBRARY */
static inline struct ipc4_message_request *ipc4_get_message_request(void)
Expand Down Expand Up @@ -339,7 +339,7 @@ __cold static int ipc4_module_process_d0ix(struct ipc4_message_request *ipc4)
__cold static void ipc_sec_core_sync_boot(uint32_t core_id)
{
#ifdef CONFIG_SOF_USERSPACE_LL
assert(core_id != PLATFORM_PRIMARY_CORE_ID);
__ASSERT_NO_MSG(core_id != PLATFORM_PRIMARY_CORE_ID);

ipc_user_wait_core_init(core_id);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/ipc/ipc4/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool z_impl_send_resource_notif(uint32_t resource_id, uint32_t event_type,
* Using a data type that is not included in the event_data union.
* Return true to prevent an infinite re-try loop in non-debug builds
*/
assert(false);
__ASSERT_NO_MSG(false);
return true;
}
}
Expand Down
Loading