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

4.104.114.84.95
Last change on this file since 5e622a9 was 5beb562, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 21, 1997 at 4:58:57 PM

Cleaned up as part of adding the Monitor test.

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