summaryrefslogtreecommitdiffstats
path: root/bsps/riscv
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-06-19 12:40:57 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-06-24 11:35:49 +0200
commitcd5573c09def76d3d202349639da6ba05617b31b (patch)
tree17bc03ce550e178efe616958d2b0e5417fa5d441 /bsps/riscv
parentsmpcapture02: Fix use of BSP_INTERRUPT_VECTOR_MAX (diff)
downloadrtems-cd5573c09def76d3d202349639da6ba05617b31b.tar.bz2
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.
Diffstat (limited to 'bsps/riscv')
-rw-r--r--bsps/riscv/griscv/include/bsp/irq.h1
-rw-r--r--bsps/riscv/riscv/include/bsp/irq.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/bsps/riscv/griscv/include/bsp/irq.h b/bsps/riscv/griscv/include/bsp/irq.h
index 2100e6f7d3..520425d2ba 100644
--- a/bsps/riscv/griscv/include/bsp/irq.h
+++ b/bsps/riscv/griscv/include/bsp/irq.h
@@ -55,6 +55,7 @@
#define RISCV_INTERRUPT_VECTOR_EXTERNAL_TO_INDEX(x) ((x) - 2)
#define BSP_INTERRUPT_VECTOR_MAX RISCV_INTERRUPT_VECTOR_EXTERNAL(RISCV_MAXIMUM_EXTERNAL_INTERRUPTS - 1)
+#define BSP_INTERRUPT_VECTOR_COUNT RISCV_INTERRUPT_VECTOR_EXTERNAL(RISCV_MAXIMUM_EXTERNAL_INTERRUPTS)
void bsp_interrupt_set_affinity(
rtems_vector_number vector,
diff --git a/bsps/riscv/riscv/include/bsp/irq.h b/bsps/riscv/riscv/include/bsp/irq.h
index a902570155..1c7cec5a02 100644
--- a/bsps/riscv/riscv/include/bsp/irq.h
+++ b/bsps/riscv/riscv/include/bsp/irq.h
@@ -55,6 +55,7 @@
#define RISCV_INTERRUPT_VECTOR_EXTERNAL_TO_INDEX(x) ((x) - 2)
#define BSP_INTERRUPT_VECTOR_MAX RISCV_INTERRUPT_VECTOR_EXTERNAL(RISCV_MAXIMUM_EXTERNAL_INTERRUPTS - 1)
+#define BSP_INTERRUPT_VECTOR_COUNT RISCV_INTERRUPT_VECTOR_EXTERNAL(RISCV_MAXIMUM_EXTERNAL_INTERRUPTS)
void bsp_interrupt_set_affinity(
rtems_vector_number vector,