1 | /* |
---|
2 | * @(#)queue.c 1.5 - 95/07/31 |
---|
3 | * |
---|
4 | * $Id$ |
---|
5 | */ |
---|
6 | |
---|
7 | #include <rtems.h> |
---|
8 | #include "monitor.h" |
---|
9 | |
---|
10 | #include <stdio.h> |
---|
11 | |
---|
12 | void |
---|
13 | rtems_monitor_queue_canonical( |
---|
14 | rtems_monitor_queue_t *canonical_queue, |
---|
15 | void *queue_void |
---|
16 | ) |
---|
17 | { |
---|
18 | Message_queue_Control *rtems_queue = (Message_queue_Control *) queue_void; |
---|
19 | |
---|
20 | canonical_queue->attributes = rtems_queue->attribute_set; |
---|
21 | canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size; |
---|
22 | canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages; |
---|
23 | canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages; |
---|
24 | } |
---|
25 | |
---|
26 | void |
---|
27 | rtems_monitor_queue_dump_header( |
---|
28 | boolean verbose |
---|
29 | ) |
---|
30 | { |
---|
31 | printf("\ |
---|
32 | ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n"); |
---|
33 | /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 |
---|
34 | 0 1 2 3 4 5 6 7 */ |
---|
35 | rtems_monitor_separator(); |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | /* |
---|
40 | * Dump out the "next" queue indicated by 'id'. |
---|
41 | * Returns next one to check. |
---|
42 | * Returns RTEMS_OBJECT_ID_FINAL when all done |
---|
43 | */ |
---|
44 | |
---|
45 | void |
---|
46 | rtems_monitor_queue_dump( |
---|
47 | rtems_monitor_queue_t *monitor_queue, |
---|
48 | boolean verbose |
---|
49 | ) |
---|
50 | { |
---|
51 | unsigned32 length = 0; |
---|
52 | |
---|
53 | length += rtems_monitor_dump_id(monitor_queue->id); |
---|
54 | length += rtems_monitor_pad(11, length); |
---|
55 | length += rtems_monitor_dump_name(monitor_queue->name); |
---|
56 | length += rtems_monitor_pad(19, length); |
---|
57 | length += rtems_monitor_dump_attributes(monitor_queue->attributes); |
---|
58 | length += rtems_monitor_pad(31, length); |
---|
59 | length += rtems_monitor_dump_decimal(monitor_queue->number_of_pending_messages); |
---|
60 | length += rtems_monitor_pad(39, length); |
---|
61 | length += rtems_monitor_dump_decimal(monitor_queue->maximum_pending_messages); |
---|
62 | length += rtems_monitor_pad(48, length); |
---|
63 | length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size); |
---|
64 | |
---|
65 | printf("\n"); |
---|
66 | } |
---|