]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/ThirdParty/GCC/Xtensa_ESP32/xtensa_vectors.S
ESP GCC port -- Added LoadStore Exception handlers.
[freertos] / FreeRTOS / Source / portable / ThirdParty / GCC / Xtensa_ESP32 / xtensa_vectors.S
index 4ae14d5c65049221cba76ec361ecc8b237a2e7c7..5c8601d1c7e086ba89acb44861c43c7bb7096f63 100644 (file)
@@ -581,6 +581,11 @@ _UserExceptionVector:
 --------------------------------------------------------------------------------\r
 */\r
 \r
+#ifdef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY\r
+    .global   LoadStoreErrorHandler\r
+    .global   AlignmentErrorHandler\r
+#endif\r
+\r
     .section .iram1,"ax"\r
 \r
     #if XCHAL_HAVE_WINDOWED\r
@@ -602,6 +607,20 @@ _xt_to_coproc_exc:
     /* never returns here - call0 is used as a jump (see note at top) */\r
     #endif\r
 \r
+#ifdef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY\r
+    .align      4\r
+_call_loadstore_handler:\r
+    call0   LoadStoreErrorHandler\r
+    /* This will return only if wrong opcode or address out of range*/\r
+    j       .LS_exit\r
+\r
+    .align      4\r
+_call_alignment_handler:\r
+    call0   AlignmentErrorHandler\r
+    /* This will return only if wrong opcode or address out of range*/\r
+    addi    a0, a0, 1\r
+    j       .LS_exit\r
+#endif\r
 \r
 /*\r
 --------------------------------------------------------------------------------\r
@@ -631,6 +650,15 @@ _xt_user_exc:
     #endif\r
     beqi    a0, EXCCAUSE_SYSCALL, _xt_to_syscall_exc\r
 \r
+#ifdef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY\r
+    beqi    a0, EXCCAUSE_LOAD_STORE_ERROR, _call_loadstore_handler\r
+\r
+    addi    a0, a0, -1\r
+    beqi    a0, 8, _call_alignment_handler\r
+    addi    a0, a0, 1\r
+.LS_exit:\r
+#endif\r
+\r
     /* Handle all other exceptions. All can have user-defined handlers. */\r
     /* NOTE: we'll stay on the user stack for exception handling.       */\r
 \r