diff options
Diffstat (limited to 'os/rt')
-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 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v6m.s | 20 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v7m.s | 22 | ||||
-rw-r--r-- | os/rt/ports/e200/compilers/GCC/ivor.s | 18 |
5 files changed, 146 insertions, 100 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__) */
diff --git a/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v6m.s b/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v6m.s index 15b0fb4c3..0f51ad753 100644 --- a/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v6m.s +++ b/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v6m.s @@ -49,9 +49,13 @@ SCB_ICSR EQU 0xE000ED04 IMPORT chThdExit
IMPORT chSchDoReschedule
+#if CH_DBG_STATISTICS
+ IMPORT _stats_start_measure_crit_thd
+ IMPORT _stats_stop_measure_crit_thd
+#endif
#if CH_DBG_SYSTEM_STATE_CHECK
- IMPORT dbg_check_unlock
- IMPORT dbg_check_lock
+ IMPORT _dbg_check_unlock
+ IMPORT _dbg_check_lock
#endif
/*
@@ -84,7 +88,7 @@ _port_switch PROC EXPORT _port_thread_start
_port_thread_start PROC
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock
+ bl _dbg_check_unlock
#endif
cpsie i
mov r0, r5
@@ -99,12 +103,18 @@ _port_thread_start PROC EXPORT _port_switch_from_isr
EXPORT _port_exit_from_isr
_port_switch_from_isr PROC
+#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
#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
diff --git a/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v7m.s b/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v7m.s index 254624708..ab38d2145 100644 --- a/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v7m.s +++ b/os/rt/ports/ARMCMx/compilers/RVCT/chcoreasm_v7m.s @@ -50,9 +50,13 @@ ICSR_PENDSVSET EQU 0x10000000 IMPORT chThdExit
IMPORT chSchDoReschedule
+#if CH_DBG_STATISTICS
+ IMPORT _stats_start_measure_crit_thd
+ IMPORT _stats_stop_measure_crit_thd
+#endif
#if CH_DBG_SYSTEM_STATE_CHECK
- IMPORT dbg_check_unlock
- IMPORT dbg_check_lock
+ IMPORT _dbg_check_unlock
+ IMPORT _dbg_check_lock
#endif
/*
@@ -79,7 +83,7 @@ _port_switch PROC EXPORT _port_thread_start
_port_thread_start PROC
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock
+ bl _dbg_check_unlock
#endif
#if CORTEX_SIMPLIFIED_PRIORITY
cpsie i
@@ -99,12 +103,18 @@ _port_thread_start PROC EXPORT _port_switch_from_isr
EXPORT _port_exit_from_isr
_port_switch_from_isr PROC
+#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
#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
@@ -113,10 +123,10 @@ _port_exit_from_isr mov r2, #ICSR_PENDSVSET
str r2, [r3, #0]
cpsie i
-waithere b waithere
#else
svc #0
#endif
+waithere b waithere
ENDP
END
diff --git a/os/rt/ports/e200/compilers/GCC/ivor.s b/os/rt/ports/e200/compilers/GCC/ivor.s index ae478b49f..46961816c 100644 --- a/os/rt/ports/e200/compilers/GCC/ivor.s +++ b/os/rt/ports/e200/compilers/GCC/ivor.s @@ -105,14 +105,14 @@ _IVOR10: #endif
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_enter_isr
- bl dbg_check_lock_from_isr
+ bl _dbg_check_enter_isr
+ bl _dbg_check_lock_from_isr
#endif
/* System tick handler invocation.*/
bl chSysTimerHandlerI
#if CH_DBG_SYSTEM_STATE_CHECK
- bl dbg_check_unlock_from_isr
- bl dbg_check_leave_isr
+ bl _dbg_check_unlock_from_isr
+ bl _dbg_check_leave_isr
#endif
#if PPC_USE_IRQ_PREEMPTION
@@ -202,8 +202,11 @@ _ivor_exit: eaddi %r0, %r0, -1
mtspr 272, %r0
+#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 chSchIsPreemptionRequired
cmpli cr0, %r3, 0
@@ -211,7 +214,10 @@ _ivor_exit: bl chSchDoReschedule
.noresch:
#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
/* Restoring the external context.*/
|