source: rtems/cpukit/libmisc/monitor/mon-config.c @ b9e230a2

Last change on this file since b9e230a2 was b9e230a2, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/08/03 at 08:38:15

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: 4.0 KB
Line 
1/*
2 * RTEMS Config display support
3 *
4 * TODO
5 *
6 *  $Id$
7 */
8
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
14#include <rtems.h>
15#include <rtems/monitor.h>
16
17#include <stdio.h>
18#include <stdlib.h>             /* strtoul() */
19
20#define DATACOL 15
21#define CONTCOL DATACOL         /* continued col */
22
23/*
24 * Fill in entire monitor config table
25 * for sending to a remote monitor or printing on the local system
26 */
27
28void
29rtems_monitor_config_canonical(
30    rtems_monitor_config_t *canonical_config,
31    void                   *config_void
32)
33{
34    rtems_configuration_table *c = (rtems_configuration_table *) config_void;
35    rtems_api_configuration_table *r = c->RTEMS_api_configuration;
36
37    canonical_config->work_space_start = c->work_space_start;
38    canonical_config->work_space_size = c->work_space_size;
39    canonical_config->maximum_tasks = r->maximum_tasks;
40    canonical_config->maximum_timers = r->maximum_timers;
41    canonical_config->maximum_semaphores = r->maximum_semaphores;
42    canonical_config->maximum_message_queues = r->maximum_message_queues;
43    canonical_config->maximum_partitions = r->maximum_partitions;
44    canonical_config->maximum_regions = r->maximum_regions;
45    canonical_config->maximum_ports = r->maximum_ports;
46    canonical_config->maximum_periods = r->maximum_periods;
47    canonical_config->maximum_extensions = c->maximum_extensions;
48    canonical_config->microseconds_per_tick = c->microseconds_per_tick;
49    canonical_config->ticks_per_timeslice = c->ticks_per_timeslice;
50    canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks;
51}   
52
53/*
54 * This is easy, since there is only 1 (altho we could get them from
55 *    other nodes...)
56 */
57
58void *
59rtems_monitor_config_next(
60    void                  *object_info,
61    rtems_monitor_config_t *canonical_config,
62    rtems_id              *next_id
63)
64{
65    rtems_configuration_table *c = _Configuration_Table;
66    int n = rtems_get_index(*next_id);
67
68    if (n >= 1)
69        goto failed;
70   
71    _Thread_Disable_dispatch();
72
73    *next_id += 1;
74    return (void *) c;
75
76failed:
77    *next_id = RTEMS_OBJECT_ID_FINAL;
78    return 0;
79}
80
81
82void
83rtems_monitor_config_dump_header(
84    boolean verbose
85)
86{
87    printf("\
88INITIAL (startup) Configuration Info\n");
89/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
900         1         2         3         4         5         6         7       */
91    rtems_monitor_separator();
92}
93
94
95void
96rtems_monitor_config_dump(
97    rtems_monitor_config_t *monitor_config,
98    boolean                 verbose
99)
100{
101    unsigned32   length = 0;
102
103    length = 0;
104    length += printf("WORKSPACE");
105    length += rtems_monitor_pad(DATACOL, length);
106    length += printf("start: 0x%x;  size: 0x%x\n",
107                     (unsigned32) monitor_config->work_space_start,
108                     monitor_config->work_space_size);
109
110    length = 0;
111    length += printf("TIME");
112    length += rtems_monitor_pad(DATACOL, length);
113    length += printf("usec/tick: %d;  tick/timeslice: %d;  tick/sec: %d\n",
114                     monitor_config->microseconds_per_tick,
115                     monitor_config->ticks_per_timeslice,
116                     1000000 / monitor_config->microseconds_per_tick);
117
118    length = 0;
119    length += printf("MAXIMUMS");
120    length += rtems_monitor_pad(DATACOL, length);
121    length += printf("tasks: %d;  timers: %d;  sems: %d;  que's: %d;  ext's: %d\n",
122                     monitor_config->maximum_tasks,
123                     monitor_config->maximum_timers,
124                     monitor_config->maximum_semaphores,
125                     monitor_config->maximum_message_queues,
126                     monitor_config->maximum_extensions);
127    length = 0;
128    length += rtems_monitor_pad(CONTCOL, length);
129    length += printf("partitions: %d;  regions: %d;  ports: %d;  periods: %d\n",
130                     monitor_config->maximum_partitions,
131                     monitor_config->maximum_regions,
132                     monitor_config->maximum_ports,
133                     monitor_config->maximum_periods);
134}
Note: See TracBrowser for help on using the repository browser.