[PATCH] libmisc/monitor: Correctly print unlimited configuration table entries.

Chris Johns chrisj at rtems.org
Tue Apr 18 02:45:47 UTC 2017


Closes #2997.
---
 cpukit/libmisc/monitor/mon-config.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/cpukit/libmisc/monitor/mon-config.c b/cpukit/libmisc/monitor/mon-config.c
index f09c7cb195..bb804c5c63 100644
--- a/cpukit/libmisc/monitor/mon-config.c
+++ b/cpukit/libmisc/monitor/mon-config.c
@@ -116,18 +116,27 @@ rtems_monitor_config_dump(
     length = 0;
     length += fprintf(stdout,"MAXIMUMS");
     length += rtems_monitor_pad(DATACOL, length);
-    length += fprintf(stdout,"tasks: %" PRId32 ";  timers: %" PRId32 ";  sems: %" PRId32 ";  que's: %" PRId32 ";  ext's: %" PRId32 "\n",
-                     monitor_config->maximum_tasks,
-                     monitor_config->maximum_timers,
-                     monitor_config->maximum_semaphores,
-                     monitor_config->maximum_message_queues,
-                     monitor_config->maximum_extensions);
+    length += fprintf(stdout,"tasks: %" PRId32 "%c;  timers: %" PRId32 "%c;  sems: %" PRId32 "%c;  que's: %" PRId32 "%c;  ext's: %" PRId32 "%c;\n",
+                     monitor_config->maximum_tasks & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_tasks & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_timers & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_timers & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_semaphores & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_semaphores & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_message_queues & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_message_queues & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_extensions & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_extensions & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+');
     length = 0;
     length += rtems_monitor_pad(CONTCOL, length);
-    length += fprintf(stdout,"partitions: %" PRId32 ";  regions: %" PRId32 ";  ports: %" PRId32 ";  periods: %" PRId32 "\n",
-                     monitor_config->maximum_partitions,
-                     monitor_config->maximum_regions,
-                     monitor_config->maximum_ports,
-                     monitor_config->maximum_periods);
+    length += fprintf(stdout,"partitions: %" PRId32 "%c;  regions: %" PRId32 "%c;  ports: %" PRId32 "%c;  periods: %" PRId32 "%c;\n",
+                     monitor_config->maximum_partitions & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_partitions & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_regions & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_regions & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_ports & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_ports & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+',
+                     monitor_config->maximum_periods & ~OBJECTS_UNLIMITED_OBJECTS,
+                     (monitor_config->maximum_periods & OBJECTS_UNLIMITED_OBJECTS) == 0 ? ' ' : '+');
     return length;
 }
-- 
2.11.0



More information about the devel mailing list