source: rtems/c/src/lib/libmisc/monitor/mon-itask.c @ 8bdcfc4

4.104.114.84.95
Last change on this file since 8bdcfc4 was b06e68ef, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 17, 1995 at 7:51:51 PM

Numerous miscellaneous features incorporated from Tony Bennett
(tbennett@…) including the following major additions:

+ variable length messages
+ named devices
+ debug monitor
+ association tables/variables

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 *      @(#)itask.c     1.4 - 95/08/02
3 *     
4 *
5 * RTEMS Monitor init task support
6 *
7 *  $Id$
8 */
9
10#include <rtems.h>
11#include "monitor.h"
12
13#include <stdio.h>
14
15/*
16 * As above, but just for init tasks
17 */
18void
19rtems_monitor_init_task_canonical(
20    rtems_monitor_init_task_t *canonical_itask,
21    void                  *itask_void
22)
23{
24    rtems_initialization_tasks_table *rtems_itask = itask_void;
25   
26    rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
27                                            rtems_itask->entry_point);
28
29    canonical_itask->argument = rtems_itask->argument;
30    canonical_itask->stack_size = rtems_itask->stack_size;
31    canonical_itask->priority = rtems_itask->initial_priority;
32    canonical_itask->modes = rtems_itask->mode_set;
33    canonical_itask->attributes = rtems_itask->attribute_set;
34}
35
36void *
37rtems_monitor_init_task_next(
38    void                  *object_info,
39    rtems_monitor_init_task_t *canonical_init_task,
40    rtems_id              *next_id
41)
42{
43    rtems_configuration_table *c = _Configuration_Table;
44    rtems_initialization_tasks_table *itask;
45    int n = rtems_get_index(*next_id);
46
47    if (n >= c->number_of_initialization_tasks)
48        goto failed;
49   
50    _Thread_Disable_dispatch();
51
52    itask = c->User_initialization_tasks_table + n;
53
54    /*
55     * dummy up a fake id and name for this item
56     */
57
58    canonical_init_task->id = n;
59    canonical_init_task->name = itask->name;
60
61    *next_id += 1;
62    return (void *) itask;
63
64failed:
65    *next_id = RTEMS_OBJECT_ID_FINAL;
66    return 0;
67}
68
69
70void
71rtems_monitor_init_task_dump_header(
72    boolean verbose
73)
74{
75    printf("\
76  #    NAME   ENTRY        ARGUMENT    PRIO   MODES  ATTRIBUTES   STACK SIZE\n");
77/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
780         1         2         3         4         5         6         7       */
79    rtems_monitor_separator();
80}
81
82/*
83 */
84
85void
86rtems_monitor_init_task_dump(
87    rtems_monitor_init_task_t *monitor_itask,
88    boolean  verbose
89)
90{
91    int length = 0;
92
93    length += rtems_monitor_dump_decimal(monitor_itask->id);
94
95    length += rtems_monitor_pad(7, length);
96    length += rtems_monitor_dump_name(monitor_itask->name);
97
98    length += rtems_monitor_pad(14, length);
99    length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
100
101    length += rtems_monitor_pad(25, length);
102    length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
103
104    length += rtems_monitor_pad(39, length);
105    length += rtems_monitor_dump_priority(monitor_itask->priority);
106
107    length += rtems_monitor_pad(46, length);
108    length += rtems_monitor_dump_modes(monitor_itask->modes);
109
110    length += rtems_monitor_pad(54, length);
111    length += rtems_monitor_dump_attributes(monitor_itask->attributes);
112   
113    length += rtems_monitor_pad(66, length);
114    length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
115
116    printf("\n");
117}
Note: See TracBrowser for help on using the repository browser.