bsps/irq: Add BSP_INTERRUPT_VECTOR_COUNT

Assert BSP_INTERRUPT_VECTOR_MAX + 1 == BSP_INTERRUPT_VECTOR_COUNT.

After building all BSPs with this patch, BSP_INTERRUPT_VECTOR_MAX can be
removed and replaced by BSP_INTERRUPT_VECTOR_COUNT.  The
BSP_INTERRUPT_VECTOR_COUNT allows a default implementation which supports no
interrupt vector at all.  Using COUNT instead of MAX may avoid some
interpretation issues, for example is the maximum value a valid vector number
or not.

Update #3269.
This commit is contained in:
Sebastian Huber
2021-06-19 12:40:57 +02:00
parent 900a84c5d1
commit cd5573c09d
55 changed files with 67 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
*/
#define BCM2835_INTC_TOTAL_IRQ 64 + 8
#define BCM2835_INTC_TOTAL_IRQ (64 + 8)
#define BCM2835_IRQ_SET1_MIN 0
#define BCM2835_IRQ_SET2_MIN 32
@@ -70,6 +71,7 @@
#define BCM2835_IRQ_ID_ILL_ACCESS_0 71
#define BSP_INTERRUPT_VECTOR_MAX (BCM2835_INTC_TOTAL_IRQ - 1)
#define BSP_INTERRUPT_VECTOR_COUNT BCM2835_INTC_TOTAL_IRQ
#define BSP_INTERRUPT_VECTOR_INVALID (UINT32_MAX)
#define BSP_IRQ_COUNT (BCM2835_INTC_TOTAL_IRQ)