diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/ports/GCC/ARM/chcoreasm.s | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/os/ports/GCC/ARM/chcoreasm.s b/os/ports/GCC/ARM/chcoreasm.s index 2266d3f1a..9b65c14b0 100644 --- a/os/ports/GCC/ARM/chcoreasm.s +++ b/os/ports/GCC/ARM/chcoreasm.s @@ -28,6 +28,9 @@ #include "chconf.h"
+#define FALSE 0
+#define TRUE 1
+
#if !defined(__DOXYGEN__)
.set MODE_USR, 0x10
@@ -190,12 +193,24 @@ _port_irq_common: add r0, pc, #1
bx r0
.code 16
+#if CH_DBG_SYSTEM_STATE_CHECK
+ bl dbg_check_lock
+#endif
bl chSchDoReschedule
+#if CH_DBG_SYSTEM_STATE_CHECK
+ bl dbg_check_unlock
+#endif
mov lr, pc
bx lr
.code 32
#else /* !THUMB_NO_INTERWORKING */
+#if CH_DBG_SYSTEM_STATE_CHECK
+ bl dbg_check_lock
+#endif
bl chSchDoReschedule
+#if CH_DBG_SYSTEM_STATE_CHECK
+ bl dbg_check_unlock
+#endif
#endif /* !THUMB_NO_INTERWORKING */
// Re-establish the IRQ conditions again.
@@ -210,12 +225,18 @@ _port_irq_common: /*
* Threads trampoline code.
- * NOTE: The threads always start in ARM mode then switch to the thread-function mode.
+ * NOTE: The threads always start in ARM mode and then switches to the
+ * thread-function mode.
*/
.balign 16
.code 32
.globl _port_thread_start
_port_thread_start:
+#if CH_DBG_SYSTEM_STATE_CHECK
+ mov r0, #0
+ ldr r1, =dbg_lock_cnt
+ str r0, [r1]
+#endif
msr CPSR_c, #MODE_SYS
#ifndef THUMB_NO_INTERWORKING
mov r0, r5
|