OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [libmisc/] [monitor/] [mon-mpci.c] - Blame information for rev 279

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 * RTEMS MPCI Config display support
3
 *
4
 * TODO
5
 *
6
 *  $Id: mon-mpci.c,v 1.2 2001-09-27 12:01:43 chris Exp $
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
 
19
/*
20
 * Fill in entire monitor config table
21
 * for sending to a remote monitor or printing on the local system
22
 */
23
 
24
void
25
rtems_monitor_mpci_canonical(
26
    rtems_monitor_mpci_t *canonical_mpci,
27
    void                  *config_void
28
)
29
{
30
    rtems_configuration_table *c = _Configuration_Table;
31
    rtems_multiprocessing_table *m;
32
    rtems_mpci_table *mt;
33
 
34
    m = c->User_multiprocessing_table;
35
    if (m == 0)
36
        return;
37
    mt = m->User_mpci_table;
38
 
39
    canonical_mpci->node = m->node;
40
    canonical_mpci->maximum_nodes = m->maximum_nodes;
41
    canonical_mpci->maximum_global_objects = m->maximum_global_objects;
42
    canonical_mpci->maximum_proxies = m->maximum_proxies;
43
 
44
    canonical_mpci->default_timeout = mt->default_timeout;
45
    canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
46
 
47
    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
48
                                            (void *) mt->initialization);
49
 
50
    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
51
                                            (void *) mt->get_packet);
52
    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
53
                                            (void *) mt->return_packet);
54
    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
55
                                            (void *) mt->send_packet);
56
    rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
57
                                            (void *) mt->receive_packet);
58
}
59
 
60
/*
61
 * This is easy, since there is only 1 (altho we could get them from
62
 *    other nodes...)
63
 */
64
 
65
void *
66
rtems_monitor_mpci_next(
67
    void                  *object_info,
68
    rtems_monitor_mpci_t  *canonical_mpci,
69
    rtems_id              *next_id
70
)
71
{
72
    rtems_configuration_table *c = _Configuration_Table;
73
    int n = rtems_get_index(*next_id);
74
 
75
    if (n >= 1)
76
        goto failed;
77
 
78
    if ( ! c->User_multiprocessing_table)
79
        goto failed;
80
 
81
    _Thread_Disable_dispatch();
82
 
83
    *next_id += 1;
84
    return (void *) c;
85
 
86
failed:
87
    *next_id = RTEMS_OBJECT_ID_FINAL;
88
    return 0;
89
}
90
 
91
 
92
void
93
rtems_monitor_mpci_dump_header(
94
    boolean verbose
95
)
96
{
97
    printf("\
98
           max     max     max     default    max\n\
99
   node   nodes  globals  proxies  timeout  pktsize\n");
100
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
101
 
102
 
103
    rtems_monitor_separator();
104
}
105
 
106
 
107
void
108
rtems_monitor_mpci_dump(
109
    rtems_monitor_mpci_t *monitor_mpci,
110
    boolean               verbose
111
)
112
{
113
    unsigned32   length = 0;
114
 
115
    length += rtems_monitor_pad(2, length);
116
    length += printf("  %d", monitor_mpci->node);
117
    length += rtems_monitor_pad(11, length);
118
    length += printf("%d", monitor_mpci->maximum_nodes);
119
 
120
    length += rtems_monitor_pad(18, length);
121
    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
122
 
123
    length += rtems_monitor_pad(28, length);
124
    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
125
 
126
    length += rtems_monitor_pad(37, length);
127
    length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
128
 
129
    length += rtems_monitor_pad(46, length);
130
    length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
131
 
132
    printf("\n");
133
    length = 0;
134
    length += rtems_monitor_pad(DATACOL, length);
135
 
136
    length += printf("init: ");
137
    length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
138
 
139
    printf("\n");
140
    length = 0;
141
    length += rtems_monitor_pad(DATACOL, length);
142
 
143
    length += printf("get: ");
144
    length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
145
    length += printf(";  return: ");
146
    length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
147
 
148
    printf("\n");
149
    length = 0;
150
    length += rtems_monitor_pad(DATACOL, length);
151
 
152
    length += printf("send: ");
153
    length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
154
    length += printf(";  receive: ");
155
    length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
156
 
157
    printf("\n");
158
    length = 0;
159
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.