source: rtems/cpukit/libmisc/monitor/mon-region.c @ e8e914b3

Last change on this file since e8e914b3 was e8e914b3, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 8, 2018 at 9:37:22 AM

rtems: Move internal structures to regiondata.h

Update #3598.

  • Property mode set to 100644
File size: 2.1 KB
Line 
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 <rtems/monitor.h>
11#include <rtems/rtems/attrimpl.h>
12#include <rtems/rtems/regiondata.h>
13#include <stdio.h>
14#include <string.h>    /* memcpy() */
15
16void
17rtems_monitor_region_canonical(
18    rtems_monitor_region_t  *canonical_region,
19    const void              *region_void
20)
21{
22    const Region_Control *rtems_region = (const Region_Control *) region_void;
23    const Heap_Control *heap = &rtems_region->Memory;
24
25    canonical_region->attribute = rtems_region->attribute_set;
26    canonical_region->start_addr = (void *) heap->area_begin;
27    canonical_region->length = heap->area_end - heap->area_begin;
28    canonical_region->page_size = heap->page_size;
29    canonical_region->max_seg_size = rtems_region->maximum_segment_size;
30    canonical_region->used_blocks = heap->stats.used_blocks;
31}
32
33
34void
35rtems_monitor_region_dump_header(
36    bool verbose RTEMS_UNUSED
37)
38{
39    printf("\
40  ID       NAME   ATTR        STARTADDR LENGTH    PAGE_SIZE USED_BLOCKS\n");
41/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234
42          1         2         3         4         5         6         7    */
43
44    rtems_monitor_separator();
45}
46
47/*
48 */
49
50void
51rtems_monitor_region_dump(
52    rtems_monitor_region_t *monitor_region,
53    bool  verbose RTEMS_UNUSED
54)
55{
56    int length = 0;
57
58    length += rtems_monitor_dump_id(monitor_region->id);
59    length += rtems_monitor_pad(11, length);
60    length += rtems_monitor_dump_name(monitor_region->id);
61    length += rtems_monitor_pad(18, length);
62    length += rtems_monitor_dump_attributes(monitor_region->attribute);
63    length += rtems_monitor_pad(30, length);
64    length += rtems_monitor_dump_addr(monitor_region->start_addr);
65    length += rtems_monitor_pad(40, length);
66    length += rtems_monitor_dump_hex(monitor_region->length);
67    length += rtems_monitor_pad(50, length);
68    length += rtems_monitor_dump_hex(monitor_region->page_size);
69    length += rtems_monitor_pad(60, length);
70    length += rtems_monitor_dump_hex(monitor_region->used_blocks);
71    printf("\n");
72}
73
Note: See TracBrowser for help on using the repository browser.