You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/03/28 14:52:38 UTC

[incubator-nuttx] 02/02: armv8-m: add wake_func arm_should_generate_nonsecure_busfault

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 0f02791ae68318127877a9db78d03ceb35a92a99
Author: ligd <li...@xiaomi.com>
AuthorDate: Thu Mar 24 21:21:34 2022 +0800

    armv8-m: add wake_func arm_should_generate_nonsecure_busfault
    
    Signed-off-by: ligd <li...@xiaomi.com>
---
 arch/arm/src/armv8-m/arm_securefault.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/armv8-m/arm_securefault.c b/arch/arm/src/armv8-m/arm_securefault.c
index 5183ff9..a06a72b 100644
--- a/arch/arm/src/armv8-m/arm_securefault.c
+++ b/arch/arm/src/armv8-m/arm_securefault.c
@@ -82,6 +82,19 @@ static void generate_nonsecure_busfault(void)
  ****************************************************************************/
 
 /****************************************************************************
+ * 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
  *
  * Description:
@@ -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;
 }