From b06e68ef1f6df69cc86d72356c3a002054a35fad Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Aug 1995 19:51:51 +0000 Subject: Numerous miscellaneous features incorporated from Tony Bennett (tbennett@divnc.com) including the following major additions: + variable length messages + named devices + debug monitor + association tables/variables --- c/src/libmisc/monitor/mon-config.c | 132 +++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 c/src/libmisc/monitor/mon-config.c (limited to 'c/src/libmisc/monitor/mon-config.c') diff --git a/c/src/libmisc/monitor/mon-config.c b/c/src/libmisc/monitor/mon-config.c new file mode 100644 index 0000000000..1c3ece086f --- /dev/null +++ b/c/src/libmisc/monitor/mon-config.c @@ -0,0 +1,132 @@ +/* + * @(#)config.c 1.5 - 95/08/02 + * + * + * RTEMS Config display support + * + * TODO + * + * $Id$ + */ + + +#include +#include "monitor.h" + +#include +#include /* strtoul() */ + +#define DATACOL 15 +#define CONTCOL DATACOL /* continued col */ + +/* + * Fill in entire monitor config table + * for sending to a remote monitor or printing on the local system + */ + +void +rtems_monitor_config_canonical( + rtems_monitor_config_t *canonical_config, + void *config_void +) +{ + rtems_configuration_table *c = (rtems_configuration_table *) config_void; + + canonical_config->work_space_start = c->work_space_start; + canonical_config->work_space_size = c->work_space_size; + canonical_config->maximum_tasks = c->maximum_tasks; + canonical_config->maximum_timers = c->maximum_timers; + canonical_config->maximum_semaphores = c->maximum_semaphores; + canonical_config->maximum_message_queues = c->maximum_message_queues; + canonical_config->maximum_partitions = c->maximum_partitions; + canonical_config->maximum_regions = c->maximum_regions; + canonical_config->maximum_ports = c->maximum_ports; + canonical_config->maximum_periods = c->maximum_periods; + canonical_config->maximum_extensions = c->maximum_extensions; + canonical_config->microseconds_per_tick = c->microseconds_per_tick; + canonical_config->ticks_per_timeslice = c->ticks_per_timeslice; + canonical_config->number_of_initialization_tasks = c->number_of_initialization_tasks; +} + +/* + * This is easy, since there is only 1 (altho we could get them from + * other nodes...) + */ + +void * +rtems_monitor_config_next( + void *object_info, + rtems_monitor_config_t *canonical_config, + rtems_id *next_id +) +{ + rtems_configuration_table *c = _Configuration_Table; + int n = rtems_get_index(*next_id); + + if (n >= 1) + goto failed; + + _Thread_Disable_dispatch(); + + *next_id += 1; + return (void *) c; + +failed: + *next_id = RTEMS_OBJECT_ID_FINAL; + return 0; +} + + +void +rtems_monitor_config_dump_header( + boolean verbose +) +{ + printf("\ +INITIAL (startup) Configuration Info\n"); +/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 +0 1 2 3 4 5 6 7 */ + rtems_monitor_separator(); +} + + +void +rtems_monitor_config_dump( + rtems_monitor_config_t *monitor_config, + boolean verbose +) +{ + unsigned32 length = 0; + + length = 0; + length += printf("WORKSPACE"); + length += rtems_monitor_pad(DATACOL, length); + length += printf("start: 0x%x; size: 0x%x\n", + (unsigned32) monitor_config->work_space_start, + monitor_config->work_space_size); + + length = 0; + length += printf("TIME"); + length += rtems_monitor_pad(DATACOL, length); + length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n", + monitor_config->microseconds_per_tick, + monitor_config->ticks_per_timeslice, + 1000000 / monitor_config->microseconds_per_tick); + + length = 0; + length += printf("MAXIMUMS"); + length += rtems_monitor_pad(DATACOL, length); + length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n", + monitor_config->maximum_tasks, + monitor_config->maximum_timers, + monitor_config->maximum_semaphores, + monitor_config->maximum_message_queues, + monitor_config->maximum_extensions); + length = 0; + length += rtems_monitor_pad(CONTCOL, length); + length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n", + monitor_config->maximum_partitions, + monitor_config->maximum_regions, + monitor_config->maximum_ports, + monitor_config->maximum_periods); +} -- cgit v1.2.3