ARMv7M: Adjust implemented priority bit assertions (#665)
Adjust assertions related to the CMSIS __NVIC_PRIO_BITS and FreeRTOS
configPRIO_BITS configuration macros such that these macros specify the
minimum number of implemented priority bits supported by a config
build rather than the exact number of implemented priority bits.
Related to Qemu issue #1122
diff --git a/portable/CCS/ARM_CM3/port.c b/portable/CCS/ARM_CM3/port.c
index ef5fa5b..f3c4e5a 100755
--- a/portable/CCS/ARM_CM3/port.c
+++ b/portable/CCS/ARM_CM3/port.c
@@ -287,19 +287,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/CCS/ARM_CM4F/port.c b/portable/CCS/ARM_CM4F/port.c
index c43cf0e..c675afe 100755
--- a/portable/CCS/ARM_CM4F/port.c
+++ b/portable/CCS/ARM_CM4F/port.c
@@ -306,19 +306,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/GCC/ARM_CM3/port.c b/portable/GCC/ARM_CM3/port.c
index 4aa1f24..9b42eac 100755
--- a/portable/GCC/ARM_CM3/port.c
+++ b/portable/GCC/ARM_CM3/port.c
@@ -330,19 +330,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/GCC/ARM_CM3_MPU/port.c b/portable/GCC/ARM_CM3_MPU/port.c
index e33df01..619f2b0 100755
--- a/portable/GCC/ARM_CM3_MPU/port.c
+++ b/portable/GCC/ARM_CM3_MPU/port.c
@@ -452,21 +452,25 @@
}
#ifdef __NVIC_PRIO_BITS
- {
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
- }
+ {
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
+ }
#endif
#ifdef configPRIO_BITS
- {
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
- }
+ {
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
+ }
#endif
/* Shift the priority group value back to its position within the AIRCR
diff --git a/portable/GCC/ARM_CM4F/port.c b/portable/GCC/ARM_CM4F/port.c
index fd9e6db..88fc76d 100755
--- a/portable/GCC/ARM_CM4F/port.c
+++ b/portable/GCC/ARM_CM4F/port.c
@@ -373,19 +373,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/GCC/ARM_CM4_MPU/port.c b/portable/GCC/ARM_CM4_MPU/port.c
index 1733fd8..ab76ee8 100755
--- a/portable/GCC/ARM_CM4_MPU/port.c
+++ b/portable/GCC/ARM_CM4_MPU/port.c
@@ -495,21 +495,25 @@
}
#ifdef __NVIC_PRIO_BITS
- {
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
- }
+ {
+ /*
+ * Check that the number of implemented priority bits queried
+ * from hardware is at least as many as specified in the
+ * CMSIS __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
+ }
#endif
#ifdef configPRIO_BITS
- {
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
- }
+ {
+ /*
+ * Check that the number of implemented priority bits queried
+ * from hardware is at least as many as specified in the
+ * FreeRTOS configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
+ }
#endif
/* Shift the priority group value back to its position within the AIRCR
diff --git a/portable/GCC/ARM_CM7/r0p1/port.c b/portable/GCC/ARM_CM7/r0p1/port.c
index 316dba1..2be4f27 100755
--- a/portable/GCC/ARM_CM7/r0p1/port.c
+++ b/portable/GCC/ARM_CM7/r0p1/port.c
@@ -361,19 +361,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/IAR/ARM_CM3/port.c b/portable/IAR/ARM_CM3/port.c
index f1c78e4..d54c3ac 100755
--- a/portable/IAR/ARM_CM3/port.c
+++ b/portable/IAR/ARM_CM3/port.c
@@ -279,19 +279,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/IAR/ARM_CM4F/port.c b/portable/IAR/ARM_CM4F/port.c
index 05d5be0..e0deaf1 100755
--- a/portable/IAR/ARM_CM4F/port.c
+++ b/portable/IAR/ARM_CM4F/port.c
@@ -317,19 +317,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/IAR/ARM_CM4F_MPU/port.c b/portable/IAR/ARM_CM4F_MPU/port.c
index 69b7bc5..1b7cca6 100755
--- a/portable/IAR/ARM_CM4F_MPU/port.c
+++ b/portable/IAR/ARM_CM4F_MPU/port.c
@@ -431,19 +431,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/IAR/ARM_CM7/r0p1/port.c b/portable/IAR/ARM_CM7/r0p1/port.c
index 9217653..63f8399 100755
--- a/portable/IAR/ARM_CM7/r0p1/port.c
+++ b/portable/IAR/ARM_CM7/r0p1/port.c
@@ -305,19 +305,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/MikroC/ARM_CM4F/port.c b/portable/MikroC/ARM_CM4F/port.c
index 1936de1..8ef593f 100755
--- a/portable/MikroC/ARM_CM4F/port.c
+++ b/portable/MikroC/ARM_CM4F/port.c
@@ -367,19 +367,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/RVDS/ARM_CM3/port.c b/portable/RVDS/ARM_CM3/port.c
index 2ffdd9c..ae7ce37 100755
--- a/portable/RVDS/ARM_CM3/port.c
+++ b/portable/RVDS/ARM_CM3/port.c
@@ -332,19 +332,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/RVDS/ARM_CM4F/port.c b/portable/RVDS/ARM_CM4F/port.c
index bf2fb86..cb003aa 100755
--- a/portable/RVDS/ARM_CM4F/port.c
+++ b/portable/RVDS/ARM_CM4F/port.c
@@ -398,19 +398,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/RVDS/ARM_CM4_MPU/port.c b/portable/RVDS/ARM_CM4_MPU/port.c
index e0bd8c8..13e2f8a 100755
--- a/portable/RVDS/ARM_CM4_MPU/port.c
+++ b/portable/RVDS/ARM_CM4_MPU/port.c
@@ -491,19 +491,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif
diff --git a/portable/RVDS/ARM_CM7/r0p1/port.c b/portable/RVDS/ARM_CM7/r0p1/port.c
index 2e81e32..1df54ab 100755
--- a/portable/RVDS/ARM_CM7/r0p1/port.c
+++ b/portable/RVDS/ARM_CM7/r0p1/port.c
@@ -382,19 +382,23 @@
#ifdef __NVIC_PRIO_BITS
{
- /* Check the CMSIS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the CMSIS
+ * __NVIC_PRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif
#ifdef configPRIO_BITS
{
- /* Check the FreeRTOS configuration that defines the number of
- * priority bits matches the number of priority bits actually queried
- * from the hardware. */
- configASSERT( ulImplementedPrioBits == configPRIO_BITS );
+ /*
+ * Check that the number of implemented priority bits queried from
+ * hardware is at least as many as specified in the FreeRTOS
+ * configPRIO_BITS configuration macro.
+ */
+ configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif