tests: arch arm: runtime nmi testing with dcache for ARM V7

For ARMV7 devices, use preferably the sys_cache_data_flush_all
function to flush the data cache

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2024-03-06 12:14:59 +01:00 committed by Carles Cufí
commit 9023c27913

View file

@ -12,6 +12,7 @@
#include <zephyr/arch/arm/nmi.h> #include <zephyr/arch/arm/nmi.h>
#include <zephyr/ztest.h> #include <zephyr/ztest.h>
#include <zephyr/tc_util.h> #include <zephyr/tc_util.h>
#include <zephyr/cache.h>
/* on v8m arch the nmi pend bit is renamed to pend nmi map it to old name */ /* on v8m arch the nmi pend bit is renamed to pend nmi map it to old name */
#ifndef SCB_ICSR_NMIPENDSET_Msk #ifndef SCB_ICSR_NMIPENDSET_Msk
@ -67,7 +68,7 @@ ZTEST(arm_runtime_nmi_fn, test_arm_runtime_nmi)
#ifdef ARM_CACHEL1_ARMV7_H #ifdef ARM_CACHEL1_ARMV7_H
/* Flush Data Cache now if enabled */ /* Flush Data Cache now if enabled */
if (IS_ENABLED(CONFIG_DCACHE)) { if (IS_ENABLED(CONFIG_DCACHE)) {
SCB_CleanDCache(); sys_cache_data_flush_all();
} }
#endif /* ARM_CACHEL1_ARMV7_H */ #endif /* ARM_CACHEL1_ARMV7_H */
zassert_true(nmi_triggered, "Isr not triggered!\n"); zassert_true(nmi_triggered, "Isr not triggered!\n");