Skip to content

Commit c9332f8

Browse files
committed
Remove __NVIC_PRIO_BITS and configPRIO_BITS check in ARMv8
* Remove __NVIC_PRIO_BITS and configPRIO_BITS check in ARMv8. * Add hardware not implemented bits check. These bits should be zero.
1 parent 13f418e commit c9332f8

File tree

21 files changed

+147
-609
lines changed

21 files changed

+147
-609
lines changed

portable/ARMv8M/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM23/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM23_NTZ/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM33/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM33_NTZ/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM35P/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM35P_NTZ/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

portable/GCC/ARM_CM55/non_secure/port.c

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,13 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11281128
* See https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */
11291129
configASSERT( ucMaxSysCallPriority );
11301130

1131+
/* Check if the bits hardware does not implement are zero in configMAX_SYSCALL_INTERRUPT_PRIORITY.
1132+
* Assertion here helps inform that the configuration is not set to hardware
1133+
* as expected, although hardware ignores these bits. Possible reason here is
1134+
* that __NVIC_PRIO_BITS or configPRIO_BITS is set greater than hardware
1135+
* implemented bits. */
1136+
configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY & ( ~ucMaxPriorityValue ) ) == 0U );
1137+
11311138
/* Calculate the maximum acceptable priority group value for the number
11321139
* of bits read back. */
11331140

@@ -1164,35 +1171,6 @@ BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
11641171
ulMaxPRIGROUPValue = portMAX_PRIGROUP_BITS - ulImplementedPrioBits;
11651172
}
11661173

1167-
/* The interrupt priority bits are not modelled in QEMU and the assert that
1168-
* checks the number of implemented bits and __NVIC_PRIO_BITS will always fail.
1169-
* Therefore, this assert is not adding any value for QEMU targets. The config
1170-
* option `configDISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
1171-
* `FreeRTOSConfig.h` for QEMU targets. */
1172-
#ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK
1173-
{
1174-
#ifdef __NVIC_PRIO_BITS
1175-
{
1176-
/*
1177-
* Check that the number of implemented priority bits queried from
1178-
* hardware is equal to the CMSIS __NVIC_PRIO_BITS configuration macro.
1179-
*/
1180-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
1181-
}
1182-
#endif /* __NVIC_PRIO_BITS */
1183-
1184-
#ifdef configPRIO_BITS
1185-
{
1186-
/*
1187-
* Check that the number of implemented priority bits queried from
1188-
* hardware is equal to the FreeRTOS configPRIO_BITS configuration macro.
1189-
*/
1190-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
1191-
}
1192-
#endif /* configPRIO_BITS */
1193-
}
1194-
#endif /* #ifndef configDISABLE_INTERRUPT_PRIO_BITS_CHECK */
1195-
11961174
/* Shift the priority group value back to its position within the AIRCR
11971175
* register. */
11981176
ulMaxPRIGROUPValue <<= portPRIGROUP_SHIFT;

0 commit comments

Comments
 (0)