File indexing completed on 2025-05-11 08:24:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifdef HAVE_CONFIG_H
0035 #include "config.h"
0036 #endif
0037
0038 #include <rtems.h>
0039 #include <rtems/monitor.h>
0040 #include <rtems/rtems/attrimpl.h>
0041 #include <rtems/rtems/partdata.h>
0042 #include <stdio.h>
0043 #include <string.h> /* memcpy() */
0044
0045 void
0046 rtems_monitor_part_canonical(
0047 rtems_monitor_part_t *canonical_part,
0048 const void *part_void
0049 )
0050 {
0051 const Partition_Control *rtems_part = (const Partition_Control *) part_void;
0052
0053 canonical_part->attribute = rtems_part->attribute_set;
0054 canonical_part->start_addr = rtems_part->base_address;
0055 canonical_part->length = (uint32_t) ( (uintptr_t)
0056 rtems_part->limit_address + 1 - (uintptr_t) rtems_part->base_address );
0057 canonical_part->buf_size = rtems_part->buffer_size;
0058 canonical_part->used_blocks = rtems_part->number_of_used_blocks;
0059 }
0060
0061
0062 void
0063 rtems_monitor_part_dump_header(
0064 bool verbose RTEMS_UNUSED
0065 )
0066 {
0067 printf("\
0068 ID NAME ATTR STARTADDR LENGTH BUF_SIZE USED_BLOCKS\n");
0069
0070
0071
0072 rtems_monitor_separator();
0073 }
0074
0075
0076
0077
0078 void
0079 rtems_monitor_part_dump(
0080 rtems_monitor_part_t *monitor_part,
0081 bool verbose RTEMS_UNUSED
0082 )
0083 {
0084 int length = 0;
0085
0086 length += rtems_monitor_dump_id(monitor_part->id);
0087 length += rtems_monitor_pad(11, length);
0088 length += rtems_monitor_dump_name(monitor_part->id);
0089 length += rtems_monitor_pad(18, length);
0090 length += rtems_monitor_dump_attributes(monitor_part->attribute);
0091 length += rtems_monitor_pad(30, length);
0092 length += rtems_monitor_dump_addr(monitor_part->start_addr);
0093 length += rtems_monitor_pad(40, length);
0094 length += rtems_monitor_dump_hex(monitor_part->length);
0095 length += rtems_monitor_pad(50, length);
0096 length += rtems_monitor_dump_hex(monitor_part->buf_size);
0097 length += rtems_monitor_pad(60, length);
0098 length += rtems_monitor_dump_hex(monitor_part->used_blocks);
0099 printf("\n");
0100 }
0101