test: error_hook: fix trigger_fault_access for em_starterkit board

em_starterkit has ICCM at 0x0 address, access to 0x0
address doesn't generate any exception, so we access
to 0xFFFFFFFF address instead to trigger exception.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
This commit is contained in:
Watson Zeng 2021-04-26 11:09:19 +08:00 committed by Ioannis Glaropoulos
commit 71a95e8d5a

View file

@ -51,11 +51,11 @@ static void trigger_fault_illegal_instruction(void)
static void trigger_fault_access(void) static void trigger_fault_access(void)
{ {
#if defined(CONFIG_SOC_ARC_IOT) || defined(CONFIG_SOC_NSIM) #if defined(CONFIG_SOC_ARC_IOT) || defined(CONFIG_SOC_NSIM) || defined(CONFIG_SOC_EMSK)
/* For iotdk and ARC/nSIM, nSIM simulates full address space of memory, /* For iotdk, em_starterkit and ARC/nSIM, nSIM simulates full address space of
* so all accesses outside of CCMs are valid and access to 0x0 address * memory, iotdk has eflash at 0x0 address, em_starterkit has ICCM at 0x0 address,
* doesn't generate any exception.So we access it 0XFFFFFFFF instead to * access to 0x0 address doesn't generate any exception. So we access to 0XFFFFFFFF
* trigger exception. See issue #31419. * address instead to trigger exception. See issue #31419.
*/ */
void *a = (void *)0xFFFFFFFF; void *a = (void *)0xFFFFFFFF;
#elif defined(CONFIG_CPU_CORTEX_M) #elif defined(CONFIG_CPU_CORTEX_M)