source: rtems/cpukit/libmisc/monitor/mon-task.c @ 52a0641

4.104.114.84.95
Last change on this file since 52a0641 was 8389628, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/96 at 16:53:46

updates from Tony Bennett

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 * RTEMS Monitor task support
3 *
4 *  $Id$
5 */
6
7#include <rtems.h>
8#include "monitor.h"
9
10#include <stdio.h>
11
12void
13rtems_monitor_task_canonical(
14    rtems_monitor_task_t  *canonical_task,
15    void                  *thread_void
16)
17{
18    Thread_Control       *rtems_thread = (Thread_Control *) thread_void;
19    RTEMS_API_Control    *api;
20
21    api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
22   
23    canonical_task->entry = rtems_thread->Start.entry_point;
24    canonical_task->argument = rtems_thread->Start.numeric_argument;
25    canonical_task->stack = rtems_thread->Start.Initial_stack.area;
26    canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
27    canonical_task->priority = rtems_thread->current_priority;
28    canonical_task->state = rtems_thread->current_state;
29    canonical_task->wait_id = rtems_thread->Wait.id;
30    canonical_task->events = api->pending_events;
31
32/* XXX modes and attributes only exist in the RTEMS API .. */
33/* XXX not directly in the core thread.. they will have to be derived */
34/* XXX if they are important enough to include anymore.   */
35    canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
36    canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
37    (void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
38/* XXX more to fix */
39/*
40    (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
41*/
42}
43
44
45void
46rtems_monitor_task_dump_header(
47    boolean verbose
48)
49{
50    printf("\
51  ID       NAME   PRIO   STAT   MODES  EVENTS   WAITID  WAITARG  NOTES\n");
52/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
530         1         2         3         4         5         6         7       */
54           
55    rtems_monitor_separator();
56}
57
58/*
59 */
60
61void
62rtems_monitor_task_dump(
63    rtems_monitor_task_t *monitor_task,
64    boolean  verbose
65)
66{
67    int length = 0;
68
69    length += rtems_monitor_dump_id(monitor_task->id);
70    length += rtems_monitor_pad(11, length);
71    length += rtems_monitor_dump_name(monitor_task->name);
72    length += rtems_monitor_pad(18, length);
73    length += rtems_monitor_dump_priority(monitor_task->priority);
74    length += rtems_monitor_pad(24, length);
75    length += rtems_monitor_dump_state(monitor_task->state);
76    length += rtems_monitor_pad(31, length);
77    length += rtems_monitor_dump_modes(monitor_task->modes);
78    length += rtems_monitor_pad(39, length);
79    length += rtems_monitor_dump_events(monitor_task->events);
80    if (monitor_task->wait_id)
81    {
82        length += rtems_monitor_pad(47, length);
83        length += rtems_monitor_dump_id(monitor_task->wait_id);
84        length += rtems_monitor_pad(57, length);
85        length += rtems_monitor_dump_hex(monitor_task->wait_args);
86    }
87
88    length += rtems_monitor_pad(65, length);
89    length += rtems_monitor_dump_notepad(monitor_task->notepad);
90    printf("\n");
91}
92
Note: See TracBrowser for help on using the repository browser.