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 <bbolen@lexmark.com>
This commit is contained in:
Bradley Bolen 2021-05-10 12:54:51 -04:00 committed by Christopher Friedt
parent 3c160ec53e
commit 4b1d808456
1 changed files with 1 additions and 1 deletions

View File

@ -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.