[PATCH 15] shared-irq: add support for custom BSP vector verification

Daniel Hellstrom daniel at gaisler.com
Mon Feb 6 16:27:58 UTC 2012


On 02/06/2012 05:11 PM, Gedare Bloom wrote:
> On Mon, Feb 6, 2012 at 9:15 AM, Daniel Hellstrom<daniel at gaisler.com>  wrote:
>> Signed-off-by: Daniel Hellstrom<daniel at gaisler.com>
>> ---
>>   c/src/lib/libbsp/shared/include/irq-generic.h |    2 ++
>>   c/src/lib/libbsp/shared/include/irq.h         |    8 ++++++++
>>   2 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/c/src/lib/libbsp/shared/include/irq-generic.h b/c/src/lib/libbsp/shared/include/irq-generic.h
>> index 5181952..3cbb7db 100644
>> --- a/c/src/lib/libbsp/shared/include/irq-generic.h
>> +++ b/c/src/lib/libbsp/shared/include/irq-generic.h
>> @@ -134,6 +134,7 @@ static inline rtems_vector_number bsp_interrupt_handler_index(
>>   * @{
>>   */
>>
>> +#if !defined(BSP_INTERRUPT_CUSTOM_VALID_VECTOR)
>>   /**
>>   * @brief Returns true if the interrupt vector with number @a vector is valid.
>>   */
>> @@ -142,6 +143,7 @@ static inline bool bsp_interrupt_is_valid_vector(rtems_vector_number vector)
>>    return (rtems_vector_number) BSP_INTERRUPT_VECTOR_MIN<= vector
>>      &&  vector<= (rtems_vector_number) BSP_INTERRUPT_VECTOR_MAX;
>>   }
>> +#endif
>>
>>   /**
>>   * @brief Default interrupt handler.
>> diff --git a/c/src/lib/libbsp/shared/include/irq.h b/c/src/lib/libbsp/shared/include/irq.h
>> index ae57bd1..19aed6f 100644
>> --- a/c/src/lib/libbsp/shared/include/irq.h
>> +++ b/c/src/lib/libbsp/shared/include/irq.h
>> @@ -72,6 +72,14 @@
>>    typedef uint8_t bsp_interrupt_handler_index_type;
>>   #endif
>>
>> +/**
>> + * @brief Enable custom vector checking
>> + *
>> + * If defined the BSP must implement the custom bsp_interrupt_is_valid_vector()
>> + * vector validator check routine.
>> + */
>> +#undef BSP_INTERRUPT_CUSTOM_VALID_VECTOR
>> +
>>   /** @} */
>>
>>   #endif /* LIBBSP_SHARED_IRQ_CONFIG_H */
>> --
>> 1.7.0.4
>>
>> _______________________________________________
>> rtems-devel mailing list
>> rtems-devel at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-devel
> I can see a possible reason for this patch could be when valid vectors
> do not necessarily fall within a range [min,max] so this patch seems
> reasonable.
Yes, my problem is that I have different IRQ controllers or a IRQ controller with either 32 or 16 interrupts. I can not set the vector count on compile-time.

Daniel



More information about the devel mailing list