diff options
Diffstat (limited to 'bsps/riscv/riscv/irq/irq.c')
-rw-r--r-- | bsps/riscv/riscv/irq/irq.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bsps/riscv/riscv/irq/irq.c b/bsps/riscv/riscv/irq/irq.c index 1f383ebb89..943dd4a68b 100644 --- a/bsps/riscv/riscv/irq/irq.c +++ b/bsps/riscv/riscv/irq/irq.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,7 +9,7 @@ */ /* - * Copyright (c) 2018 embedded brains GmbH + * Copyright (C) 2018, 2022 embedded brains GmbH * * Copyright (c) 2015 University of York. * Hesham Almatary <hesham@alumni.york.ac.uk> @@ -274,6 +276,19 @@ void bsp_interrupt_facility_initialize(void) riscv_plic_init(fdt); } +bool bsp_interrupt_is_valid_vector(rtems_vector_number vector) +{ + /* + * The PLIC interrupt ID of zero is reserved. For example, this ID is used + * to indicate that no interrupt was claimed. + */ + if (vector == RISCV_INTERRUPT_VECTOR_EXTERNAL(0)) { + return false; + } + + return vector < (rtems_vector_number) BSP_INTERRUPT_VECTOR_COUNT; +} + rtems_status_code bsp_interrupt_get_attributes( rtems_vector_number vector, rtems_interrupt_attributes *attributes |