1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | #ifdef HAVE_CONFIG_H1 |
10 | #include "config.h" |
11 | #endif |
12 | |
13 | #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ |
14 | #include <rtems.h> |
15 | #include <rtems/monitor.h> |
16 | |
17 | #include <inttypes.h> |
18 | #include <stdio.h> |
19 | #include <stdlib.h> /* strtoul() */ |
20 | |
21 | #define DATACOL15 15 |
22 | #define CONTCOL15 DATACOL15 /* continued col */ |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | void |
30 | rtems_monitor_config_canonical( |
31 | rtems_monitor_config_t *canonical_config, |
32 | void *config_void |
33 | ) |
34 | { |
35 | rtems_configuration_table *c = (rtems_configuration_table *) config_void; |
36 | rtems_api_configuration_table *r = &Configuration_RTEMS_API; |
37 | |
38 | canonical_config->work_space_start = c->work_space_start; |
39 | canonical_config->work_space_size = c->work_space_size; |
40 | canonical_config->maximum_tasks = r->maximum_tasks; |
41 | canonical_config->maximum_timers = r->maximum_timers; |
42 | canonical_config->maximum_semaphores = r->maximum_semaphores; |
43 | canonical_config->maximum_message_queues = r->maximum_message_queues; |
44 | canonical_config->maximum_partitions = r->maximum_partitions; |
45 | canonical_config->maximum_regions = r->maximum_regions; |
46 | canonical_config->maximum_ports = r->maximum_ports; |
47 | canonical_config->maximum_periods = r->maximum_periods; |
48 | canonical_config->maximum_extensions = c->maximum_extensions; |
49 | canonical_config->microseconds_per_tick = c->microseconds_per_tick; |
50 | canonical_config->ticks_per_timeslice = c->ticks_per_timeslice; |
51 | canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks; |
52 | } |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | void * |
60 | rtems_monitor_config_next( |
61 | void *object_info __attribute__((unused)), |
62 | rtems_monitor_config_t *canonical_config __attribute__((unused)), |
63 | rtems_id *next_id |
64 | ) |
65 | { |
66 | rtems_configuration_table *c = &Configuration; |
67 | int n = rtems_object_id_get_index(*next_id)_Objects_Get_index( *next_id ); |
68 | |
69 | if (n >= 1) |
70 | goto failed; |
71 | |
72 | _Thread_Disable_dispatch(); |
73 | |
74 | *next_id += 1; |
75 | return (void *) c; |
76 | |
77 | failed: |
78 | *next_id = RTEMS_OBJECT_ID_FINAL((Objects_Id)~0); |
79 | return 0; |
80 | } |
81 | |
82 | |
83 | void |
84 | rtems_monitor_config_dump_header( |
85 | bool_Bool verbose __attribute__((unused)) |
86 | ) |
87 | { |
88 | fprintf(stdoutstdout,"\ |
89 | INITIAL (startup) Configuration Info\n"); |
90 | |
91 | |
92 | rtems_monitor_separator(); |
93 | } |
94 | |
95 | |
96 | int |
97 | rtems_monitor_config_dump( |
98 | rtems_monitor_config_t *monitor_config, |
99 | bool_Bool verbose __attribute__((unused)) |
100 | ) |
101 | { |
102 | int length = 0; |
103 | |
104 | length = 0; |
105 | length += fprintf(stdoutstdout,"WORKSPACE"); |
106 | length += rtems_monitor_pad(DATACOL15, length); |
107 | length += fprintf(stdoutstdout,"start: %p; size: 0x%" PRIx32"x" "\n", |
108 | monitor_config->work_space_start, |
109 | monitor_config->work_space_size); |
110 | |
111 | length = 0; |
112 | length += fprintf(stdoutstdout,"TIME"); |
113 | length += rtems_monitor_pad(DATACOL15, length); |
114 | length += fprintf(stdoutstdout,"usec/tick: %" PRId32"d" "; tick/timeslice: %" PRId32"d" "; tick/sec: %" PRId32"d" "\n", |
115 | monitor_config->microseconds_per_tick, |
116 | monitor_config->ticks_per_timeslice, |
117 | 1000000 / monitor_config->microseconds_per_tick); |
118 | |
119 | length = 0; |
120 | length += fprintf(stdoutstdout,"MAXIMUMS"); |
121 | length += rtems_monitor_pad(DATACOL15, length); |
122 | length += fprintf(stdoutstdout,"tasks: %" PRId32"d" "; timers: %" PRId32"d" "; sems: %" PRId32"d" "; que's: %" PRId32"d" "; ext's: %" PRId32"d" "\n", |
| Value stored to 'length' is never read |
123 | monitor_config->maximum_tasks, |
124 | monitor_config->maximum_timers, |
125 | monitor_config->maximum_semaphores, |
126 | monitor_config->maximum_message_queues, |
127 | monitor_config->maximum_extensions); |
128 | length = 0; |
129 | length += rtems_monitor_pad(CONTCOL15, length); |
130 | length += fprintf(stdoutstdout,"partitions: %" PRId32"d" "; regions: %" PRId32"d" "; ports: %" PRId32"d" "; periods: %" PRId32"d" "\n", |
131 | monitor_config->maximum_partitions, |
132 | monitor_config->maximum_regions, |
133 | monitor_config->maximum_ports, |
134 | monitor_config->maximum_periods); |
135 | return length; |
136 | } |