From 25c944f87f69c46efe23e998152c9c48365e51b0 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Fri, 27 Mar 2015 09:51:45 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7816 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chsys.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'os/rt/include') 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 @@ -63,6 +63,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. -- cgit v1.2.3