@@ -126,9 +126,9 @@ static rtems_timer_service_routine OS_TimeBase_ISR(rtems_id rtems_timer_id, void
126
126
OS_impl_timebase_internal_record_t * local ;
127
127
128
128
user_data .opaque_arg = arg ;
129
- OS_ConvertToArrayIndex (user_data .value , & local_id );
129
+ OS_ConvertToArrayIndex (user_data .id , & local_id );
130
130
local = & OS_impl_timebase_table [local_id ];
131
- if (OS_global_timebase_table [local_id ].active_id == user_data .value )
131
+ if (OS_ObjectIdEqual ( OS_global_timebase_table [local_id ].active_id , user_data .id ) )
132
132
{
133
133
/*
134
134
* Reset the timer, but only if an interval was selected
@@ -299,12 +299,18 @@ int32 OS_TimeBaseCreate_Impl(uint32 timer_id)
299
299
rtems_status_code rtems_sc ;
300
300
OS_impl_timebase_internal_record_t * local ;
301
301
OS_common_record_t * global ;
302
+ rtems_name r_name ;
302
303
303
304
304
305
return_code = OS_SUCCESS ;
305
306
local = & OS_impl_timebase_table [timer_id ];
306
307
global = & OS_global_timebase_table [timer_id ];
307
308
309
+ /*
310
+ * The RTEMS classic name for dependent resources
311
+ */
312
+ r_name = OS_ObjectIdToInteger (global -> active_id );
313
+
308
314
/*
309
315
* Set up the necessary OS constructs
310
316
*
@@ -323,7 +329,7 @@ int32 OS_TimeBaseCreate_Impl(uint32 timer_id)
323
329
* The tick_sem is a simple semaphore posted by the ISR and taken by the
324
330
* timebase helper task (created later).
325
331
*/
326
- rtems_sc = rtems_semaphore_create (global -> active_id , 0 , RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY , 0 ,
332
+ rtems_sc = rtems_semaphore_create (r_name , 0 , RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY , 0 ,
327
333
& local -> tick_sem );
328
334
if ( rtems_sc != RTEMS_SUCCESSFUL )
329
335
{
@@ -334,7 +340,7 @@ int32 OS_TimeBaseCreate_Impl(uint32 timer_id)
334
340
/*
335
341
* The handler_mutex is deals with access to the callback list for this timebase
336
342
*/
337
- rtems_sc = rtems_semaphore_create (global -> active_id , 1 , OSAL_TIMEBASE_MUTEX_ATTRIBS , 0 ,
343
+ rtems_sc = rtems_semaphore_create (r_name , 1 , OSAL_TIMEBASE_MUTEX_ATTRIBS , 0 ,
338
344
& local -> handler_mutex );
339
345
340
346
if ( rtems_sc != RTEMS_SUCCESSFUL )
@@ -344,7 +350,7 @@ int32 OS_TimeBaseCreate_Impl(uint32 timer_id)
344
350
return_code = OS_TIMER_ERR_INTERNAL ;
345
351
}
346
352
347
- rtems_sc = rtems_timer_create (global -> active_id , & local -> rtems_timer_id );
353
+ rtems_sc = rtems_timer_create (r_name , & local -> rtems_timer_id );
348
354
if ( rtems_sc != RTEMS_SUCCESSFUL )
349
355
{
350
356
OS_DEBUG ("Error: Timer object could not be created: %d\n" ,(int )rtems_sc );
@@ -372,7 +378,7 @@ int32 OS_TimeBaseCreate_Impl(uint32 timer_id)
372
378
* the priority is set to RTEMS_MINIMUM_PRIORITY.
373
379
*/
374
380
rtems_sc = rtems_task_create (
375
- global -> active_id ,
381
+ r_name ,
376
382
RTEMS_MINIMUM_PRIORITY + 1 ,
377
383
0 ,
378
384
RTEMS_PREEMPT | RTEMS_NO_ASR | RTEMS_NO_TIMESLICE | RTEMS_INTERRUPT_LEVEL (0 ),
@@ -391,7 +397,7 @@ int32 OS_TimeBaseCreate_Impl(uint32 timer_id)
391
397
/* will place the task in 'ready for scheduling' state */
392
398
rtems_sc = rtems_task_start (local -> handler_task , /*rtems task id*/
393
399
(rtems_task_entry ) OS_TimeBase_CallbackThread , /* task entry point */
394
- (rtems_task_argument ) global -> active_id ); /* passed argument */
400
+ (rtems_task_argument ) OS_ObjectIdToInteger ( global -> active_id ) ); /* passed argument */
395
401
396
402
if (rtems_sc != RTEMS_SUCCESSFUL )
397
403
{
@@ -471,7 +477,7 @@ int32 OS_TimeBaseSet_Impl(uint32 timer_id, int32 start_time, int32 interval_time
471
477
OS_UsecsToTicks (start_time , & start_ticks );
472
478
473
479
user_data .opaque_arg = NULL ;
474
- user_data .value = OS_global_timebase_table [timer_id ].active_id ;
480
+ user_data .id = OS_global_timebase_table [timer_id ].active_id ;
475
481
476
482
status = rtems_timer_fire_after (local -> rtems_timer_id , start_ticks ,
477
483
OS_TimeBase_ISR , user_data .opaque_arg );
0 commit comments