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

4.104.114.84.95
Last change on this file since 0836603 was be95da0, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 18, 1996 at 8:55:13 PM

casts added to numerous arguments, prototypes corrected, and
proper include files added.

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