From ecb71667e136826d9e3141817f2988753a0be015 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Jul 2025 16:52:54 -0500 Subject: [PATCH] cpukit/score/cpu/or1k/*: Move _CPU_ISR_install_vector() to cpu.c This function was static inline which means that it must compile cleanly for all versions of C and C++. Newer C standards make it an error to cast between incompatible function types. Moving this function to cpu.c from cpu.h allows the C standard version required to be narrowed from "whatever the user wants" to the one version that is used to compile RTEMS. --- cpukit/score/cpu/or1k/cpu.c | 13 +++++++++++++ cpukit/score/cpu/or1k/include/rtems/score/cpu.h | 11 ++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cpukit/score/cpu/or1k/cpu.c b/cpukit/score/cpu/or1k/cpu.c index b545739838..e9b77b2f7f 100644 --- a/cpukit/score/cpu/or1k/cpu.c +++ b/cpukit/score/cpu/or1k/cpu.c @@ -116,6 +116,19 @@ void _CPU_ISR_install_raw_handler( _ISR_Local_enable( level ); } +void _CPU_ISR_install_vector( + uint32_t vector, + CPU_ISR_handler new_handler, + CPU_ISR_handler *old_handler +) +{ + _CPU_ISR_install_raw_handler( + vector, + (CPU_ISR_raw_handler) new_handler, + (CPU_ISR_raw_handler *) old_handler + ); +} + void *_CPU_Thread_Idle_body( uintptr_t ignored ) { do { diff --git a/cpukit/score/cpu/or1k/include/rtems/score/cpu.h b/cpukit/score/cpu/or1k/include/rtems/score/cpu.h index 7a6ac004fd..cc2b6ba6c5 100644 --- a/cpukit/score/cpu/or1k/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/or1k/include/rtems/score/cpu.h @@ -468,18 +468,11 @@ void _CPU_ISR_install_raw_handler( typedef void ( *CPU_ISR_handler )( uint32_t ); -static inline void _CPU_ISR_install_vector( +void _CPU_ISR_install_vector( uint32_t vector, CPU_ISR_handler new_handler, CPU_ISR_handler *old_handler -) -{ - _CPU_ISR_install_raw_handler( - vector, - (CPU_ISR_raw_handler) new_handler, - (CPU_ISR_raw_handler *) old_handler - ); -} +); RTEMS_NO_RETURN void *_CPU_Thread_Idle_body( uintptr_t ignored );