From 4b1d80845676a15cd5085fe2fa259e34aefa6a6d Mon Sep 17 00:00:00 2001 From: Bradley Bolen Date: Mon, 10 May 2021 12:54:51 -0400 Subject: [PATCH] tests: error_hook: Fix trigger_fault_access for Cortex-R The Cortex-R platforms may no use XIP which means userspace code with have read and execute access to some of the RAM so that it can execute code. However, userspace will not have access the the protected read/write parts of RAM so it is safe to use the Cortex-M version of trigger_fault_access for this test. Signed-off-by: Bradley Bolen --- tests/ztest/error_hook/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ztest/error_hook/src/main.c b/tests/ztest/error_hook/src/main.c index 226e0f326af..696aa8cbddb 100644 --- a/tests/ztest/error_hook/src/main.c +++ b/tests/ztest/error_hook/src/main.c @@ -66,7 +66,7 @@ __no_optimization static void trigger_fault_access(void) * address instead to trigger exception. See issue #31419. */ void *a = (void *)0xFFFFFFFF; -#elif defined(CONFIG_CPU_CORTEX_M) +#elif defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R) /* As this test case only runs when User Mode is enabled, * accessing _current always triggers a memory access fault, * and is guaranteed not to trigger SecureFault exceptions.