Skip to content

Commit

Permalink
armv8-m: add wake_func arm_should_generate_nonsecure_busfault
Browse files Browse the repository at this point in the history
Signed-off-by: ligd <liguiding1@xiaomi.com>
  • Loading branch information
GUIDINGLI committed Mar 25, 2022
1 parent 5bda2f4 commit 0539fbb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions arch/arm/src/armv8-m/arm_securefault.c
Expand Up @@ -81,6 +81,19 @@ static void generate_nonsecure_busfault(void)
* Public Functions
****************************************************************************/

/****************************************************************************
* Name: arm_securefault_should_generate
*
* Description:
* Check whether should generate non-secure IRQ from securefault
*
****************************************************************************/

bool weak_function arm_should_generate_nonsecure_busfault(void)
{
return true;
}

/****************************************************************************
* Name: arm_securefault
*
Expand Down Expand Up @@ -145,11 +158,15 @@ int arm_securefault(int irq, FAR void *context, FAR void *arg)
putreg32(0xff, SAU_SFSR);

#ifdef CONFIG_DEBUG_SECUREFAULT
generate_nonsecure_busfault();
#else
if (arm_should_generate_nonsecure_busfault())
{
generate_nonsecure_busfault();
return OK;
}
#endif

up_irq_save();
PANIC();
#endif

return OK;
}

0 comments on commit 0539fbb

Please sign in to comment.