File indexing completed on 2025-05-11 08:24:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifdef HAVE_CONFIG_H
0013 #include "config.h"
0014 #endif
0015
0016 #include <inttypes.h>
0017
0018 #include <rtems.h>
0019 #include <rtems/malloc.h>
0020 #include <rtems/shell.h>
0021 #include <rtems/score/protectedheap.h>
0022 #include <rtems/score/wkspace.h>
0023 #include "internal.h"
0024
0025 void rtems_shell_print_unified_work_area_message(void)
0026 {
0027 printf( "C Program Heap and RTEMS Workspace are %s.\n",
0028 rtems_configuration_get_unified_work_area() ? "the same" : "separate"
0029 );
0030 }
0031
0032 static int rtems_shell_main_wkspace_info(
0033 int argc RTEMS_UNUSED,
0034 char *argv[] RTEMS_UNUSED
0035 )
0036 {
0037 Heap_Information_block info;
0038
0039 rtems_shell_print_unified_work_area_message();
0040
0041 _Protected_heap_Get_information( &_Workspace_Area, &info );
0042 rtems_shell_print_heap_info( "free", &info.Free );
0043 rtems_shell_print_heap_info( "used", &info.Used );
0044 rtems_shell_print_heap_stats( &info.Stats );
0045
0046 return 0;
0047 }
0048
0049 rtems_shell_cmd_t rtems_shell_WKSPACE_INFO_Command = {
0050 "wkspace",
0051 "Report on RTEMS Executive Workspace",
0052 "rtems",
0053 rtems_shell_main_wkspace_info,
0054 NULL,
0055 NULL
0056 };