aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/ports
diff options
context:
space:
mode:
authoredolomb <none@example.com>2018-01-10 09:28:25 +0000
committeredolomb <none@example.com>2018-01-10 09:28:25 +0000
commite669bfa7e66f92f65f8f4c66e7eaf4b505b435f6 (patch)
tree52459655de99fc06316f468831a6fa323b14205a /os/common/ports
parent3310b12b3be4483babf13bc95a35e5d3000c1daf (diff)
downloadChibiOS-e669bfa7e66f92f65f8f4c66e7eaf4b505b435f6.tar.gz
ChibiOS-e669bfa7e66f92f65f8f4c66e7eaf4b505b435f6.tar.bz2
ChibiOS-e669bfa7e66f92f65f8f4c66e7eaf4b505b435f6.zip
PORT_SUPPORTS_RT for Cortex-A5 and Cortex-A9
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11245 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/ports')
-rw-r--r--os/common/ports/ARMCAx-TZ/chcore.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/os/common/ports/ARMCAx-TZ/chcore.h b/os/common/ports/ARMCAx-TZ/chcore.h
index ca23c296f..e639ae9f4 100644
--- a/os/common/ports/ARMCAx-TZ/chcore.h
+++ b/os/common/ports/ARMCAx-TZ/chcore.h
@@ -39,7 +39,7 @@
/**
* @brief This port supports a realtime counter.
*/
-#define PORT_SUPPORTS_RT FALSE
+#define PORT_SUPPORTS_RT TRUE
/**
* @brief Natural alignment constant.
@@ -508,6 +508,29 @@ static inline void port_wait_for_interrupt(void) {
asm volatile ("wfi" : : : "memory");
}
+/**
+ * @brief Returns the current value of the realtime counter.
+ *
+ * @return The realtime counter value.
+ */
+static inline rtcnt_t port_rt_get_counter_value(void) {
+
+#if ((ARM_CORE == ARM_CORE_CORTEX_A5) || (ARM_CORE == ARM_CORE_CORTEX_A9) || defined(__DOXYGEN__))
+
+ rtcnt_t cyc;
+
+ __asm volatile("mrc p15, 0, %[p0], c9, c13, 0" : [p0] "=r" (cyc) :);
+
+ return cyc;
+#else
+/*
+ * TODO develop same function for ARM_CORE_CORTEX_A8
+ */
+ return 0;
+
+#endif
+}
+
#if CH_CFG_ST_TIMEDELTA > 0
#if PORT_USE_ALT_TIMER == FALSE
#include "chcore_timer.h"