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
This commit is contained in:
Paul Bartell 2023-04-19 22:24:54 -07:00 committed by GitHub
parent aa987a3443
commit 686b6e62eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 200 additions and 136 deletions

View file

@ -287,19 +287,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -306,19 +306,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -330,19 +330,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -452,21 +452,25 @@ BaseType_t xPortStartScheduler( void )
} }
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
} */
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
} */
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif #endif
/* Shift the priority group value back to its position within the AIRCR /* Shift the priority group value back to its position within the AIRCR

View file

@ -373,19 +373,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -495,21 +495,25 @@ BaseType_t xPortStartScheduler( void )
} }
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried
* from the hardware. */ * from hardware is at least as many as specified in the
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * CMSIS __NVIC_PRIO_BITS configuration macro.
} */
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
}
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried
* from the hardware. */ * from hardware is at least as many as specified in the
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * FreeRTOS configPRIO_BITS configuration macro.
} */
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
}
#endif #endif
/* Shift the priority group value back to its position within the AIRCR /* Shift the priority group value back to its position within the AIRCR

View file

@ -361,19 +361,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -279,19 +279,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -317,19 +317,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -431,19 +431,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -305,19 +305,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -367,19 +367,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -332,19 +332,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -398,19 +398,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -491,19 +491,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif

View file

@ -382,19 +382,23 @@ BaseType_t xPortStartScheduler( void )
#ifdef __NVIC_PRIO_BITS #ifdef __NVIC_PRIO_BITS
{ {
/* Check the CMSIS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the CMSIS
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS ); * __NVIC_PRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
} }
#endif #endif
#ifdef configPRIO_BITS #ifdef configPRIO_BITS
{ {
/* Check the FreeRTOS configuration that defines the number of /*
* priority bits matches the number of priority bits actually queried * Check that the number of implemented priority bits queried from
* from the hardware. */ * hardware is at least as many as specified in the FreeRTOS
configASSERT( ulImplementedPrioBits == configPRIO_BITS ); * configPRIO_BITS configuration macro.
*/
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
} }
#endif #endif