source: rtems/cpukit/libmisc/monitor/mon-itask.c @ 2cc9367

4.104.114.84.95
Last change on this file since 2cc9367 was 550c3df7, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/08/03 at 08:39:16

2003-07-08 Ralf Corsepius <corsepiu@…>

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