aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-05-24 18:31:34 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-05-24 18:31:34 +0000
commit7a6a1679a413987ffa47f2f9892e241f3448f5f0 (patch)
tree88c38d7e249eeedc7b51979486262a0c7619bc0e /os/ports/GCC
parent293eddc33f8957f1bb896ef074bb56bf2ec2f895 (diff)
downloadChibiOS-7a6a1679a413987ffa47f2f9892e241f3448f5f0.tar.gz
ChibiOS-7a6a1679a413987ffa47f2f9892e241f3448f5f0.tar.bz2
ChibiOS-7a6a1679a413987ffa47f2f9892e241f3448f5f0.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4232 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports/GCC')
-rw-r--r--os/ports/GCC/ARMCMx/chcore.h6
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v6m.h9
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v7m.h11
3 files changed, 24 insertions, 2 deletions
diff --git a/os/ports/GCC/ARMCMx/chcore.h b/os/ports/GCC/ARMCMx/chcore.h
index 18ee5a364..ec534fdb2 100644
--- a/os/ports/GCC/ARMCMx/chcore.h
+++ b/os/ports/GCC/ARMCMx/chcore.h
@@ -87,6 +87,12 @@
(((n) >= 0) && ((n) < CORTEX_PRIORITY_LEVELS))
/**
+ * @brief Priority level verification macro.
+ */
+#define CORTEX_IS_VALID_KERNEL_PRIORITY(n) \
+ (((n) >= CORTEX_MAX_KERNEL_PRIORITY) && ((n) < CORTEX_PRIORITY_LEVELS))
+
+/**
* @brief Priority level to priority mask conversion macro.
*/
#define CORTEX_PRIORITY_MASK(n) \
diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.h b/os/ports/GCC/ARMCMx/chcore_v6m.h
index b36e405ea..76bfbf184 100644
--- a/os/ports/GCC/ARMCMx/chcore_v6m.h
+++ b/os/ports/GCC/ARMCMx/chcore_v6m.h
@@ -107,6 +107,15 @@
/* Port derived parameters. */
/*===========================================================================*/
+/**
+ * @brief Maximum usable priority for normal ISRs.
+ */
+#if CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
+#define CORTEX_MAX_KERNEL_PRIORITY 1
+#else
+#define CORTEX_MAX_KERNEL_PRIORITY 0
+#endif
+
/*===========================================================================*/
/* Port exported info. */
/*===========================================================================*/
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.h b/os/ports/GCC/ARMCMx/chcore_v7m.h
index 6fdfd44d6..ea9b8dab5 100644
--- a/os/ports/GCC/ARMCMx/chcore_v7m.h
+++ b/os/ports/GCC/ARMCMx/chcore_v7m.h
@@ -145,14 +145,21 @@
/* Port derived parameters. */
/*===========================================================================*/
+#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
+/**
+ * @brief Maximum usable priority for normal ISRs.
+ */
+#define CORTEX_MAX_KERNEL_PRIORITY (CORTEX_PRIORITY_SVCALL + 1)
+
/**
* @brief BASEPRI level within kernel lock.
* @note In compact kernel mode this constant value is enforced to zero.
*/
-#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
#define CORTEX_BASEPRI_KERNEL \
- CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SVCALL+1)
+ CORTEX_PRIORITY_MASK(CORTEX_MAX_KERNEL_PRIORITY)
#else
+
+#define CORTEX_MAX_KERNEL_PRIORITY 1
#define CORTEX_BASEPRI_KERNEL 0
#endif