source: rtems/c/src/lib/libmisc/monitor/mon-mpci.c @ e642446

4.104.114.84.95
Last change on this file since e642446 was e642446, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 6, 1996 at 9:37:43 PM

As part of reducing visibility into rtems and hiding the .inl files
from the application code, this file required more visibility than
is given by default to application code.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*
2 *      @(#)mpci.c      1.6 - 95/08/02
3 *     
4 *
5 * RTEMS MPCI Config display support
6 *
7 * TODO
8 *
9 *  $Id$
10 */
11
12
13#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
14#include <rtems.h>
15#include "monitor.h"
16
17#include <stdio.h>
18#include <stdlib.h>             /* strtoul() */
19
20#define DATACOL 15
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_mpci_canonical(
29    rtems_monitor_mpci_t *canonical_mpci,
30    void                  *config_void
31)
32{
33    rtems_configuration_table *c = _Configuration_Table;
34    rtems_multiprocessing_table *m;
35    rtems_mpci_table *mt;
36
37    m = c->User_multiprocessing_table;
38    if (m == 0)
39        return;
40    mt = m->User_mpci_table;
41   
42    canonical_mpci->node = m->node;
43    canonical_mpci->maximum_nodes = m->maximum_nodes;
44    canonical_mpci->maximum_global_objects = m->maximum_global_objects;
45    canonical_mpci->maximum_proxies = m->maximum_proxies;
46
47    canonical_mpci->default_timeout = mt->default_timeout;
48    canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
49
50    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
51                                            mt->initialization);
52
53    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
54                                            mt->get_packet);
55    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
56                                            mt->return_packet);
57    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
58                                            mt->send_packet);
59    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
60                                            mt->receive_packet);
61}   
62
63/*
64 * This is easy, since there is only 1 (altho we could get them from
65 *    other nodes...)
66 */
67
68void *
69rtems_monitor_mpci_next(
70    void                  *object_info,
71    rtems_monitor_mpci_t  *canonical_mpci,
72    rtems_id              *next_id
73)
74{
75    rtems_configuration_table *c = _Configuration_Table;
76    int n = rtems_get_index(*next_id);
77
78    if (n >= 1)
79        goto failed;
80   
81    if ( ! c->User_multiprocessing_table)
82        goto failed;
83   
84    _Thread_Disable_dispatch();
85
86    *next_id += 1;
87    return (void *) c;
88
89failed:
90    *next_id = RTEMS_OBJECT_ID_FINAL;
91    return 0;
92}
93
94
95void
96rtems_monitor_mpci_dump_header(
97    boolean verbose
98)
99{
100    printf("\
101           max     max     max     default    max\n\
102   node   nodes  globals  proxies  timeout  pktsize\n");
103/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
1040         1         2         3         4         5         6         7       */
105           
106    rtems_monitor_separator();
107}
108
109
110void
111rtems_monitor_mpci_dump(
112    rtems_monitor_mpci_t *monitor_mpci,
113    boolean               verbose
114)
115{
116    unsigned32   length = 0;
117
118    length += rtems_monitor_pad(2, length);
119    length += printf("  %d", monitor_mpci->node);
120    length += rtems_monitor_pad(11, length);
121    length += printf("%d", monitor_mpci->maximum_nodes);
122   
123    length += rtems_monitor_pad(18, length);
124    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
125   
126    length += rtems_monitor_pad(28, length);
127    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
128
129    length += rtems_monitor_pad(37, length);
130    length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
131
132    length += rtems_monitor_pad(46, length);
133    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
134
135    printf("\n");
136    length = 0;
137    length += rtems_monitor_pad(DATACOL, length);
138
139    length += printf("init: ");
140    length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
141
142    printf("\n");
143    length = 0;
144    length += rtems_monitor_pad(DATACOL, length);
145
146    length += printf("get: ");
147    length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
148    length += printf(";  return: ");
149    length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
150
151    printf("\n");
152    length = 0;
153    length += rtems_monitor_pad(DATACOL, length);
154
155    length += printf("send: ");
156    length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
157    length += printf(";  receive: ");
158    length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
159
160    printf("\n");
161    length = 0;
162}
Note: See TracBrowser for help on using the repository browser.