summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-05 14:36:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 09:08:20 +0200
commit97312fcc6da163d76b69bf8ce68fd791cf014c2a (patch)
tree6599b770a1587356b02b92b4003489f2e9bf8bc5 /cpukit/libmisc
parentbsp/atsam: Fix mbuf allocation (diff)
downloadrtems-97312fcc6da163d76b69bf8ce68fd791cf014c2a.tar.bz2
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.
Diffstat (limited to 'cpukit/libmisc')
-rw-r--r--cpukit/libmisc/monitor/mon-task.c32
1 files changed, 26 insertions, 6 deletions
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 <stdio.h>
#include <string.h> /* 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