ipc_service: open-amp: Add __ASSERTs on cache alignment
Add some asserts to warn the user about unaligned VDEV status area, VRINGs and buffers. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
parent
9752cbe045
commit
1fcb929108
1 changed files with 9 additions and 0 deletions
|
|
@ -758,6 +758,15 @@ static int backend_init(const struct device *instance)
|
|||
|
||||
data->role = conf->role;
|
||||
|
||||
#if defined(CONFIG_CACHE_MANAGEMENT) && defined(CONFIG_DCACHE)
|
||||
__ASSERT((VDEV_STATUS_SIZE % sys_cache_data_line_size_get()) == 0U,
|
||||
"VDEV status area must be aligned to the cache line");
|
||||
__ASSERT((VRING_ALIGNMENT % sys_cache_data_line_size_get()) == 0U,
|
||||
"Static VRINGs must be aligned to the cache line");
|
||||
__ASSERT((conf->buffer_size % sys_cache_data_line_size_get()) == 0U,
|
||||
"Buffers must be aligned to the cache line ");
|
||||
#endif
|
||||
|
||||
k_mutex_init(&data->rpmsg_inst.mtx);
|
||||
atomic_set(&data->state, STATE_READY);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue