Skip to content

Commit b7734d2

Browse files
povergoingcfriedt
authored andcommitted
tests: ztests: error_hook: Fix for Armv8R aarch64
Fix the trigger_fault_access. The fix is similar to cortex m. Fix the trigger_fault_divide_zero. The fix is similar to qemu, i.e. skip this testcase, because FVP would not trigger the exception for dividing zero either. Signed-off-by: Jaxson Han <[email protected]>
1 parent 27ed237 commit b7734d2

File tree

1 file changed

+4
-2
lines changed
  • tests/ztest/error_hook/src

1 file changed

+4
-2
lines changed

tests/ztest/error_hook/src/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ __no_optimization static void trigger_fault_access(void)
6666
* address instead to trigger exception. See issue #31419.
6767
*/
6868
void *a = (void *)0xFFFFFFFF;
69-
#elif defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R)
69+
#elif defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R) || \
70+
defined(CONFIG_CPU_AARCH64_CORTEX_R)
7071
/* As this test case only runs when User Mode is enabled,
7172
* accessing _current always triggers a memory access fault,
7273
* and is guaranteed not to trigger SecureFault exceptions.
@@ -118,7 +119,8 @@ __no_optimization static void trigger_fault_divide_zero(void)
118119
(defined(CONFIG_SOC_SERIES_MPS3) && defined(CONFIG_QEMU_TARGET)) || \
119120
defined(CONFIG_BOARD_QEMU_CORTEX_A53) || defined(CONFIG_SOC_QEMU_ARC) || \
120121
defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) || \
121-
defined(CONFIG_BOARD_QEMU_CORTEX_R5)
122+
defined(CONFIG_BOARD_QEMU_CORTEX_R5) || \
123+
defined(CONFIG_BOARD_FVP_BASER_AEMV8R)
122124
ztest_test_skip();
123125
#endif
124126
}

0 commit comments

Comments
 (0)