RTEMS | bsps/leon3: Limit the interrupt map to 32 lines (!1514)
Matteo Concas (@matteo.concas)
gitlab at rtems.org
Mon Sep 28 12:08:53 UTC 2026
Matteo Concas commented on a discussion on bsps/sparc/leon3/start/eirq.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1514#note_160092
>
> #ifdef LEON3_IRQAMP_IRQMAP
> /* Mapping from bus interrupt lines to IRQ(A)MP interrupt lines */
> -rtems_vector_number LEON3_IrqCtrl_Mapping[ BSP_INTERRUPT_VECTOR_MAX_MAP + 1 ];
> +rtems_vector_number LEON3_IrqCtrl_Mapping[ BSP_INTERRUPT_VECTOR_COUNT ];
> +
> +/*
> + * A map field is eight bits wide. A field value above the last interrupt
> + * line of the IRQ(A)MP selects no interrupt line. Line 0 is no interrupt.
> + */
> +static rtems_vector_number leon3_irqmap_line( uint32_t field )
Yes I'm aware of that, I was commenting on whether `leon3_irqmap_line()` is necessary in this form, especially because of:
```c
if ( field >= BSP_INTERRUPT_VECTOR_COUNT ) {
return 0;
}
```
Reading the map registers should never result in a value above `BSP_INTERRUPT_VECTOR_COUNT`. If it does it means there's something seriously wrong with the system and we should probably stop there.
Continuing with a software map that doesn't match the hardware map is only pushing the problem to a later time while making it harder to diagnose.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1514#note_160092
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/5-f5lxd06z34bw9v2i49doa9jim-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260928/b4c2784b/attachment.htm>
More information about the bugs
mailing list