source: rtems/c/src/libmisc/monitor/mon-itask.c @ e642446

4.104.114.84.95
Last change on this file since e642446 was e642446, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 6, 1996 at 9:37:43 PM

As part of reducing visibility into rtems and hiding the .inl files
from the application code, this file required more visibility than
is given by default to application code.

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