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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 30 unneback
/*
2
 * RTEMS Config display support
3
 *
4
 * TODO
5
 *
6
 *  $Id: mon-config.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
#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
 
25
void
26
rtems_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
 
55
void *
56
rtems_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
 
73
failed:
74
    *next_id = RTEMS_OBJECT_ID_FINAL;
75
    return 0;
76
}
77
 
78
 
79
void
80
rtems_monitor_config_dump_header(
81
    boolean verbose
82
)
83
{
84
    printf("\
85
INITIAL (startup) Configuration Info\n");
86
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
87
 
88
    rtems_monitor_separator();
89
}
90
 
91
 
92
void
93
rtems_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
}

powered by: WebSVN 2.1.0

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