1 | /* |
---|
2 | * RTEMS Monitor region support |
---|
3 | */ |
---|
4 | |
---|
5 | #ifdef HAVE_CONFIG_H |
---|
6 | #include "config.h" |
---|
7 | #endif |
---|
8 | |
---|
9 | #include <rtems.h> |
---|
10 | #include "monitor.h" |
---|
11 | #include <rtems/rtems/attrimpl.h> |
---|
12 | #include <stdio.h> |
---|
13 | #include <string.h> /* memcpy() */ |
---|
14 | |
---|
15 | void |
---|
16 | rtems_monitor_region_canonical( |
---|
17 | rtems_monitor_region_t *canonical_region, |
---|
18 | const void *region_void |
---|
19 | ) |
---|
20 | { |
---|
21 | const Region_Control *rtems_region = (const Region_Control *) region_void; |
---|
22 | |
---|
23 | canonical_region->attribute = rtems_region->attribute_set; |
---|
24 | canonical_region->start_addr = rtems_region->starting_address; |
---|
25 | canonical_region->length = rtems_region->length; |
---|
26 | canonical_region->page_size = rtems_region->page_size; |
---|
27 | canonical_region->max_seg_size = rtems_region->maximum_segment_size; |
---|
28 | canonical_region->used_blocks = rtems_region->number_of_used_blocks; |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | void |
---|
33 | rtems_monitor_region_dump_header( |
---|
34 | bool verbose __attribute__((unused)) |
---|
35 | ) |
---|
36 | { |
---|
37 | printf("\ |
---|
38 | ID NAME ATTR STARTADDR LENGTH PAGE_SIZE USED_BLOCKS\n"); |
---|
39 | /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 |
---|
40 | 1 2 3 4 5 6 7 */ |
---|
41 | |
---|
42 | rtems_monitor_separator(); |
---|
43 | } |
---|
44 | |
---|
45 | /* |
---|
46 | */ |
---|
47 | |
---|
48 | void |
---|
49 | rtems_monitor_region_dump( |
---|
50 | rtems_monitor_region_t *monitor_region, |
---|
51 | bool verbose __attribute__((unused)) |
---|
52 | ) |
---|
53 | { |
---|
54 | int length = 0; |
---|
55 | |
---|
56 | length += rtems_monitor_dump_id(monitor_region->id); |
---|
57 | length += rtems_monitor_pad(11, length); |
---|
58 | length += rtems_monitor_dump_name(monitor_region->id); |
---|
59 | length += rtems_monitor_pad(18, length); |
---|
60 | length += rtems_monitor_dump_attributes(monitor_region->attribute); |
---|
61 | length += rtems_monitor_pad(30, length); |
---|
62 | length += rtems_monitor_dump_addr(monitor_region->start_addr); |
---|
63 | length += rtems_monitor_pad(40, length); |
---|
64 | length += rtems_monitor_dump_hex(monitor_region->length); |
---|
65 | length += rtems_monitor_pad(50, length); |
---|
66 | length += rtems_monitor_dump_hex(monitor_region->page_size); |
---|
67 | length += rtems_monitor_pad(60, length); |
---|
68 | length += rtems_monitor_dump_hex(monitor_region->used_blocks); |
---|
69 | printf("\n"); |
---|
70 | } |
---|
71 | |
---|