From 45b1495a8a8fe08c5041ff531f7863c23ea254e5 Mon Sep 17 00:00:00 2001 From: Lucian Silistru Date: Sat, 24 May 2025 18:00:15 +0300 Subject: [PATCH] record: Avoid dependency on object link order For the application configuration option CONFIGURE_RECORD_INTERRUPTS_ENABLED, define bsp_interrupt_get_dispatch_table_slot() in the application configuration to avoid issues with the object link order within the RTEMS libraries. Enable this option in an associated test. Close #5244. --- bsps/shared/irq/irq-record.c | 9 +-------- cpukit/include/rtems/confdefs/extensions.h | 11 +++++++++++ cpukit/include/rtems/record.h | 3 +++ testsuites/libtests/record02/init.c | 2 ++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/bsps/shared/irq/irq-record.c b/bsps/shared/irq/irq-record.c index 15bb20132d..a6e79c0d54 100644 --- a/bsps/shared/irq/irq-record.c +++ b/bsps/shared/irq/irq-record.c @@ -39,7 +39,7 @@ #include /* The regular interrupt entries are registered in this table */ -static rtems_interrupt_entry * +rtems_interrupt_entry * _Record_Interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ]; /* @@ -49,13 +49,6 @@ _Record_Interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ]; static rtems_interrupt_entry _Record_Interrupt_entry_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ]; -rtems_interrupt_entry **bsp_interrupt_get_dispatch_table_slot( - rtems_vector_number index -) -{ - return &_Record_Interrupt_dispatch_table[ index ]; -} - static void _Record_Interrupt_handler( void *arg ) { uintptr_t vector; diff --git a/cpukit/include/rtems/confdefs/extensions.h b/cpukit/include/rtems/confdefs/extensions.h index 398e6aec2f..c1d902f986 100644 --- a/cpukit/include/rtems/confdefs/extensions.h +++ b/cpukit/include/rtems/confdefs/extensions.h @@ -195,6 +195,17 @@ extern "C" { ); #ifdef CONFIGURE_RECORD_INTERRUPTS_ENABLED + 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 ]; + } + RTEMS_SYSINIT_ITEM( _Record_Interrupt_initialize, RTEMS_SYSINIT_LAST, diff --git a/cpukit/include/rtems/record.h b/cpukit/include/rtems/record.h index f423aa1d6a..9f2d014490 100644 --- a/cpukit/include/rtems/record.h +++ b/cpukit/include/rtems/record.h @@ -30,6 +30,7 @@ #include "recorddata.h" +#include #include #include #include @@ -68,6 +69,8 @@ void _Record_Initialize( void ); void _Record_Interrupt_initialize( void ); +extern rtems_interrupt_entry *_Record_Interrupt_dispatch_table[]; + bool _Record_Thread_create( struct _Thread_Control *executing, struct _Thread_Control *created diff --git a/testsuites/libtests/record02/init.c b/testsuites/libtests/record02/init.c index f4060e5d11..c7c05ad5d7 100644 --- a/testsuites/libtests/record02/init.c +++ b/testsuites/libtests/record02/init.c @@ -242,6 +242,8 @@ static void fatal_extension( #define CONFIGURE_RECORD_EXTENSIONS_ENABLED +#define CONFIGURE_RECORD_INTERRUPTS_ENABLED + #define CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB #define CONFIGURE_INIT