From 97312fcc6da163d76b69bf8ce68fd791cf014c2a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 5 Apr 2016 14:36:30 +0200 Subject: score: Delete Thread_Wait_information::id This field was only by the monitor in non-multiprocessing configurations. Add new field Thread_Wait_information::remote_id in multiprocessing configurations and use it for the remote procedure call thread queue. Add _Thread_Wait_get_id() to obtain the object identifier for debug and system information tools. Ensure the object layout via static asserts. Add test cases to sptests/spthreadq01. --- cpukit/libmisc/monitor/mon-task.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'cpukit/libmisc') diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c index 341a403ef6..96891e26de 100644 --- a/cpukit/libmisc/monitor/mon-task.c +++ b/cpukit/libmisc/monitor/mon-task.c @@ -14,26 +14,46 @@ #include #include /* memcpy() */ +static void +rtems_monitor_task_wait_info( + rtems_monitor_task_t *canonical_task, + Thread_Control *rtems_thread +) +{ + ISR_lock_Context lock_context; + void *lock; + + lock = _Thread_Lock_acquire( rtems_thread, &lock_context ); + + canonical_task->state = rtems_thread->current_state; + canonical_task->wait_id = _Thread_Wait_get_id( rtems_thread ); + canonical_task->wait_queue = rtems_thread->Wait.queue; + canonical_task->wait_operations = rtems_thread->Wait.operations; + + _Thread_Lock_release( lock, &lock_context ); +} + void rtems_monitor_task_canonical( rtems_monitor_task_t *canonical_task, const void *thread_void ) { - const Thread_Control *rtems_thread = (const Thread_Control *) thread_void; - RTEMS_API_Control *api; + Thread_Control *rtems_thread; + RTEMS_API_Control *api; + + rtems_thread = + RTEMS_DECONST( Thread_Control *, (const Thread_Control *) thread_void ); api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ]; + rtems_monitor_task_wait_info( canonical_task, rtems_thread ); + canonical_task->entry = rtems_thread->Start.Entry; canonical_task->stack = rtems_thread->Start.Initial_stack.area; canonical_task->stack_size = rtems_thread->Start.Initial_stack.size; canonical_task->cpu = _Per_CPU_Get_index( _Thread_Get_CPU( rtems_thread ) ); canonical_task->priority = rtems_thread->current_priority; - canonical_task->state = rtems_thread->current_state; - canonical_task->wait_id = rtems_thread->Wait.id; - canonical_task->wait_queue = rtems_thread->Wait.queue; - canonical_task->wait_operations = rtems_thread->Wait.operations; canonical_task->events = api->Event.pending_events; /* * FIXME: make this optionally cpu_time_executed -- cgit v1.2.3