aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-27 09:51:45 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-27 09:51:45 +0000
commit25c944f87f69c46efe23e998152c9c48365e51b0 (patch)
tree5ca6c4694122ba4996c812394cf45809b097ac12 /os/rt/include
parent6cc7199329fa18b0f2a2110c686b71c2d5ea556e (diff)
downloadChibiOS-25c944f87f69c46efe23e998152c9c48365e51b0.tar.gz
ChibiOS-25c944f87f69c46efe23e998152c9c48365e51b0.tar.bz2
ChibiOS-25c944f87f69c46efe23e998152c9c48365e51b0.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7816 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chsys.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h
index 888e98b5c..9d1bff204 100644
--- a/os/rt/include/chsys.h
+++ b/os/rt/include/chsys.h
@@ -64,6 +64,42 @@
* @name ISRs abstraction macros
*/
/**
+ * @brief Priority level validation macro.
+ * @details This macro determines if the passed value is a valid priority
+ * level for the underlying architecture.
+ *
+ * @param[in] prio the priority level
+ * @return Priority range result.
+ * @false if the priority is invalid or if the architecture
+ * does not support priorities.
+ * @true if the priority is valid.
+ */
+#if defined(PORT_IRQ_IS_VALID_PRIORITY) || defined(__DOXYGEN__)
+#define CH_IRQ_IS_VALID_PRIORITY(prio) \
+ PORT_IRQ_IS_VALID_PRIORITY(prio)
+#else
+#define CH_IRQ_IS_VALID_PRIORITY(prio) false
+#endif
+
+/**
+ * @brief Priority level validation macro.
+ * @details This macro determines if the passed value is a valid priority
+ * level that cannot preempt the kernel critical zone.
+ *
+ * @param[in] prio the priority level
+ * @return Priority range result.
+ * @false if the priority is invalid or if the architecture
+ * does not support priorities.
+ * @true if the priority is valid.
+ */
+#if defined(PORT_IRQ_IS_VALID_KERNEL_PRIORITY) || defined(__DOXYGEN__)
+#define CH_IRQ_IS_VALID_KERNEL_PRIORITY(prio) \
+ PORT_IRQ_IS_VALID_KERNEL_PRIORITY(prio)
+#else
+#define CH_IRQ_IS_VALID_KERNEL_PRIORITY(prio) false
+#endif
+
+/**
* @brief IRQ handler enter code.
* @note Usually IRQ handlers functions are also declared naked.
* @note On some architectures this macro can be empty.