RTEMS | bsps/shared/irq: move record interrupt get_dispatch_table_slot to conf (!489)

Sebastian Huber (@sebhub) gitlab at rtems.org
Tue Jul 1 02:59:48 UTC 2025



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/489 was reviewed by Sebastian Huber

--
  
Sebastian Huber started a new discussion on bsps/shared/irq/irq-record.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/489#note_125665

 > -static rtems_interrupt_entry *
 > -_Record_Interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ];
 > -

In general, this is the right way to fix the issue. I would still define \_Record_Interrupt_dispatch_table here, so that confdefs.h doesn't have to know anything about BSP_INTERRUPT_DISPATCH_TABLE_SIZE.

The \_Record_Interrupt_dispatch_table should be declared in cpukit/include/rtems/record.h:

```
#include <rtems/rtems/intr.h>
```

```c
extern rtems_interrupt_entry *_Record_Interrupt_dispatch_table[];
```

--
  
Sebastian Huber started a new discussion on bsps/shared/irq/irq-record.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/489#note_125666

 >    entry = bsp_interrupt_entry_load_acquire(
 > -    &_Record_Interrupt_dispatch_table[ vector ]
 > +    bsp_interrupt_get_dispatch_table_slot( vector )

This just adds an overhead. I would revert this change.

--
  
Sebastian Huber started a new discussion on cpukit/include/rtems/confdefs/extensions.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/489#note_125667

 > +    /* The regular interrupt entries are registered in this table */
 > +    rtems_interrupt_entry *
 > +    _Record_Interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ];

The definition should stay in irq-record.c so that BSP_INTERRUPT_DISPATCH_TABLE_SIZE is not exposed to confdefs.h.

--
  
Sebastian Huber started a new discussion on cpukit/include/rtems/confdefs/extensions.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/489#note_125668

 > +    _Record_Interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ];
 > +
 > +    rtems_interrupt_entry **bsp_interrupt_get_dispatch_table_slot(

Here we use a BSP interface in confdefs.h. I don't know a better way to address this issue. To avoid warnings, we have to declare the function here also:

```c
rtems_interrupt_entry **bsp_interrupt_get_dispatch_table_slot(
  rtems_vector_number index
);

rtems_interrupt_entry **bsp_interrupt_get_dispatch_table_slot(
  rtems_vector_number index
)
{
  return &_Record_Interrupt_dispatch_table[ index ];
}
```


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/489
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250701/f331a08f/attachment-0001.htm>


More information about the bugs mailing list