score: Remove ISR_LOCK_DEFINE()

Use ISR_LOCK_NEEDS_OBJECT to determine if a lock object is needed.

Update #4957 and #5038.
This commit is contained in:
Sebastian Huber
2024-06-18 11:56:09 +02:00
parent 050b61aab6
commit bdbda6a75f
10 changed files with 32 additions and 26 deletions

View File

@@ -138,23 +138,6 @@ typedef struct {
#define ISR_LOCK_DECLARE( _qualifier, _designator )
#endif
/**
* @brief Defines an ISR lock variable.
*
* Do not add a ';' after this macro.
*
* @param _qualifier The qualifier for the interrupt lock, e.g. static.
* @param _designator The designator for the interrupt lock.
* @param _name The name for the interrupt lock. It must be a string. The
* name is only used if profiling is enabled.
*/
#if defined( RTEMS_SMP )
#define ISR_LOCK_DEFINE( _qualifier, _designator, _name ) \
_qualifier ISR_lock_Control _designator = { SMP_LOCK_INITIALIZER( _name ) };
#else
#define ISR_LOCK_DEFINE( _qualifier, _designator, _name )
#endif
/**
* @brief Defines an ISR lock variable reference.
*

View File

@@ -29,7 +29,9 @@
#include <rtems.h>
ISR_LOCK_DEFINE (static, __rtld_tbg_lock, "RTLD TBG")
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control __rtld_tbg_lock = ISR_LOCK_INITIALIZER ("RTLD TBG");
#endif
uint32_t
rtems_trace_names_size (void)

View File

@@ -45,7 +45,9 @@
#include <rtems/score/hash.h>
#include <rtems/bspIo.h>
ISR_LOCK_DEFINE( static, gcov_dump_lock, "gcov dump" );
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control gcov_dump_lock = ISR_LOCK_INITIALIZER( "gcov dump" );
#endif
static bool gcov_dump_done;

View File

@@ -47,7 +47,10 @@
#include <rtems/score/todimpl.h>
#include <rtems/score/watchdogimpl.h>
ISR_LOCK_DEFINE( static, _POSIX_signals_Alarm_lock, "POSIX Alarm" )
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control _POSIX_signals_Alarm_lock =
ISR_LOCK_INITIALIZER( "POSIX Alarm" );
#endif
static void _POSIX_signals_Alarm_TSR( Watchdog_Control *the_watchdog )
{

View File

@@ -45,7 +45,10 @@
#include <rtems/score/watchdogimpl.h>
#include <rtems/config.h>
ISR_LOCK_DEFINE( static, _POSIX_signals_Ualarm_lock, "POSIX Ualarm" )
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control _POSIX_signals_Ualarm_lock =
ISR_LOCK_INITIALIZER( "POSIX Ualarm" );
#endif
static uint32_t _POSIX_signals_Ualarm_interval;

View File

@@ -44,7 +44,10 @@
#include <rtems/ioimpl.h>
#include <rtems/rtems/intr.h>
ISR_LOCK_DEFINE( , _IO_Driver_registration_lock, "IO Driver Registration" )
#if ISR_LOCK_NEEDS_OBJECT
ISR_lock_Control _IO_Driver_registration_lock =
ISR_LOCK_INITIALIZER( "IO Driver Registration" );
#endif
static inline bool rtems_io_is_empty_table(
const rtems_driver_address_table *table

View File

@@ -100,7 +100,9 @@
#include <limits.h>
#include <string.h>
#include <rtems.h>
ISR_LOCK_DEFINE(, _Timecounter_Lock, "Timecounter")
#if ISR_LOCK_NEEDS_OBJECT
ISR_lock_Control _Timecounter_Lock = ISR_LOCK_INITIALIZER( "Timecounter");
#endif
#define _Timecounter_Release(lock_context) \
_ISR_lock_Release_and_ISR_enable(&_Timecounter_Lock, lock_context)
#define hz rtems_clock_get_ticks_per_second()

View File

@@ -70,7 +70,10 @@ uint32_t _Objects_MP_Maximum_global_objects;
static CHAIN_DEFINE_EMPTY( _Objects_MP_Inactive_global_objects );
ISR_LOCK_DEFINE( static, _Objects_MP_Global_lock, "MP Objects" )
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control _Objects_MP_Global_lock =
ISR_LOCK_INITIALIZER( "MP Objects" );
#endif
static void _Objects_MP_Global_acquire( ISR_lock_Context *lock_context )
{

View File

@@ -50,7 +50,10 @@ static RBTREE_DEFINE_EMPTY( _Thread_MP_Active_proxies );
static CHAIN_DEFINE_EMPTY( _Thread_MP_Inactive_proxies );
ISR_LOCK_DEFINE( static, _Thread_MP_Proxies_lock, "Thread MP Proxies" )
#if ISR_LOCK_NEEDS_OBJECT
static ISR_lock_Control _Thread_MP_Proxies_lock =
ISR_LOCK_INITIALIZER( "Thread MP Proxies" );
#endif
static void _Thread_MP_Proxies_acquire( ISR_lock_Context *lock_context )
{

View File

@@ -98,7 +98,9 @@ static void test_watchdog_init( test_watchdog *watchdog, int counter )
static uint64_t test_watchdog_tick( Watchdog_Header *header, uint64_t now )
{
ISR_LOCK_DEFINE( , lock, "Test" )
#if ISR_LOCK_NEEDS_OBJECT
ISR_lock_Control lock = ISR_LOCK_INITIALIZER( "Test" );
#endif
ISR_lock_Context lock_context;
Watchdog_Control *first;