diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-21 10:47:36 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-24 09:22:36 +0100 |
commit | 0b263b0eb7dd05efe44359b9d8172926856badc7 (patch) | |
tree | 0fcb6c0924561f08c7854a5fbecc51f79bfca22a /cpukit/rtems/src | |
parent | build: Fix format in wscript (diff) | |
download | rtems-0b263b0eb7dd05efe44359b9d8172926856badc7.tar.bz2 |
score: Remove _Objects_Open()
Use the type safe _Objects_Open_u32() instead. Return the object
identifier to enforce a common usage pattern.
Diffstat (limited to 'cpukit/rtems/src')
-rw-r--r-- | cpukit/rtems/src/barriercreate.c | 9 | ||||
-rw-r--r-- | cpukit/rtems/src/dpmemcreate.c | 6 | ||||
-rw-r--r-- | cpukit/rtems/src/msgqconstruct.c | 6 | ||||
-rw-r--r-- | cpukit/rtems/src/partcreate.c | 5 | ||||
-rw-r--r-- | cpukit/rtems/src/ratemoncreate.c | 6 | ||||
-rw-r--r-- | cpukit/rtems/src/regioncreate.c | 5 | ||||
-rw-r--r-- | cpukit/rtems/src/semcreate.c | 6 | ||||
-rw-r--r-- | cpukit/rtems/src/taskconstruct.c | 2 | ||||
-rw-r--r-- | cpukit/rtems/src/timercreate.c | 6 |
9 files changed, 16 insertions, 35 deletions
diff --git a/cpukit/rtems/src/barriercreate.c b/cpukit/rtems/src/barriercreate.c index 6e6b294832..99d916d8c7 100644 --- a/cpukit/rtems/src/barriercreate.c +++ b/cpukit/rtems/src/barriercreate.c @@ -63,14 +63,7 @@ rtems_status_code rtems_barrier_create( _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); - _Objects_Open( - &_Barrier_Information, - &the_barrier->Object, - (Objects_Name) name - ); - - *id = the_barrier->Object.id; - + *id = _Objects_Open_u32( &_Barrier_Information, &the_barrier->Object, name ); _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/rtems/src/dpmemcreate.c b/cpukit/rtems/src/dpmemcreate.c index bc14de19c8..eba3a523c4 100644 --- a/cpukit/rtems/src/dpmemcreate.c +++ b/cpukit/rtems/src/dpmemcreate.c @@ -59,13 +59,11 @@ rtems_status_code rtems_port_create( the_port->external_base = external_start; the_port->length = length - 1; - _Objects_Open( + *id = _Objects_Open_u32( &_Dual_ported_memory_Information, &the_port->Object, - (Objects_Name) name + name ); - - *id = the_port->Object.id; _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/rtems/src/msgqconstruct.c b/cpukit/rtems/src/msgqconstruct.c index a8a50e9aa1..6cada4c570 100644 --- a/cpukit/rtems/src/msgqconstruct.c +++ b/cpukit/rtems/src/msgqconstruct.c @@ -158,14 +158,12 @@ rtems_status_code _Message_queue_Create( return _Status_Get( status ); } - _Objects_Open( + *id = _Objects_Open_u32( &_Message_queue_Information, &the_message_queue->Object, - (Objects_Name) config->name + config->name ); - *id = the_message_queue->Object.id; - #if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Message_queue_MP_Send_process_packet( diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c index 205a31620e..012a416a1a 100644 --- a/cpukit/rtems/src/partcreate.c +++ b/cpukit/rtems/src/partcreate.c @@ -138,13 +138,12 @@ rtems_status_code rtems_partition_create( attribute_set ); - _Objects_Open( + *id = _Objects_Open_u32( &_Partition_Information, &the_partition->Object, - (Objects_Name) name + name ); - *id = the_partition->Object.id; #if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) _Partition_MP_Send_process_packet( diff --git a/cpukit/rtems/src/ratemoncreate.c b/cpukit/rtems/src/ratemoncreate.c index 09f7806a05..cd56a13df6 100644 --- a/cpukit/rtems/src/ratemoncreate.c +++ b/cpukit/rtems/src/ratemoncreate.c @@ -60,13 +60,11 @@ rtems_status_code rtems_rate_monotonic_create( _Rate_monotonic_Reset_statistics( the_period ); - _Objects_Open( + *id = _Objects_Open_u32( &_Rate_monotonic_Information, &the_period->Object, - (Objects_Name) name + name ); - - *id = the_period->Object.id; _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/rtems/src/regioncreate.c b/cpukit/rtems/src/regioncreate.c index d05d37aec4..112cac2cd2 100644 --- a/cpukit/rtems/src/regioncreate.c +++ b/cpukit/rtems/src/regioncreate.c @@ -75,13 +75,12 @@ rtems_status_code rtems_region_create( } else { the_region->attribute_set = attribute_set; - _Objects_Open( + *id = _Objects_Open_u32( &_Region_Information, &the_region->Object, - (Objects_Name) name + name ); - *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c index 20c2c7192d..3647bb7b13 100644 --- a/cpukit/rtems/src/semcreate.c +++ b/cpukit/rtems/src/semcreate.c @@ -245,14 +245,12 @@ rtems_status_code rtems_semaphore_create( * Whether we initialized it as a mutex or counting semaphore, it is * now ready to be "offered" for use as a Classic API Semaphore. */ - _Objects_Open( + *id = _Objects_Open_u32( &_Semaphore_Information, &the_semaphore->Object, - (Objects_Name) name + name ); - *id = the_semaphore->Object.id; - #if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) _Semaphore_MP_Send_process_packet( diff --git a/cpukit/rtems/src/taskconstruct.c b/cpukit/rtems/src/taskconstruct.c index d33a850d88..799554c417 100644 --- a/cpukit/rtems/src/taskconstruct.c +++ b/cpukit/rtems/src/taskconstruct.c @@ -135,7 +135,7 @@ rtems_status_code _RTEMS_tasks_Create( THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE : THREAD_CPU_BUDGET_ALGORITHM_NONE, thread_config.isr_level = _Modes_Get_interrupt_level( config->initial_modes ); - thread_config.name.name_u32 = config->name; + thread_config.name = config->name; thread_config.is_fp = _Attributes_Is_floating_point( attributes ); thread_config.is_preemptible = _Modes_Is_preempt( config->initial_modes ); diff --git a/cpukit/rtems/src/timercreate.c b/cpukit/rtems/src/timercreate.c index ce143f59f6..a3ece5cc4d 100644 --- a/cpukit/rtems/src/timercreate.c +++ b/cpukit/rtems/src/timercreate.c @@ -209,13 +209,11 @@ rtems_status_code rtems_timer_create( the_timer->the_class = TIMER_DORMANT; _Watchdog_Preinitialize( &the_timer->Ticker, _Per_CPU_Get_snapshot() ); - _Objects_Open( + *id = _Objects_Open_u32( &_Timer_Information, &the_timer->Object, - (Objects_Name) name + name ); - - *id = the_timer->Object.id; _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } |