source: rtems/c/src/libmisc/monitor/mon-config.c @ 9863dbf

4.104.114.84.95
Last change on this file since 9863dbf was b06e68ef, checked in by Joel Sherrill <joel.sherrill@…>, on 08/17/95 at 19:51:51

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