diff options
Diffstat (limited to 'os/rt/ports/ARMCMx/compilers/IAR')
-rw-r--r-- | os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v6m.s | 102 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v7m.s | 84 |
2 files changed, 103 insertions, 83 deletions
diff --git a/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v6m.s b/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v6m.s index 81f61214a..d2f233fb5 100644 --- a/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v6m.s +++ b/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v6m.s @@ -40,90 +40,100 @@ #if !defined(__DOXYGEN__)
- MODULE ?chcoreasm_v6m
+ MODULE ?chcoreasm_v6m
- AAPCS INTERWORK, VFP_COMPATIBLE
- PRESERVE8
+ AAPCS INTERWORK, VFP_COMPATIBLE
+ PRESERVE8
CONTEXT_OFFSET SET 12
SCB_ICSR SET 0xE000ED04
- SECTION .text:CODE:NOROOT(2)
+ SECTION .text:CODE:NOROOT(2)
- EXTERN chThdExit
- EXTERN chSchDoReschedule
+ EXTERN chThdExit
+ EXTERN chSchDoReschedule
+#if CH_DBG_STATISTICS
+ EXTERN _stats_start_measure_crit_thd
+ EXTERN _stats_stop_measure_crit_thd
+#endif
#if CH_DBG_SYSTEM_STATE_CHECK
- EXTERN dbg_check_unlock
- EXTERN dbg_check_lock
+ EXTERN _dbg_check_unlock
+ EXTERN _dbg_check_lock
#endif
- THUMB
+ THUMB
/*
* Performs a context switch between two threads.
*/
- PUBLIC _port_switch
+ PUBLIC _port_switch
_port_switch:
- push {r4, r5, r6, r7, lr}
- mov r4, r8
- mov r5, r9
- mov r6, r10
- mov r7, r11
- push {r4, r5, r6, r7}
- mov r3, sp
- str r3, [r1, #CONTEXT_OFFSET]
- ldr r3, [r0, #CONTEXT_OFFSET]
- mov sp, r3
- pop {r4, r5, r6, r7}
- mov r8, r4
- mov r9, r5
- mov r10, r6
- mov r11, r7
- pop {r4, r5, r6, r7, pc}
+ push {r4, r5, r6, r7, lr}
+ mov r4, r8
+ mov r5, r9
+ mov r6, r10
+ mov r7, r11
+ push {r4, r5, r6, r7}
+ mov r3, sp
+ str r3, [r1, #CONTEXT_OFFSET]
+ ldr r3, [r0, #CONTEXT_OFFSET]
+ mov sp, r3
+ pop {r4, r5, r6, r7}
+ mov r8, r4
+ mov r9, r5
+ mov r10, r6
+ mov r11, r7
+ pop {r4, r5, r6, r7, pc}
/*
* Start a thread by invoking its work function.
* If the work function returns @p chThdExit() is automatically invoked.
*/
- PUBLIC _port_thread_start
+ PUBLIC _port_thread_start
_port_thread_start:
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock
+ bl _dbg_check_unlock
#endif
- cpsie i
- mov r0, r5
- blx r4
- bl chThdExit
+ cpsie i
+ mov r0, r5
+ blx r4
+ bl chThdExit
/*
* Post-IRQ switch code.
* Exception handlers return here for context switching.
*/
- PUBLIC _port_switch_from_isr
- PUBLIC _port_exit_from_isr
+ PUBLIC _port_switch_from_isr
+ PUBLIC _port_exit_from_isr
_port_switch_from_isr:
+#if CH_DBG_STATISTICS
+ bl _stats_start_measure_crit_thd
+#endif
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_lock
+ bl _dbg_check_lock
#endif
- bl chSchDoReschedule
+ bl chSchDoReschedule
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock
+ bl _dbg_check_unlock
+#endif
+#if CH_DBG_STATISTICS
+ bl _stats_stop_measure_crit_thd
#endif
_port_exit_from_isr:
- ldr r2, =SCB_ICSR
- movs r3, #128
+ ldr r2, =SCB_ICSR
+ movs r3, #128
#if CORTEX_ALTERNATE_SWITCH
- lsls r3, r3, #21
- str r3, [r2, #0]
- cpsie i
+ lsls r3, r3, #21
+ str r3, [r2, #0]
+ cpsie i
#else
- lsls r3, r3, #24
- str r3, [r2, #0]
+ lsls r3, r3, #24
+ str r3, [r2, #0]
#endif
waithere:
- b waithere
+ b waithere
- END
+ END
#endif /* !defined(__DOXYGEN__) */
diff --git a/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v7m.s b/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v7m.s index 6a83a8f3d..90f9f8c76 100644 --- a/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v7m.s +++ b/os/rt/ports/ARMCMx/compilers/IAR/chcoreasm_v7m.s @@ -40,88 +40,98 @@ #if !defined(__DOXYGEN__)
- MODULE ?chcoreasm_v7m
+ MODULE ?chcoreasm_v7m
- AAPCS INTERWORK, VFP_COMPATIBLE
- PRESERVE8
+ AAPCS INTERWORK, VFP_COMPATIBLE
+ PRESERVE8
CONTEXT_OFFSET SET 12
SCB_ICSR SET 0xE000ED04
ICSR_PENDSVSET SET 0x10000000
- SECTION .text:CODE:NOROOT(2)
+ SECTION .text:CODE:NOROOT(2)
- EXTERN chThdExit
- EXTERN chSchDoReschedule
+ EXTERN chThdExit
+ EXTERN chSchDoReschedule
+#if CH_DBG_STATISTICS
+ EXTERN _stats_start_measure_crit_thd
+ EXTERN _stats_stop_measure_crit_thd
+#endif
#if CH_DBG_SYSTEM_STATE_CHECK
- EXTERN dbg_check_unlock
- EXTERN dbg_check_lock
+ EXTERN _dbg_check_unlock
+ EXTERN _dbg_check_lock
#endif
- THUMB
+ THUMB
/*
* Performs a context switch between two threads.
*/
- PUBLIC _port_switch
+ PUBLIC _port_switch
_port_switch:
- push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
+ push {r4, r5, r6, r7, r8, r9, r10, r11, lr}
#if CORTEX_USE_FPU
- vpush {s16-s31}
+ vpush {s16-s31}
#endif
- str sp, [r1, #CONTEXT_OFFSET]
- ldr sp, [r0, #CONTEXT_OFFSET]
+ str sp, [r1, #CONTEXT_OFFSET]
+ ldr sp, [r0, #CONTEXT_OFFSET]
#if CORTEX_USE_FPU
- vpop {s16-s31}
+ vpop {s16-s31}
#endif
- pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
+ pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}
/*
* Start a thread by invoking its work function.
* If the work function returns @p chThdExit() is automatically invoked.
*/
- PUBLIC _port_thread_start
+ PUBLIC _port_thread_start
_port_thread_start:
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock
+ bl _dbg_check_unlock
#endif
#if CORTEX_SIMPLIFIED_PRIORITY
- cpsie i
+ cpsie i
#else
- movs r3, #CORTEX_BASEPRI_DISABLED
- msr BASEPRI, r3
+ movs r3, #CORTEX_BASEPRI_DISABLED
+ msr BASEPRI, r3
#endif
- mov r0, r5
- blx r4
- bl chThdExit
+ mov r0, r5
+ blx r4
+ bl chThdExit
/*
* Post-IRQ switch code.
* Exception handlers return here for context switching.
*/
- PUBLIC _port_switch_from_isr
- PUBLIC _port_exit_from_isr
+ PUBLIC _port_switch_from_isr
+ PUBLIC _port_exit_from_isr
_port_switch_from_isr:
+#if CH_DBG_STATISTICS
+ bl _stats_start_measure_crit_thd
+#endif
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_lock
+ bl _dbg_check_lock
#endif
- bl chSchDoReschedule
+ bl chSchDoReschedule
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock
+ bl _dbg_check_unlock
+#endif
+#if CH_DBG_STATISTICS
+ bl _stats_stop_measure_crit_thd
#endif
_port_exit_from_isr:
#if CORTEX_SIMPLIFIED_PRIORITY
- mov r3, #LWRD SCB_ICSR
- movt r3, #HWRD SCB_ICSR
- mov r2, #ICSR_PENDSVSET
- str r2, [r3]
- cpsie i
-.L3: b .L3
+ mov r3, #LWRD SCB_ICSR
+ movt r3, #HWRD SCB_ICSR
+ mov r2, #ICSR_PENDSVSET
+ str r2, [r3]
+ cpsie i
#else
- svc #0
+ svc #0
#endif
+.L3: b .L3
- END
+ END
#endif /* !defined(__DOXYGEN__) */
|