aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC/ARMCMx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-30 14:23:37 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-30 14:23:37 +0000
commit64403d8f188725bc5814813371382bc148956a83 (patch)
treed6bdfcc69266e383071e50645a1ecee3e08df786 /os/ports/GCC/ARMCMx
parent9cd24294b8b5c32af4f64762eb99868b1a5c7b75 (diff)
downloadChibiOS-64403d8f188725bc5814813371382bc148956a83.tar.gz
ChibiOS-64403d8f188725bc5814813371382bc148956a83.tar.bz2
ChibiOS-64403d8f188725bc5814813371382bc148956a83.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6048 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports/GCC/ARMCMx')
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v7m.c6
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v7m.h10
2 files changed, 14 insertions, 2 deletions
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c
index bb099e50c..821f2403e 100644
--- a/os/ports/GCC/ARMCMx/chcore_v7m.c
+++ b/os/ports/GCC/ARMCMx/chcore_v7m.c
@@ -62,9 +62,9 @@ CH_IRQ_HANDLER(SysTickVector) {
CH_IRQ_PROLOGUE();
- chSysLockFromIsr();
+ chSysLockFromISR();
chSysTimerHandlerI();
- chSysUnlockFromIsr();
+ chSysUnlockFromISR();
CH_IRQ_EPILOGUE();
}
@@ -191,9 +191,11 @@ __attribute__((naked))
#endif
void _port_switch_from_isr(void) {
+ _stats_start_measure_crit_thd();
dbg_check_lock();
chSchDoReschedule();
dbg_check_unlock();
+ _stats_stop_measure_crit_thd();
asm volatile ("_port_exit_from_isr:" : : : "memory");
#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
asm volatile ("svc #0");
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h
index 6cd461408..b9b30dad2 100644
--- a/os/ports/GCC/ARMCMx/chcore_v7m.h
+++ b/os/ports/GCC/ARMCMx/chcore_v7m.h
@@ -421,6 +421,10 @@ static inline void port_init(void) {
SCB_VTOR = CORTEX_VTOR_INIT;
SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(CORTEX_PRIGROUP_INIT);
+ /* DWT cycle counter enable.*/
+ SCS_DEMCR |= SCS_DEMCR_TRCENA;
+ DWT_CTRL |= DWT_CTRL_CYCCNTENA;
+
/* Initialization of the system vectors used by the port.*/
nvicSetSystemHandlerPriority(HANDLER_SVCALL,
CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL));
@@ -595,6 +599,12 @@ static inline void port_wait_for_interrupt(void) {
#endif
}
+
+static inline rtcnt_t port_rt_get_counter_value(void) {
+
+ return DWT_CYCCNT;
+}
+
#endif /* _FROM_ASM_ */
#endif /* _CHCORE_V7M_H_ */