aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC/ARMCMx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-26 10:43:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-26 10:43:49 +0000
commit3f82a81f544b45d82924dc6b080a5c63e9cf7c09 (patch)
tree0a670cb7ec87b742d683a20daf70e06ffdfb71c8 /os/ports/GCC/ARMCMx
parent89e829f55cdbc01646f931039618ae99ed262eaf (diff)
downloadChibiOS-3f82a81f544b45d82924dc6b080a5c63e9cf7c09.tar.gz
ChibiOS-3f82a81f544b45d82924dc6b080a5c63e9cf7c09.tar.bz2
ChibiOS-3f82a81f544b45d82924dc6b080a5c63e9cf7c09.zip
GCC Cortex-Mx ports optimization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3659 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports/GCC/ARMCMx')
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v6m.h17
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v7m.c2
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v7m.h17
3 files changed, 35 insertions, 1 deletions
diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h
index 0997ddeea..34d1ee911 100644
--- a/os/ports/GCC/ARMCMx/chcore_v6m.h
+++ b/os/ports/GCC/ARMCMx/chcore_v6m.h
@@ -349,6 +349,23 @@ struct context {
}
#endif
+/**
+ * @brief Excludes the default @p chSchIsPreemptionRequired()implementation.
+ */
+#define PORT_OPTIMIZED_ISPREEMPTIONREQUIRED
+
+#if (CH_TIME_QUANTUM > 0) || defined(__DOXYGEN__)
+/**
+ * @brief Inlineable version of this kernel function.
+ */
+#define chSchIsPreemptionRequired() \
+ (rlist.r_preempt ? firstprio(&rlist.r_queue) > currp->p_prio : \
+ firstprio(&rlist.r_queue) >= currp->p_prio)
+#else /* CH_TIME_QUANTUM == 0 */
+#define chSchIsPreemptionRequired() \
+ (firstprio(&rlist.r_queue) > currp->p_prio)
+#endif /* CH_TIME_QUANTUM == 0 */
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c
index 437492c90..30ba9c220 100644
--- a/os/ports/GCC/ARMCMx/chcore_v7m.c
+++ b/os/ports/GCC/ARMCMx/chcore_v7m.c
@@ -163,7 +163,7 @@ void _port_unlock(void) {
void _port_irq_epilogue(void) {
port_lock_from_isr();
- if ((SCB_ICSR & ICSR_RETTOBASE)) {
+ if ((SCB_ICSR & ICSR_RETTOBASE) != 0) {
struct extctx *ctxp;
/* Current PSP value.*/
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h
index 86b49a095..7fd763a7d 100644
--- a/os/ports/GCC/ARMCMx/chcore_v7m.h
+++ b/os/ports/GCC/ARMCMx/chcore_v7m.h
@@ -486,6 +486,23 @@ struct context {
}
#endif
+/**
+ * @brief Excludes the default @p chSchIsPreemptionRequired()implementation.
+ */
+#define PORT_OPTIMIZED_ISPREEMPTIONREQUIRED
+
+#if (CH_TIME_QUANTUM > 0) || defined(__DOXYGEN__)
+/**
+ * @brief Inlineable version of this kernel function.
+ */
+#define chSchIsPreemptionRequired() \
+ (rlist.r_preempt ? firstprio(&rlist.r_queue) > currp->p_prio : \
+ firstprio(&rlist.r_queue) >= currp->p_prio)
+#else /* CH_TIME_QUANTUM == 0 */
+#define chSchIsPreemptionRequired() \
+ (firstprio(&rlist.r_queue) > currp->p_prio)
+#endif /* CH_TIME_QUANTUM == 0 */
+
#ifdef __cplusplus
extern "C" {
#endif