Changeset 9b3f187 in rtems
- Timestamp:
- Nov 29, 2004, 10:45:43 PM (16 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 4406c2f
- Parents:
- 55243362
- Location:
- cpukit
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
r55243362 r9b3f187 1 2004-11-29 Joel Sherrill <joel@OARcorp.com> 2 3 * libcsupport/src/mallocfreespace.c, rtems/Makefile.am, 4 rtems/include/rtems/rtems/region.h, score/Makefile.am, 5 score/include/rtems/score/heap.h, score/src/heapgetinfo.c: Add 6 capability to return information about just the free blocks in a 7 region or heap. Also changed the semantics of free space available 8 to be the largest block of memory that can be allocated. 9 * rtems/src/regiongetfreeinfo.c, score/src/heapgetfreeinfo.c: New files. 10 : score/include/rtems/score/object.h, 11 score/src/objectinitializeinformation.c: Remove warning. 12 1 13 2004-11-22 Joel Sherrill <joel@OARcorp.com> 2 14 -
cpukit/libcsupport/src/mallocfreespace.c
r55243362 r9b3f187 38 38 region_information_block heap_info; 39 39 40 if ( !rtems_region_get_ information( RTEMS_Malloc_Heap, &heap_info ) ) {41 return (size_t) heap_info. free_size;40 if ( !rtems_region_get_free_information( RTEMS_Malloc_Heap, &heap_info ) ) { 41 return (size_t) heap_info.Free.largest; 42 42 } 43 43 return (size_t) -1; -
cpukit/rtems/Makefile.am
r55243362 r9b3f187 108 108 REGION_C_FILES = src/region.c src/regioncreate.c src/regiondelete.c \ 109 109 src/regionextend.c src/regiongetsegment.c src/regiongetsegmentsize.c \ 110 src/regionident.c src/regionreturnsegment.c src/regiongetinfo.c 110 src/regionident.c src/regionreturnsegment.c src/regiongetinfo.c \ 111 src/regiongetfreeinfo.c 111 112 112 113 PARTITION_C_FILES = src/part.c src/partcreate.c src/partdelete.c \ -
cpukit/rtems/include/rtems/rtems/region.h
r55243362 r9b3f187 135 135 136 136 /* 137 * rtems_region_ ident137 * rtems_region_get_information 138 138 * 139 139 * DESCRIPTION: … … 145 145 146 146 rtems_status_code rtems_region_get_information( 147 Objects_Id id, 148 Heap_Information_block *the_info 149 ); 150 151 /* 152 * rtems_region_get_free_information 153 * 154 * DESCRIPTION: 155 * 156 * This routine implements the rtems_region_get_free_information directive. 157 * This directive returns information about the free blocks in the 158 * heap associated with this region. 159 */ 160 161 rtems_status_code rtems_region_get_free_information( 147 162 Objects_Id id, 148 163 Heap_Information_block *the_info -
cpukit/score/Makefile.am
r55243362 r9b3f187 95 95 96 96 HEAP_C_FILES = src/heap.c src/heapallocate.c src/heapextend.c src/heapfree.c \ 97 src/heapsizeofuserarea.c src/heapwalk.c src/heapgetinfo.c 97 src/heapsizeofuserarea.c src/heapwalk.c src/heapgetinfo.c \ 98 src/heapgetfreeinfo.c 98 99 99 100 OBJECT_C_FILES = src/object.c src/objectallocate.c \ -
cpukit/score/include/rtems/score/heap.h
r55243362 r9b3f187 56 56 57 57 /** 58 * Information block returned by the Heap routines used to 59 * obtain statistics. This information is returned about 60 * either free or used blocks. 61 */ 62 63 typedef struct { 64 /** Number of blocks of this type. */ 65 uint32_t number; 66 /** Largest blocks of this type. */ 67 uint32_t largest; 68 /** Total size of the blocks of this type. */ 69 uint32_t total; 70 71 } Heap_Information; 72 73 74 /** 58 75 * Information block returned by _Heap_Get_information 59 76 */ 60 77 typedef struct { 61 /** This field is the number of free blocks in this heap. */ 62 uint32_t free_blocks; 63 /** This field is the amount of free memory in this heap. */ 64 uint32_t free_size; 65 /** This field is the number of used blocks in this heap. */ 66 uint32_t used_blocks; 67 /** This field is the amount of used memory in this heap. */ 68 uint32_t used_size; 78 /** This field is information on the used blocks in the heap. */ 79 Heap_Information Free; 80 /** This field is information on the used blocks in the heap. */ 81 Heap_Information Used; 69 82 } Heap_Information_block; 70 83 … … 279 292 ); 280 293 294 /** 295 * This heap routine returns information about the free blocks 296 * in the specified heap. 297 * 298 * @param the_heap (in) pointer to heap header. 299 * @param info (in) pointer to the free block information. 300 * 301 * @return free block information filled in. 302 */ 303 304 void _Heap_Get_free_information( 305 Heap_Control *the_heap, 306 Heap_Information *info 307 ); 281 308 282 309 #ifndef __RTEMS_APPLICATION__ -
cpukit/score/include/rtems/score/object.h
r55243362 r9b3f187 232 232 boolean is_string; /* TRUE if names are strings */ 233 233 uint16_t name_length; /* maximum length of names */ 234 Objects_Thread_queue_Extract_callout *extract;234 Objects_Thread_queue_Extract_callout extract; 235 235 #if defined(RTEMS_MULTIPROCESSING) 236 236 Chain_Control *global_table; /* pointer to global table */ … … 352 352 , 353 353 boolean supports_global, 354 Objects_Thread_queue_Extract_callout *extract354 Objects_Thread_queue_Extract_callout extract 355 355 #endif 356 356 ); -
cpukit/score/src/heapgetinfo.c
r55243362 r9b3f187 41 41 Heap_Block *next_block = 0; /* avoid warnings */ 42 42 int notdone = 1; 43 uint32_t size; 43 44 44 45 45 the_info->free_blocks = 0; 46 the_info->free_size = 0; 47 the_info->used_blocks = 0; 48 the_info->used_size = 0; 46 the_info->Free.number = 0; 47 the_info->Free.total = 0; 48 the_info->Free.largest = 0; 49 the_info->Used.number = 0; 50 the_info->Used.total = 0; 51 the_info->Used.largest = 0; 49 52 50 53 /* … … 73 76 */ 74 77 78 size = _Heap_Block_size(the_block); 75 79 if ( _Heap_Is_block_free(the_block) ) { 76 the_info->free_blocks++; 77 the_info->free_size += _Heap_Block_size(the_block); 80 the_info->Free.number++; 81 the_info->Free.total += size; 82 if ( size > the_info->Free.largest ) 83 the_info->Free.largest = size; 78 84 } else { 79 the_info->used_blocks++; 80 the_info->used_size += _Heap_Block_size(the_block); 85 the_info->Used.number++; 86 the_info->Used.total += size; 87 if ( size > the_info->Used.largest ) 88 the_info->Used.largest = size; 81 89 } 82 90 -
cpukit/score/src/objectinitializeinformation.c
r55243362 r9b3f187 39 39 * When multiprocessing is configured, 40 40 * supports_global - TRUE if this is a global object class 41 * extract_callout - pointer to threadq extract callout if MP41 * extract_callout - pointer to threadq extract callout 42 42 * 43 43 * Output parameters: NONE … … 55 55 , 56 56 boolean supports_global, 57 Objects_Thread_queue_Extract_callout *extract57 Objects_Thread_queue_Extract_callout extract 58 58 #endif 59 59 )
Note: See TracChangeset
for help on using the changeset viewer.