Skip to content

Commit 686b6e6

Browse files
authored
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
1 parent aa987a3 commit 686b6e6

File tree

16 files changed

+200
-136
lines changed

16 files changed

+200
-136
lines changed

portable/CCS/ARM_CM3/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,19 +287,23 @@ BaseType_t xPortStartScheduler( void )
287287

288288
#ifdef __NVIC_PRIO_BITS
289289
{
290-
/* Check the CMSIS configuration that defines the number of
291-
* priority bits matches the number of priority bits actually queried
292-
* from the hardware. */
293-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
290+
/*
291+
* Check that the number of implemented priority bits queried from
292+
* hardware is at least as many as specified in the CMSIS
293+
* __NVIC_PRIO_BITS configuration macro.
294+
*/
295+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
294296
}
295297
#endif
296298

297299
#ifdef configPRIO_BITS
298300
{
299-
/* Check the FreeRTOS configuration that defines the number of
300-
* priority bits matches the number of priority bits actually queried
301-
* from the hardware. */
302-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
301+
/*
302+
* Check that the number of implemented priority bits queried from
303+
* hardware is at least as many as specified in the FreeRTOS
304+
* configPRIO_BITS configuration macro.
305+
*/
306+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
303307
}
304308
#endif
305309

portable/CCS/ARM_CM4F/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,23 @@ BaseType_t xPortStartScheduler( void )
306306

307307
#ifdef __NVIC_PRIO_BITS
308308
{
309-
/* Check the CMSIS configuration that defines the number of
310-
* priority bits matches the number of priority bits actually queried
311-
* from the hardware. */
312-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
309+
/*
310+
* Check that the number of implemented priority bits queried from
311+
* hardware is at least as many as specified in the CMSIS
312+
* __NVIC_PRIO_BITS configuration macro.
313+
*/
314+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
313315
}
314316
#endif
315317

316318
#ifdef configPRIO_BITS
317319
{
318-
/* Check the FreeRTOS configuration that defines the number of
319-
* priority bits matches the number of priority bits actually queried
320-
* from the hardware. */
321-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
320+
/*
321+
* Check that the number of implemented priority bits queried from
322+
* hardware is at least as many as specified in the FreeRTOS
323+
* configPRIO_BITS configuration macro.
324+
*/
325+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
322326
}
323327
#endif
324328

portable/GCC/ARM_CM3/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,23 @@ BaseType_t xPortStartScheduler( void )
330330

331331
#ifdef __NVIC_PRIO_BITS
332332
{
333-
/* Check the CMSIS configuration that defines the number of
334-
* priority bits matches the number of priority bits actually queried
335-
* from the hardware. */
336-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
333+
/*
334+
* Check that the number of implemented priority bits queried from
335+
* hardware is at least as many as specified in the CMSIS
336+
* __NVIC_PRIO_BITS configuration macro.
337+
*/
338+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
337339
}
338340
#endif
339341

340342
#ifdef configPRIO_BITS
341343
{
342-
/* Check the FreeRTOS configuration that defines the number of
343-
* priority bits matches the number of priority bits actually queried
344-
* from the hardware. */
345-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
344+
/*
345+
* Check that the number of implemented priority bits queried from
346+
* hardware is at least as many as specified in the FreeRTOS
347+
* configPRIO_BITS configuration macro.
348+
*/
349+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
346350
}
347351
#endif
348352

portable/GCC/ARM_CM3_MPU/port.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -452,21 +452,25 @@ BaseType_t xPortStartScheduler( void )
452452
}
453453

454454
#ifdef __NVIC_PRIO_BITS
455-
{
456-
/* Check the CMSIS configuration that defines the number of
457-
* priority bits matches the number of priority bits actually queried
458-
* from the hardware. */
459-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
460-
}
455+
{
456+
/*
457+
* Check that the number of implemented priority bits queried from
458+
* hardware is at least as many as specified in the CMSIS
459+
* __NVIC_PRIO_BITS configuration macro.
460+
*/
461+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
462+
}
461463
#endif
462464

463465
#ifdef configPRIO_BITS
464-
{
465-
/* Check the FreeRTOS configuration that defines the number of
466-
* priority bits matches the number of priority bits actually queried
467-
* from the hardware. */
468-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
469-
}
466+
{
467+
/*
468+
* Check that the number of implemented priority bits queried from
469+
* hardware is at least as many as specified in the FreeRTOS
470+
* configPRIO_BITS configuration macro.
471+
*/
472+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
473+
}
470474
#endif
471475

472476
/* Shift the priority group value back to its position within the AIRCR

portable/GCC/ARM_CM4F/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,19 +373,23 @@ BaseType_t xPortStartScheduler( void )
373373

374374
#ifdef __NVIC_PRIO_BITS
375375
{
376-
/* Check the CMSIS configuration that defines the number of
377-
* priority bits matches the number of priority bits actually queried
378-
* from the hardware. */
379-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
376+
/*
377+
* Check that the number of implemented priority bits queried from
378+
* hardware is at least as many as specified in the CMSIS
379+
* __NVIC_PRIO_BITS configuration macro.
380+
*/
381+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
380382
}
381383
#endif
382384

383385
#ifdef configPRIO_BITS
384386
{
385-
/* Check the FreeRTOS configuration that defines the number of
386-
* priority bits matches the number of priority bits actually queried
387-
* from the hardware. */
388-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
387+
/*
388+
* Check that the number of implemented priority bits queried from
389+
* hardware is at least as many as specified in the FreeRTOS
390+
* configPRIO_BITS configuration macro.
391+
*/
392+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
389393
}
390394
#endif
391395

portable/GCC/ARM_CM4_MPU/port.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -495,21 +495,25 @@ BaseType_t xPortStartScheduler( void )
495495
}
496496

497497
#ifdef __NVIC_PRIO_BITS
498-
{
499-
/* Check the CMSIS configuration that defines the number of
500-
* priority bits matches the number of priority bits actually queried
501-
* from the hardware. */
502-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
503-
}
498+
{
499+
/*
500+
* Check that the number of implemented priority bits queried
501+
* from hardware is at least as many as specified in the
502+
* CMSIS __NVIC_PRIO_BITS configuration macro.
503+
*/
504+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
505+
}
504506
#endif
505507

506508
#ifdef configPRIO_BITS
507-
{
508-
/* Check the FreeRTOS configuration that defines the number of
509-
* priority bits matches the number of priority bits actually queried
510-
* from the hardware. */
511-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
512-
}
509+
{
510+
/*
511+
* Check that the number of implemented priority bits queried
512+
* from hardware is at least as many as specified in the
513+
* FreeRTOS configPRIO_BITS configuration macro.
514+
*/
515+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
516+
}
513517
#endif
514518

515519
/* Shift the priority group value back to its position within the AIRCR

portable/GCC/ARM_CM7/r0p1/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,19 +361,23 @@ BaseType_t xPortStartScheduler( void )
361361

362362
#ifdef __NVIC_PRIO_BITS
363363
{
364-
/* Check the CMSIS configuration that defines the number of
365-
* priority bits matches the number of priority bits actually queried
366-
* from the hardware. */
367-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
364+
/*
365+
* Check that the number of implemented priority bits queried from
366+
* hardware is at least as many as specified in the CMSIS
367+
* __NVIC_PRIO_BITS configuration macro.
368+
*/
369+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
368370
}
369371
#endif
370372

371373
#ifdef configPRIO_BITS
372374
{
373-
/* Check the FreeRTOS configuration that defines the number of
374-
* priority bits matches the number of priority bits actually queried
375-
* from the hardware. */
376-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
375+
/*
376+
* Check that the number of implemented priority bits queried from
377+
* hardware is at least as many as specified in the FreeRTOS
378+
* configPRIO_BITS configuration macro.
379+
*/
380+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
377381
}
378382
#endif
379383

portable/IAR/ARM_CM3/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,23 @@ BaseType_t xPortStartScheduler( void )
279279

280280
#ifdef __NVIC_PRIO_BITS
281281
{
282-
/* Check the CMSIS configuration that defines the number of
283-
* priority bits matches the number of priority bits actually queried
284-
* from the hardware. */
285-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
282+
/*
283+
* Check that the number of implemented priority bits queried from
284+
* hardware is at least as many as specified in the CMSIS
285+
* __NVIC_PRIO_BITS configuration macro.
286+
*/
287+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
286288
}
287289
#endif
288290

289291
#ifdef configPRIO_BITS
290292
{
291-
/* Check the FreeRTOS configuration that defines the number of
292-
* priority bits matches the number of priority bits actually queried
293-
* from the hardware. */
294-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
293+
/*
294+
* Check that the number of implemented priority bits queried from
295+
* hardware is at least as many as specified in the FreeRTOS
296+
* configPRIO_BITS configuration macro.
297+
*/
298+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
295299
}
296300
#endif
297301

portable/IAR/ARM_CM4F/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,23 @@ BaseType_t xPortStartScheduler( void )
317317

318318
#ifdef __NVIC_PRIO_BITS
319319
{
320-
/* Check the CMSIS configuration that defines the number of
321-
* priority bits matches the number of priority bits actually queried
322-
* from the hardware. */
323-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
320+
/*
321+
* Check that the number of implemented priority bits queried from
322+
* hardware is at least as many as specified in the CMSIS
323+
* __NVIC_PRIO_BITS configuration macro.
324+
*/
325+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
324326
}
325327
#endif
326328

327329
#ifdef configPRIO_BITS
328330
{
329-
/* Check the FreeRTOS configuration that defines the number of
330-
* priority bits matches the number of priority bits actually queried
331-
* from the hardware. */
332-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
331+
/*
332+
* Check that the number of implemented priority bits queried from
333+
* hardware is at least as many as specified in the FreeRTOS
334+
* configPRIO_BITS configuration macro.
335+
*/
336+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
333337
}
334338
#endif
335339

portable/IAR/ARM_CM4F_MPU/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,19 +431,23 @@ BaseType_t xPortStartScheduler( void )
431431

432432
#ifdef __NVIC_PRIO_BITS
433433
{
434-
/* Check the CMSIS configuration that defines the number of
435-
* priority bits matches the number of priority bits actually queried
436-
* from the hardware. */
437-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
434+
/*
435+
* Check that the number of implemented priority bits queried from
436+
* hardware is at least as many as specified in the CMSIS
437+
* __NVIC_PRIO_BITS configuration macro.
438+
*/
439+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
438440
}
439441
#endif
440442

441443
#ifdef configPRIO_BITS
442444
{
443-
/* Check the FreeRTOS configuration that defines the number of
444-
* priority bits matches the number of priority bits actually queried
445-
* from the hardware. */
446-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
445+
/*
446+
* Check that the number of implemented priority bits queried from
447+
* hardware is at least as many as specified in the FreeRTOS
448+
* configPRIO_BITS configuration macro.
449+
*/
450+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
447451
}
448452
#endif
449453

portable/IAR/ARM_CM7/r0p1/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,19 +305,23 @@ BaseType_t xPortStartScheduler( void )
305305

306306
#ifdef __NVIC_PRIO_BITS
307307
{
308-
/* Check the CMSIS configuration that defines the number of
309-
* priority bits matches the number of priority bits actually queried
310-
* from the hardware. */
311-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
308+
/*
309+
* Check that the number of implemented priority bits queried from
310+
* hardware is at least as many as specified in the CMSIS
311+
* __NVIC_PRIO_BITS configuration macro.
312+
*/
313+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
312314
}
313315
#endif
314316

315317
#ifdef configPRIO_BITS
316318
{
317-
/* Check the FreeRTOS configuration that defines the number of
318-
* priority bits matches the number of priority bits actually queried
319-
* from the hardware. */
320-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
319+
/*
320+
* Check that the number of implemented priority bits queried from
321+
* hardware is at least as many as specified in the FreeRTOS
322+
* configPRIO_BITS configuration macro.
323+
*/
324+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
321325
}
322326
#endif
323327

portable/MikroC/ARM_CM4F/port.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,19 +367,23 @@ BaseType_t xPortStartScheduler( void )
367367

368368
#ifdef __NVIC_PRIO_BITS
369369
{
370-
/* Check the CMSIS configuration that defines the number of
371-
* priority bits matches the number of priority bits actually queried
372-
* from the hardware. */
373-
configASSERT( ulImplementedPrioBits == __NVIC_PRIO_BITS );
370+
/*
371+
* Check that the number of implemented priority bits queried from
372+
* hardware is at least as many as specified in the CMSIS
373+
* __NVIC_PRIO_BITS configuration macro.
374+
*/
375+
configASSERT( ulImplementedPrioBits >= __NVIC_PRIO_BITS );
374376
}
375377
#endif
376378

377379
#ifdef configPRIO_BITS
378380
{
379-
/* Check the FreeRTOS configuration that defines the number of
380-
* priority bits matches the number of priority bits actually queried
381-
* from the hardware. */
382-
configASSERT( ulImplementedPrioBits == configPRIO_BITS );
381+
/*
382+
* Check that the number of implemented priority bits queried from
383+
* hardware is at least as many as specified in the FreeRTOS
384+
* configPRIO_BITS configuration macro.
385+
*/
386+
configASSERT( ulImplementedPrioBits >= configPRIO_BITS );
383387
}
384388
#endif
385389

0 commit comments

Comments
 (0)