From 775d11a2cbe478778da45927e301426350fb9c52 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 28 Mar 2023 21:07:23 +0000 Subject: [PATCH] idc: call cache function z_xtensa_cache_flush directly Do not use intermediate macro SOC_DCACHE_FLUSH from Zephyr, use cache function instead. SOC_DCACHE_FLUSH will be removed from zephyr. Signed-off-by: Anas Nashif --- src/idc/zephyr_idc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/idc/zephyr_idc.c b/src/idc/zephyr_idc.c index 769e1a32d4ca..ba34df7d46ba 100644 --- a/src/idc/zephyr_idc.c +++ b/src/idc/zephyr_idc.c @@ -29,6 +29,9 @@ #include #include #include +#if defined(CONFIG_ARCH_XTENSA) && !defined(CONFIG_KERNEL_COHERENCE) +#include +#endif /* * Inter-CPU communication is only used in @@ -62,7 +65,7 @@ static void idc_handler(struct k_p4wq_work *work) int payload = -1; k_spinlock_key_t key; - SOC_DCACHE_INVALIDATE(msg, sizeof(*msg)); + z_xtensa_cache_flush(msg, sizeof(*msg)); if (msg->size == sizeof(int)) { const int idc_handler_memcpy_err __unused = @@ -122,13 +125,13 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode) msg->payload, msg->size); assert(!idc_send_memcpy_err); - SOC_DCACHE_FLUSH(payload->data, MIN(sizeof(payload->data), msg->size)); + z_xtensa_cache_flush(payload->data, MIN(sizeof(payload->data), msg->size)); } /* Temporarily store sender core ID */ msg_cp->core = cpu_get_id(); - SOC_DCACHE_FLUSH(msg_cp, sizeof(*msg_cp)); + z_xtensa_cache_flush(msg_cp, sizeof(*msg_cp)); k_p4wq_submit(q_zephyr_idc + target_cpu, work); switch (mode) {