source: rtems/c/src/libmisc/monitor/mon-task.c @ 7f6a24ab

4.104.114.84.95
Last change on this file since 7f6a24ab was 7f6a24ab, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 28, 1995 at 3:30:29 PM

Added unused priority ceiling parameter to rtems_semaphore_create.

Rearranged code to created thread handler routines to initialize,
start, restart, and "close/delete" a thread.

Made internal threads their own object class. This now uses the
thread support routines for starting and initializing a thread.

Insured deleted tasks are freed to the Inactive pool associated with the
correct Information block.

Added an RTEMS API specific data area to the thread control block.

Beginnings of removing the word "rtems" from the core.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 *      @(#)task.c      1.9 - 95/08/01
3 *     
4 *
5 * RTEMS Monitor task support
6 *
7 *  $Id$
8 */
9
10#include <rtems.h>
11#include "monitor.h"
12
13#include <stdio.h>
14
15void
16rtems_monitor_task_canonical(
17    rtems_monitor_task_t  *canonical_task,
18    void                  *thread_void
19)
20{
21    Thread_Control       *rtems_thread = (Thread_Control *) thread_void;
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 = rtems_thread->RTEMS_API->pending_events;
31    canonical_task->modes = rtems_thread->current_modes;
32    canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->RTEMS_API->attribute_set */;
33    (void) memcpy(canonical_task->notepad, rtems_thread->RTEMS_API->Notepads, sizeof(canonical_task->notepad));
34    (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
35}
36
37
38void
39rtems_monitor_task_dump_header(
40    boolean verbose
41)
42{
43    printf("\
44  ID       NAME   PRIO   STAT   MODES  EVENTS   WAITID  WAITARG  NOTES\n");
45/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
460         1         2         3         4         5         6         7       */
47           
48    rtems_monitor_separator();
49}
50
51/*
52 */
53
54void
55rtems_monitor_task_dump(
56    rtems_monitor_task_t *monitor_task,
57    boolean  verbose
58)
59{
60    int length = 0;
61
62    length += rtems_monitor_dump_id(monitor_task->id);
63    length += rtems_monitor_pad(11, length);
64    length += rtems_monitor_dump_name(monitor_task->name);
65    length += rtems_monitor_pad(18, length);
66    length += rtems_monitor_dump_priority(monitor_task->priority);
67    length += rtems_monitor_pad(24, length);
68    length += rtems_monitor_dump_state(monitor_task->state);
69    length += rtems_monitor_pad(31, length);
70    length += rtems_monitor_dump_modes(monitor_task->modes);
71    length += rtems_monitor_pad(39, length);
72    length += rtems_monitor_dump_events(monitor_task->events);
73    if (monitor_task->wait_id)
74    {
75        length += rtems_monitor_pad(47, length);
76        length += rtems_monitor_dump_id(monitor_task->wait_id);
77        length += rtems_monitor_pad(57, length);
78        length += rtems_monitor_dump_hex(monitor_task->wait_args);
79    }
80
81    length += rtems_monitor_pad(65, length);
82    length += rtems_monitor_dump_notepad(monitor_task->notepad);
83    printf("\n");
84}
85
Note: See TracBrowser for help on using the repository browser.